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

Jan Beulich jbeulich@suse.com
Tue Jul 23 10:18:36 GMT 2024


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.

Cc-ing Nick as to views towards putting this on the branch as well.

Jan


More information about the Binutils mailing list