[PATCH v4] ld: Add --encoded-package-metadata
H.J. Lu
hjl.tools@gmail.com
Tue Jul 23 12:19:47 GMT 2024
On Tue, Jul 23, 2024, 6:39 PM Jan Beulich <jbeulich@suse.com> wrote:
> On 23.07.2024 12:24, H.J. Lu wrote:
> > On Tue, Jul 23, 2024, 6:19 PM Jan Beulich <jbeulich@suse.com> wrote:
> >
> >> On 18.07.2024 11:04, Benjamin Drung wrote:
> >>> Specifying the compiler flag `-Wl,--package-metadata=<JSON>` might not
> >>> work, because the shells might eat the quotation marks and the compiler
> >>> splits the JSON at the commas.
> >>>
> >>> Ubuntu tried to using a specs file to set `--package-metadata` but that
> >>> turned out to be too fragile. autopkgtests might use the compiler flags
> >>> but the needed environment variables are not set in the test
> >>> environment. Debugging a crash of an application build with the -spec
> >>> parameter lacks the environment variables. People like to iteratively
> >>> continue building the software in the build directory while hacking on
> >>> the package and then have no environment variable set.
> >>>
> >>> So introduce a `--encoded-package-metadata` linker flag that takes a
> >>> percent-encoded JSON. Percent-encoding is used because it is a
> >>> standard and simple to implement.
> >>>
> >>> Bug-Ubutru: https://bugs.launchpad.net/bugs/2071468
> >>> Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
> >>
> >> Okay. Please don't forget to add a reference to the PR that you created
> >> upon H.J.'s request. I notice H.J. has voiced a readability concern
> >> there, but I think that can be taken care of incrementally.
> >
> > I think we should make the existing option
> > usable instead of adding another option.
>
> Can you at least vaguely explain how you envision doing so, without any
> kind of risk of breaking existing uses?
>
See my comments in the bug report.
> Jan
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/binutils/attachments/20240723/89d4bc21/attachment.htm>
More information about the Binutils
mailing list