Skip to content

Fix __int128 detection when cross-compiling - #3002

Open
mablr wants to merge 1 commit into
jemalloc:devfrom
mablr:fix/int128-cross-compile
Open

mablr wants to merge 1 commit into
jemalloc:devfrom
mablr:fix/int128-cross-compile

Conversation

@mablr

@mablr mablr commented Sep 15, 2026

Copy link
Copy Markdown

Cross-compiling currently defaults je_cv_int128 to no, disabling the optimized extent comparator even when the target compiler supports __int128. Replace AC_RUN_IFELSE with AC_LINK_IFELSE: the probe only initializes a value to zero and returns it, so compilation and linking are sufficient.

Tested locally with an ARM64-to-x86_64 macOS cross-build: detection changes from no to yes, and both static and shared allocator libraries build successfully.

Existing native CI tests do not cover this detection regression. I also prepared a small cross-configure assertion in an existing macOS CI entry, verified to fail before the fix and pass afterward. Happy to include that CI update if you consider it useful.

AI-assisted

The runtime probe defaults to no when cross-compiling, disabling the
optimized extent comparator even when the target compiler supports
__int128. The test only initializes a value to zero and returns it, so
executing it adds no runtime validation.

Use AC_LINK_IFELSE to retain compilation and linking checks without
requiring execution on the build host.
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