This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] libgcc/config/t-vxworks: remove -nostdinc from LIBGCC2_INCLUDES


On 2018-06-03 09:06, Olivier Hainque wrote:
> Hello Rasmus,
> 
>> On 01 Jun 2018, at 14:23, Rasmus Villemoes <rasmus.villemoes@prevas.dk> wrote:
>> 
>> -nostdinc apparently does not affect the directories added by the -B
>> options when the xgcc wrapper is used when building an ordinary
>> cross-compiler, but having -nostdinc in LIBGCC2_INCLUDES breaks a
>> canadian cross build (i.e., when we use an already installed
>> cross-compiler), because we cannot find the ppc-asm.h file.
>> 
>> -I. alone already ensures we search find the gcc-provided unwind.h
>> rather than a system header by that name, but just for good measure
>> change the following -I includes to -isystem.
>> 
>> I have tested that both a cross (build=host=x86-linux,
>> target=powerpc-wrs-vxworks) and canadian cross (build=x86-linux,
>> host=x86-windows, target=powerpc-wrs-vxworks) builds work, and that
>> the resulting compilers produce working code on target.
>> 
>> 2018-06-01  Rasmus Villemoes  <rasmus.villemoes@prevas.dk>
>> 
>> libgcc/
>> 
>>        * config/t-vxworks: Remove -nostdinc from LIBGCC2_INCLUDES.
> 
> Thanks for proposing this patch. It unfortunately breaks
> a regular cross build for me, configured like:
> 
>    /gcc.git/configure  --prefix=/gournay.a/users/hainque/ins  
> --target=powerpc-wrs-vxworks --enable-languages=c --disable-libada --with-gnu-ld 
> --with-gnu-as --disable-libssp
> 
> on a x86-linux host. With a properly set WIND_BASE, "make" passes with the
> current trunk, and with the patch now fails with errors like:
> 
>    In file included from .../users/hainque/gcc.git/libgcc/config/vxlib-tls.c:45:
>    .../vxworks-6.8/vxworks-6.8/target/h/taskLib.h:425:5: error: unknown type 
> name 'REG_SET'
>       REG_SET *  pExcRegSet; /* 0x120: exception regSet ptr or NULL*/
> 
> vxlib-tls.c #includes some vxworks headers, which end up including "regs.h",
> intended to get the vxworks instance of this file. Without -nostdinc, we get
> gcc's "regs.h" instead.

Ah. I'm on VxWorks 5.5, where the system headers mostly use #include
"...", so the include in taskLib.h first searches the directory of
taskLib.h itself.

> Turns out we have encountered the canadian build problem as well and have
> an alternate resolution for it, which I was about to commit.
> 
> Does the attached patch work for you ?

It does seem to work for me, both for the cross and canadian builds.

thanks,
Rasmus


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]