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

--- Comment #33 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jan Beulich <jbeul...@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b0cc81e87087bb8a6b12dc1e4fd7f2591927977b

commit b0cc81e87087bb8a6b12dc1e4fd7f2591927977b
Author: Benjamin Drung <benjamin.dr...@canonical.com>
Date:   Mon Nov 18 11:38:25 2024 +0100

    ld: Support percent-encoded JSON in --package-metadata

    Specifying the compiler flag `-Wl,--package-metadata=<JSON>` will not
    work in case the JSON contains a comma, because compiler drivers eat
    commas. Example:

    ```
    $ echo "void main() { }" > test.c
    $ gcc '-Wl,--package-metadata={"type":"deb","os":"ubuntu"}' test.c
    /usr/bin/ld: cannot find "os":"ubuntu"}: No such file or directory
    collect2: error: ld returned 1 exit status
    ```

    The quotation marks in the JSON value do not work well with shell nor
    make. Specifying the `--package-metadata` linker flag in a `LDFLAGS`
    environment variable might loose its quotation marks when it hits the
    final compiler call.

    So support percent-encoded and %[string] encoded JSON data in the
    `--package-metadata` linker flag. Percent-encoding is used because it is
    a standard, simple to implement, and does take too many additional
    characters. %[string] encoding is supported for having a more readable
    encoding.

    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32003
    Bug-Ubutru: https://bugs.launchpad.net/bugs/2071468
    Signed-off-by: Benjamin Drung <benjamin.dr...@canonical.com>

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

Reply via email to