This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Problems cross-compiling GCC 2.95.1 host=sparc-sun-solaris2.7 target=sparcv9-sun-solaris2.7
- To: <gcc-bugs at gcc dot gnu dot org>
- Subject: Problems cross-compiling GCC 2.95.1 host=sparc-sun-solaris2.7 target=sparcv9-sun-solaris2.7
- From: "Kevin Neel" <kevinsn at earthlink dot net>
- Date: Sat, 6 Nov 1999 15:46:28 -0800
When creating a cross compiler GCC 2.95.1 (host=sparc-sun-solaris2.7
target=sparcv9-sun-solaris2.7) using a native 2.95.1, I get the following
messages:
(1)
../../gcc-2.95.1/gcc/config/sparc/gmon-sol2.c:184: `PATH_MAX' undeclared
(first use in this function)
(2)
checking whether the C compiler
(/home/kneel/gcc/b1-cross/gcc/xgcc -B/home/kneel/gcc/b1-cross/gcc/ -B/home/k
neel/gcc/inst-cross/sparcv9-sun-solaris2.7/bin/ -g -O2 ) works... no
configure: error: installation or configuration problem: C compiler cannot
create executables.
(3)
I get a number of warnings indicating that function declarations aren't in
effect. These are generally in building the library. E.g.:
/home/kneel/gcc/b1-cross/gcc/xgcc -B/home/kneel/gcc/b1-cross/gcc/ -B/home/kn
e\
el/gcc/inst-cross/sparcv9-sun-solaris2.7/bin/ -I/home/kneel/gcc/inst-cross/s
par\
cv9-sun-solaris2.7/include -O2 -DCROSS_COMPILE -DIN_GCC -DHAIFA -DSVR4 -g
-O\
2 -I./include -fPIC -g1 -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_
NEE\
DED -fexceptions -I. -I../../gcc-2.95.1/gcc -I../../gcc-2.95.1/gcc/config
-I\
../../gcc-2.95.1/gcc/../include -c \
-DL${name} ../../gcc-2.95.1/gcc/libgcc2.c -o ${name}.o; \
if [ $? -eq 0 ] ; then true; else exit 1; fi; \
sparcv9-sun-solaris2.7-ar rc tmplibgcc2.a ${name}.o; \
rm -f ${name}.o; \
done
_eh
In file included from
/home/kneel/gcc/inst-cross/sparcv9-sun-solaris2.7/include\
/pthread.h:14,
from ../../gcc-2.95.1/gcc/gthr-posix.h:37,
from gthr-default.h:1,
from ../../gcc-2.95.1/gcc/gthr.h:98,
from ../../gcc-2.95.1/gcc/libgcc2.c:3034:
/home/kneel/gcc/inst-cross/sparcv9-sun-solaris2.7/include/sched.h:52:
warning: \
`struct timespec' declared inside parameter list
/home/kneel/gcc/inst-cross/sparcv9-sun-solaris2.7/include/sched.h:52:
warning: \
its scope is only this definition or declaration, which is probably not what
yo\
u want.
In file included from ../../gcc-2.95.1/gcc/gthr-posix.h:37,
from gthr-default.h:1,
from ../../gcc-2.95.1/gcc/gthr.h:98,
from ../../gcc-2.95.1/gcc/libgcc2.c:3034:
/home/kneel/gcc/inst-cross/sparcv9-sun-solaris2.7/include/pthread.h:185:
warnin\
g: `struct timespec' declared inside parameter list
>>>../../gcc-2.95.1/gcc/libgcc2.c: In function `new_eh_context':
>>>../../gcc-2.95.1/gcc/libgcc2.c:3094: warning: type mismatch in implicit
declara\
>>>tion for built-in function `memset'
>>>../../gcc-2.95.1/gcc/libgcc2.c: In function `copy_reg':
>>>../../gcc-2.95.1/gcc/libgcc2.c:3649: warning: type mismatch in implicit
declara\
>>>tion for built-in function `memcpy'
Similarly:
/home/kneel/gcc/b1-cross/gcc/xgcc -B/home/kneel/gcc/b1-cross/gcc/ -B/home/k\
neel/gcc/inst-cross/sparcv9-sun-solaris2.7/bin/ -I/home/kneel/gcc/inst-cross
/sp\
arcv9-sun-solaris2.7/include -O2 -DCROSS_COMPILE -DIN_GCC -DHAIFA -DSVR4
-g \
-O2 -I./include -fPIC -g1 -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NO
T_N\
EEDED -I. -I../../gcc-2.95.1/gcc -I../../gcc-2.95.1/gcc/config -I../../gc
c-2\
.95.1/gcc/../include -c ${file}; \
if [ $? -eq 0 ] ; then true; else exit 1; fi; \
sparcv9-sun-solaris2.7-ar rc tmplibgcc2.a ${oname}.o; \
....
In file included from ../../gcc-2.95.1/gcc/gthr-posix.h:37,
from gthr-default.h:1,
from ../../gcc-2.95.1/gcc/gthr.h:98,
from ../../gcc-2.95.1/gcc/frame.c:52:
/home/kneel/gcc/inst-cross/sparcv9-sun-solaris2.7/include/pthread.h:185:
warnin\
g: `struct timespec' declared inside parameter list
../../gcc-2.95.1/gcc/frame.c: In function `extract_cie_info':
../../gcc-2.95.1/gcc/frame.c:571: warning: type mismatch in implicit
declaratio\
n for built-in function `strlen'
../../gcc-2.95.1/gcc/frame.c: In function `execute_cfa_insn':
../../gcc-2.95.1/gcc/frame.c:691: warning: type mismatch in implicit
declaratio\
n for built-in function `memcpy'
../../gcc-2.95.1/gcc/frame.c: In function `__frame_state_for':
../../gcc-2.95.1/gcc/frame.c:837: warning: type mismatch in implicit
declaratio\
n for built-in function `memset'
Also:
../../../gcc-2.95.1/libio/iofdopen.c: In function `_IO_fdopen':
../../../gcc-2.95.1/libio/iofdopen.c:105: warning: cast to pointer from
integer\
[multiple instances in compiling libio/*.c]
----------------------------------------------------------------------------
---------------------
My methodology for building the compiler is this:
1. Build a bootstrap native compiler 2.95.1 (sparc-sun-solaris2.7) --
successful (an old gcc was the base compiler)
2. Build a cross compiler sparc-sun-solaris2.7 => sparcv9-sun-solaris2.7,
using the Sun ld and as -- warnings
3. [Not there yet] Use #2 to bootstrap a sparcv9 compiler
In step 2, I'm using the following definitions:
set target=sparcv9-sun-solaris2.7
set prefix=/home/kneel/gcc/inst-cross
set path = (~/gcc/bin /opt/SUNWspro/bin /usr/ccs/bin /usr/ccs/lib /usr/bin
\
/etc /usr/ucb /usr/dt/bin /usr/games /usr/local/x11/bin
\
/usr/openwin/bin /home/kneel/bin ~/gcc/inst-v8/bin )
alias config ../gcc-2.95.1/configure --host=sparc-sun-solaris2.7 \
--target=$target --prefix=$prefix \
-v --enable-languages=c++
alias build make MAKE="make -j 2" -j 2
... where ~/gcc/inst-v8/bin is the installation of the native 2.95.1
compiler and ~/gcc/bin includes
nazgul% ls -l ~/gcc/bin
total 0
lrwxrwxrwx 1 kneel geneva 25 Aug 18 17:25 make ->
/usr/progressive/bin/make
lrwxrwxrwx 1 kneel geneva 19 Aug 19 14:41 perl ->
/usr/local/bin/perl
lrwxrwxrwx 1 kneel geneva 15 Aug 19 12:37
sparcv9-sun-solaris2.7-ar -> /usr/ccs/bin/ar
lrwxrwxrwx 1 kneel geneva 15 Aug 19 12:41
sparcv9-sun-solaris2.7-nm -> /usr/ccs/bin/nm
lrwxrwxrwx 1 kneel geneva 19 Aug 19 14:02
sparcv9-sun-solaris2.7-ranlib -> /usr/ccs/bin/ranlib
In my install directory for the cross compiler, I have:
nazgul% ls -l ~/gcc/inst-cross/sparcv9-sun-solaris2.7/
total 16
lrwxrwxrwx 1 kneel geneva 12 Nov 5 23:34 include ->
/usr/include
drwxrwxr-x 9 kneel geneva 16384 Nov 5 23:30 sys-include
and I have copied all files from /usr/include/sys into the above sys-include
directory.
My host is:
nazgul% uname -a
SunOS nazgul 5.7 Generic_106541-07 sun4u sparc SUNW,Ultra-Enterprise
I'm attaching the .i file for libgcc2.c and the entire log of the build in
step 2.
Any ideas? Am I configuring this wrongly? Has anyone tried this
combination?
Thanks,
Kevin
libgcc2.zip
Log.zip