From 7908fb9583cb6af84345508390ec9ea9fc986763 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Wed, 29 Jul 2026 03:00:59 +0900 Subject: internal/rosa/llvm: exclude runtime symbols These leak by default when static linking, which is considered unacceptable for many libraries. Signed-off-by: Ophestra --- internal/rosa/llvm.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'internal/rosa/llvm.go') diff --git a/internal/rosa/llvm.go b/internal/rosa/llvm.go index 19815a2f..8189b642 100644 --- a/internal/rosa/llvm.go +++ b/internal/rosa/llvm.go @@ -193,6 +193,10 @@ func init() { "tr", "awk", }, + + ScriptEarly: ` +rm -f /system/bin/clang++.cfg +`, }, &CMakeHelper{ Append: []string{"llvm"}, @@ -202,7 +206,10 @@ ln -s ld.lld /work/system/bin/ld ln -s clang /work/system/bin/cc ln -s clang /work/system/bin/cpp ln -s clang++ /work/system/bin/c++ -echo '-static-libstdc++' > /work/system/bin/clang++.cfg +cat << EOF > /work/system/bin/clang++.cfg +-static-libstdc++ +-Wl,--exclude-libs,libunwind.a:libc++.a:libc++experimental.a:libc++abi.a +EOF `, // LLVM_LINK_LLVM_DYLIB causes llvm test suite to leak system -- cgit v1.3.1