Repository navigation
ndk: define the down-call's variables outside the unnamed namespace - #413
Merged
Merged
Conversation
GCC 15 does not link the arm64 build. bionic_runtime.cpp defined the four variables its down-call assembly reads (acl_ndk_tls_disp, acl_ndk_wrap_disp, acl_ndk_block_disp, acl_ndk_env_tbl_ptr) as `extern "C"` inside an unnamed namespace. GCC up to 15 gives such a variable internal linkage and a mangled name, so the assembly's references to the C names stay undefined. Clang and GCC 16 use the C name, which is why the clang arm64 builds link. x86-64 has no such variables. The block now closes the unnamed namespace around itself. Tested: - Yocto's aarch64 GCC 15.2, this file compiled to assembly at -O2: before, the four are defined under mangled names and acl_ndk_tls_disp is left undefined; after, all four are defined under their C names. - arm64 (clang release build) on an i.MX 8M Plus: a WebView app loads its library through the down-call and draws. - x86-64 builds with no warning; clang-format clean. Signed-off-by: Joel Winarske <joel.winarske@linux.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GCC 15 does not link the arm64 build.
src/ndk/bionic_runtime.cppdefined the four variables its down-call assembly reads asextern "C"inside an unnamed namespace. GCC up to 15 gives such a variable internal linkage and a mangled name, so the assembly's references to the C names stay undefined. Clang and GCC 16 use the C name. x86-64 has no such variables.The block now closes the unnamed namespace around itself. No other change.
Found by a Yocto build (wrynose, GCC 15.2), which had to switch the arm64 build to clang.
tools/pi-build.shbuilds natively with g++ 14 and would not link either.Test status
-O2, beforeacl_ndk_tls_dispundefinedNot done: a full arm64 link with GCC 15. The assembler in that toolchain copy did not run outside its build, so the check stops at the compiler's output.