public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* the struggle to create a 64-bit gcc on Solaris 10
@ 2012-11-09 19:52 Dennis Clarke
  2012-11-09 21:46 ` Eric Botcazou
  0 siblings, 1 reply; 19+ messages in thread
From: Dennis Clarke @ 2012-11-09 19:52 UTC (permalink / raw)
  To: gcc


I have been trying repeatedly and in incrementally more rewarding stages towards building a purely 64-bit GCC compiler on Solaris 10 sparc. I have no need for the 32-bit libs at all and my entire toolchain is 64-bit only. There are no 32-bit libs in /usr/local/lib nor do there need to be. Thus far things have gone well with this approach but I have been using the Oraccle Studio compilers to get to this point. Now I need to get to GCC and then never look back. 

This has been a struggle as I have needed to hand edit Makefiles over and over and regardless of what I do I end up stopping within stage one of the 3-stage bootstrap with a problem dealing with GMP libs. 

I have the sources to gmp, mpfr and mpc extracted in the gcc-4.7.2 source directory. No problem there. I have hand edited Makefiles after configure to ensure that ABI=64 in every Makefile that needs it. Thus : 

$ find . -type f -name Makefile | xargs grep "^ABI" 
./gmp/mpq/Makefile:ABI = 64
./gmp/tune/Makefile:ABI = 64
./gmp/scanf/Makefile:ABI = 64
./gmp/mpf/Makefile:ABI = 64
./gmp/printf/Makefile:ABI = 64
./gmp/mpn/Makefile:ABI = 64
./gmp/mpz/Makefile:ABI = 64
./gmp/cxx/Makefile:ABI = 64
./gmp/Makefile:ABI = 64
./gmp/tests/devel/Makefile:ABI = 64
./gmp/tests/Makefile:ABI = 64
./gmp/tests/misc/Makefile:ABI = 64
./gmp/tests/rand/Makefile:ABI = 64
./gmp/tests/cxx/Makefile:ABI = 64
./gmp/tests/mpn/Makefile:ABI = 64
./gmp/tests/mpz/Makefile:ABI = 64
./gmp/tests/mpf/Makefile:ABI = 64
./gmp/tests/mpq/Makefile:ABI = 64
./gmp/tests/mpbsd/Makefile:ABI = 64
./gmp/mpbsd/Makefile:ABI = 64
./gmp/demos/calc/Makefile:ABI = 64
./gmp/demos/Makefile:ABI = 64
./gmp/demos/expr/Makefile:ABI = 64
./gmp/doc/Makefile:ABI = 64

After doing this and running gmake I eventually get stopped and see these guys : 

$ find . -type f | xargs file | grep ELF | grep -v 64 
./gmp/gen-bases: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped
./gmp/gen-psqr: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped
./gmp/gen-fac_ui: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped
./gmp/gen-fib: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped
./gmp/gen-trialdivtab: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped

All of which were somehow compiled as 32-bit binaries. No idea where they are coming from and why they did not respect the CFLAGS of "-m64 -mptr64 " which I have hand edited into Makefiles everywhere. 

As an example : 

$ diff ./Makefile.backup Makefile 
414c414
< STAGE_CFLAGS = $(BOOT_CFLAGS)
---
> STAGE_CFLAGS = -m64 -mptr64 -I/usr/local/include:/opt/csw/gcc4/include $(BOOT_CFLAGS)
417c417
< POSTSTAGE1_CONFIGURE_FLAGS = --enable-build-with-cxx
---
> POSTSTAGE1_CONFIGURE_FLAGS = -m64 -mptr64 --enable-build-with-cxx
421,422c421,422
< STAGE1_CFLAGS = $(STAGE_CFLAGS)
< STAGE1_CXXFLAGS = $(CXXFLAGS)
---
> STAGE1_CFLAGS = -m64 -mptr64 $(STAGE_CFLAGS)
> STAGE1_CXXFLAGS = -m64 -mptr64 $(CXXFLAGS)
424,425c424,425
< STAGE1_CXXFLAGS = $(STAGE1_CFLAGS)
< STAGE1_TFLAGS = $(STAGE_TFLAGS)
---
> STAGE1_CXXFLAGS = -m64 -mptr64 $(STAGE1_CFLAGS)
> STAGE1_TFLAGS = -m64 -mptr64 $(STAGE_TFLAGS)
432,433c432,433
< STAGE2_CFLAGS = $(STAGE_CFLAGS)
< STAGE2_CXXFLAGS = $(CXXFLAGS)
---
> STAGE2_CFLAGS = -m64 -mptr64 $(STAGE_CFLAGS)
> STAGE2_CXXFLAGS = -m64 -mptr64 $(CXXFLAGS)
435c435
< STAGE2_CXXFLAGS = $(STAGE2_CFLAGS)
---
> STAGE2_CXXFLAGS = -m64 -mptr64 $(STAGE2_CFLAGS)
443,444c443,444
< STAGE3_CFLAGS = $(STAGE_CFLAGS)
< STAGE3_CXXFLAGS = $(CXXFLAGS)
---
> STAGE3_CFLAGS = -m64 -mptr64 $(STAGE_CFLAGS)
> STAGE3_CXXFLAGS = -m64 -mptr64 $(CXXFLAGS)
446,447c446,447
< STAGE3_CXXFLAGS = $(STAGE3_CFLAGS)
< STAGE3_TFLAGS = $(STAGE_TFLAGS)
---
> STAGE3_CXXFLAGS = -m64 -mptr64 $(STAGE3_CFLAGS)
> STAGE3_TFLAGS = -m64 -mptr64 $(STAGE_TFLAGS)
454,455c454,455
< STAGE4_CFLAGS = $(STAGE_CFLAGS)
< STAGE4_CXXFLAGS = $(CXXFLAGS)
---
> STAGE4_CFLAGS = -m64 -mptr64 $(STAGE_CFLAGS)
> STAGE4_CXXFLAGS = -m64 -mptr64 $(CXXFLAGS)
457,458c457,458
< STAGE4_CXXFLAGS = $(STAGE4_CFLAGS)
< STAGE4_TFLAGS = $(STAGE_TFLAGS)
---
> STAGE4_CXXFLAGS = -m64 -mptr64 $(STAGE4_CFLAGS)
> STAGE4_TFLAGS = -m64 -mptr64 $(STAGE_TFLAGS)
493c493
< STAGE1_CFLAGS = -g -fkeep-inline-functions
---
> STAGE1_CFLAGS = -m64 -mptr64 -g -fkeep-inline-functions


A bit messy I know. However this is pass 1 with hopes that by the third time I do this it will be a fine art. 

Any pointers at all as to the error of my ways ? 

Dennis 

ps: I am using gcc 4.5.1 to perform the bootstrap and this release has been very well tested : 

$ which gcc
/opt/csw/gcc4/bin/gcc
$ 
$ $CC --version 
gcc (Blastwave.org Inc. Mon Aug  9 07:10:45 GMT 2010) 4.5.1
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: the struggle to create a 64-bit gcc on Solaris 10
  2012-11-09 19:52 the struggle to create a 64-bit gcc on Solaris 10 Dennis Clarke
@ 2012-11-09 21:46 ` Eric Botcazou
  2012-11-09 22:26   ` Dennis Clarke
  0 siblings, 1 reply; 19+ messages in thread
From: Eric Botcazou @ 2012-11-09 21:46 UTC (permalink / raw)
  To: Dennis Clarke; +Cc: gcc

> Any pointers at all as to the error of my ways ?

http://gcc.gnu.org/install/specific.html#sparc64-x-solaris2

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: the struggle to create a 64-bit gcc on Solaris 10
  2012-11-09 21:46 ` Eric Botcazou
@ 2012-11-09 22:26   ` Dennis Clarke
  2012-11-09 23:08     ` Eric Botcazou
  0 siblings, 1 reply; 19+ messages in thread
From: Dennis Clarke @ 2012-11-09 22:26 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: gcc



> > Any pointers at all as to the error of my ways ?
> 
> http://gcc.gnu.org/install/specific.html#sparc64-x-solaris2

nope. Been there .. done that and that fails badly .. in fact worse than before : 

Configure .. look good but lies : 

$ ../gcc-4.7.2/configure --build=sparc64-sun-solaris2.10 --target=sparc64-sun-solaris2.10 \
> --with-as=/usr/ccs/bin/as --without-gnu-ld \
> --with-ld=/usr/ccs/bin/ld --disable-multilib --enable-nls \
> --enable-threads=posix --prefix=/usr/local/gcc4 --enable-shared \
> --libdir=/usr/local/gcc4/lib --with-local-prefix=/usr/local/gcc4 \
> --with-cpu=v9 --enable-stage1-languages=c --disable-multilib \
> --libexecdir=/usr/local/gcc4/lib --with-gxx-include-dir=/usr/local/gcc4/include \
> --with-pkgversion=Blastwave.org\ Inc.\ Fri\ Nov\ \ 9\ 21\:55\:41\ UTC\ 2012 \
> --with-bugurl=http\:\/\/www.blastwave.org\/support \
> --enable-languages=c,c++,objc,fortran,ada --enable-bootstrap
checking build system type... sparc64-sun-solaris2.10
checking host system type... sparc64-sun-solaris2.10
checking target system type... sparc64-sun-solaris2.10
checking for a BSD-compatible install... ../gcc-4.7.2/install-sh -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /usr/local/bin/gsed
checking for gawk... gawk
checking for libitm support... yes
checking for gcc... /opt/csw/gcc4/bin/gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /opt/csw/gcc4/bin/gcc accepts -g... yes
checking for /opt/csw/gcc4/bin/gcc option to accept ISO C89... none needed
checking whether we are using the GNU C++ compiler... yes
checking whether /opt/csw/gcc4/bin/g++ accepts -g... yes
checking for gnatbind... gnatbind
checking for gnatmake... gnatmake
checking whether compiler driver understands Ada... yes
checking how to compare bootstrapped objects... cmp $$f1 $$f2 16 16
checking for objdir... .libs
checking for PWL_handle_timeout in -lpwl... no
checking for version 0.11 (revision 0 or later) of PPL... no
The following languages will be built: c,ada,c++,fortran,lto,objc
*** This configuration is not supported in the following subdirectories:
     target-libmudflap target-libgo target-libffi target-zlib target-libjava target-boehm-gc
    (Any other directories should still work fine.)
checking for default BUILD_CONFIG... 
checking for bison... bison -y
checking for bison... bison
checking for gm4... /usr/local/bin/gm4
checking for flex... flex
checking for flex... flex
checking for makeinfo... makeinfo
checking for expect... expect
checking for runtest... runtest
checking for ar... (cached) /usr/ccs/bin/ar
checking for as... (cached) /usr/ccs/bin/as
checking for dlltool... no
checking for ld... (cached) /usr/ccs/bin/ld
checking for lipo... no
checking for nm... nm
checking for ranlib... ranlib
checking for strip... strip
checking for windres... no
checking for windmc... no
checking for objcopy... no
checking for objdump... no
checking for readelf... no
checking for sparc64-sun-solaris2.10-cc... no
checking for cc... cc
checking for sparc64-sun-solaris2.10-c++... no
checking for c++... c++
checking for sparc64-sun-solaris2.10-gcc... no
checking for gcc... gcc
checking for sparc64-sun-solaris2.10-gcj... no
checking for gcj... no
checking for sparc64-sun-solaris2.10-gfortran... no
checking for gfortran... gfortran
checking for sparc64-sun-solaris2.10-gccgo... no
checking for gccgo... no
checking for ar... no
checking for sparc64-sun-solaris2.10-ar... no
checking for ar... ar
checking for as... no
checking for sparc64-sun-solaris2.10-as... no
checking for as... as
checking for dlltool... no
checking for sparc64-sun-solaris2.10-dlltool... no
checking for dlltool... no
checking for ld... no
checking for sparc64-sun-solaris2.10-ld... no
checking for ld... ld
checking for lipo... no
checking for sparc64-sun-solaris2.10-lipo... no
checking for lipo... no
checking for nm... no
checking for sparc64-sun-solaris2.10-nm... no
checking for nm... nm
checking for objdump... no
checking for sparc64-sun-solaris2.10-objdump... no
checking for objdump... no
checking for ranlib... no
checking for sparc64-sun-solaris2.10-ranlib... no
checking for ranlib... ranlib
checking for readelf... no
checking for sparc64-sun-solaris2.10-readelf... no
checking for readelf... no
checking for strip... no
checking for sparc64-sun-solaris2.10-strip... no
checking for strip... strip
checking for windres... no
checking for sparc64-sun-solaris2.10-windres... no
checking for windres... no
checking for windmc... no
checking for sparc64-sun-solaris2.10-windmc... no
checking for windmc... no
checking where to find the target ar... host tool
checking where to find the target as... host tool
checking where to find the target cc... just compiled
checking where to find the target c++... just compiled
checking where to find the target c++ for libstdc++... just compiled
checking where to find the target dlltool... host tool
checking where to find the target gcc... just compiled
checking where to find the target gcj... host tool
checking where to find the target gfortran... just compiled
checking where to find the target gccgo... host tool
checking where to find the target ld... host tool
checking where to find the target lipo... host tool
checking where to find the target nm... host tool
checking where to find the target objdump... host tool
checking where to find the target ranlib... host tool
checking where to find the target readelf... host tool
checking where to find the target strip... host tool
checking where to find the target windres... host tool
checking where to find the target windmc... host tool
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether -fkeep-inline-functions is supported... yes
configure: creating ./config.status
config.status: creating Makefile
$

$ gmake 
[ -f stage_final ] || echo stage3 > stage_final
gmake[1]: Entering directory `/usr/local/build/gcc-4.7.2_SunOS5.10.002'
gmake[2]: Entering directory `/usr/local/build/gcc-4.7.2_SunOS5.10.002'
gmake[2]: Leaving directory `/usr/local/build/gcc-4.7.2_SunOS5.10.002'
gmake[2]: Entering directory `/usr/local/build/gcc-4.7.2_SunOS5.10.002'
Configuring stage 1 in ./intl
.
.
.
  a little while later 
.
.
.
gmake[4]: Leaving directory `/usr/local/build/gcc-4.7.2_SunOS5.10.002/mpfr'
gmake[3]: Leaving directory `/usr/local/build/gcc-4.7.2_SunOS5.10.002/mpfr'
Configuring stage 1 in ./mpc
configure: creating cache ./config.cache
checking for a BSD-compatible install... /usr/local/build/gcc-4.7.2/install-sh -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ../../gcc-4.7.2/mpc/install-sh -c -d
checking for gawk... gawk
checking whether /usr/local/bin/gmake sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... sparc64-sun-solaris2.10
checking host system type... sparc64-sun-solaris2.10
checking for grep that handles long lines and -e... /usr/xpg4/bin/grep
checking for egrep... /usr/xpg4/bin/grep -E
checking for a sed that does not truncate output... /usr/local/bin/gsed
checking for sparc64-sun-solaris2.10-gcc... /opt/csw/gcc4/bin/gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /opt/csw/gcc4/bin/gcc accepts -g... yes
checking for /opt/csw/gcc4/bin/gcc option to accept ISO C89... none needed
checking for style of include used by /usr/local/bin/gmake... GNU
checking dependency style of /opt/csw/gcc4/bin/gcc... gcc3
checking for sparc64-sun-solaris2.10-ar... /usr/ccs/bin/ar
checking the archiver (/usr/ccs/bin/ar) interface... ar
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/local/bin/gsed
checking for fgrep... /usr/xpg4/bin/grep -F
checking for ld used by /opt/csw/gcc4/bin/gcc... /usr/ccs/bin/ld
checking if the linker (/usr/ccs/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... nm
checking the name lister (nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 786240
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert sparc64-sun-solaris2.10 file names to sparc64-sun-solaris2.10 format... func_convert_file_noop
checking how to convert sparc64-sun-solaris2.10 file names to toolchain format... func_convert_file_noop
checking for /usr/ccs/bin/ld option to reload object files... -r
checking for sparc64-sun-solaris2.10-objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for sparc64-sun-solaris2.10-dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for sparc64-sun-solaris2.10-ar... (cached) /usr/ccs/bin/ar
checking for archiver @FILE support... no
checking for sparc64-sun-solaris2.10-strip... no
checking for strip... strip
checking for sparc64-sun-solaris2.10-ranlib... ranlib
checking command to parse nm output from /opt/csw/gcc4/bin/gcc object... failed
checking for sysroot... no
checking for sparc64-sun-solaris2.10-mt... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... /opt/csw/gcc4/bin/gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /opt/csw/gcc4/bin/gcc supports -fno-rtti -fno-exceptions... no
checking for /opt/csw/gcc4/bin/gcc option to produce PIC... -fPIC -DPIC
checking if /opt/csw/gcc4/bin/gcc PIC flag -fPIC -DPIC works... yes
checking if /opt/csw/gcc4/bin/gcc static flag -static works... no
checking if /opt/csw/gcc4/bin/gcc supports -c -o file.o... yes
checking if /opt/csw/gcc4/bin/gcc supports -c -o file.o... (cached) yes
checking whether the /opt/csw/gcc4/bin/gcc linker (/usr/ccs/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... solaris2.10 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... no
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for gmp.h... yes
checking for ANSI C header files... (cached) yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for unistd.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking whether time.h and sys/time.h may both be included... yes
checking complex.h usability... yes
checking complex.h presence... yes
checking for complex.h... yes
checking for library containing creal... -lm
checking whether creal, cimag and I can be used... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for gettimeofday... yes
checking for localeconv... yes
checking for setlocale... yes
checking for dup... yes
checking for dup2... yes
checking for __gmpz_init in -lgmp... yes
checking for MPFR... no
configure: error: libmpfr not found or uses a different ABI (including static vs shared).
gmake[2]: *** [configure-stage1-mpc] Error 1
gmake[2]: Leaving directory `/usr/local/build/gcc-4.7.2_SunOS5.10.002'
gmake[1]: *** [stage1-bubble] Error 2
gmake[1]: Leaving directory `/usr/local/build/gcc-4.7.2_SunOS5.10.002'
gmake: *** [all] Error 2
$


The build dir is laced with 32-bit objects all over the place. 

$ find . -type f | xargs file | grep ELF | grep -c "ELF 32-bit MSB relocatable SPARC Version 1"
823

Nothing is 64-bit ..

$ find . -type f | xargs file | grep ELF | grep -c "ELF 64-bit"
0

My previous attempt with viciously hand edited Makefiles was doing better :

$ cd ../gcc-4.7.2_SunOS5.10-pass1/
$ find . -type f | xargs file | grep ELF | grep -c "ELF 64-bit"
825
$ find . -type f | xargs file | grep ELF | grep -c "ELF 32-bit"
5

.. but .. no solution in sight. 

However I am way way open to suggestion here. 

Dennis


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: the struggle to create a 64-bit gcc on Solaris 10
  2012-11-09 22:26   ` Dennis Clarke
@ 2012-11-09 23:08     ` Eric Botcazou
  2012-11-10  0:47       ` Dennis Clarke
  0 siblings, 1 reply; 19+ messages in thread
From: Eric Botcazou @ 2012-11-09 23:08 UTC (permalink / raw)
  To: Dennis Clarke; +Cc: gcc

> nope. Been there .. done that and that fails badly .. in fact worse than
> before :

Yet this is the standard way and works flawlessly if done correctly...

> However I am way way open to suggestion here.

You need to configure everything with --build=sparc64-sun-solaris2.10 and 
compile everything with a 64-bit compiler, i.e. all compilers ever invoked 
must generate 64-bit code *by default*.  This can mean setting CC and CXX to 
appropriate values, e.g. "gcc -m64" and "g++ -m64" or the Sun equivalent.

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: the struggle to create a 64-bit gcc on Solaris 10
  2012-11-09 23:08     ` Eric Botcazou
@ 2012-11-10  0:47       ` Dennis Clarke
  2012-11-10 14:53         ` Eric Botcazou
  0 siblings, 1 reply; 19+ messages in thread
From: Dennis Clarke @ 2012-11-10  0:47 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: gcc


> > nope. Been there .. done that and that fails badly .. in fact worse 
> than
> > before :
> 
> Yet this is the standard way and works flawlessly if done correctly...

I can not see my error here and am wondering what the issue is. 
 
> > However I am way way open to suggestion here.
> 
> You need to configure everything with --build=sparc64-sun-solaris2.10 
> and 
> compile everything with a 64-bit compiler, i.e. all compilers ever 
> invoked 
> must generate 64-bit code *by default*.  This can mean setting CC and 
> CXX to 
> appropriate values, e.g. "gcc -m64" and "g++ -m64" or the Sun equivalent.

I am using gcc and g++ here. 

So, in any case .. looks like I am back to square zero. 

Thanks for the input. 

dc 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: the struggle to create a 64-bit gcc on Solaris 10
  2012-11-10  0:47       ` Dennis Clarke
@ 2012-11-10 14:53         ` Eric Botcazou
  0 siblings, 0 replies; 19+ messages in thread
From: Eric Botcazou @ 2012-11-10 14:53 UTC (permalink / raw)
  To: Dennis Clarke; +Cc: gcc

> I can not see my error here and am wondering what the issue is.

Obviously, if you have 32-bit object files in your build tree, you're using a 
32-bit compiler.  Which very likely means that you didn't set CC and CXX.

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: the struggle to create a 64-bit gcc on Solaris 10
  2012-11-11 23:41     ` Jonathan Wakely
@ 2012-11-12  2:01       ` Dennis Clarke
  0 siblings, 0 replies; 19+ messages in thread
From: Dennis Clarke @ 2012-11-12  2:01 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: Eric Botcazou, Ryan Johnson, gcc


> On 11 November 2012 21:57, Dennis Clarke wrote:
> > Here is what I did with gmp :
> >
> > $ ls $SRC/gmp*
> > /usr/local/src/gmp-5.0.5.tar.bz2
> >
> > $ /opt/schily/bin/star -x -bz -xdir -xdot -U -fs=16m file=/usr/local/src/gmp-5.0.5.tar.bz2
> > star: 1262 blocks + 0 bytes (total of 12922880 bytes = 12620.00k).
> > $ mv gmp-5.0.5 gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2
> >
> > $ mkdir gcc-4.7.2_sparc64-sun-solaris2.10.ebotcazou
> > $ cd gcc-4.7.2_sparc64-sun-solaris2.10.ebotcazou
> >
> > So now that I am in the gcc build dir ( named after you actually ) I 
> do this :
> >
> >
> > $ CC='gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g 
> -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO' \
> >> CXX='g++ -mno-app-regs -mcpu=v9 -m64 -mptr64 -g 
> -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO' \
> >> ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/configure ABI=64 
> --enable-cxx --prefix=/usr/local/gcc4 \
> >> --libdir=/usr/local/gcc4/lib --build=sparc64-sun-solaris2.10
> 
> What on earth are you doing here?

Making a stupid mistake. Just sit back and make popcore, this will allll work out in the end. 

No really, I am hoping for a great result real soon now. 

However I now have mpfr getting upset at me for this : 

/bin/bash ../libtool --tag=CC   --mode=link gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO  -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -no-install -L../src/.libs -L/usr/local/lib -o tversion tversion.o libfrtests.la -lm ../src/libmpfr.la -lgmp
libtool: link: gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -o tversion tversion.o  -L../src/.libs -L/usr/local/lib ./.libs/libfrtests.a -lm ../src/.libs/libmpfr.so /usr/local/lib/libgmp.so -R/usr/local/build/mpfr-3.1.1_SunOS5.10_sparcv9-for-gcc-4.7.2/src/.libs -R/usr/local/lib -R/usr/local/lib
ld: fatal: file /usr/local/lib/libgcc_s.so.1: version 'GCC_4.3.0' does not exist:
        required by file ../src/.libs/libmpfr.so
ld: fatal: file processing errors. No output written to tversion
collect2: ld returned 1 exit status
gmake[2]: *** [tversion] Error 1

Sweet. 

This is what happens when I have libgcc from Sun as well as my own libgcc from GCC 4.5.1. 

Easy to sort out .. just annoying. 

> Well duh.

Yes, I deserve the shame. Also, even worse, I really am not new to this. 
 
> Just run the contrib/download_prerequisites script to put the gmp,
> mpfr & mpc sources in the gcc source tree then forget about gmp, mpfr
> and mpc completely.  Just configure GCC, as Eric and Ryan have
> suggested, and run make. Don't try to configure and build gmp
> yourself, *definitely* not in the GCC build dir.  You're making it far
> more complicated than it needs to be, stop it.

[screetch]  <-- sound of large brembo brakes 

> Finally, shouldn't this be on the gcc-help list?  This is just a "how
> do I install GCC?" question, the 64-bit aspect seems to be a red
> herring.

Yes, and I did post there and was told to post there and never heard a word of feedback from anyone. So therefore this is far more successful here .. but the wrong place. However the right place for feedback. Thus the correct place.  If you get my meaning. 

see http://gcc.gnu.org/ml/gcc-help/2012-11/msg00043.html

See?  I did try. 

Dennis


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: the struggle to create a 64-bit gcc on Solaris 10
  2012-11-11 21:57   ` Dennis Clarke
  2012-11-11 22:37     ` Eric Botcazou
@ 2012-11-11 23:41     ` Jonathan Wakely
  2012-11-12  2:01       ` Dennis Clarke
  1 sibling, 1 reply; 19+ messages in thread
From: Jonathan Wakely @ 2012-11-11 23:41 UTC (permalink / raw)
  To: Dennis Clarke; +Cc: Eric Botcazou, Ryan Johnson, gcc

On 11 November 2012 21:57, Dennis Clarke wrote:
> Here is what I did with gmp :
>
> $ ls $SRC/gmp*
> /usr/local/src/gmp-5.0.5.tar.bz2
>
> $ /opt/schily/bin/star -x -bz -xdir -xdot -U -fs=16m file=/usr/local/src/gmp-5.0.5.tar.bz2
> star: 1262 blocks + 0 bytes (total of 12922880 bytes = 12620.00k).
> $ mv gmp-5.0.5 gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2
>
> $ mkdir gcc-4.7.2_sparc64-sun-solaris2.10.ebotcazou
> $ cd gcc-4.7.2_sparc64-sun-solaris2.10.ebotcazou
>
> So now that I am in the gcc build dir ( named after you actually ) I do this :
>
>
> $ CC='gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO' \
>> CXX='g++ -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO' \
>> ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/configure ABI=64 --enable-cxx --prefix=/usr/local/gcc4 \
>> --libdir=/usr/local/gcc4/lib --build=sparc64-sun-solaris2.10

What on earth are you doing here?

You seem to be running the gmp configure script inside the gcc build
dir ... why? Who suggested that?

> The result however, is that the gcc build dir is polluted with objects from the gmp build.

Well duh.

http://gcc.gnu.org/wiki/InstallingGCC

Just run the contrib/download_prerequisites script to put the gmp,
mpfr & mpc sources in the gcc source tree then forget about gmp, mpfr
and mpc completely.  Just configure GCC, as Eric and Ryan have
suggested, and run make. Don't try to configure and build gmp
yourself, *definitely* not in the GCC build dir.  You're making it far
more complicated than it needs to be, stop it.

Finally, shouldn't this be on the gcc-help list?  This is just a "how
do I install GCC?" question, the 64-bit aspect seems to be a red
herring.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: the struggle to create a 64-bit gcc on Solaris 10
  2012-11-11 22:37     ` Eric Botcazou
@ 2012-11-11 22:44       ` Dennis Clarke
  0 siblings, 0 replies; 19+ messages in thread
From: Dennis Clarke @ 2012-11-11 22:44 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: gcc, Ryan Johnson


> > What isn't clear is where that is run. I decided that I will take your
> > approach and try to follow the magic incantations to the very 
> letter. OKay,
> > sort of. I may expand on the CFLAGS just a little bit and I have to 
> assume,
> > in the absence of any data, that I shall run these "config ; make; make
> > check" incantations inside the GCC build dir.
> 
> Well, of course not, you must build them as usual.

  I sort of figured that .. however there was this little voice in my head that said "you know .. you have been doing this a long long time and you never had these problems so let's just do it his way" and so I did. 

> > $ CC='gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS
> > -D_LARGEFILE64_SOURCE -D_TS_ERRNO' \
> > > CXX='g++ -mno-app-regs -mcpu=v9 -m64 -mptr64 -g
> > > -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO' \
> > > ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/configure ABI=64
> > > --enable-cxx --prefix=/usr/local/gcc4 \ --libdir=/usr/local/gcc4/lib
> > > --build=sparc64-sun-solaris2.10
> 
> Totally puzzled here.... why on Earth are you using all these flags?  
> Just use the configure lines posted by Ryan.

Well in Solaris we need a define _TS_ERRNO in order to get a thread safe errno. Otherwise it can not be relied upone. The other two defines are sort of self explanatory.  I felt that the sparc v9 would ensure that whatever binary object gets produced will run on any UltraSparc chip in the past ten years. The -g was simply to ensure that I could possible use a debugger in the future if ever needed and the -mptr64 I forgot. 

The -mno-app-regs is pretty imporant for shared libs. I do need the shared libs.  From the gcc docs : 

    To be fully SVR4 ABI-compliant at the cost of some performance loss, 
    specify -mno-app-regs. You should compile libraries and system software
    with this option. 

So even when I use the Oracle Studio compilers I ensure that I have -xregs=no%appl to protect global registers 2 through 4.

Those were my thoughts there and the build was flawless. 

> > The result however, is that the gcc build dir is polluted with 
> > objects from the gmp build.
> > 
> > Not what I want most likely.
> 
> Then do not build them in the GCC build dir!

uh yeah .. that was just plain stupid of me.   :-)


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: the struggle to create a 64-bit gcc on Solaris 10
  2012-11-11 21:57   ` Dennis Clarke
@ 2012-11-11 22:37     ` Eric Botcazou
  2012-11-11 22:44       ` Dennis Clarke
  2012-11-11 23:41     ` Jonathan Wakely
  1 sibling, 1 reply; 19+ messages in thread
From: Eric Botcazou @ 2012-11-11 22:37 UTC (permalink / raw)
  To: Dennis Clarke; +Cc: gcc, Ryan Johnson

> What isn't clear is where that is run. I decided that I will take your
> approach and try to follow the magic incantations to the very letter. OKay,
> sort of. I may expand on the CFLAGS just a little bit and I have to assume,
> in the absence of any data, that I shall run these "config ; make; make
> check" incantations inside the GCC build dir.

Well, of course not, you must build them as usual.

> $ CC='gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS
> -D_LARGEFILE64_SOURCE -D_TS_ERRNO' \
> > CXX='g++ -mno-app-regs -mcpu=v9 -m64 -mptr64 -g
> > -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO' \
> > ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/configure ABI=64
> > --enable-cxx --prefix=/usr/local/gcc4 \ --libdir=/usr/local/gcc4/lib
> > --build=sparc64-sun-solaris2.10

Totally puzzled here.... why on Earth are you using all these flags?  Just use 
the configure lines posted by Ryan.

> The result however, is that the gcc build dir is polluted with objects from
> the gmp build.
> 
> Not what I want most likely.

Then do not build them in the GCC build dir!

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: the struggle to create a 64-bit gcc on Solaris 10
  2012-11-11 12:03 ` Eric Botcazou
  2012-11-11 18:25   ` Dennis Clarke
@ 2012-11-11 21:57   ` Dennis Clarke
  2012-11-11 22:37     ` Eric Botcazou
  2012-11-11 23:41     ` Jonathan Wakely
  1 sibling, 2 replies; 19+ messages in thread
From: Dennis Clarke @ 2012-11-11 21:57 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: Ryan Johnson, gcc


> > The last (very annoying) issue is that when gcc bootstraps itself, the
> > freshly-built compiler doesn't generate 64-bit binaries by default.
> > BOOT_CFLAGS can work around that: http://gcc.gnu.org/install/build.html.
> 
> That isn't true at all.

okay .. I'll just nod my head and agree. 

> > CC='cc -m64' CXX='CC -m64' ../gmp-5.0.1-src/configure
> > --prefix=$HOME/apps/gcc-4.7.2 --build=sparc64-sun-solaris2.10
> > --disable-shared

What isn't clear is where that is run. I decided that I will take your approach and try to follow the magic incantations to the very letter. OKay, sort of. I may expand on the CFLAGS just a little bit and I have to assume, in the absence of any data, that I shall run these "config ; make; make check" incantations inside the GCC build dir. After all, I already have gmp/mpfr/mpc built, tested and installed therefore I have to assume this is a way to avoid needing them in the gcc source tree. 

Here is what I did with gmp : 

$ ls $SRC/gmp*
/usr/local/src/gmp-5.0.5.tar.bz2

$ /opt/schily/bin/star -x -bz -xdir -xdot -U -fs=16m file=/usr/local/src/gmp-5.0.5.tar.bz2
star: 1262 blocks + 0 bytes (total of 12922880 bytes = 12620.00k).
$ mv gmp-5.0.5 gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2

$ mkdir gcc-4.7.2_sparc64-sun-solaris2.10.ebotcazou
$ cd gcc-4.7.2_sparc64-sun-solaris2.10.ebotcazou

So now that I am in the gcc build dir ( named after you actually ) I do this : 


$ CC='gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO' \
> CXX='g++ -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO' \
> ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/configure ABI=64 --enable-cxx --prefix=/usr/local/gcc4 \
> --libdir=/usr/local/gcc4/lib --build=sparc64-sun-solaris2.10
checking build system type... sparc64-sun-solaris2.10
checking host system type... sparc64-sun-solaris2.10
checking for a BSD-compatible install... ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/install-sh -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/install-sh -c -d
checking for gawk... gawk
checking whether /usr/local/bin/gmake sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking ABI=64
checking compiler gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -I/usr/local/include:/opt/csw/gcc4/include... yes
checking compiler gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO has sizeof(long)==8... yes
checking for gcc... gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO accepts -g... yes
checking for gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO option to accept ISO C89... none needed
checking for gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO option to accept ISO C99... -std=gnu99
checking for gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -std=gnu99 option to accept ISO Standard C... (cached) -std=gnu99
checking how to run the C preprocessor... gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -std=gnu99 -E
checking build system compiler gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -std=gnu99... yes
checking for build system preprocessor... gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -std=gnu99 -E
checking for build system executable suffix... 
checking whether build system compiler is ANSI... yes
checking for build system compiler math library... -lm
checking whether we are using the GNU C++ compiler... yes
checking whether g++ -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO accepts -g... yes
checking C++ compiler g++ -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -I/usr/local/include:/opt/csw/gcc4/include -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO... yes
checking how to run the C++ preprocessor... g++ -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -E
checking for grep that handles long lines and -e... /usr/xpg4/bin/grep
checking for egrep... /usr/xpg4/bin/grep -E
using ABI="64"
      CC="gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -std=gnu99"
      CFLAGS="-mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO"
      CPPFLAGS="-I/usr/local/include:/opt/csw/gcc4/include"
      CXX="g++ -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO"
      CXXFLAGS="-mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO"
      MPN_PATH=" sparc64 generic"
checking for function prototypes... yes
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking whether assembler supports --noexecstack option... no
checking for ar... /usr/ccs/bin/ar
checking for BSD- or MS-compatible name lister (nm)... /usr/xpg4/bin/nm -p
checking the name lister (/usr/xpg4/bin/nm -p) interface... BSD nm
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/local/bin/gsed
checking for fgrep... /usr/xpg4/bin/grep -F
checking for ld used by gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -std=gnu99... /usr/ccs/bin/ld
checking if the linker (/usr/ccs/bin/ld) is GNU ld... no
checking whether ln -s works... yes
checking the maximum length of command line arguments... 786240
checking whether the shell understands some XSI constructs... no
checking whether the shell understands "+="... no
checking how to convert sparc64-sun-solaris2.10 file names to sparc64-sun-solaris2.10 format... func_convert_file_noop
checking how to convert sparc64-sun-solaris2.10 file names to toolchain format... func_convert_file_noop
checking for /usr/ccs/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/xpg4/bin/nm -p output from gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -std=gnu99 object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -std=gnu99 supports -fno-rtti -fno-exceptions... no
checking for gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -std=gnu99 option to produce PIC... -fPIC -DPIC
checking if gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -std=gnu99 PIC flag -fPIC -DPIC works... yes
checking if gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -std=gnu99 static flag -static works... no
checking if gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -std=gnu99 supports -c -o file.o... yes
checking if gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -std=gnu99 supports -c -o file.o... (cached) yes
checking whether the gcc -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -std=gnu99 linker (/usr/ccs/bin/ld -64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... solaris2.10 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... no
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -E
checking for ld used by g++ -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO... /usr/ccs/bin/ld -64
checking if the linker (/usr/ccs/bin/ld -64) is GNU ld... no
checking whether the g++ -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO linker (/usr/ccs/bin/ld -64) supports shared libraries... yes
checking for g++ -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO option to produce PIC... -fPIC -DPIC
checking if g++ -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO PIC flag -fPIC -DPIC works... yes
checking if g++ -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO static flag -static works... no
checking if g++ -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO supports -c -o file.o... yes
checking if g++ -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO supports -c -o file.o... (cached) yes
checking whether the g++ -mno-app-regs -mcpu=v9 -m64 -mptr64 -g -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO linker (/usr/ccs/bin/ld -64) supports shared libraries... yes
checking dynamic linker characteristics... solaris2.10 ld.so
checking how to hardcode library paths into programs... immediate
checking for ANSI C header files... (cached) yes
checking whether time.h and sys/time.h may both be included... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking float.h usability... yes
checking float.h presence... yes
checking for float.h... yes
checking invent.h usability... no
checking invent.h presence... no
checking for invent.h... no
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking nl_types.h usability... yes
checking nl_types.h presence... yes
checking for nl_types.h... yes
checking sys/attributes.h usability... no
checking sys/attributes.h presence... no
checking for sys/attributes.h... no
checking sys/iograph.h usability... no
checking sys/iograph.h presence... no
checking for sys/iograph.h... no
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/processor.h usability... yes
checking sys/processor.h presence... yes
checking for sys/processor.h... yes
checking sys/pstat.h usability... no
checking sys/pstat.h presence... no
checking for sys/pstat.h... no
checking sys/sysinfo.h usability... yes
checking sys/sysinfo.h presence... yes
checking for sys/sysinfo.h... yes
checking sys/syssgi.h usability... no
checking sys/syssgi.h presence... no
checking for sys/syssgi.h... no
checking sys/systemcfg.h usability... no
checking sys/systemcfg.h presence... no
checking for sys/systemcfg.h... no
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/times.h usability... yes
checking sys/times.h presence... yes
checking for sys/times.h... yes
checking for sys/resource.h... yes
checking for sys/sysctl.h... no
checking for machine/hal_sysinfo.h... no
checking whether fgetc is declared... yes
checking whether fscanf is declared... yes
checking whether optarg is declared... yes
checking whether ungetc is declared... yes
checking whether vfprintf is declared... yes
checking whether sys_errlist is declared... no
checking whether sys_nerr is declared... no
checking return type of signal handlers... void
checking for intmax_t... yes
checking for long double... yes
checking for long long... yes
checking for ptrdiff_t... yes
checking for quad_t... yes
checking for uint_least32_t... yes
checking for intptr_t... yes
checking for preprocessor stringizing operator... yes
checking for working volatile... yes
checking for C/C++ restrict keyword... __restrict
checking whether <stdarg.h> exists and works... yes
checking whether gcc __attribute__ ((const)) works... yes
checking whether gcc __attribute__ ((malloc)) works... yes
checking whether gcc __attribute__ ((mode (XX))) works... yes
checking whether gcc __attribute__ ((noreturn)) works... yes
checking for inline... inline
checking for cos in -lm... yes
checking for working alloca.h... yes
checking for alloca (via gmp-impl.h)... yes
checking how to allocate temporary memory... alloca
checking whether byte ordering is bigendian... yes
checking format of `double' floating point... IEEE big endian
checking for alarm... yes
checking for attr_get... no
checking for clock... yes
checking for clock_gettime... no
checking for cputime... no
checking for getpagesize... yes
checking for getrusage... yes
checking for gettimeofday... yes
checking for getsysinfo... no
checking for localeconv... yes
checking for memset... yes
checking for mmap... yes
checking for mprotect... yes
checking for nl_langinfo... yes
checking for obstack_vprintf... no
checking for popen... yes
checking for processor_info... yes
checking for pstat_getprocessor... no
checking for raise... yes
checking for read_real_time... no
checking for sigaction... yes
checking for sigaltstack... yes
checking for sigstack... yes
checking for syssgi... no
checking for strchr... yes
checking for strerror... yes
checking for strnlen... no
checking for strtol... yes
checking for strtoul... yes
checking for sysconf... yes
checking for sysctl... no
checking for sysctlbyname... no
checking for times... yes
checking for vsnprintf... yes
checking whether vsnprintf works... yes
checking whether sscanf needs writable input... no
checking for struct pst_processor.psp_iticksperclktick... no
checking sstream usability... yes
checking sstream presence... yes
checking for sstream... yes
checking for std::locale... yes
checking for suitable m4... /usr/local/bin/gm4
checking if m4wrap produces spurious output... no
checking how to switch to text section... .text
checking how to switch to data section... .data
checking for assembler label suffix... :
checking for assembler global directive... .globl
checking for assembler global directive attribute... 
checking if globals are prefixed by underscore... no
checking how to switch to read-only data section...     .section        ".rodata"
checking for assembler .type directive... .type $1,@$2
checking for assembler .size directive... .size $1,$2
checking for assembler local label prefix... .L
checking for assembler byte directive... .byte
checking how to define a 32-bit word... .long
checking if .align assembly directive is logarithmic... no
checking if the assembler accepts ".register"... yes
checking size of void *... 8
checking size of unsigned short... 2
checking size of unsigned... 4
checking size of unsigned long... 8
checking size of mp_limb_t... 8
checking for stack_t... yes
checking for tputs in -lncurses... yes
checking for readline in -lreadline... yes
checking readline/readline.h usability... no
checking readline/readline.h presence... no
checking for readline/readline.h... no
checking readline detected... no
checking for bison... bison -y
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... -lfl
checking whether yytext is a pointer... yes
checking for ranlib... (cached) ranlib
creating config.m4
configure: creating ./config.status
config.status: creating demos/pexpr-config.h
config.status: creating demos/calc/calc-config.h
config.status: creating Makefile
config.status: creating mpbsd/Makefile
config.status: creating mpf/Makefile
config.status: creating mpn/Makefile
config.status: creating mpq/Makefile
config.status: creating mpz/Makefile
config.status: creating printf/Makefile
config.status: creating scanf/Makefile
config.status: creating cxx/Makefile
config.status: creating tests/Makefile
config.status: creating tests/devel/Makefile
config.status: creating tests/mpbsd/Makefile
config.status: creating tests/mpf/Makefile
config.status: creating tests/mpn/Makefile
config.status: creating tests/mpq/Makefile
config.status: creating tests/mpz/Makefile
config.status: creating tests/rand/Makefile
config.status: creating tests/misc/Makefile
config.status: creating tests/cxx/Makefile
config.status: creating doc/Makefile
config.status: creating tune/Makefile
config.status: creating demos/Makefile
config.status: creating demos/calc/Makefile
config.status: creating demos/expr/Makefile
config.status: creating gmp.h
config.status: creating mp.h
config.status: creating config.h
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/add.c to mpn/add.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/add_1.c to mpn/add_1.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/sparc64/add_n.asm to mpn/add_n.asm
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/sub.c to mpn/sub.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/sub_1.c to mpn/sub_1.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/sparc64/sub_n.asm to mpn/sub_n.asm
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/neg.c to mpn/neg.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/com.c to mpn/com.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/sparc64/mul_1.asm to mpn/mul_1.asm
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/sparc64/addmul_1.asm to mpn/addmul_1.asm
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/sparc64/submul_1.asm to mpn/submul_1.asm
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/sparc64/lshift.asm to mpn/lshift.asm
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/sparc64/rshift.asm to mpn/rshift.asm
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/sparc64/dive_1.c to mpn/dive_1.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/diveby3.c to mpn/diveby3.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/divis.c to mpn/divis.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/divrem.c to mpn/divrem.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/sparc64/divrem_1.c to mpn/divrem_1.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/divrem_2.c to mpn/divrem_2.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/fib2_ui.c to mpn/fib2_ui.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/sparc64/mod_1.c to mpn/mod_1.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/mod_34lsub1.c to mpn/mod_34lsub1.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/sparc64/mode1o.c to mpn/mode1o.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/pre_divrem_1.c to mpn/pre_divrem_1.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/pre_mod_1.c to mpn/pre_mod_1.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/dump.c to mpn/dump.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/mod_1_1.c to mpn/mod_1_1.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/mod_1_2.c to mpn/mod_1_2.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/mod_1_3.c to mpn/mod_1_3.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/mod_1_4.c to mpn/mod_1_4.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/lshiftc.c to mpn/lshiftc.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/mul.c to mpn/mul.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/mul_fft.c to mpn/mul_fft.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/mul_n.c to mpn/mul_n.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/sqr.c to mpn/sqr.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/mul_basecase.c to mpn/mul_basecase.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/sqr_basecase.c to mpn/sqr_basecase.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/nussbaumer_mul.c to mpn/nussbaumer_mul.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/random.c to mpn/random.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/random2.c to mpn/random2.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/pow_1.c to mpn/pow_1.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/rootrem.c to mpn/rootrem.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/sqrtrem.c to mpn/sqrtrem.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/get_str.c to mpn/get_str.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/set_str.c to mpn/set_str.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/scan0.c to mpn/scan0.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/scan1.c to mpn/scan1.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/popham.c to mpn/popcount.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/popham.c to mpn/hamdist.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/cmp.c to mpn/cmp.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/perfsqr.c to mpn/perfsqr.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/perfpow.c to mpn/perfpow.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/gcd_1.c to mpn/gcd_1.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/gcd.c to mpn/gcd.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/gcdext_1.c to mpn/gcdext_1.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/gcdext.c to mpn/gcdext.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/gcd_lehmer.c to mpn/gcd_lehmer.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/gcd_subdiv_step.c to mpn/gcd_subdiv_step.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/gcdext_lehmer.c to mpn/gcdext_lehmer.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/gcdext_subdiv_step.c to mpn/gcdext_subdiv_step.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/div_q.c to mpn/div_q.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/tdiv_qr.c to mpn/tdiv_qr.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/jacbase.c to mpn/jacbase.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/get_d.c to mpn/get_d.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/matrix22_mul.c to mpn/matrix22_mul.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/hgcd2.c to mpn/hgcd2.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/hgcd.c to mpn/hgcd.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/mullo_n.c to mpn/mullo_n.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/mullo_basecase.c to mpn/mullo_basecase.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom22_mul.c to mpn/toom22_mul.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom32_mul.c to mpn/toom32_mul.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom42_mul.c to mpn/toom42_mul.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom52_mul.c to mpn/toom52_mul.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom62_mul.c to mpn/toom62_mul.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom33_mul.c to mpn/toom33_mul.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom43_mul.c to mpn/toom43_mul.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom53_mul.c to mpn/toom53_mul.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom63_mul.c to mpn/toom63_mul.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom44_mul.c to mpn/toom44_mul.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom6h_mul.c to mpn/toom6h_mul.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom6_sqr.c to mpn/toom6_sqr.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom8h_mul.c to mpn/toom8h_mul.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom8_sqr.c to mpn/toom8_sqr.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom_couple_handling.c to mpn/toom_couple_handling.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom2_sqr.c to mpn/toom2_sqr.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom3_sqr.c to mpn/toom3_sqr.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom4_sqr.c to mpn/toom4_sqr.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom_eval_dgr3_pm1.c to mpn/toom_eval_dgr3_pm1.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom_eval_dgr3_pm2.c to mpn/toom_eval_dgr3_pm2.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom_eval_pm1.c to mpn/toom_eval_pm1.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom_eval_pm2.c to mpn/toom_eval_pm2.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom_eval_pm2exp.c to mpn/toom_eval_pm2exp.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom_eval_pm2rexp.c to mpn/toom_eval_pm2rexp.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom_interpolate_5pts.c to mpn/toom_interpolate_5pts.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom_interpolate_6pts.c to mpn/toom_interpolate_6pts.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom_interpolate_7pts.c to mpn/toom_interpolate_7pts.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom_interpolate_8pts.c to mpn/toom_interpolate_8pts.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom_interpolate_12pts.c to mpn/toom_interpolate_12pts.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/toom_interpolate_16pts.c to mpn/toom_interpolate_16pts.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/invertappr.c to mpn/invertappr.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/invert.c to mpn/invert.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/binvert.c to mpn/binvert.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/mulmod_bnm1.c to mpn/mulmod_bnm1.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/sqrmod_bnm1.c to mpn/sqrmod_bnm1.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/sbpi1_div_q.c to mpn/sbpi1_div_q.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/sbpi1_div_qr.c to mpn/sbpi1_div_qr.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/sbpi1_divappr_q.c to mpn/sbpi1_divappr_q.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/dcpi1_div_q.c to mpn/dcpi1_div_q.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/dcpi1_div_qr.c to mpn/dcpi1_div_qr.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/dcpi1_divappr_q.c to mpn/dcpi1_divappr_q.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/mu_div_qr.c to mpn/mu_div_qr.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/mu_divappr_q.c to mpn/mu_divappr_q.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/mu_div_q.c to mpn/mu_div_q.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/bdiv_q_1.c to mpn/bdiv_q_1.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/sbpi1_bdiv_q.c to mpn/sbpi1_bdiv_q.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/sbpi1_bdiv_qr.c to mpn/sbpi1_bdiv_qr.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/dcpi1_bdiv_q.c to mpn/dcpi1_bdiv_q.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/dcpi1_bdiv_qr.c to mpn/dcpi1_bdiv_qr.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/mu_bdiv_q.c to mpn/mu_bdiv_q.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/mu_bdiv_qr.c to mpn/mu_bdiv_qr.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/bdiv_q.c to mpn/bdiv_q.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/bdiv_qr.c to mpn/bdiv_qr.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/divexact.c to mpn/divexact.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/bdiv_dbm1c.c to mpn/bdiv_dbm1c.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/redc_1.c to mpn/redc_1.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/redc_2.c to mpn/redc_2.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/redc_n.c to mpn/redc_n.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/powm.c to mpn/powm.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/powlo.c to mpn/powlo.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/powm_sec.c to mpn/powm_sec.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/subcnd_n.c to mpn/subcnd_n.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/redc_1_sec.c to mpn/redc_1_sec.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/trialdiv.c to mpn/trialdiv.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/remove.c to mpn/remove.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/logops_n.c to mpn/and_n.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/logops_n.c to mpn/andn_n.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/logops_n.c to mpn/nand_n.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/logops_n.c to mpn/ior_n.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/logops_n.c to mpn/iorn_n.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/logops_n.c to mpn/nior_n.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/logops_n.c to mpn/xor_n.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/logops_n.c to mpn/xnor_n.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/sparc64/copyi.asm to mpn/copyi.asm
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/sparc64/copyd.asm to mpn/copyd.asm
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/generic/zero.c to mpn/zero.c
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/sparc64/sqr_diagonal.asm to mpn/sqr_diagonal.asm
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/sparc64/addmul_2.asm to mpn/addmul_2.asm
config.status: linking ../gmp-5.0.5_SunOS5.10_sparcv9-for-gcc-4.7.2/mpn/sparc64/gmp-mparam.h to gmp-mparam.h
config.status: executing libtool commands
$ 

ran gmake, runs fine 

gmake check runs fine also 


The result however, is that the gcc build dir is polluted with objects from the gmp build. 

Not what I want most likely. 


> No, don't mess with CFLAGS_FOR_TARGET or BOOT_CFLAGS, just type 'make'.

okay !

Dennis 


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: the struggle to create a 64-bit gcc on Solaris 10
  2012-11-11 12:03 ` Eric Botcazou
@ 2012-11-11 18:25   ` Dennis Clarke
  2012-11-11 21:57   ` Dennis Clarke
  1 sibling, 0 replies; 19+ messages in thread
From: Dennis Clarke @ 2012-11-11 18:25 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: Ryan Johnson, gcc


> > The last (very annoying) issue is that when gcc bootstraps itself, the
> > freshly-built compiler doesn't generate 64-bit binaries by default.
> > BOOT_CFLAGS can work around that: http://gcc.gnu.org/install/build.html.
> 
> That isn't true at all.
> 
> > CC='cc -m64' CXX='CC -m64' ../gmp-5.0.1-src/configure
> > --prefix=$HOME/apps/gcc-4.7.2 --build=sparc64-sun-solaris2.10
> > --disable-shared
> > CC='cc -m64' CXX='CC -m64' ../mpfr-3.1.1-src/configure
> > --prefix=$HOME/apps/gcc-4.7.2 --build=sparc64-sun-solaris2.10
> > --disable-shared --with-gmp=$HOME/apps/gcc-4.7.2
> > CC='cc -m64' CXX='CC -m64' ../mpc-0.8.2-src/configure
> > --prefix=$HOME/apps/gcc-4.7.2 --build=sparc64-sun-solaris2.10
> > --disable-shared --with-{gmp,mpfr}=$HOME/apps/gcc-4.7.2
> > CC='cc -m64' CXX='CC -m64' ../gcc-4.7.2-src/configure
> > --prefix=$HOME/apps/gcc-4.7.2 --build=sparc64-sun-solaris2.10
> > --disable-multilib --with-{gmp,mpfr,mpc}=$HOME/apps/gcc-4.7.2
> > --without-gnu-{as,ld}
> > make {CFLAGS_FOR_TARGET,BOOT_CFLAGS}='-m64 -O2'
> 
> No, don't mess with CFLAGS_FOR_TARGET or BOOT_CFLAGS, just type 'make'.

I would have to edit that as I use gcc to bootstrap gcc.  Hoever, I am very willing to give your method a try.  However, my prediction is that Oracle Studio 12.3 will have a fit .. early.

Dennis 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: the struggle to create a 64-bit gcc on Solaris 10
  2012-11-10 17:29 Ryan Johnson
  2012-11-10 20:51 ` Dennis Clarke
@ 2012-11-11 12:03 ` Eric Botcazou
  2012-11-11 18:25   ` Dennis Clarke
  2012-11-11 21:57   ` Dennis Clarke
  1 sibling, 2 replies; 19+ messages in thread
From: Eric Botcazou @ 2012-11-11 12:03 UTC (permalink / raw)
  To: Ryan Johnson; +Cc: gcc, Dennis Clarke

> The last (very annoying) issue is that when gcc bootstraps itself, the
> freshly-built compiler doesn't generate 64-bit binaries by default.
> BOOT_CFLAGS can work around that: http://gcc.gnu.org/install/build.html.

That isn't true at all.

> CC='cc -m64' CXX='CC -m64' ../gmp-5.0.1-src/configure
> --prefix=$HOME/apps/gcc-4.7.2 --build=sparc64-sun-solaris2.10
> --disable-shared
> CC='cc -m64' CXX='CC -m64' ../mpfr-3.1.1-src/configure
> --prefix=$HOME/apps/gcc-4.7.2 --build=sparc64-sun-solaris2.10
> --disable-shared --with-gmp=$HOME/apps/gcc-4.7.2
> CC='cc -m64' CXX='CC -m64' ../mpc-0.8.2-src/configure
> --prefix=$HOME/apps/gcc-4.7.2 --build=sparc64-sun-solaris2.10
> --disable-shared --with-{gmp,mpfr}=$HOME/apps/gcc-4.7.2
> CC='cc -m64' CXX='CC -m64' ../gcc-4.7.2-src/configure
> --prefix=$HOME/apps/gcc-4.7.2 --build=sparc64-sun-solaris2.10
> --disable-multilib --with-{gmp,mpfr,mpc}=$HOME/apps/gcc-4.7.2
> --without-gnu-{as,ld}
> make {CFLAGS_FOR_TARGET,BOOT_CFLAGS}='-m64 -O2'

No, don't mess with CFLAGS_FOR_TARGET or BOOT_CFLAGS, just type 'make'.

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: the struggle to create a 64-bit gcc on Solaris 10
  2012-11-10 22:08     ` Ryan Johnson
@ 2012-11-10 22:19       ` Jonathan Wakely
  0 siblings, 0 replies; 19+ messages in thread
From: Jonathan Wakely @ 2012-11-10 22:19 UTC (permalink / raw)
  To: Ryan Johnson; +Cc: Dennis Clarke, gcc, Eric Botcazou

On 10 November 2012 22:08, Ryan Johnson wrote:
> You know, somehow I'd missed that gcc would build the numerical libs for you
> if they were in tree... I'd only heard about the host tools (binutils,
> etc.). Does it do the same for all deps (e.g. readline) as well?

No.

The contrib/download_prerequisites script will fetch the gmp, mpfr and
mpc code and put it in the tree. See
http://gcc.gnu.org/wiki/InstallingGCC for more.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: the struggle to create a 64-bit gcc on Solaris 10
  2012-11-10 21:54   ` Jonathan Wakely
@ 2012-11-10 22:08     ` Ryan Johnson
  2012-11-10 22:19       ` Jonathan Wakely
  0 siblings, 1 reply; 19+ messages in thread
From: Ryan Johnson @ 2012-11-10 22:08 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: Dennis Clarke, gcc, Eric Botcazou

On 10/11/2012 4:54 PM, Jonathan Wakely wrote:
> On 10 November 2012 20:51, Dennis Clarke wrote:
>> So 32-bit gcc works just fine.  However I need a pile of libs all over the place ( gmp, mpfr, mpc, etc etc ) for this to work
> No you don't.  If you put gmp, mpfr and mpc in the GCC source tree, or
> install them with --disable-shared, then you don't need to keep the
> libs around.

You know, somehow I'd missed that gcc would build the numerical libs for 
you if they were in tree... I'd only heard about the host tools 
(binutils, etc.). Does it do the same for all deps (e.g. readline) as well?

That will save a fair bit of configury work next time!

Ryan

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: the struggle to create a 64-bit gcc on Solaris 10
  2012-11-10 20:51 ` Dennis Clarke
  2012-11-10 21:40   ` Ryan Johnson
@ 2012-11-10 21:54   ` Jonathan Wakely
  2012-11-10 22:08     ` Ryan Johnson
  1 sibling, 1 reply; 19+ messages in thread
From: Jonathan Wakely @ 2012-11-10 21:54 UTC (permalink / raw)
  To: Dennis Clarke; +Cc: Ryan Johnson, gcc, Eric Botcazou

On 10 November 2012 20:51, Dennis Clarke wrote:
>
> So 32-bit gcc works just fine.  However I need a pile of libs all over the place ( gmp, mpfr, mpc, etc etc ) for this to work

No you don't.  If you put gmp, mpfr and mpc in the GCC source tree, or
install them with --disable-shared, then you don't need to keep the
libs around.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: the struggle to create a 64-bit gcc on Solaris 10
  2012-11-10 20:51 ` Dennis Clarke
@ 2012-11-10 21:40   ` Ryan Johnson
  2012-11-10 21:54   ` Jonathan Wakely
  1 sibling, 0 replies; 19+ messages in thread
From: Ryan Johnson @ 2012-11-10 21:40 UTC (permalink / raw)
  To: Dennis Clarke; +Cc: gcc, Eric Botcazou

On 10/11/2012 3:51 PM, Dennis Clarke wrote:
>> Eric wrote:
>>>> Any pointers at all as to the error of my ways ?
>>> http://gcc.gnu.org/install/specific.html#sparc64-x-solaris2
>> You're up against three factors here. First, the sparc64 platform ABI
>> specifies 32-bit executables unless the user specifically asks for
>> 64-bit. I'm really unclear on why you think that's a bad thing (spacv9
> It isn't.
Then why is it bad to have a 32-bit gcc? I'm really confused now.

I've had a 32-bit gcc producing 64-bit binaries without complaint on a 
Niagara II machine for about three years now. Recent versions of gcc 
aren't even hard to bring up any more. All the stuff I wrote in my email 
was about not doing the easy way, and instead bootstrapping a gcc that 
is itself a 64-bit binary and produces only 64-bit executables.

> <snipped detailed rant>
>
> To make a long story short, it is a drag to deal wwith such crap when I just want a compiler that looks like, walks like and acts like the one in my RHEL 6 workstation at home.
The only difference I've noticed with a stock sparc-solaris gcc is that 
thread-local storage is dog slow (blame the ABI) and dbx usually can't 
handle dwarf debug info correctly. I've actually had *far* more multilib 
pain from linux over the years than solaris. Plus, most multilib pain I 
have suffered in Solaris was due to autotools projects from the linux 
world insisting on dropping 64-bit libraries in $PREFIX/lib instead of 
$PREFIX/lib/sparcv9. I've never even heard of half the stuff you 
mentioned ($ISALIST mumble mumble, version needed mumble mumble), and 
yet multilib development has somehow been working all right so far.

> <snipped some more>
>
> So I have a whole pile of GNU stuff on my production nice shiney new Niagara Sparc server and I can not find a reason to care about 32-bit anything.
> So why not try a full 64-bit GNU toolchain?
... because it's an awful lot of work for something you claim not to 
care about?

>> CC='cc -m64' CXX='CC -m64' ../gmp-5.0.1-src/configure
>> --prefix=$HOME/apps/gcc-4.7.2 --build=sparc64-sun-solaris2.10
>> --disable-shared
>> CC='cc -m64' CXX='CC -m64' ../mpfr-3.1.1-src/configure
>> --prefix=$HOME/apps/gcc-4.7.2 --build=sparc64-sun-solaris2.10
>> --disable-shared --with-gmp=$HOME/apps/gcc-4.7.2
>> CC='cc -m64' CXX='CC -m64' ../mpc-0.8.2-src/configure
>> --prefix=$HOME/apps/gcc-4.7.2 --build=sparc64-sun-solaris2.10
>> --disable-shared --with-{gmp,mpfr}=$HOME/apps/gcc-4.7.2
>> CC='cc -m64' CXX='CC -m64' ../gcc-4.7.2-src/configure
>> --prefix=$HOME/apps/gcc-4.7.2 --build=sparc64-sun-solaris2.10
>> --disable-multilib --with-{gmp,mpfr,mpc}=$HOME/apps/gcc-4.7.2
>> --without-gnu-{as,ld}
>> make {CFLAGS_FOR_TARGET,BOOT_CFLAGS}='-m64 -O2'
>>
>> $ file $HOME/apps/gcc-4.7.2/bin/gcc
>> gcc:   ELF 64-bit MSB executable SPARCV9 Version 1, dynamically
>> linked,
>> not stripped, no debugging information available
> nice !
>
>> $ $HOME/apps/gcc-4.7.2/bin/gcc hello.c
>> $ file ./a.out
>> a.out:          ELF 64-bit MSB executable SPARCV9 Version 1,
>> dynamically
>> linked, not stripped, no debugging information available
> yeah but a 32-bit gcc can do that just fine.
You said you didn't want a 32-bit gcc, that having 32-bit anything 
around was a liability. Hence the directions to make a purely 64-bit one.

> <snipped yet more stuff>
>
> pain.
> been there .. done that .. over and over.
>> (linker errors involving alloca)
>> - Build the support libs with --disable-shared to avoid strange
>> TLS-related loader errors
>> - Disable -g to avoid linker errors mentioning R_SPARC_UA32 and
>> .rela.debug_info during stage 3
> I am rapidly coming to the conclusion that this won't be easy to do .. but I'll keep hacking at it.
I don't think you understand: I used the above configury incantation to 
bring up, from scratch, a purely 64-bit gcc that produces 64-bit 
binaries by default. Today. On a Niagara II machine. No 32-bit ELF files 
anywhere. Hence the delay in responding and the notes about gotchas I 
encountered along the way.

If that's not what you were looking for, what is?

Ryan

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: the struggle to create a 64-bit gcc on Solaris 10
  2012-11-10 17:29 Ryan Johnson
@ 2012-11-10 20:51 ` Dennis Clarke
  2012-11-10 21:40   ` Ryan Johnson
  2012-11-10 21:54   ` Jonathan Wakely
  2012-11-11 12:03 ` Eric Botcazou
  1 sibling, 2 replies; 19+ messages in thread
From: Dennis Clarke @ 2012-11-10 20:51 UTC (permalink / raw)
  To: Ryan Johnson; +Cc: gcc, Eric Botcazou


> Eric wrote:
> > > Any pointers at all as to the error of my ways ?
> >
> > http://gcc.gnu.org/install/specific.html#sparc64-x-solaris2
> You're up against three factors here. First, the sparc64 platform ABI 
> specifies 32-bit executables unless the user specifically asks for 
> 64-bit. I'm really unclear on why you think that's a bad thing (spacv9 

It isn't. 

In fact, it has never been a problem for me in the past. Furthermore I have been doingbuilds of GCC on Solaris for a long long time now. Decade. Maybe more. Can't recall to be honest. Usually I have no problem and like to post my results.  See solaris 8 results at http://gcc.gnu.org/gcc-4.7/buildstat.html

However, Solaris 8 was the old gold standard.  anything that built there, ran everywhere in the Solaris world. At least for anything in the last ten years. 

Consider the compiler I am using here : 

$ ls -lap $CC 
-rwxr-xr-x   1 root     bin       640388 Aug 11  2010 /opt/csw/gcc4/bin/gcc

$ file /opt/csw/gcc4/bin/gcc
/opt/csw/gcc4/bin/gcc: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped

$ elfdump -vd $CC 

Version Needed Section:  .SUNW_version
            file                        version
            libc.so.1                   SUNW_1.18.1          

Dynamic Section:  .dynamic
     index  tag                value
       [0]  NEEDED            0x2973              libc.so.1
       [1]  INIT              0x36150             
       [2]  FINI              0x3616c             
       [3]  RUNPATH           0x2989              /opt/csw/lib/$ISALIST:/opt/csw/lib:/opt/csw/gcc4/lib/$ISALIST:/opt/csw/gcc4/lib
       [4]  RPATH             0x2989              /opt/csw/lib/$ISALIST:/opt/csw/lib:/opt/csw/gcc4/lib/$ISALIST:/opt/csw/gcc4/lib
       [5]  HASH              0x100e8             
       [6]  STRTAB            0x13ce0             
       [7]  STRSZ             0x29d9              
       [8]  SYMTAB            0x114f0             
       [9]  SYMENT            0x10                
      [10]  CHECKSUM          0x88ef              
      [11]  VERNEED           0x166bc             
      [12]  VERNEEDNUM        0x1                 
      [13]  PLTRELSZ          0x48c               
      [14]  PLTREL            0x7                 
      [15]  JMPREL            0x16730             
      [16]  RELA              0x166dc             
      [17]  RELASZ            0x4e0               
      [18]  RELAENT           0xc                 
      [19]  DEBUG             0                   
      [20]  FEATURE_1         0x1                 [ PARINIT ]
      [21]  FLAGS             0                   0
      [22]  FLAGS_1           0                   0
      [23]  PLTGOT            0x63544             
      [24]  NULL              0                   
$ 


See that version need section in the output binary gcc ? To me this compiler works just fine and has for a few years now. It is really well tested and was released a while back.  Note, however, the version needed for  libc.so.1.  See that SUNW_1.18.1 ?  Well to someone in the know, that is a dead give away that this was compiled on Solaris 8.  That version "NEEDED" was released quite a while ago. If you had a baseline version of Solaris 8 and then patched it up to date you would have a libc no higher than 1.18.1 or maybe 1.19. This means the resultant binaries created on that platform are assured to have access to the system calls and baseline functions provided in all libraries that follow in Solaris 9 and 10 and even Solaris 11. 

Let's take a look at the libc in Solaris 10 : 

$ ls -lapb /lib/libc.so.1
-rwxr-xr-x   1 root     bin      1653368 Aug 21 17:34 /lib/libc.so.1

$ elfdump -vd /lib/libc.so.1

Version Definition Section:  .SUNW_version
     index  version                     dependency
       [1]  libc.so.1                                        [ BASE ]
       [2]  SUNW_1.23                   SUNW_1.22.7          
       [3]  SUNW_1.22.7                 SUNW_1.22.6          
       [4]  SUNW_1.22.6                 SUNW_1.22.5          
       [5]  SUNW_1.22.5                 SUNW_1.22.4          
       [6]  SUNW_1.22.4                 SUNW_1.22.3          
       [7]  SUNW_1.22.3                 SUNW_1.22.2          
       [8]  SUNW_1.22.2                 SUNW_1.22.1          
       [9]  SUNW_1.22.1                 SUNW_1.22            
      [10]  SUNW_1.22                   SUNW_1.21.3          
      [11]  SUNW_1.21.3                 SUNW_1.21.2          
      [12]  SUNW_1.21.2                 SUNW_1.21.1          
      [13]  SUNW_1.21.1                 SUNW_1.21            
      [14]  SUNW_1.21                   SUNW_1.20.4          
      [15]  SUNW_1.20.4                 SUNW_1.20.1          
      [16]  SUNW_1.20.1                 SUNW_1.20            
      [17]  SUNW_1.20                   SUNW_1.19            
      [18]  SUNW_1.19                   SUNW_1.18.1          
      [19]  SUNW_1.18.1                 SUNW_1.18            
      [20]  SUNW_1.18                   SUNW_1.17            
      [21]  SUNW_1.17                   SUNW_1.16            
      [22]  SUNW_1.16                   SUNW_1.15            
      [23]  SUNW_1.15                   SUNW_1.14            
      [24]  SUNW_1.14                   SUNW_1.13            
      [25]  SUNW_1.13                   SUNW_1.12            
      [26]  SUNW_1.12                   SUNW_1.11            
      [27]  SUNW_1.11                   SUNW_1.10            
      [28]  SUNW_1.10                   SUNW_1.9             
      [29]  SUNW_1.9                    SUNW_1.8             
      [30]  SUNW_1.8                    SUNW_1.7             
      [31]  SUNW_1.7                    SUNW_1.6             
      [32]  SUNW_1.6                    SUNW_1.5             
      [33]  SUNW_1.5                    SUNW_1.4             
      [34]  SUNW_1.4                    SUNW_1.3             
      [35]  SUNW_1.3                    SUNW_1.2             
      [36]  SUNW_1.2                    SUNW_1.1             
      [37]  SUNW_1.1                    SUNW_0.9             
      [38]  SUNW_0.9                    SUNW_0.8             
      [39]  SUNW_0.8                    SUNW_0.7             
      [40]  SUNW_0.7                    SISCD_2.3            
      [41]  SISCD_2.3                   SYSVABI_1.3          
      [42]  SYSVABI_1.3                                      
      [43]  SUNWprivate_1.1                                  

Dynamic Section:  .dynamic
     index  tag                value
       [0]  SUNW_FILTER       0x596f              /usr/lib/ld.so.1
       [1]  SUNW_FILTER       0x5980              libm.so.2
       [2]  SUNW_AUXILIARY    0x598a              /platform/$PLATFORM/lib/libc_psr.so.1
       [3]  INIT              0xd0444             
       [4]  FINI              0xd0450             
       [5]  SONAME            0x5965              libc.so.1
       [6]  HASH              0x2dfc              
       [7]  STRTAB            0x13db0             
       [8]  STRSZ             0x59b0              
       [9]  SYMTAB            0x8890              
      [10]  SYMENT            0x10                
      [11]  CHECKSUM          0xb6f9              
      [12]  VERDEF            0x19760             
      [13]  VERDEFNUM         0x2b                
      [14]  RELACOUNT         0x86a               
      [15]  PLTRELSZ          0x1ad0              
      [16]  PLTREL            0x7                 
      [17]  JMPREL            0x21f74             
      [18]  RELA              0x1b3f8             
      [19]  RELASZ            0x864c              
      [20]  RELAENT           0xc                 
      [21]  SYMINFO           0xb4                
      [22]  SYMINSZ           0x2d48              
      [23]  SYMINENT          0x4                 
      [24]  SUNW_RTLDINF      0x14a1a0            
      [25]  FEATURE_1         0x1                 [ PARINIT ]
      [26]  FLAGS             0                   0
      [27]  FLAGS_1           0x20000             [ NODIRECT ]
      [28]  PLTGOT            0x1433ec            
      [29]  NULL              0                   
$ 

wow. See that version SUNW_1.23 ?   If you compile something on this machine ( Solaris 10 ) and then try to run it on Solaris 9, forget it. Even worse, and people screw this up all the time, if you create a software package on Solaris 10 and then install it on another Solaris 10 machine, whammo, you may be in deep trouble there also because it was not patched up to date. 

So to make a long story short, there are good reasons to compile on baseline servers within reason. Next comes the heartache of dealing with an operating system that is perfectly happy with both 32-bit executables and all dependencies as well as 64-bit.  Well how do you keeep all that working? I mean heck, how does a 32-bit binary locate and then use the 32-bit libraries it needs and not have the runtime linker bring up a 64-bit library which has the exact same name? 

I don't want to get into a long yakkity yak about things like $ISALIST or RPATH values in the ELF objects without sufficient beer and scotch.  Nope. Not today.  Have fun looking at : 

http://docs.oracle.com/cd/E23824_01/html/819-0690/appendixc-1.html

.. but don't waste your time. 

To make a long story short, it is a drag to deal wwith such crap when I just want a compiler that looks like, walks like and acts like the one in my RHEL 6 workstation at home. 

[dclarke@rockbox ~]$ cat /proc/version 
Linux version 2.6.32-279.11.1.el6.x86_64 (mockbuild@x86-009.build.bos.redhat.com) (gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) ) #1 SMP Sat Sep 22 07:10:26 EDT 2012

On this box I have gcc provided by the Red Hat folks, it isn't the version I want, but it will work to bootstrap what I want. 

$ which gcc 
/usr/bin/gcc
$ ldd /usr/bin/gcc
        linux-vdso.so.1 =>  (0x00007ffff8fff000)
        libc.so.6 => /lib64/libc.so.6 (0x0000003c85a00000)
        /lib64/ld-linux-x86-64.so.2 (0x0000003c85200000)

For a giggle, run "readelf -Vd /lib64/libc-2.12.so".  Holy nightmare batman. 

In any case, the gcc binary is 64-bit and there isn't a 32-bit part of it anywhere. can I compile 32-bit objects? Yeah sure, why not?  All one needs is some headers and some libs. Away we go. 

So I have a whole pile of GNU stuff on my production nice shiney new Niagara Sparc server and I can not find a reason to care about 32-bit anything. I don't care about memory overhead, because, quite frankly, I'm swimming in memory. There are a bucket of cores here : 

gnume-sparc-SunOS5.10 # psrinfo -pv 
The physical processor has 64 virtual processors (0-63)
  UltraSPARC-T2+ (chipid 0, clock 1582 MHz)
The physical processor has 64 virtual processors (64-127)
  UltraSPARC-T2+ (chipid 1, clock 1582 MHz)

So why not try a full 64-bit GNU toolchain? 

So .. that is what I have been doing. It has all been going well. 

All except for GCC which simply insists on creating a pile of 32-bit objects in the bootstrap stage 1. Hell if I know why. 

> CC='cc -m64' and CXX='CC -m64' ./configure --build=sparc64-sun-solaris2.10

yep .. did that .. fail again. 

> usually does the trick (you didn't mention which compiler you're using 

GCC 4.5.1 

> Another issue is preventing gcc from attempting a 32-bit multilib, 
> since it wants to be able to generate both 32- and 64-bit code (as per the 
> platform ABI). Passing --disable-multilib takes care of that.

yep .. did that.   

> The last (very annoying) issue is that when gcc bootstraps itself, the 
> freshly-built compiler doesn't generate 64-bit binaries by default. 
> BOOT_CFLAGS can work around that: http://gcc.gnu.org/install/build.html.

Seems to be something we can control with STAGE1 and STAGE2 or whatever they are called CFLAGS in the Makefiles. 

> CC='cc -m64' CXX='CC -m64' ../gmp-5.0.1-src/configure 
> --prefix=$HOME/apps/gcc-4.7.2 --build=sparc64-sun-solaris2.10 
> --disable-shared
> CC='cc -m64' CXX='CC -m64' ../mpfr-3.1.1-src/configure 
> --prefix=$HOME/apps/gcc-4.7.2 --build=sparc64-sun-solaris2.10 
> --disable-shared --with-gmp=$HOME/apps/gcc-4.7.2
> CC='cc -m64' CXX='CC -m64' ../mpc-0.8.2-src/configure 
> --prefix=$HOME/apps/gcc-4.7.2 --build=sparc64-sun-solaris2.10 
> --disable-shared --with-{gmp,mpfr}=$HOME/apps/gcc-4.7.2
> CC='cc -m64' CXX='CC -m64' ../gcc-4.7.2-src/configure 
> --prefix=$HOME/apps/gcc-4.7.2 --build=sparc64-sun-solaris2.10 
> --disable-multilib --with-{gmp,mpfr,mpc}=$HOME/apps/gcc-4.7.2 
> --without-gnu-{as,ld}
> make {CFLAGS_FOR_TARGET,BOOT_CFLAGS}='-m64 -O2'
> 
> $ file $HOME/apps/gcc-4.7.2/bin/gcc
> gcc:   ELF 64-bit MSB executable SPARCV9 Version 1, dynamically 
> linked, 
> not stripped, no debugging information available

nice ! 

> 
> $ $HOME/apps/gcc-4.7.2/bin/gcc hello.c
> $ file ./a.out
> a.out:          ELF 64-bit MSB executable SPARCV9 Version 1, 
> dynamically 
> linked, not stripped, no debugging information available

yeah but a 32-bit gcc can do that just fine. 

$ cat -n hello.c
     1  #include <stdio.h>
     2  
     3  int
     4  main(int argc, char *argv[])
     5  {
     6      printf ( "Hello World!\n" );
     7      return (0);
     8  }
$ file $CC    
/opt/csw/gcc4/bin/gcc: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped

$ gcc -m64 -o hello hello.c 
$ file hello 
hello: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped
$ ./hello 
Hello World!

So 32-bit gcc works just fine.  However I need a pile of libs all over the place ( gmp, mpfr, mpc, etc etc ) for this to work and that doesn't even get into libgcc or libstdc++ blah blah blah and the list goes on and then I am stuck with a libpath with both 32-bit libs and 64-bit libs and $ISALIST etc etc. 

pain.  

> Notes:
> - Use mpfr-3.1.1 or newer, older versions are broken on sparc-solaris 

$ ls /usr/local/lib/libmpfr*
/usr/local/lib/libmpfr.a         /usr/local/lib/libmpfr.so.4
/usr/local/lib/libmpfr.la        /usr/local/lib/libmpfr.so.4.1.1
/usr/local/lib/libmpfr.so

$ file /usr/local/lib/libmpfr.so.4.1.1
/usr/local/lib/libmpfr.so.4.1.1: ELF 64-bit MSB dynamic lib SPARCV9 Version 1, UltraSPARC3 Extensions Required, dynamically linked, not stripped

$ head -29 /usr/local/lib/libmpfr.la | tail -5 
# Version information for libmpfr.
current=5
age=1
revision=1

been there .. done that .. over and over. 
 
> (linker errors involving alloca)
> - Build the support libs with --disable-shared to avoid strange 
> TLS-related loader errors
> - Disable -g to avoid linker errors mentioning R_SPARC_UA32 and 
> .rela.debug_info during stage 3

I am rapidly coming to the conclusion that this won't be easy to do .. but I'll keep hacking at it. 

Dennis 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: the struggle to create a 64-bit gcc on Solaris 10
@ 2012-11-10 17:29 Ryan Johnson
  2012-11-10 20:51 ` Dennis Clarke
  2012-11-11 12:03 ` Eric Botcazou
  0 siblings, 2 replies; 19+ messages in thread
From: Ryan Johnson @ 2012-11-10 17:29 UTC (permalink / raw)
  To: gcc, Dennis Clarke, Eric Botcazou

Eric wrote:
> > Any pointers at all as to the error of my ways ?
>
> http://gcc.gnu.org/install/specific.html#sparc64-x-solaris2
You're up against three factors here. First, the sparc64 platform ABI 
specifies 32-bit executables unless the user specifically asks for 
64-bit. I'm really unclear on why you think that's a bad thing (spacv9 
gives all the benefits of 64-bit, including 64-bit regs, but without the 
space blow-up that comes from 64-bit pointers). It's useful enough that 
the x86 world is replicating it with x32. However, if you're really 
determined to have 64-bit only,

CC='cc -m64' and CXX='CC -m64' ./configure --build=sparc64-sun-solaris2.10

usually does the trick (you didn't mention which compiler you're using 
to bootstrap, I assume suncc). You'll want to do that with gmp/mpfr/mpc 
as well, because gcc is pretty picky that they have *exactly* the same 
target triple.

Another issue is preventing gcc from attempting a 32-bit multilib, since 
it wants to be able to generate both 32- and 64-bit code (as per the 
platform ABI). Passing --disable-multilib takes care of that.

The last (very annoying) issue is that when gcc bootstraps itself, the 
freshly-built compiler doesn't generate 64-bit binaries by default. 
BOOT_CFLAGS can work around that: http://gcc.gnu.org/install/build.html.

CC='cc -m64' CXX='CC -m64' ../gmp-5.0.1-src/configure 
--prefix=$HOME/apps/gcc-4.7.2 --build=sparc64-sun-solaris2.10 
--disable-shared
CC='cc -m64' CXX='CC -m64' ../mpfr-3.1.1-src/configure 
--prefix=$HOME/apps/gcc-4.7.2 --build=sparc64-sun-solaris2.10 
--disable-shared --with-gmp=$HOME/apps/gcc-4.7.2
CC='cc -m64' CXX='CC -m64' ../mpc-0.8.2-src/configure 
--prefix=$HOME/apps/gcc-4.7.2 --build=sparc64-sun-solaris2.10 
--disable-shared --with-{gmp,mpfr}=$HOME/apps/gcc-4.7.2
CC='cc -m64' CXX='CC -m64' ../gcc-4.7.2-src/configure 
--prefix=$HOME/apps/gcc-4.7.2 --build=sparc64-sun-solaris2.10 
--disable-multilib --with-{gmp,mpfr,mpc}=$HOME/apps/gcc-4.7.2 
--without-gnu-{as,ld}
make {CFLAGS_FOR_TARGET,BOOT_CFLAGS}='-m64 -O2'

$ file $HOME/apps/gcc-4.7.2/bin/gcc
gcc:   ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, 
not stripped, no debugging information available

$ $HOME/apps/gcc-4.7.2/bin/gcc hello.c
$ file ./a.out
a.out:          ELF 64-bit MSB executable SPARCV9 Version 1, dynamically 
linked, not stripped, no debugging information available

Notes:
- Use mpfr-3.1.1 or newer, older versions are broken on sparc-solaris 
(linker errors involving alloca)
- Build the support libs with --disable-shared to avoid strange 
TLS-related loader errors
- Disable -g to avoid linker errors mentioning R_SPARC_UA32 and 
.rela.debug_info during stage 3

Ryan

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2012-11-12  2:01 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-09 19:52 the struggle to create a 64-bit gcc on Solaris 10 Dennis Clarke
2012-11-09 21:46 ` Eric Botcazou
2012-11-09 22:26   ` Dennis Clarke
2012-11-09 23:08     ` Eric Botcazou
2012-11-10  0:47       ` Dennis Clarke
2012-11-10 14:53         ` Eric Botcazou
2012-11-10 17:29 Ryan Johnson
2012-11-10 20:51 ` Dennis Clarke
2012-11-10 21:40   ` Ryan Johnson
2012-11-10 21:54   ` Jonathan Wakely
2012-11-10 22:08     ` Ryan Johnson
2012-11-10 22:19       ` Jonathan Wakely
2012-11-11 12:03 ` Eric Botcazou
2012-11-11 18:25   ` Dennis Clarke
2012-11-11 21:57   ` Dennis Clarke
2012-11-11 22:37     ` Eric Botcazou
2012-11-11 22:44       ` Dennis Clarke
2012-11-11 23:41     ` Jonathan Wakely
2012-11-12  2:01       ` Dennis Clarke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).