public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* the struggle to create a 64-bit gcc on Solaris 10
@ 2012-11-09 21:09 Dennis Clarke
  0 siblings, 0 replies; only message in thread
From: Dennis Clarke @ 2012-11-09 21:09 UTC (permalink / raw)
  To: gcc-help


This is a re-post from the gcc maillist which, it turns out, was the
wrong place. 

http://gcc.gnu.org/ml/gcc/2012-11/msg00150.html

   Sent Friday, November 9, 2012 2:51 pm
     To gcc@gcc.gnu.org 
Subject the struggle to create a 64-bit gcc on Solaris 10


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] only message in thread

only message in thread, other threads:[~2012-11-09 21:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-09 21:09 the struggle to create a 64-bit gcc on Solaris 10 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).