This is the mail archive of the
mailing list for the GCC project.
Re: Building a Solaris cross compiler
- From: "Mark Cuss" <mcuss at cdlsystems dot com>
- To: <gcc-return-96598-mcuss=cdlsystems dot com at gcc dot gnu dot org>,<gcc at gcc dot gnu dot org>
- Date: Fri, 28 May 2004 12:58:37 -0600
- Subject: Re: Building a Solaris cross compiler
- References: <NUTMEGTBjzoqv69Ti4c000000b7@NUTMEG.CAM.ARTIMI.COM>
- Reply-to: mcuss at cdlsystems dot com
That made the configure work and the build goes part way, but it ends up
/users/mark/cross2/build-gcc/gcc/xgcc -B/users/mark/cross2/build-gcc/gcc/ -B
/users/mark/cross2/build-install/sparc-sun-solaris2.9/sys-include -DIN_GCC -
DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prot
otypes -Wold-style-definition -isystem
./include -I. -I. -I../../gcc-3.4.0/gcc -I../../gcc-3.4.0/gcc/. -I../../gcc
-c ../../gcc-3.4.0/gcc/config/sparc/gmon-sol2.c -o gmon.o
../../gcc-3.4.0/gcc/config/sparc/gmon-sol2.c: In function `_mcleanup':
../../gcc-3.4.0/gcc/config/sparc/gmon-sol2.c:182: error: `PATH_MAX'
undeclared (first use in this function)
../../gcc-3.4.0/gcc/config/sparc/gmon-sol2.c:182: error: (Each undeclared
identifier is reported only once
../../gcc-3.4.0/gcc/config/sparc/gmon-sol2.c:182: error: for each function
it appears in.)
../../gcc-3.4.0/gcc/config/sparc/gmon-sol2.c:182: warning: unused variable
make: *** [gmon.o] Error 1
make: Leaving directory `/users/mark/cross2/build-gcc/gcc'
make: *** [all-gcc] Error 2
I did a google for this and read that if one includes limits.h in the
gmon-sol2.c file that the problem goes away, but I tried this and had the
same problem. I think the problem is because there is a limits.h in the
Solaris headers (in which PATH_MAX defined), but there is also 2 limits.h
files in the gcc source tree. I'm thinking that the compiler picks up the
limits.h from the gcc tree and ignores the one in the Solaris headers
causing the error to occur.
Has anyone seen this before? Does anyone know which limits.h file I should
Thanks in advance,
----- Original Message -----
From: "Dave Korn" <firstname.lastname@example.org>
To: <email@example.com>; <firstname.lastname@example.org>
Sent: Friday, May 28, 2004 4:06 AM
Subject: RE: Building a Solaris cross compiler
> > -----Original Message-----
> > From: gcc-owner On Behalf Of Mark Cuss
> > Sent: 27 May 2004 23:23
> > I'm working on building a Solaris cross compiler on my Linux
> > machine.
> > 2) Build gcc
> > First, I do this to add the newly compiled binutils to my path:
> > export PATH=$prefix/sparc-sun-solaris2.9:$PATH
> That's not quite right. What you want is
> export PATH=$prefix/bin:$PATH
> When you build binutils you get two versions of each application: one
> the target prefixed to it ($prefix/bin/sparc-sun-solaris2.9-as, for
> and one without the target in the name, but located in a specialized
> subdirectory ($prefix/sparc-sun-solaris2.9/bin/as in this case).
> You want the prefixed version to be in your $PATH so that the cross
> compiler can find it. You don't want the unprefixed versions in your
> because then there's no way to specify which target-version of as gets
> > /tmp/ccQ2EJ2k.s: Assembler messages:
> > /tmp/ccQ2EJ2k.s:8: Error: Unknown opcode: `pushl'
> > /tmp/ccQ2EJ2k.s:9: Error: Illegal operands
> > /tmp/ccQ2EJ2k.s:10: Error: Unknown opcode: `subl'
> > /tmp/ccQ2EJ2k.s:11: Error: Unknown opcode: `andl'
> > /tmp/ccQ2EJ2k.s:12: Error: Unknown opcode: `xorl'
> > /tmp/ccQ2EJ2k.s:13: Error: Unknown opcode: `leave'
> > *** The command '/usr/bin/gcc -o conftest -O2 conftest.c' failed.
> > *** You must set the environment variable CC to a working compiler.
> > root. The
> > permissions errors vanished, byt the unknown opcodes are still there.
> > Any ideas? As far as I know the gcc on the system is
> > fine....
> Those are x86 opcodes. The local compiler is being called to make the
> cross compiler, it's generating assembly files, but then because you put
> (unprefixed) sparc assembler earlier in your $PATH than the x86 ones, the
> sparc assembler tried to assemble the files for the x86->sparc cross
> compiler. Re-set your $PATH and try again and you should get there.
> Can't think of a witty .sigline today....