[PATCH v1] gold: Make '--section-ordering-file' also specifiable in env variable
Fangrui Song
i@maskray.me
Fri May 12 06:43:06 GMT 2023
On Thu, May 11, 2023 at 2:02 PM Noah Goldstein via Binutils
<binutils@sourceware.org> wrote:
>
> New proposed env variable is 'GLOBAL_SECTION_ORDERING_FILE'.
>
> The motivation for this change to help package maintainers use the
> section ordering feature. For package maintainers, modifying the link
> flags of all their maintained projects, is time consumining to a
> degree that it is often considered infeasable. By making the feature
> enablable simply with an environment variable, removes this
> roadblock. Similiarly, the rationale behind ignoring errors when using
> the environment specified file is to make it so that it never create
> new problems in the build process.
>
> The hope by making this feature more accessable it will allow package
> maintainers to use ordering lists from profiles of their applications
> to distribute better optimized packages.
The motivation isn't compelling to me. Using an environment variable
to control a linker option isn't a convention.
I probably should say, it's very odd, going against the spirit of a linker.
Can you use LDFLAGS or a linker wrapper to achieve your goal?
% cat ld.gold
#!/bin/sh -e
...
If some packages don't recognize standard variables CFLAGS/LDFLAGS,
just help add them so that other distributions can control global
compiler/linker options more conveniently.
More information about the Binutils
mailing list