Skip to content

Commit 66ff271

Browse files
committed
Add work-around for linux/armhf target compiling as 64bit w/ OpenSSL
1 parent c7f83a7 commit 66ff271

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

external/openssl-cmake/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,17 @@ if(CMAKE_CROSSCOMPILING)
162162
endif()
163163
endif()
164164
endif()
165+
166+
# NOTE: Running the configure step with OpenSSL on linux/armhf defaults to aarch64 instead of armv4
167+
# so we must set the cross-host value to force it to do the right thing. We detect that platform
168+
# here and do so accordingly.
169+
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
170+
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" proc)
171+
if(proc MATCHES "^arm" OR proc MATCHES "^armv[4-7]")
172+
set(cross_host "linux-armv4")
173+
endif()
174+
endif()
175+
165176
build_external(openssl
166177
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env
167178
CC=${deps_cc}

0 commit comments

Comments
 (0)