public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Building a toolchain on Sparc Solaris 5.9 with static libgcc
@ 2013-01-09  3:56 Shawn Ferris
  0 siblings, 0 replies; only message in thread
From: Shawn Ferris @ 2013-01-09  3:56 UTC (permalink / raw)
  To: gcc-help

Hey Guys --

I've been trying to build a gcc toolchain on a solaris box so that I
can build a utility I need that will be used on other solaris
environments with greater restrictions. (IE: I can't install glib or a
shared libgcc on those boxes)

I was able to get the admins to install a toolchain from sunfreeware
(installed in /usr/local) which I then try to use to build a more
recent version. (I'm trying to build 4.7.2 with a 3.4.6 gcc) Does
anyone have a decent recipe for this? Here's how I started:

$SOURCE/gmp-5.0.5/configure       \
  --host=${TARGET}                \
  --prefix=${TCPREFIX}            \
  --disable-shared                \
  --with-pic

$SOURCE/mpfr-3.1.1/configure      \
  --host=${TARGET}                \
  --prefix=${TCPREFIX}            \
  --with-gmp=${TCPREFIX}          \
  --disable-shared                \
  --with-pic

$SOURCE/mpc-1.0.1/configure       \
  --host=${TARGET}                \
  --prefix=${TCPREFIX}            \
  --with-gmp=${TCPREFIX}          \
  --with-mpfr=${TCPREFIX}         \
  --disable-shared                \
  --with-pic

# zlib
./configure --static
make                              \
  CC="${TARGET}-gcc"              \
  CPP="${TARGET}-gcc"             \
  AR="${TARGET}-ar"               \
  LDSHARED="${TARGET}-gcc"        \
  prefix=${PREFIX}

make                              \
  CC="${TARGET}-gcc"              \
  CPP="${TARGET}-gcc"             \
  AR="${TARGET}-ar"               \
  LDSHARED="${TARGET}-gcc"        \
  prefix=${PREFIX}

${SOURCE}/binutils-2.22/configure \
  --host=${TARGET}                \
  --prefix=${TCPREFIX}            \
  -v

CFLAGS='-static' \
${SOURCE}/gcc-4.7.2/configure    \
  --enable-languages=c,c++                         \
  --with-gnu-as                                    \
  --prefix=${TCPREFIX}                             \
  --with-as=${TCPREFIX}/bin/as                     \
  --with-ld=${TCPREFIX}/bin/ld                     \
  --with-mpfr=${TCPREFIX}                          \
  --with-gmp=${TCPREFIX}                           \
  --with-mpc=${TCPREFIX}                           \
  --disable-libgcj                                 \
  --disable-shared                                 \
  --enable-static                                  \
  --disable-bootstrap

I've made sure that TCPREFIX is first in my PATH (as well as
PKG_CONFIG_PATH and LD_LIBRARY_PATH) hoping that as I compile things,
the sunfreeware version is replaced with my new version.
Unfortunately, no matter what I do though, somewhere along the line,
the shared /usr/local/lib/libgcc_s.so is being pulled into things that
I compile. Everything that I do to work around it, feels very hackish
too me. (IE: manually running gcc at certain steps in an autotools
compile to exclude -L/usr/local/lib, which brings in the static
libgcc)

Can anyone point out any flaws (or better suggestions) on at least the
above packages?

Thanks for any help!

Shawn

PS: I have TARGET included above as I was once trying to build it as a
cross compiler from a linux machine. That didn't work out so well, but
I basically used the same recipe when trying it native.

TARGET=sparc-sun-solaris2.9

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-01-08 22:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-09  3:56 Building a toolchain on Sparc Solaris 5.9 with static libgcc Shawn Ferris

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).