crosstool-ng/scripts/build
Joel Holdsworth da1ffd0412 cc/gcc: Remove -lstdc++ and -lm from gcc LDFLAGS
In Bryan Hundven's patch 1ad439907 from 2010, the author added -lstdc++
and -lm to the host gcc build's LDFLAGS, because at the time the linker
did not correctly include these libraries causing the build to fail.

In modern builds, this causes a problem for canadian gcc builds where
the host machine is mingw32-w64 Windows.

Within the gcc build there is the liblto_plugin module. On Windows this
must be built as the "liblto_plugin.dll" dynamic library. However,
libtool cannot produce a dynamic library unless every library dependency
is also a dynamic library, and falls back to producing a libstdc++.a
static library. liblto_plugin does not require libstdc++ - it
does not contain any C++ code, and the dependency would usually be
elided by the linker.

Unfortunately, in this case, crosstool-ng will never build a
libstdc++.dll dynamic library - only a libstdc++.a static library.
Therefore, there will never be a dynamic library version of stdc++ for
libtool to load and then discard.

This patch corrects the issue by removing "-lstdc++" from LDFLAGS,
because modern versions of gcc are able to correctly include libstdc++
where necessary. It also remove "-lm" for similar reasons.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2022-05-11 20:25:42 +12:00
..
arch Remove obsolete bionic/android support 2022-05-10 19:46:53 +12:00
binutils binutils: Disable libdebuginfod when producing a static toolchain 2022-02-23 20:20:34 +13:00
cc cc/gcc: Remove -lstdc++ and -lm from gcc LDFLAGS 2022-05-11 20:25:42 +12:00
companion_libs Convert tabs to spaces 2022-02-11 00:47:51 -08:00
companion_tools Convert tabs to spaces 2022-02-11 00:47:51 -08:00
debug gdb: drop obsolete versions 2022-05-10 19:46:53 +12:00
kernel Add support for no-mmu microblaze 2021-08-25 17:36:47 +10:00
libc Remove obsolete glibc 2.12.1 2022-05-10 19:46:53 +12:00
test_suite Fix the references to old config variables 2017-07-08 10:57:56 -07:00
arch.sh Add config flags for omitting 'arch' and 'vendor' 2018-12-10 01:10:01 -08:00
companion_libs.sh Build companion libs for target. 2015-11-13 10:24:22 -08:00
companion_tools.sh Some locations were missed while renaming kconfig symbols 2017-07-08 10:57:57 -07:00
debug.sh Some locations were missed while renaming kconfig symbols 2017-07-08 10:57:57 -07:00
internals.sh build/internals.sh: Handle pie executables 2019-09-14 22:21:11 +12:00
libc.sh Fold libc_start_files into libc 2022-02-11 00:47:51 -08:00
test_suite.sh Some locations were missed while renaming kconfig symbols 2017-07-08 10:57:57 -07:00