GCC as crosscompiler for LynxOS

Roberto Cabral roberto.cabral@gmail.com
Fri Aug 19 00:07:00 GMT 2005


OK, forget about this problem. 

There was a header file that I did not patch correctly. But now, when
the build is using xgcc, compiler exits with an internal compiler
error:

/home/rcabral/src/gcc/build/gcc/xgcc -B/home/rcabral/src/gcc/build/gcc/ -B/usr/l
ocal/i386-lynx-lynxos/bin/ -B/usr/local/i386-lynx-lynxos/lib/ -isystem /usr/loca
l/i386-lynx-lynxos/include -isystem /usr/local/i386-lynx-lynxos/sys-include -O2
 -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissi
ng-prototypes -Wold-style-definition  -isystem ./include   -g  -DIN_LIBGCC2 -D__
GCC_FLOAT_NOT_NEEDED  -I. -I. -I../../gcc-4.0.1/gcc -I../../gcc-4.0.1/gcc/. -I..
/../gcc-4.0.1/gcc/../include -I../../gcc-4.0.1/gcc/../libcpp/include  -DL_muldi3
 -c ../../gcc-4.0.1/gcc/libgcc2.c -o libgcc/./_muldi3.o
cc1: internal compiler error: in init_reg_sets, at regclass.c:294

 Someone can help me with this type of error?

Thanks

2005/8/18, Roberto Cabral <roberto.cabral@gmail.com>:
> Hi,
> 
> I'm trying to build GCC 4 for the LynxOS. The native compiler didn't
> work so I'm trying for the crosscompiling route.
> 
> I build the binutils 2.15 as:
> 
> ../binutils-2.15/configure --prefix=/usr/local
> --target=i386-lynx-lynxos --disable-nls
> 
> and I have built GCC 4.0.1 with this patch reverted to enable coff
> target as default for lynxos:
> 
> http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00501.html
> 
> with this flags:
> 
> $ ../gcc-4.0.1/configure --prefix=/usr/local --target=i386-lynx-lynxos
> --disable-nls --with-gnu-as --with-gnu-ld --with-headers
> 
> the headers and libs of the system are under /usr/local/i386-lynx-lynxos
> 
> The binutils were build fine, and the gcc stops on building
> libstdc++-v3 (so, I tought that the c compiler was build fine and ran
> make install to see what happens).
> 
> Then, If I run:
> 
> gcc -V 4.0.1 -b i386-lynx-lynxos hello.c -o hello
> 
> The system says about unresolved symbols:
> /cygdrive/c/DOCUME~1/rcabral/LOCALS~1/Temp/ccrW7xqg.o(.text+0x7):hello.c:
> multiple definition of `_main'
> /usr/local/lib/gcc/i386-lynx-lynxos/4.0.1/../../../../i386-lynx-lynxos/lib/init1.o(.text+0x0):.file:
> first defined here
> /cygdrive/c/DOCUME~1/rcabral/LOCALS~1/Temp/ccrW7xqg.o(.text+0x31):hello.c:
> undefined reference to `_puts'
> /usr/local/lib/gcc/i386-lynx-lynxos/4.0.1/../../../../i386-lynx-lynxos/lib/libc.
> a(runmainthread.s)(.text+0x29):runmainthread.s: undefined reference to `main'
> collect2: ld returned 1 exit status
> 
> So, I checked with nm about the symbols on the libc of the LynxOS and
> they exists in there but without the "_" appended. So, I generate an
> object file (".o"). And then I changed the symbols of the object file
> with objcopy to the same name but without the "_" like this:
> 
> i386-lynx-lynxos-objcopy --redefine-sym _main=main --redefine-sym
> _puts=puts hello.o hello2.o
> 
> After that, I ran:
> 
> gcc -V 4.0.1 -b i386-lynx-lynxos hello2.o -o hello
> 
> And it links without errors. Then I copy the executable file to the
> LynxOS machine and it did work fine (It printed "hello").
> 
> So, after all this, my question is: What should I do to tell to GCC to
> not append "_" on the symbols? Did I build GCC or binutils the wrong
> way?
> 
> I'm using cygwin as the host.
> 
> Any help is appreciated,
> 
> Thanks in advance, (and sorry for my bad English)
> --
> -----------------------------------------------
> Roberto Cabral
> Correo: roberto.cabral( at )gmail.com
> 


-- 
-----------------------------------------------
Roberto Cabral
Correo: roberto.cabral( at )gmail.com



More information about the Gcc-help mailing list