[all-commits] [llvm/llvm-project] a60d69: [clang][driver][AIX] Change linker bcdtor mode to ...
David Tenty via All-commits
all-commits at lists.llvm.org
Mon Apr 13 10:12:52 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: a60d6982cd0a495d2d5e2c0a219f63de289cc1c9
https://github.com/llvm/llvm-project/commit/a60d6982cd0a495d2d5e2c0a219f63de289cc1c9
Author: David Tenty <daltenty at ibm.com>
Date: 2026-04-13 (Mon, 13 Apr 2026)
Changed paths:
M clang/docs/ReleaseNotes.rst
M clang/lib/Driver/ToolChains/AIX.cpp
M clang/test/Driver/aix-ld.c
M compiler-rt/lib/profile/InstrProfilingPlatformAIX.c
M compiler-rt/test/profile/instrprof-merge-entry-cover.c
M compiler-rt/test/profile/instrprof-merge.c
M compiler-rt/test/profile/instrprof-write-file-atexit-explicitly.c
M compiler-rt/test/profile/profile_test.h
Log Message:
-----------
[clang][driver][AIX] Change linker bcdtor mode to default to mbr (#191265)
The bcdtor mode affects how the AIX linker choose to pull in static
constructors and destructors
(https://www.ibm.com/docs/en/aix/7.2.0?topic=l-ld-command) to the link.
The current setting of `all` makes static init in archive members live
regardless of if the archive member would be otherwise referenced,
causing that whole archive member to become part of the link.
This default was initially retained for compatibility purposes with
historical compilers on the platform which defaulted to this setting.
Unfortunately this greedy pulling in of static init can have unintended
consequences for applications, for example for programs linked against
parts of compiler-rt which contain optional instrumentation (containing
static initializers) which may be unused as these now become live in all
programs regardless of use.
For that reason and similar reasons, this PR switches the default to
`mbr`, which only extracts static init from archive members which would
otherwise be referenced. This gives a behaviour very consistent with
linkers on other platforms (e.g. Linux).
Users requiring the old default behaviour can manually pass
`-bcdtors:all` on the link step which will override any default we pass
here.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list