File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -162,6 +162,25 @@ if(CMAKE_CROSSCOMPILING)
162162 endif ()
163163 endif ()
164164endif ()
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+ include (CheckCSourceCompiles )
170+ check_c_source_compiles ("
171+ #if !(defined(__arm__) || defined(__TARGET_ARCH_ARM) || defined(_M_ARM))
172+ #error Not 32-bit ARM
173+ #endif
174+ #if defined(__aarch64__) || defined(__ARM64__) || defined(_M_ARM64)
175+ #error 64-bit ARM
176+ #endif
177+ int main() { return 0; }
178+ " IS_ARM32 )
179+
180+ if (IS_ARM32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
181+ set (cross_host "linux-armv4" )
182+ endif ()
183+
165184build_external (openssl
166185 CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env
167186 CC=${deps_cc}
You can’t perform that action at this time.
0 commit comments