summaryrefslogtreecommitdiff
path: root/scripts/build/cc
diff options
context:
space:
mode:
authorJohannes Stezenbach <js@sig21.net>2010-07-29 17:47:16 (GMT)
committerJohannes Stezenbach <js@sig21.net>2010-07-29 17:47:16 (GMT)
commit143f02e0ce81ec8886bbdfd73f139eadb910cfe3 (patch)
treeb6efd3d28d0a353106a4ffccd64df4a8c17d9fd9 /scripts/build/cc
parent8bd0034057c8bd34df4fb401bedfca49384f5323 (diff)
cc/gcc: add option to compile against static libstdc++, for gcc-4.4 and newer
Idea and know-how taken from CodeSourcery build script. Normal build: $ ldd arm-unknown-linux-uclibcgnueabi-gcc linux-gate.so.1 => (0xb77f3000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb76e8000) libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb75a1000) libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb757a000) /lib/ld-linux.so.2 (0xb77f4000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb755c000) CC_STATIC_LIBSTDCXX=y: $ ldd arm-unknown-linux-uclibcgnueabi-gcc linux-gate.so.1 => (0xb7843000) libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb76e6000) /lib/ld-linux.so.2 (0xb7844000) I made CC_STATIC_LIBSTDCXX default=y since I think it is always desirable. Signed-off-by: Johannes Stezenbach <js@sig21.net>
Diffstat (limited to 'scripts/build/cc')
-rw-r--r--scripts/build/cc/gcc.sh14
1 files changed, 10 insertions, 4 deletions
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
index f11517c..0b40d71 100644
--- a/scripts/build/cc/gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -347,10 +347,16 @@ do_cc() {
extra_config+=(--disable-libmudflap)
fi
- # When companion libraries are build static (eg !shared),
- # the libstdc++ is not pulled automatically, although it
- # is needed. Shoe-horn it in our LDFLAGS
- if [ "${CT_COMPLIBS_SHARED}" != "y" ]; then
+ if [ "${CT_CC_STATIC_LIBSTDCXX}" = "y" ]; then
+ # this is from CodeSourcery arm-2010q1-202-arm-none-linux-gnueabi.src.tar.bz2
+ # build script
+ # FIXME: if the host gcc is gcc-4.5 then presumably we could use -static-libstdc++,
+ # see http://gcc.gnu.org/ml/gcc-patches/2009-06/msg01635.html
+ extra_config+=("--with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm")
+ elif [ "${CT_COMPLIBS_SHARED}" != "y" ]; then
+ # When companion libraries are build static (eg !shared),
+ # the libstdc++ is not pulled automatically, although it
+ # is needed. Shoe-horn it in our LDFLAGS
final_LDFLAGS='-lstdc++'
fi
if [ "${CT_CC_GCC_USE_GMP_MPFR}" = "y" ]; then