This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
bootstrap/3437: vxworks cross-compile problem because of fixincludes
- To: gcc-gnats at gcc dot gnu dot org
- Subject: bootstrap/3437: vxworks cross-compile problem because of fixincludes
- From: alexsh at hectic dot net
- Date: 27 Jun 2001 13:34:06 -0000
- Reply-To: alexsh at hectic dot net
>Number: 3437
>Category: bootstrap
>Synopsis: vxworks cross-compile problem because of fixincludes
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Jun 27 06:36:02 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Alex Shnitman
>Release: 3.0
>Organization:
>Environment:
Host compiler gcc-2.95.3, Debian 2.2
>Description:
When cross-compiling gcc 3.0 for a vxworks target, it
copies the include files that come with VxWorks and runs
fixincludes on them. The latter changes all the occurrences
of "CPU" to "__CPU__" in those files. However, after this
change one of the files stops compiling. This file defines
CPU_FAMILY according to the definition of CPU. (The latter
is defined by the compiler -- it's in the spec file for the
platform.) Here's a snippet from vxCpu.h:
#if (CPU==I80386 || CPU==I80486 || CPU==PENTIUM || CPU==PENTIUMPRO)
#define CPU_FAMILY I80X86
#endif /* CPU_FAMILY==I80X86 */
fixincludes changes "CPU" to "__CPU__", and the above code
naturally stops working. At the end of vxCpu.h, there's
this code:
#if !defined(CPU) || !defined(CPU_FAMILY)
#error CPU is not defined correctly
#endif
Due to the fixincludes "fixes", this error is always
triggered. The gcc build thus fails:
make[2]: Entering directory `/home/alexsh/gcc-3.0/gcc'
for d in libgcc nof libgcc/nof le libgcc/le ca libgcc/ca und libgcc/und le/und libgcc/le/und nof/le libgcc/nof/le nof/ca libgcc/nof/ca nof/und libgcc/nof/und nof/le/und libgcc/nof/le/und; do \
if [ -d $d ]; then true; else mkdir $d; fi \
done
if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi
/home/alexsh/gcc-3.0/gcc/xgcc -B/home/alexsh/gcc-3.0/gcc/ -B/usr/local/vxworks/powerpc-wrs-vxworks/bin/ -B/usr/local/vxworks/powerpc-wrs-vxworks/lib/ -isystem /usr/local/vxworks/powerpc-wrs-vxworks/include -O2 -DCROSS_COMPILE -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include -g1 -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I. -I./. -I./config -I./../include -mrelocatable-lib -mno-eabi -mstrict-align -DL_muldi3 -c ./libgcc2.c -o libgcc/./_muldi3.o
In file included from /usr/local/vxworks/powerpc-wrs-vxworks/sys-include/types/vxANSI.h:44,
from /home/alexsh/gcc-3.0/gcc/include/stdio.h:66,
from tsystem.h:63,
from libgcc2.c:37:
/home/alexsh/gcc-3.0/gcc/include/types/vxCpu.h:209:2: #error CPU is not defined correctly
make[2]: *** [libgcc/./_muldi3.o] Error 1
make[2]: Leaving directory `/home/alexsh/gcc-3.0/gcc'
make[1]: *** [stmp-multilib] Error 2
make[1]: Leaving directory `/home/alexsh/gcc-3.0/gcc'
make: *** [all-gcc] Error 2
>How-To-Repeat:
cd gcc-3.0
./configure --target=powerpc-wrs-vxworks --with-headers=/net/tornado/c/Tornado/target/h
make
The same process works flawlessly when compiling gcc 2.95.3.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: