Skip to content

Commit 827dd1e

Browse files
authored
[Bolt] Explicitly request PIE in tests (#108818)
When clang is built with `-DCLANG_DEFAULT_PIE_ON_LINUX=OFF`, a number of bolt tests fail: BOLT :: AArch64/build_id.c BOLT :: AArch64/plt-call.test BOLT :: X86/dwarf5-dwarf4-types-backward-forward-cross-reference.test BOLT :: X86/dwarf5-locexpr-referrence.test BOLT :: X86/internal-call-instrument.s BOLT :: X86/linux-static-keys.s BOLT :: X86/plt-call.test Avoid this by explicitly adding `-fPIE` and `-pie` to the default flags in tests, so we don't depend on the clang-side default.
1 parent 30d7dcc commit 827dd1e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bolt/test/lit.local.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
host_linux_triple = config.target_triple.split("-")[0] + "-unknown-linux-gnu"
2-
common_linker_flags = "-fuse-ld=lld -Wl,--unresolved-symbols=ignore-all"
3-
flags = f"--target={host_linux_triple} {common_linker_flags}"
2+
common_linker_flags = "-fuse-ld=lld -Wl,--unresolved-symbols=ignore-all -pie"
3+
flags = f"--target={host_linux_triple} -fPIE {common_linker_flags}"
44

55
config.substitutions.insert(0, ("%cflags", f"%cflags {flags}"))
66
config.substitutions.insert(0, ("%cxxflags", f"%cxxflags {flags}"))

0 commit comments

Comments
 (0)