[llvm] [CMake] Add -Wl, -z, pack-relative-relocs if supported (PR #208217)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 14 10:47:21 PDT 2026
================
@@ -1153,6 +1153,25 @@ if (LLVM_USE_SPLIT_DWARF AND
endif()
endif()
+# For PIC builds, enable RELR if supported by the linker and loader.
+# glibc supports RELR since 2.36. musl supports RELR since 1.2.4, but there's
+# no easy way to detect or feature-test this.
+if (LLVM_ENABLE_PIC AND LLVM_USING_GLIBC)
----------------
MaskRay wrote:
Newer FreeBSD also support RELR https://reviews.freebsd.org/D32524 @emaste
https://github.com/llvm/llvm-project/pull/208217
More information about the llvm-commits
mailing list