So seriously,

because the command line includes -I/usr/include

and because the toolchain directory /usr/arm-linux-eabi/include is embedded in the toolchain,
and because --sysroot /usr/include is also a standard directory

it searches its full paramters first before it considers any standard locations, even if those standard locations are actually supplied on the command line.

So it will find /usr/include first before venturing into e.g. $SYSROOT/usr/include.

Why? Well apparently because due to --sysroot /usr/include is no longer a standard location, so it is considered first.

Isn't that freaking amazing, it just ignores your parameters because it already knows about them.

It integrates them into its list and only after will it start sorting them according to what it already knew.

Which is really just wrong behaviour, but anyway.

It should integrate after sorting and then use the first occurance in the list.

So I can get around it yes.

If I just copy the headers to $SYSROOT/usr/local/include.fuckedup, then it will work.

Symlinks also don't work because it will just readlink them :p.

Meanwhile --sysroot actually does not cause locations to be resolved according to $SYSROOT.

So it's whole purpose is meaningless: it just causes important locations to be searched last.

Neither full nor relative paths are resolved with regards to it. Why have it then???

Maybe it works for libraries, I don't know.

Oh man...

I truly believe people make it harder on purpose. Not you, in this case just GCC.

There are just people invested in making life harder for other people.

For example, why doesn't GCC or make just output a list of locations that it searched in?

It would be so easy.

And save so much time.

But they don't do it.

They just give a non-descript error.

That you need fucking strace to diagnose.

Sorry for my language though.

Regards.

Reply via email to