Skip to content

Commit 9c7bedc

Browse files
committed
test: m6/m7 — -Wl,-load_hidden form (split-brain libc++ fix hypothesis)
1 parent 2b8b14f commit 9c7bedc

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

.github/workflows/temp-mixed-c-forensics.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,22 @@ jobs:
7272
"$LLVM/bin/clang++" $CXXFLAGS -x c++ -c answer.c -o answercc.o
7373
run_case "m4 mixed(as-c++) static" \
7474
"$LLVM/bin/clang++" $CXXFLAGS -fuse-ld=lld main.cpp answercc.o -o prog $LDSTATIC
75+
# m6: load_hidden form — forces the ARCHIVE by path with
76+
# hidden visibility (the lld-correct equivalent of ld64
77+
# -hidden-l). Hypothesis: fixes the split-brain libc++
78+
# (static copy + system dylib coexisting) seen in m1/m3.
79+
run_case "m6 mixed static load_hidden" \
80+
"$LLVM/bin/clang++" $CXXFLAGS -fuse-ld=lld main.cpp answer.o -o prog \
81+
-nostdlib++ -Wl,-load_hidden,"$LLVM/lib/libc++.a" -Wl,-load_hidden,"$LLVM/lib/libc++abi.a"
82+
# m7: pure-C++ int-output + load_hidden (control for m6)
83+
cat > pureint.cpp <<'CEOF'
84+
#include <iostream>
85+
int answer3(void) { return 42; }
86+
int main() { std::cout << "llvm " << answer3() << "\n"; return 0; }
87+
CEOF
88+
run_case "m7 pure-c++ int load_hidden" \
89+
"$LLVM/bin/clang++" $CXXFLAGS -fuse-ld=lld pureint.cpp -o prog \
90+
-nostdlib++ -Wl,-load_hidden,"$LLVM/lib/libc++.a" -Wl,-load_hidden,"$LLVM/lib/libc++abi.a"
7591
# m5: rebuild m3 and harvest crash report if it dies
7692
"$LLVM/bin/clang++" $CXXFLAGS -fuse-ld=lld main.cpp answer.o -o prog $LDSTATIC
7793
./prog; rc=$?

0 commit comments

Comments
 (0)