On 06.04.2016 19:47, T Parys wrote:
> Perhaps the symlink at /usr/include/asm is better suited elsewhere?
>
> The cpp include path for i386 (-m32 flag), is as follows:
>
> foo ~ $ gcc -m32 -Wp,-v test.c
> ignoring nonexistent directory "/usr/local/include/i386-linux-gnu"
> ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../x86_64-linux-gnu/include"
> #include "..." search starts here:
> #include <...> search starts here:
> /usr/lib/gcc/x86_64-linux-gnu/4.8/include
> /usr/local/include
> /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed
> /usr/include/i386-linux-gnu
> /usr/include
> End of search list.
>
> And for the armhf toolchain ...
>
> foo ~ $ arm-linux-gnueabihf-gcc -Wp,-v test.c
> ignoring nonexistent directory "/usr/local/include/arm-linux-gnueabihf"
> ignoring nonexistent directory "/usr/include/arm-linux-gnueabihf"
> #include "..." search starts here:
> #include <...> search starts here:
> /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/include
> /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/include-fixed
> /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/include
> /usr/include
>
> Wouldn't it be better to allow gcc to find i386 specific asm defines in
> /usr/include/i386-linux-gnu/asm?
>
> # rm -f /usr/include/asm
> # ln -s x86_64-linux-gnu /usr/include/i386-linux-gnu
> # ln -s x86_64-linux-gnu /usr/include/x86_64-linux-gnux32
>
> There. Both -m32 and -mx32 flags will work fine. You can have cross
> compilers installed at the same time. And to boot, no potential for
> cross-contamination between platform specific macros.
no this is plain wrong. The headers are different.
>
> Hopefully, we can agree that a symlink at /usr/include/asm is
> universally wrong? You can't have platform specific defines in a common
> include directory for all gcc targets? Maybe we can file a bug against
> gcc-multilib, and move on?
you have to come up with a proper solution, which doesn't involve hacks like
these. Otoh, I don't understand why you would need gcc-multilib and other cross
compilers at the same time.
On 06.04.2016 19:47, T Parys wrote: include/ i386-linux- gnu" gcc/x86_ 64-linux- gnu/4.8/ ../../. ./../x86_ 64-linux- gnu/include" gcc/x86_ 64-linux- gnu/4.8/ include gcc/x86_ 64-linux- gnu/4.8/ include- fixed i386-linux- gnu gnueabihf- gcc -Wp,-v test.c include/ arm-linux- gnueabihf" arm-linux- gnueabihf" gcc-cross/ arm-linux- gnueabihf/ 4.8/include gcc-cross/ arm-linux- gnueabihf/ 4.8/include- fixed gcc-cross/ arm-linux- gnueabihf/ 4.8/../ ../../. ./arm-linux- gnueabihf/ include i386-linux- gnu/asm? i386-linux- gnu x86_64- linux-gnux32
> Perhaps the symlink at /usr/include/asm is better suited elsewhere?
>
> The cpp include path for i386 (-m32 flag), is as follows:
>
> foo ~ $ gcc -m32 -Wp,-v test.c
> ignoring nonexistent directory "/usr/local/
> ignoring nonexistent directory "/usr/lib/
> #include "..." search starts here:
> #include <...> search starts here:
> /usr/lib/
> /usr/local/include
> /usr/lib/
> /usr/include/
> /usr/include
> End of search list.
>
> And for the armhf toolchain ...
>
> foo ~ $ arm-linux-
> ignoring nonexistent directory "/usr/local/
> ignoring nonexistent directory "/usr/include/
> #include "..." search starts here:
> #include <...> search starts here:
> /usr/lib/
> /usr/lib/
> /usr/lib/
> /usr/include
>
> Wouldn't it be better to allow gcc to find i386 specific asm defines in
> /usr/include/
>
> # rm -f /usr/include/asm
> # ln -s x86_64-linux-gnu /usr/include/
> # ln -s x86_64-linux-gnu /usr/include/
>
> There. Both -m32 and -mx32 flags will work fine. You can have cross
> compilers installed at the same time. And to boot, no potential for
> cross-contamination between platform specific macros.
no this is plain wrong. The headers are different.
>
> Hopefully, we can agree that a symlink at /usr/include/asm is
> universally wrong? You can't have platform specific defines in a common
> include directory for all gcc targets? Maybe we can file a bug against
> gcc-multilib, and move on?
you have to come up with a proper solution, which doesn't involve hacks like
these. Otoh, I don't understand why you would need gcc-multilib and other cross
compilers at the same time.