Skip to content

Fix crash with HXCPP_CATCH_SEGV on android x86_64 - #1378

Merged
Aidan63 merged 4 commits into
HaxeFoundation:masterfrom
tobil4sk:fix/android-x86_64-signal
Sep 8, 2026
Merged

Fix crash with HXCPP_CATCH_SEGV on android x86_64#1378
Aidan63 merged 4 commits into
HaxeFoundation:masterfrom
tobil4sk:fix/android-x86_64-signal

Conversation

@tobil4sk

Copy link
Copy Markdown
Member

This compat code was added in c91637a to work around an ndk compatibility issue when linking files that target platform 21 with older object files.

64 bit architectures (arm64 and x86_64) have only ever been supported with platform 21 and above, so this fix should be excluded from there. Keeping it enabled results in an error on x86_64 android builds that define HXCPP_CATCH_SEGV, because bsd_signal does not exist, so when hxcpp attempts to call signal there is a crash with the message: "bsd_signal symbol not found!"

Checking HXCPP_M64 instead of just HXCPP_ARM64 ensures that all 64-bit architectures are covered:

<flag value="-DHXCPP_M64" if="HXCPP_M64||HXCPP_ARM64||HXCPP_X86_64"/>

@tobil4sk
tobil4sk force-pushed the fix/android-x86_64-signal branch 2 times, most recently from 72240c5 to 4d6603f Compare August 27, 2026 23:55
This compat code was added in c91637a
to work around an ndk compatibility issue when linking files that target
platform 21 with older object files.

64 bit architectures (arm64 and x86_64) have only ever been supported
with platform 21 and above, so this fix should be excluded from there.
Keeping it enabled results in an error on x86_64 android builds that
define HXCPP_CATCH_SEGV, because bsd_signal does not exist, so when
hxcpp attempts to call signal there is a crash with the message:
"bsd_signal symbol not found!"

Checking HXCPP_M64 instead of just HXCPP_ARM64 ensures that all 64-bit
architectures are covered:
https://github.com/HaxeFoundation/hxcpp/blob/10f73c52cb4c82e72df20d012216b1592eff8d28/toolchain/common-defines.xml#L8
These became obsolete in 76e4f4e, but
some were left in.
The patch is not needed in ndk r13 and above, as the bsd_signal symbol
was restored:
https://android-review.googlesource.com/c/platform/development/+/255054
@tobil4sk
tobil4sk force-pushed the fix/android-x86_64-signal branch from 4d6603f to 74514fb Compare September 5, 2026 09:34
@Aidan63
Aidan63 merged commit ceb70d0 into HaxeFoundation:master Sep 8, 2026
145 checks passed
@tobil4sk
tobil4sk deleted the fix/android-x86_64-signal branch September 8, 2026 20:06
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.

2 participants