fix: resolve size_t ABI mismatch between clang and GCC toolchain#10
Open
ppenna wants to merge 1 commit into
Open
fix: resolve size_t ABI mismatch between clang and GCC toolchain#10ppenna wants to merge 1 commit into
ppenna wants to merge 1 commit into
Conversation
Update LLVM_COMMIT to pick up upstream libc++ runtimes (nanvix/llvm-project#17) which ship libc++, libc++abi, and libunwind built with clang. This ensures the C++ runtime ABI matches clang's size_t definition (unsigned int) on i686-nanvix, fixing linker failures for operator new and other STL symbols. Changes: - Bump LLVM_COMMIT to 405181e (includes stage 1 libc++ runtimes) - Add Dockerfile smoke test for libc++ static libraries - Add C++ ABI regression test (tests/test_size_t_abi.cpp) - Add CI step to compile and link C++ test with -stdlib=libc++ - Update README pinned LLVM commit Closes #9 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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
Fixes the
size_tABI mismatch where clang manglessize_tasunsigned int(j) but the GCC toolchain'slibstdc++/libsupc++useslong unsigned int(m), causing linker failures for any C++ code targetingi686-nanvix.Approach
Updates
LLVM_COMMITto pick up the upstream fix from nanvix/llvm-project#17 which ships libc++, libc++abi, and libunwind built with clang as stage 1 runtimes. Since these libraries are compiled with clang, their ABI matches clang'ssize_tdefinition.Changes
LLVM_COMMITto405181e(includes stage 1 libc++ runtimes); update stage 1 comment; add smoke test verifyinglibc++.a,libc++abi.a, andlibunwind.aare present::operator new(size_t)— the exact pattern that was broken-stdlib=libc++, then verify ELF output (added to both build and registry smoke test jobs)Validation
405181everified to exist and includes the libc++ runtimes fixdocker build --check(syntax validation)operator new(size_t)ABI mismatch from the issue reproductionCloses #9