Building a static toolchain ?
Dimitry Andric
dimitry@andric.com
Thu Apr 1 09:43:00 GMT 2010
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))
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gcc-4.3.3-static-gmp-mpfr.diff
URL: <http://sourceware.org/pipermail/crossgcc/attachments/20100401/4e1202d7/attachment.ksh>
-------------- next part --------------
--
For unsubscribe information see http://sourceware.org/lists.html#faq
More information about the crossgcc
mailing list