Problem compiling for other platform

Bryan Ischo bryan@ischo.com
Tue Aug 9 22:08:00 GMT 2011


On 08/09/11 15:03, Brian Ipsen wrote:
> Hi
>
>   I am trying to compile gcc 3.2 (based on RHEL RPM source) with a build-environment used for creating Synology 3rd-part applications (since I need libstdc++.so.5).
>
> I start building with (target is an Intel Atom CPU):
>
> CC=/usr/local/i686-linux-gnu/bin/i686-linux-gnu-gcc AS=/usr/local/i686-linux-gnu/bin/i686-linux-gnu-as ASFLAGS+=--32 CCFLAGS="-I/usr/local/i686-linux-gnu/include/ -m32" LDFLAGS=-L/usr/local/i686-linux-gnu/lib/   rpmbuild -bc --target=i686 compat-gcc-32.spec
>
> But during compiling, it fails with:
>
> ./xgcc -B./ -B/usr/i686-redhat-linux/bin/ -isystem /usr/i686-redhat-linux/include -isystem /usr/i686-redhat-linux/sys-include -O2 -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include  -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/config -I../../gcc/../include  -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-omit-frame-pointer \
>             -c ../../gcc/crtstuff.c -DCRT_END \
>            -o crtend.o
> /tmp/ccrc3fSw.s: Assembler messages:
> /tmp/ccrc3fSw.s:37: Error: suffix or operands invalid for `push'
> /tmp/ccrc3fSw.s:50: Error: suffix or operands invalid for `call'
> /tmp/ccrc3fSw.s:76: Error: suffix or operands invalid for `push'
> /tmp/ccrc3fSw.s:82: Error: suffix or operands invalid for `pop'
> /tmp/ccrc3fSw.s:101: Error: suffix or operands invalid for `call'
> /tmp/ccrc3fSw.s:104: Error: suffix or operands invalid for `pop'
>
> I wonder if this is caused by an incorrect assembler being called - or with wrong parameters ?
>
> gcc -v (with above environment variables) gives:
>
> Using built-in specs.
> Target: i686-linux-gnu
> Configured with: /synosrc/source_backup/crosstool-0.43/build/i686-linux-gnu/gcc-4.2.1/configure --target=i686-linux-gnu --host=i686-host_pc-linux-gnu --prefix=/usr/local/i686-linux-gnu --with-arch=pentium3 --with-tune=pentium4 --with-headers=/usr/local/i686-linux-gnu/i686-linux-gnu/include --with-local-prefix=/usr/local/i686-linux-gnu/i686-linux-gnu --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c,c++ --enable-shared --enable-c99 --enable-long-long
> Thread model: posix
> gcc version 4.2.1
>
> Any ideas on how I proceed in order to try to get the library created ?
>
> Regards
> Brian
>

I am fairly certain that I saw that same error while developing a script 
for building a cross-compiler, and the way I solved it was to upgrade 
the version of gcc that I was using to build the cross-compiler (i.e. 
the system compiler that you are using while building gcc).  But since I 
never figured out what the exact root cause was I don't know what other 
solutions might be possible.

Bryan



More information about the Gcc-help mailing list