On 10/12/2021 19.24, Olivier Hainque wrote:

> For the toolchains we build, this is achieved with a few
> configure options like:
> 
>   --with-sysroot
>   --with-build-sysroot=${WIND_BASE}/target

So forward-porting our private patches up until

7bf710b5116 - libstdc++: Add support for '?' in linker script globs

(i.e. the commit before this one) went without problems, with no changes
required in our build scripts. Then when rebasing to this one, now known as

f3f923e5139 - Leverage sysroot for VxWorks

the build broke as expected because I'd been using somewhat different
values of --with(-build)-sysroot. However, changing those configure
options as indicated above again produced a working toolchain, so this
is all good.

>   --with-specs=%{!sysroot=*:--sysroot=%:getenv(WIND_BASE /target)}

However, I'm a little confused about the purpose of this one. First,
shouldn't this be '%{!-sysroot=*....}', i.e. with a leading dash, since
the option is --sysroot ? But whether I use one or the other, it seems
that the resulting compiler ignores a --sysroot argument; if I
explicitly unexport WIND_BASE and manually add a --sysroot argument that
should have the same effect as above, gcc fails with WIND_BASE not defined:

$ echo $WIND_BASE
/usr/powerpc-wrs-vxworks/wind_base
$ export -n WIND_BASE
$ powerpc-wrs-vxworks-gcc --sysroot=${WIND_BASE}/target -v -E -  < /dev/null
Using built-in specs.
powerpc-wrs-vxworks-gcc: fatal error: environment variable 'WIND_BASE'
not defined
compilation terminated.

The specs syntax doesn't explicitly list the negative form of %{S*:X},
and I can't find any in-tree examples (though it's rather hard to grep
for), so I don't even know if this is supposed to work.

It's not a big deal, we can just continue to define and export
WIND_BASE, but it's probably best for long-term maintenance if our build
scripts and configure options are aligned with what you do on your end,
so I would just like to understand this fully.

Rasmus

Reply via email to