[PATCH 3 of 3] scripts/gcc: if build host gcc is greater then 4.5.x use -static-libstdc++
Bryan Hundven
bryanhundven@gmail.com
Mon May 30 05:07:00 GMT 2011
scripts/build/cc/gcc.sh | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
# HG changeset patch
# User Bryan Hundven <bryanhundven@gmail.com>
# Date 1306731531 25200
# Node ID 6bc2b9441fb0dcf16e68f4ac22d9ec1568c38181
# Parent 9d58c4e241bebc95f78ad593222a94ed364d39e9
scripts/gcc: if build host gcc is greater then 4.5.x use -static-libstdc++
Previously there was a FIXME to check if the build host is > 4.5 and use
use -static-libstdc++. This patch does just that.
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
diff -r 9d58c4e241be -r 6bc2b9441fb0 scripts/build/cc/gcc.sh
--- a/scripts/build/cc/gcc.sh Sun May 29 21:58:28 2011 -0700
+++ b/scripts/build/cc/gcc.sh Sun May 29 21:58:51 2011 -0700
@@ -449,13 +449,16 @@
final_LDFLAGS+=("-lm")
else
if [ "${CT_CC_STATIC_LIBSTDCXX}" = "y" -a "${CONFIGURE_has_static_libstdcpp}" = "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
+ # This is from CodeSourcery arm-2010q1-202-arm-none-linux-gnueabi.src.tar.bz2
+ # build script.
host_libstdcxx_flags+=("-static-libgcc")
- host_libstdcxx_flags+=("-Wl,-Bstatic,-lstdc++,-Bdynamic")
host_libstdcxx_flags+=("-lm")
+ if [ $(echo ${CT_SYS_GCC} | cut -d. -f1) -ge 4 -a \
+ $(echo ${CT_SYS_GCC} | cut -d. -f2) -ge 5 ]; then
+ host_libstdcxx_flags+=("-static-libstdc++")
+ else
+ host_libstdcxx_flags+=("-Wl,-Bstatic,-lstdc++,-Bdynamic")
+ fi
elif [ "${CT_COMPLIBS_SHARED}" != "y" ]; then
# When companion libraries are build static (eg !shared),
# the libstdc++ is not pulled automatically, although it
--
For unsubscribe information see http://sourceware.org/lists.html#faq
More information about the crossgcc
mailing list