[Picolibc] Integrating Picolibc into a GCC toolchain

Keith Packard keithp at keithp.com
Sat Feb 19 14:29:17 PST 2022


"R. Diez" <rdiezmail-newlib at yahoo.de> writes:

> I would rather keep it AGPLv3.

Cool. It's not built into the library, so it's not an issue other than
documentation.

> For c_link_args, I can add an option '--lflag' to my script that works in the same way as '--cflag'.
>
> Do you have an example? Your 340-picolibc.sh script does not use this
> setting.

Right, I'm hoping to replace *all* of the cross-compilation control
scripts that picolibc uses today with your script so that it gets tested
as a part of picolibc CI, not just crosstool-ng. So, things like
scripts/cross-clang-thumbv7e+fp-none-eabi.txt

> I guess that it has to go under [built-in options] now, instead of
> [properties]. It is not clearly documented, which is becoming an
> annoying pattern for Meson cross-compilation.

Agreed. They seem to have a plan for "cleaning things up", but if you
aren't watching their communication channels, it all seems quite
opaque. At least things remain backwards compatible for now; I've 
kinda stopped worrying about the warnings as a result.
>
> Initially, I thought that these other settings would be as follow (taken from the Meson documentation):
>
> c_ld = 'lld'
> exe_wrapper = 'wine'
>
> But I saw in scripts/cross-arm-none-eabi.txt that exe_wrapper can be an array like this:
>
> exe_wrapper = ['sh', '-c', 'test -z "$MESON_SOURCE_ROOT" || "$MESON_SOURCE_ROOT"/scripts/run-arm "$@"', 'run-arm']
>
> That possibility not documented anywhere in Meson. Or did I miss it?

*every* command can be an array of arguments. I'm not sure if it's
documented; I don't recall where I discovered this.

> I guess I can add an option called '--exewrap', but that is going to be cumbersome to use:
>
> --exewrap 'sh'
> --exewrap '-c'
> --exewrap 'test -z "$MESON_SOURCE_ROOT" || "$MESON_SOURCE_ROOT"/scripts/run-arm "$@"'
> --exewrap 'run-arm'
>
> Is that OK? I haven't figured out yet how to test it at the moment on
> my system.

Yup, that looks great. If there's only one, you can use a simple
string. If there's more than one, you'd create an array.

> I guess I should automatically add "needs_exe_wrapper = true" if
> option exe_wrapper is present.

Agreed

> Is that the same for c_ld? Or does it have to be a single string, and
> then Meson adds c_link_args? Again, it is not documented whether c_ld
> could be an array, like the others. Maybe you could test it on your
> system.

Meson does both -- the command can be an array; it will then add the
relevant arguments to that in constructing the final command.

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://keithp.com/pipermail/picolibc/attachments/20220219/1966214c/attachment.sig>


More information about the Picolibc mailing list