Skip to content

Fix cross-compilation with openssl backend#2396

Open
G10h4ck wants to merge 1 commit into
rnpgp:mainfrom
G10h4ck:main
Open

Fix cross-compilation with openssl backend#2396
G10h4ck wants to merge 1 commit into
rnpgp:mainfrom
G10h4ck:main

Conversation

@G10h4ck

@G10h4ck G10h4ck commented Jun 9, 2026

Copy link
Copy Markdown

FindOpenSSLFeatures.cmake uses execute_process() to run findopensslfeatures during configure, but execute_process() does not respect CMAKE_CROSSCOMPILING_EMULATOR (unlike try_run()). This causes configuration to fail when cross-compiling for Android, ARM, etc. because the target binary cannot execute on the host.

Prepend CMAKE_CROSSCOMPILING_EMULATOR to the FOF command if set, so the feature detection binary is run via the configured emulator (e.g. qemu-user) when cross-compiling.

Link findopensslfeatures statically when CMAKE_CROSSCOMPILING_EMULATOR is enabled to avoid linker not found errors when emulator attempt to run it

FindOpenSSLFeatures.cmake uses execute_process() to run
findopensslfeatures during configure, but execute_process() does not
respect CMAKE_CROSSCOMPILING_EMULATOR (unlike try_run()). This causes
configuration to fail when cross-compiling for Android, ARM, etc.
because the target binary cannot execute on the host.

Prepend CMAKE_CROSSCOMPILING_EMULATOR to the FOF command if set,
so the feature detection binary is run via the configured emulator
(e.g. qemu-user) when cross-compiling.

Link findopensslfeatures statically when CMAKE_CROSSCOMPILING_EMULATOR
is enabled to avoid linker not found errors when emulator attempt to
run it
@G10h4ck

G10h4ck commented Jun 14, 2026

Copy link
Copy Markdown
Author

ping @ni4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant