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

Jan Beulich jbeulich@suse.com
Mon Jul 22 06:00:17 GMT 2024


On 21.07.2024 00:34, 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.

There is a testcase now (there wasn't in the initial version, iirc). I don't,
however, see how a testcase can "show why this feature is needed". The need
is supplied in the patch description to an imo sufficient degree.

Jan


More information about the Binutils mailing list