On Tue, Jun 21, 2022 at 02:37:51PM +0200, Stanisław Kardach wrote: > On Tue, Jun 21, 2022 at 1:53 PM Thomas Monjalon <tho...@monjalon.net> wrote: > > <snip> > > If it is made intentionally hard, it is just a wrong design. > > A toolchain prefix is just a name. > > We can have 2 toolchains compiled with the same name and different > > behaviours. > > And we can have 2 similar toolchains with a different name. > I don't think meson will allow it anytime soon (see [1]). The > reasoning being that it's easy to screw up the environment and not > notice it where as files are persistent. > > > > > So should the direction be environment or rather separating > > > cross-files into arch-part and toolchain-parts and letting user create > > > his own toolchain part while maintaining a matrix of supported > > > combinations for CI? I'm not advocating either, just want to wrap my > > > head around it. > > > > We should be able to use a toolchain compiled anywhere > > without modifying the cross files, just because a "-gnu-" is missing > > or any other irrelevant detail. > I've checked that if I remove the binaries from a cross-file, then > specifying CC/CXX/AR/STRIP environment variables is picked up by > meson: > AR=riscv64-unknown-linux-gnu-ar \ > STRIP=riscv64-unknown-linux-gnu-strip \ > CC=riscv64-unknown-linux-gnu-gcc \ > CXX=riscv64-unknown-linux-gnu-g++ \ > meson build-rv-test --cross-file=config/riscv/riscv64_linux_gcc > But then there are no default values. > > A suggested frankenstein-like solution in [1] is to use a script that > generates a cross-file with [constants] section and launches meson > with it. > > [1] https://github.com/mesonbuild/meson/issues/9#issuecomment-381410972
This is all incidental to the original fix, which is to replace cpp with g++ in the existing cross files. Any update to how cross files are used by our DPDK scripts, is a different discussion for a different day! [Sorry to have brought it up here, it just seemed somewhat relevant at the time!]