Compiling a cross compiler for VXWorks - "cannot compute suffix of object files"

Kai Ruottu kai.ruottu@wippies.com
Wed Feb 2 13:40:00 GMT 2011


2.2.2011 12:23, Kai Ruottu kirjoitti:

> 2.2.2011 6:03, Thomas Clark kirjoitti:
>
>> I'm trying to compile GCC (right from the svn trunk) on an
>> i686-pc-linux-gnu
>> host, targeting powerpc-wrs-vxworks. I'm using gcc 4.6.0 to compile it. I
>> configured it like so:
>>
>> ~/gcc/trunk/configure --target=powerpc-wrs-vxworks
>> --host=i686-linux-gnu \
>> --enable-languages=c++
>>
>> The error was:
>>
>> checking for suffix of object files... configure: error: in
>> `~/gcc/trunk/powerpc-wrs-vxworks/libgcc':
>> configure: error: cannot compute suffix of object files:
>
> What else you did than started to build GCC? There are prerequisities
> like :
>
> 1. the target binutils being built and installed
>
> 2. the target C library being copied and installed

I myself had only some very old vxWorks/PPC headers from 1994, no
startups or libs...

Trying with them stopped with (by '$target/libgcc/config.log) :

------------------ clip --------------------------------
configure:3268: /home/src/gcc-4.6/build/./gcc/xgcc
  -B/home/src/gcc-4.6/build/./gcc/ -B/usr/local/ppc-wrs-vxworks/bin/
  -B/usr/local/ppc-wrs-vxworks/lib/
  -isystem /usr/local/ppc-wrs-vxworks/include
  -isystem /usr/local/ppc-wrs-vxworks/sys-include
  -c -g -Os  conftest.c >&5
xgcc: fatal error: environment variable 'WIND_BASE' not defined
compilation terminated.
------------------ clip --------------------------------

Investigation of this revealed things like the following
in 'gcc/config/vxworks.h' :

------------------ clip --------------------------------
/* We look for the VxWorks header files using the environment
    variables that are set in VxWorks to indicate the location of the
    system header files.  We use -idirafter so that the GCC's own
    header-file directories (containing <stddef.h>, etc.) come before
    the VxWorks system header directories.  */

/* Since we provide a default -isystem, expand -isystem on the command
    line early.  */
#undef VXWORKS_ADDITIONAL_CPP_SPEC
#define VXWORKS_ADDITIONAL_CPP_SPEC             \
  "%{!nostdinc:                                  \
     %{isystem*} -idirafter                      \
     %{mrtp: %:getenv(WIND_USR /h)               \
       ;:    %:getenv(WIND_BASE /target/h)}}"
------------------ clip --------------------------------

So before one starts to build a GCC for vxWorks, one prerequisite
more is to be familiar with the existing WindRiver-provided vxWorks
tools and know where they are keeping the headers, not in 'include'
but in 'target/h' and so on ...

I made a couple of environment settings and symlinks to get the
'include' where those target headers were to be seen in 'h' and
'target/h' there. Then the libgcc build continued until :

------------------ clip --------------------------------
/home/src/gcc-4.6/build/./gcc/xgcc -B/home/src/gcc-4.6/build/./gcc/ 
-B/usr/local/ppc-wrs-vxworks/bin/ -B/usr/local/ppc-wrs-vxworks/lib/ 
-isystem /usr/local/ppc-wrs-vxworks/include -isystem 
/usr/local/ppc-wrs-vxworks/sys-include    -g -Os -mrtp -O2 -nostdinc -I 
`case "/mrtp" in */mrtp*) echo /h ;; *) echo /target/h ;; esac` -g -Os 
-DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings 
-Wcast-qual -Wstrict-prototypes -Wmissing-prototypes 
-Wold-style-definition  -isystem ./include    -DHAVE_GTHR_DEFAULT 
-DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -fno-stack-protector 
-Dinhibit_libc  -I. -I. -I../../.././gcc -I../../../../libgcc 
-I../../../../libgcc/. -I../../../../libgcc/../gcc 
-I../../../../libgcc/../include  -DHAVE_CC_TLS  -o vxlib.o -MT vxlib.o 
-MD -MP -MF vxlib.dep -fexceptions -c 
../../../../libgcc/../gcc/config/vxlib.c
In file included from /usr/local/ppc-wrs-vxworks/include/vxWorks.h:158:0,
                  from /usr/local/ppc-wrs-vxworks/include/semLib.h:40,
                  from ../../../../libgcc/../gcc/gthr-vxworks.h:51,
                  from ../../.././gcc/gthr-default.h:1,
                  from ../../../../libgcc/../gcc/gthr.h:162,
                  from ../../../../libgcc/../gcc/config/vxlib.c:30:
/usr/local/ppc-wrs-vxworks/include/types/vxTypes.h:66:1: error: 
conflicting types for 'ptrdiff_t'
/home/src/gcc-4.6/build/./gcc/include/stddef.h:150:26: note: previous 
declaration of 'ptrdiff_t' was here
/usr/local/ppc-wrs-vxworks/include/types/vxTypes.h:76:1: error: 
conflicting types for 'wchar_t'
/home/src/gcc-4.6/build/./gcc/include/stddef.h:324:24: note: previous 
declaration of 'wchar_t' was here
../../../../libgcc/../gcc/config/vxlib.c:37:21: fatal error: taskLib.h: 
No such file or directory
compilation terminated.
make[4]: *** [vxlib.o] Virhe 1
make[4]: Poistutaan hakemistosta 
"/home/src/gcc-4.6-20110129/build/ppc-wrs-vxworks/mrtp/libgcc"
------------------ clip --------------------------------

I hadn't that 'taskLib.h' anywhere...

No paying - no working with something one will never need... That was
my result with this :(



More information about the Gcc-help mailing list