This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Building a Solaris cross compiler


Thanks!

That made the configure work and the build goes part way, but it ends up
stopping on:

/users/mark/cross2/build-gcc/gcc/xgcc -B/users/mark/cross2/build-gcc/gcc/ -B
/users/mark/cross2/build-install/sparc-sun-solaris2.9/bin/ -B/users/mark/cro
ss2/build-install/sparc-sun-solaris2.9/lib/ -isystem
/users/mark/cross2/build-install/sparc-sun-solaris2.9/include -isystem
/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
-3.4.0/gcc/../include   \
 -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
`buf'
make[1]: *** [gmon.o] Error 1
make[1]: 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
be using?

Thanks in advance,

Mark

----- Original Message ----- 
From: "Dave Korn" <dk@artimi.com>
To: <mcuss@cdlsystems.com>; <gcc@gcc.gnu.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
with
> the target prefixed to it ($prefix/bin/sparc-sun-solaris2.9-as, for
example)
> 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
$PATH
> because then there's no way to specify which target-version of as gets
> called.
>
> > /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
the
> (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.
>
>     cheers,
>       DaveK
> -- 
> Can't think of a witty .sigline today....
>
>



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]