diff options
author | Chris Packham <judge.packham@gmail.com> | 2021-09-08 20:25:06 +1200 |
---|---|---|
committer | Chris Packham <judge.packham@gmail.com> | 2021-09-08 20:25:16 +1200 |
commit | bc4b8c790b8d9c1faa5041ca73b4fcdcc4a6b0f1 (patch) | |
tree | ac6fdcd1b4e2f099f8cd58153ad04d553901b391 /scripts/build/cc | |
parent | 4de586cd2ee8fe7de53bc0ede6ab25e3c71412cd (diff) | |
parent | e075bdfc9465ae8cab0bfab9dfc59bcdf459adca (diff) | |
download | crosstool-ng-bc4b8c790b8d9c1faa5041ca73b4fcdcc4a6b0f1.tar.gz crosstool-ng-bc4b8c790b8d9c1faa5041ca73b4fcdcc4a6b0f1.tar.bz2 crosstool-ng-bc4b8c790b8d9c1faa5041ca73b4fcdcc4a6b0f1.zip |
Merge branch 'with-host-libstdcxx' of https://github.com/foss-for-synopsys-dwc-arc-processors/crosstool-ng
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Diffstat (limited to 'scripts/build/cc')
-rw-r--r-- | scripts/build/cc/gcc.sh | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh index fdfa7d65..6cb5de15 100644 --- a/scripts/build/cc/gcc.sh +++ b/scripts/build/cc/gcc.sh @@ -436,9 +436,11 @@ do_gcc_core_backend() { # with the same block in do_gcc_backend, below. if [ "${build_staticlinked}" = "yes" ]; then core_LDFLAGS+=("-static") - host_libstdcxx_flags+=("-static-libgcc") - host_libstdcxx_flags+=("-Wl,-Bstatic,-lstdc++") - host_libstdcxx_flags+=("-lm") + if [ "${CT_GCC_older_than_6}" = "y" ]; then + host_libstdcxx_flags+=("-static-libgcc") + host_libstdcxx_flags+=("-Wl,-Bstatic,-lstdc++") + host_libstdcxx_flags+=("-lm") + fi # Companion libraries are build static (eg !shared), so # the libstdc++ is not pulled automatically, although it # is needed. Shoe-horn it in our LDFLAGS @@ -446,7 +448,7 @@ do_gcc_core_backend() { core_LDFLAGS+=("-lstdc++") core_LDFLAGS+=("-lm") else - if [ "${CT_CC_GCC_STATIC_LIBSTDCXX}" = "y" ]; then + if [ "${CT_CC_GCC_STATIC_LIBSTDCXX}" = "y" -a "${CT_GCC_older_than_6}" = "y" ]; then # this is from CodeSourcery arm-2010q1-202-arm-none-linux-gnueabi.src.tar.bz2 # build script # INFO: if the host gcc is gcc-4.5 then presumably we could use -static-libstdc++, @@ -1084,9 +1086,11 @@ do_gcc_backend() { # with the same block in do_gcc_core_backend, above. if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then final_LDFLAGS+=("-static") - host_libstdcxx_flags+=("-static-libgcc") - host_libstdcxx_flags+=("-Wl,-Bstatic,-lstdc++") - host_libstdcxx_flags+=("-lm") + if [ "${CT_GCC_older_than_6}" = "y" ]; then + host_libstdcxx_flags+=("-static-libgcc") + host_libstdcxx_flags+=("-Wl,-Bstatic,-lstdc++") + host_libstdcxx_flags+=("-lm") + fi # Companion libraries are build static (eg !shared), so # the libstdc++ is not pulled automatically, although it # is needed. Shoe-horn it in our LDFLAGS @@ -1094,7 +1098,7 @@ do_gcc_backend() { final_LDFLAGS+=("-lstdc++") final_LDFLAGS+=("-lm") else - if [ "${CT_CC_GCC_STATIC_LIBSTDCXX}" = "y" ]; then + if [ "${CT_CC_GCC_STATIC_LIBSTDCXX}" = "y" -a "${CT_GCC_older_than_6}" = "y" ]; then # this is from CodeSourcery arm-2010q1-202-arm-none-linux-gnueabi.src.tar.bz2 # build script # INFO: if the host gcc is gcc-4.5 then presumably we could use -static-libstdc++, |