1.1 --- a/config/cc/gcc.in.2 Thu Jul 29 19:30:37 2010 +0200
1.2 +++ b/config/cc/gcc.in.2 Thu Jul 29 19:47:16 2010 +0200
1.3 @@ -7,6 +7,18 @@
1.4
1.5 This will compile crossgcc's libs with -Os.
1.6
1.7 +config CC_STATIC_LIBSTDCXX
1.8 + bool
1.9 + prompt "Link libstdc++ statically into the gcc binary"
1.10 + default y
1.11 + depends on CC_GCC_4_4_or_later
1.12 + help
1.13 + Newer gcc versions use the PPL library which is C++ code. Statically
1.14 + linking libstdc++ increases the likeliness that the gcc binary will
1.15 + run on machines other than the one which it was built on, without
1.16 + having to worry about distributing the matching version of libstdc++
1.17 + along with it.
1.18 +
1.19 comment "Misc. obscure options."
1.20
1.21 config CC_CXA_ATEXIT
2.1 --- a/scripts/build/cc/gcc.sh Thu Jul 29 19:30:37 2010 +0200
2.2 +++ b/scripts/build/cc/gcc.sh Thu Jul 29 19:47:16 2010 +0200
2.3 @@ -347,10 +347,16 @@
2.4 extra_config+=(--disable-libmudflap)
2.5 fi
2.6
2.7 - # When companion libraries are build static (eg !shared),
2.8 - # the libstdc++ is not pulled automatically, although it
2.9 - # is needed. Shoe-horn it in our LDFLAGS
2.10 - if [ "${CT_COMPLIBS_SHARED}" != "y" ]; then
2.11 + if [ "${CT_CC_STATIC_LIBSTDCXX}" = "y" ]; then
2.12 + # this is from CodeSourcery arm-2010q1-202-arm-none-linux-gnueabi.src.tar.bz2
2.13 + # build script
2.14 + # FIXME: if the host gcc is gcc-4.5 then presumably we could use -static-libstdc++,
2.15 + # see http://gcc.gnu.org/ml/gcc-patches/2009-06/msg01635.html
2.16 + extra_config+=("--with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm")
2.17 + elif [ "${CT_COMPLIBS_SHARED}" != "y" ]; then
2.18 + # When companion libraries are build static (eg !shared),
2.19 + # the libstdc++ is not pulled automatically, although it
2.20 + # is needed. Shoe-horn it in our LDFLAGS
2.21 final_LDFLAGS='-lstdc++'
2.22 fi
2.23 if [ "${CT_CC_GCC_USE_GMP_MPFR}" = "y" ]; then