Hello Rasmus, > On 01 Jun 2018, at 14:23, Rasmus Villemoes <rasmus.villem...@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.villem...@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. 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 ? -- Refine -I flags for VxWorks libgcc Arrange to always have <toplevel-build-dir>/gcc/include in the -I flags for libgcc on VxWorks. This contains user accessible header files provided by gcc so is legitimate and needed in many cases. This is implicitly achieved with -B when building a regular cross compiler, but there's no such -B when cross compiling libraries as part of a canadian build. 2018-06-03 Olivier Hainque <hain...@adacore.com> * libgcc/config/t-vxworks (LIBGCC_INCLUDES): Add -I$(MULTIBUILDTOP)../../gcc/include. * libgcc/config/t-vxworks7: Likewise. Reformat a bit to match the t-vxworks layout.
p.diff
Description: Binary data