public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Fangrui Song <i@maskray.me>
To: Noah Goldstein <goldstein.w.n@gmail.com>
Cc: binutils@sourceware.org, hjl.tools@gmail.com, arjan@linux.intel.com
Subject: Re: [PATCH v1] gold: Make '--section-ordering-file' also specifiable in env variable
Date: Fri, 12 May 2023 12:17:38 -0700	[thread overview]
Message-ID: <DS7PR12MB5765C2ACA61AB33C6D046723CB759@DS7PR12MB5765.namprd12.prod.outlook.com> (raw)
In-Reply-To: <CAFUsyfLA8QDeUGecsOsmtBcsAYKq9FH7itEv9=UpHfpw+H7Log@mail.gmail.com>

On Fri, May 12, 2023 at 9:09 AM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> On Fri, May 12, 2023 at 1:48 AM Fangrui Song <i@maskray.me> wrote:
> >
> > 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.
>
> Okay, would you be okay with a new commandline flag to just not fail
> linking if there are issues with the section ordering file? Something
> like "--section-ordering-ignore-errors"?

When are there issues with the section ordering file?
For a pattern that doesn't match any input section, there is no linker error.
See my example at
https://maskray.me/blog/2020-11-15-explain-gnu-linker-options#:~:text=section%2dordering%2dfile
and my description of why --symbol-ordering-file= may be more useful.

I think our discussion may be a case of https://xyproblem.info/ . If
you describe your original problem, I or someone may give a better
answer.

      reply	other threads:[~2023-05-12 19:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-11 21:02 Noah Goldstein
2023-05-12  6:43 ` Fangrui Song
     [not found] ` <DS7PR12MB5765297831D2026E87441325CB759@DS7PR12MB5765.namprd12.prod.outlook.com>
2023-05-12 16:09   ` Noah Goldstein
2023-05-12 19:17     ` Fangrui Song [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DS7PR12MB5765C2ACA61AB33C6D046723CB759@DS7PR12MB5765.namprd12.prod.outlook.com \
    --to=i@maskray.me \
    --cc=arjan@linux.intel.com \
    --cc=binutils@sourceware.org \
    --cc=goldstein.w.n@gmail.com \
    --cc=hjl.tools@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).