[PATCH 3 of 3] scripts/gcc: if build host gcc is greater then 4.5.x use -static-libstdc++
Benoît THÉBAUDEAU
benoit.thebaudeau@advansee.com
Mon May 30 10:26:00 GMT 2011
Hi Bryan, Yann, all,
> 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
Just note that CodeSourcery's arm-2011.03-41-arm-none-linux-gnueabi.src.tar.bz2
- based on GCC 4.5.2 - still uses "-Wl,-Bstatic,-lstdc++,-Bdynamic" in
arm-2011.03-41-arm-none-linux-gnueabi.sh.
I have not checked in detail the implications of changing this. Was the FIXME
created because of some issue, or only to simplify the options passed?
Best regards,
Benoît
--
For unsubscribe information see http://sourceware.org/lists.html#faq
More information about the crossgcc
mailing list