[PATCH v4] ld: Add --encoded-package-metadata

Benjamin Drung benjamin.drung@canonical.com
Mon Jul 22 12:11:41 GMT 2024


On Sun, 2024-07-21 at 06:34 +0800, H.J. Lu wrote:
> 
> On Thu, Jul 18, 2024, 5:05 PM Benjamin Drung <benjamin.drung@canonical.com> 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.
> 
> Please open a bug report for this feature request.
> A test case is needed to show why this feature is needed.


I created https://sourceware.org/bugzilla/show_bug.cgi?id=32003 for it
now.

-- 
Benjamin Drung
Debian & Ubuntu Developer


More information about the Binutils mailing list