public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: Dimitry Andric <dimitry@andric.com>
Cc: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>,
		crossgcc@sourceware.org, Trevor Woerner <twoerner@gmail.com>
Subject: Re: Building a static toolchain ?
Date: Thu, 01 Apr 2010 18:53:00 -0000	[thread overview]
Message-ID: <20100401185418.GA5113@gmail.com> (raw)
In-Reply-To: <4BB46ACE.3000701@andric.com>

On (01/04/10 11:43), Dimitry Andric wrote:
> On 2010-03-31 23:25, Yann E. MORIN wrote:
> >>- make sure any extra dependencies, usually libgmp and/or libmpfr,
> >>*are* statically linked into the toolchain executables, since not
> >>everybody will have those as .so files on their system, or may have
> >>different, incompatible versions.
> >
> >Yes, and those *I* was not able to properly build statically (yet!)... :-(
> 
> For that, I use something like the attached patch, which should apply
> cleanly to gcc 4.3.3, but most likely also to later versions.
> 
> After building the toolchain, you can check out the dependencies with
> ldd, for example:
> 
> $ ldd $TOOLCHAIN_ROOT/libexec/gcc/$TARGET_TRIPLET/4.3.3/cc1
>          linux-gate.so.1 =>  (0x00a5b000)
>          libc.so.6 => /lib/libc.so.6 (0x00110000)
>          /lib/ld-linux.so.2 (0x00996000)
> 
> So it only links dynamically with glibc, while it contains gmp and mpfr
> statically:
> 
> $ strings $TOOLCHAIN_ROOT/libexec/gcc/$TARGET_TRIPLET/4.3.3/cc1|grep -E "gmp|mpfr"
> real_from_mpfr
> mpfr_from_real
> |*p+>(__builtin_constant_p (1) && (1) == 0 ? (((S)->_mpfr_exp == ((mp_exp_t)((~((~(unsigned long)0)>>1))+1))) ? 0 : ((S)->_mpfr_sign)) : mpfr_cmp_ui_2exp ((S),(1),0)) < 0
> !(((t)->_mpfr_exp) == (((-2147483647L - 1L))+2))
> prec >= 2 && prec <= ((mpfr_prec_t)((mpfr_prec_t)(~(mpfr_prec_t)0)>>1))
> p >= 2 && p <= ((mpfr_prec_t)((mpfr_prec_t)(~(mpfr_prec_t)0)>>1))
> (((k)->_mpfr_exp) == ((((long) ((~ (unsigned long) 0) ^ ((unsigned long) (~ (unsigned long) 0) >> 1))))+1)) || ((k)->_mpfr_exp) <= 2
> (!(((r)->_mpfr_exp) == ((((long) ((~ (unsigned long) 0) ^ ((unsigned long) (~ (unsigned long) 0) >> 1))))+2)) && !(((r)->_mpfr_exp) == ((((long) ((~ (unsigned long) 0) ^ ((unsigned long) (~ (unsigned long) 0) >> 1))))+3)))
> (((cache->x)->_mpfr_sign) > 0)
> ! (un < pn || (un == pn && __gmpn_cmp (up, pp, pn) < 0))
> 

> diff -ur a/configure.ac b/configure.ac
> --- a/configure.ac	2008-02-02 04:29:30.000000000 +0100
> +++ b/configure.ac	2010-04-01 11:18:19.000000000 +0200
> @@ -1139,7 +1139,7 @@
>  ACX_PROG_CMP_IGNORE_INITIAL
>  
>  # Check for GMP and MPFR
> -gmplibs="-lmpfr -lgmp"
> +gmplibs="-Wl,-Bstatic -lmpfr -lgmp -Wl,-Bdynamic"
>  gmpinc=
>  have_gmp=no
>  
> diff -ur a/configure b/configure
> --- a/configure	2008-02-02 04:29:30.000000000 +0100
> +++ b/configure	2010-04-01 11:18:19.000000000 +0200
> @@ -4368,7 +4368,7 @@
>  
>  
>  # Check for GMP and MPFR
> -gmplibs="-lmpfr -lgmp"
> +gmplibs="-Wl,-Bstatic -lmpfr -lgmp -Wl,-Bdynamic"
>  gmpinc=
>  have_gmp=no
>  
> 
> 

you could add symlinks to gmp and mpfr sources on top of gcc tree
and then it should link them statically you would not need this patch.

> --
> For unsubscribe information see http://sourceware.org/lists.html#faq


--
For unsubscribe information see http://sourceware.org/lists.html#faq

  reply	other threads:[~2010-04-01 18:53 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-23 17:46 M P
2010-03-24 19:44 ` Yann E. MORIN
2010-03-24 20:04   ` Josh Henderson
2010-03-25 22:24     ` Yann E. MORIN
2010-03-31 20:37       ` Trevor Woerner
2010-03-31 20:50         ` Dimitry Andric
2010-03-31 21:08           ` Trevor Woerner
2010-03-31 21:18             ` Josh Henderson
2010-03-31 21:22             ` Khem Raj
2010-03-31 21:23               ` Trevor Woerner
2010-03-31 21:31             ` Yann E. MORIN
2010-03-31 21:26           ` Yann E. MORIN
2010-04-01  9:43             ` Dimitry Andric
2010-04-01 18:53               ` Khem Raj [this message]
2010-04-01 19:05               ` Marc Kleine-Budde
2010-04-01 20:29                 ` Dimitry Andric
2010-04-05  0:31 Arnaud Lacombe
2010-04-10 10:50 ` Yann E. MORIN
2010-04-10 17:10   ` Arnaud Lacombe
2010-04-10 17:20     ` Yann E. MORIN
2010-04-10 17:28       ` Yann E. MORIN
2010-04-10 21:35         ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100401185418.GA5113@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=crossgcc@sourceware.org \
    --cc=dimitry@andric.com \
    --cc=twoerner@gmail.com \
    --cc=yann.morin.1998@anciens.enib.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).