[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Building gcc-3.2.1 for sparc64 on a sparc32?



On Wed, Nov 27, 2002 at 02:36:42PM +0100, Christian Jönsson wrote:
> On Wed, Nov 27, 2002 at 08:12:57AM -0500, Ben Collins wrote:
> > > Assume /usr/local/src/gcc-3.2.1 is the src dir and
> > > /usr/local/src/objdir-gcc-3.2.1 is the dir to be built in.
> > > 
> > > $ cd /usr/local/src/objdir-gcc-3.2.1 $
> > > /usr/local/src/gcc-3.2.1/configure --target=sparc64-linux \
> > > --host=sparc64-linux --build=sparc-linux --prefix=/usr/local/gcc-3.2.1
> > > 
> > > Is that a right use of target/host/build?
> > > 
> > > What other configure options do I need to set? What .deb packages do
> > > they in turn require to be installed to be able to build gcc-3.2.1
> > > this way?
> > 
> > So the sparc64 you are installing this on has 64bit runtime? Do you have
> > 64bit runtime to link against? If not, I'd leave it as a sparc host with
> > sparc target:
> 
> Yes, the sparc64 machine is a sun4u with 64-bit runtimes... The build
> machine is a sparc32 sun4m one.
> 
> >  --host=sparc-linux --build=sparc-linux --target=sparc64-linux
> >  --with-cpu=v7
>  
> > That will build for an ultrasparc target, default to v7. Then your new
> > compiler can build 64bit binaries from either host (just like Debian's
> > compiler does), sparc or sparc64.
> 
> Well, I'd like it to be sparc64-linux... based multilibbed...
>  
> > If what you really want is a 64bit binary, then you need to do the above
> > step first, so that you have a cross-compiler that can build 64bit
> > binaries.
> 
> I want to build a 3.2.1 sparc64 one, then install it on the sun4u
> machine, there I can natively build new one I guess...
> 

hmm, I did build the binutils 2.13 branch configures like that,
--host=sparc64-linux --build=sparc-linux
--prefix=/usr/local/gcc-binutils, installed it, got this:

$ ls -l /usr/local/gcc-binutils/bin/
total 7608
-rwxr-xr-x    1 root     staff      333324 Nov 29 21:04 sparc64-linux-addr2line
-rwxr-xr-x    2 root     staff      327423 Nov 29 21:03 sparc64-linux-ar
-rwxr-xr-x    2 root     staff     1628543 Nov 29 21:04 sparc64-linux-as
-rwxr-xr-x    1 root     staff      185414 Nov 29 21:04 sparc64-linux-c++filt
-rwxr-xr-x    2 root     staff     1204694 Nov 29 21:05 sparc64-linux-ld
-rwxr-xr-x    2 root     staff      381479 Nov 29 21:04 sparc64-linux-nm
-rwxr-xr-x    1 root     staff      858372 Nov 29 21:03 sparc64-linux-objcopy
-rwxr-xr-x    1 root     staff      870136 Nov 29 21:03 sparc64-linux-objdump
-rwxr-xr-x    2 root     staff      327422 Nov 29 21:03 sparc64-linux-ranlib
-rwxr-xr-x    1 root     staff      442170 Nov 29 21:04 sparc64-linux-readelf
-rwxr-xr-x    1 root     staff      147460 Nov 29 21:03 sparc64-linux-size
-rwxr-xr-x    1 root     staff      146355 Nov 29 21:03 sparc64-linux-strings
-rwxr-xr-x    2 root     staff      858371 Nov 29 21:04 sparc64-linux-strip
$ file /usr/local/gcc-binutils/bin/sparc64-linux-addr2line
/usr/local/gcc-binutils/bin/sparc64-linux-addr2line: ELF 32-bit MSB executable, SPARC, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), not stripped

added /usr/local/gcc-binutils/bin to the PATH and then proceeded to
build the gcc 3.2 branch, configured like this:

env CXX=g++-3.2 CC=gcc-3.2 \
/usr/local/src/gcc-binutils/branch/gcc/configure \
--host=sparc-linux --build=sparc-linux --target=sparc64-linux --prefix=/usr/local/gcc-binutils \
--enable-shared --enable-threads=posix

issued a make bootstrap-lean and the build process stopped here:

./xgcc -B./ -B/usr/local/gcc-binutils/sparc64-linux/bin/ -isystem /usr/local/gcc-binutils/sparc64-linux/include -isystem /usr/local/gcc-binutils/sparc64-linux/sys-include -O2  -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include  -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I/usr/local/src/gcc-binutils/branch/gcc/gcc -I/usr/local/src/gcc-binutils/branch/gcc/gcc/. -I/usr/local/src/gcc-binutils/branch/gcc/gcc/config -I/usr/local/src/gcc-binutils/branch/gcc/gcc/../include  -DL__gcc_bcmp -c /usr/local/src/gcc-binutils/branch/gcc/gcc/libgcc2.c -o libgcc/./__gcc_bcmp.o
rm -rf ./libgcc.a
sparc64-linux-ar  rc ./libgcc.a libgcc/./_muldi3.oS libgcc/./_negdi2.oS libgcc/./_lshrdi3.oS libgcc/./_ashldi3.oS libgcc/./_ashrdi3.oS libgcc/./_ffsdi2.oS libgcc/./_clz.oS libgcc/./_cmpdi2.oS libgcc/./_ucmpdi2.oS libgcc/./_floatdidf.oS libgcc/./_floatdisf.oS libgcc/./_fixunsdfsi.oS libgcc/./_fixunssfsi.oS libgcc/./_fixunsdfdi.oS libgcc/./_fixdfdi.oS libgcc/./_fixunssfdi.oS libgcc/./_fixsfdi.oS libgcc/./_fixxfdi.oS libgcc/./_fixunsxfdi.oS libgcc/./_floatdixf.oS libgcc/./_fixunsxfsi.oS libgcc/./_fixtfdi.oS libgcc/./_fixunstfdi.oS libgcc/./_floatditf.oS libgcc/./_clear_cache.oS libgcc/./_trampoline.oS libgcc/./__main.oS libgcc/./_exit.oS libgcc/./_absvsi2.oS libgcc/./_absvdi2.oS libgcc/./_addvsi3.oS libgcc/./_addvdi3.oS libgcc/./_subvsi3.oS libgcc/./_subvdi3.oS libgcc/./_mulvsi3.oS libgcc/./_mulvdi3.oS libgcc/./_negvsi2.oS libgcc/./_negvdi2.oS libgcc/./_ctors.oS libgcc/./_divdi3.oS libgcc/./_moddi3.oS libgcc/./_udivdi3.oS libgcc/./_umoddi3.oS libgcc/./_udiv_w_sdiv.oS libgcc/./_udivmoddi4.oS libgcc/./_eprintf.oS libgcc/./_bb.oS libgcc/./__gcc_bcmp.oS
if [ -f sparc64-linux-ranlib ] || ( [ sparc-unknown-linux-gnu = sparc64-unknown-linux-gnu ] && [ -f /usr/bin/ranlib -o -f /bin/ranlib ] ) ; then \
  sparc64-linux-ranlib ./libgcc.a ; \
else true; fi;
./xgcc -B./ -B/usr/local/gcc-binutils/sparc64-linux/bin/ -isystem /usr/local/gcc-binutils/sparc64-linux/include -isystem /usr/local/gcc-binutils/sparc64-linux/sys-include -O2  -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include  -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I/usr/local/src/gcc-binutils/branch/gcc/gcc -I/usr/local/src/gcc-binutils/branch/gcc/gcc/. -I/usr/local/src/gcc-binutils/branch/gcc/gcc/config -I/usr/local/src/gcc-binutils/branch/gcc/gcc/../include -fexceptions -c /usr/local/src/gcc-binutils/branch/gcc/gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o
In file included from /usr/local/src/gcc-binutils/branch/gcc/gcc/unwind-dw2.c:26:
/usr/local/src/gcc-binutils/branch/gcc/gcc/unwind-pe.h: In function `size_of_encoded_value':
/usr/local/src/gcc-binutils/branch/gcc/gcc/unwind-pe.h:76: warning: implicit declaration of function `abort'
In file included from gthr-default.h:1,
                 from /usr/local/src/gcc-binutils/branch/gcc/gcc/gthr.h:98,
                 from /usr/local/src/gcc-binutils/branch/gcc/gcc/unwind-dw2.c:28:
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:37:21: pthread.h: No such file or directory
In file included from gthr-default.h:1,
                 from /usr/local/src/gcc-binutils/branch/gcc/gcc/gthr.h:98,
                 from /usr/local/src/gcc-binutils/branch/gcc/gcc/unwind-dw2.c:28:
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h: At top level:
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:39: parse error before "__gthread_key_t"
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:39: warning: type defaults to `int' in declaration of `__gthread_key_t'
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:39: warning: data definition has no type or storage class
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:40: parse error before "__gthread_once_t"
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:40: warning: type defaults to `int' in declaration of `__gthread_once_t'
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:40: warning: data definition has no type or storage class
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:41: parse error before "__gthread_mutex_t"
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:41: warning: type defaults to `int' in declaration of `__gthread_mutex_t'
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:41: warning: data definition has no type or storage class
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h: In function `__gthread_active_p':
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:83: `pthread_create' undeclared (first use in this function)
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:83: (Each undeclared identifier is reported only once
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:83: for each function it appears in.)
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h: At top level:
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:438: parse error before '*' token
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:438: parse error before ')' token
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:447: parse error before '*' token
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:447: parse error before ')' token
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:453: parse error before "key"
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:454: warning: function declaration isn't a prototype
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h: In function `__gthread_key_dtor':
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:456: `ptr' undeclared (first use in this function)
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:457: warning: implicit declaration of function `pthread_setspecific'
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:457: `key' undeclared (first use in this function)
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h: At top level:
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:463: parse error before "key"
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:464: warning: function declaration isn't a prototype
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h: In function `__gthread_key_delete':
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:465: warning: implicit declaration of function `pthread_key_delete'
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:465: `key' undeclared (first use in this function)
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h: At top level:
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:469: parse error before "key"
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:470: warning: function declaration isn't a prototype
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h: In function `__gthread_getspecific':
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:471: warning: implicit declaration of function `pthread_getspecific'
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:471: `key' undeclared (first use in this function)
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:471: warning: return makes pointer from integer without a cast
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h: At top level:
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:475: parse error before "key"
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:476: warning: function declaration isn't a prototype
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h: In function `__gthread_setspecific':
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:477: `key' undeclared (first use in this function)
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:477: `ptr' undeclared (first use in this function)
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h: At top level:
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:481: parse error before '*' token
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:482: warning: function declaration isn't a prototype
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h: In function `__gthread_mutex_lock':
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:484: warning: implicit declaration of function `pthread_mutex_lock'
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:484: `mutex' undeclared (first use in this function)
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h: At top level:
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:490: parse error before '*' token
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:491: warning: function declaration isn't a prototype
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h: In function `__gthread_mutex_trylock':
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:493: warning: implicit declaration of function `pthread_mutex_trylock'
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:493: `mutex' undeclared (first use in this function)
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h: At top level:
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:499: parse error before '*' token
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:500: warning: function declaration isn't a prototype
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h: In function `__gthread_mutex_unlock':
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:502: warning: implicit declaration of function `pthread_mutex_unlock'
/usr/local/src/gcc-binutils/branch/gcc/gcc/gthr-posix.h:502: `mutex' undeclared (first use in this function)
/usr/local/src/gcc-binutils/branch/gcc/gcc/unwind-dw2.c: In function `extract_cie_info':
/usr/local/src/gcc-binutils/branch/gcc/gcc/unwind-dw2.c:226: warning: implicit declaration of function `strlen'
/usr/local/src/gcc-binutils/branch/gcc/gcc/unwind-dw2.c: In function `uw_frame_state_for':
/usr/local/src/gcc-binutils/branch/gcc/gcc/unwind-dw2.c:899: warning: implicit declaration of function `memset'
/usr/local/src/gcc-binutils/branch/gcc/gcc/unwind-dw2.c: In function `uw_install_context_1':
/usr/local/src/gcc-binutils/branch/gcc/gcc/unwind-dw2.c:1166: syntax error before "once_regsizes"
/usr/local/src/gcc-binutils/branch/gcc/gcc/unwind-dw2.c:1167: warning: implicit declaration of function `__gthread_once'
/usr/local/src/gcc-binutils/branch/gcc/gcc/unwind-dw2.c:1167: `once_regsizes' undeclared (first use in this function)
/usr/local/src/gcc-binutils/branch/gcc/gcc/unwind-dw2.c:1181: warning: implicit declaration of function `memcpy'
make[3]: *** [libgcc/./unwind-dw2.o] Error 1
make[3]: Leaving directory `/exports/gcc-binutils/branch/objdir/gcc'
make[2]: *** [stmp-multilib] Error 2
make[2]: Leaving directory `/exports/gcc-binutils/branch/objdir/gcc'
make[1]: *** [stage1_build] Error 2
make[1]: Leaving directory `/exports/gcc-binutils/branch/objdir/gcc'
make: *** [bootstrap-lean] Error 2

There still are problems with my try thus.., could use some help here
please...

This was on a Debian prerelease (Sarge) dual SuperSparc-(II) sun4m
system with these packages:

binutils	2.13.90.0.10-1
bison		1.75-1
dejagnu		1.4.2-1.1
expect		5.38.0-2
g++-3.2		1:3.2.1-0pre3 (Debian prerelease)
gcc-3.2		1:3.2.1-0pre3 (Debian prerelease)
kernel-image	2.4.20smp (from http://osinvestor.com/sparc)
libc6		2.2.5-14.3
tcl8.3		8.3.3-8

Cheers,

/ChJ



Reply to: