https://sourceware.org/bugzilla/show_bug.cgi?id=32003

Andreas K. Huettel <dilfridge at gentoo dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dilfridge at gentoo dot org

--- Comment #20 from Andreas K. Huettel <dilfridge at gentoo dot org> ---

The general idea is good, but, man, seriously, this feels like you're
reinventing the wheel multiple times....

> 1. The comma in the JSON value is used to split the -Wl parameter specified
> for gcc:

Yep. Won't work. So let's not pass raw json.

And as someone who regularly has to look at stuff that is passed around between
bash, python, and perl I stronly advise to rely too much on escaping.

> 2. The quotation marks in the JSON value are eaten by configure scripts and
> Makefiles. Example:

Yep. Won't work. So let's not pass raw json.

Dito.

> Add support for an `--escaped-package-metadata` parameter to the linkers
> that takes a percent encoded (RFC 3986) parameter. Example:

Well, this works, but makes the metadata block pretty much unreadable.
Please not.

> 3. Add `-specs=<spec-file>` to the gcc linker flags. Then this spec file
> could construct the package metadata parameter. Example spec file:
> 
> ```
> Issue with that approach: It requires the spec file to be around and the
> environment variables to be set.

And exactly this is the *much* easier solution. 
Fill in the values of the variables at build time in, e.g., a json file, and
then pass the filename on the command line.

You definitely don't want to hardcode environment lookups or any sort of
similar evaluation into your metadata (imagine your field for DEB_HOST_ARCH
being `cat /dev/zero /dev/root`)... Simple strings that are not interpreted in
any way are the best option.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to