[clang] [compiler-rt] [clang][driver][AIX] Change linker bcdtor mode to default to mbr (PR #191265)

Wael Yehia via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 12 21:13:38 PDT 2026


================
@@ -9,4 +9,14 @@
 # define ALIGNED(x) __attribute__((aligned(x)))
 #endif
 
+inline void __llvm_profile_test_initialize() {
+  // This is a no-op on most platforms, but on AIX it forces the linker to
+  // keep the start/stop stub data for the runtime. Normally this data is
+  // referenced by pulling in `__llvm_profile_runtime` from the runtime but
+  // some tests explicitly supress that.
----------------
w2yehia wrote:

just to give some context about `__llvm_profile_keep` (no need to take action):
the `__llvm_profile_keep` references a bunch of stub data variables that are necessary to allow the linker to define the `__stop___llvm_prf_vnds` and other start/stop symbols, which are live because they are referenced by parts of the runtime that compute the filename. The start/stop symbols are weak declarations, but on AIX an undefined WEAK is an error (just like a regular undefined), so we need those stub data variables and stop the linker from GC'ing them.

https://github.com/llvm/llvm-project/pull/191265


More information about the llvm-commits mailing list