aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2015-03-02 11:02:47 +0800
committerAndrew Hsieh <andrewhsieh@google.com>2015-03-02 11:02:47 +0800
commitf8db3f1d0824da5315df3415814ba76108157796 (patch)
treed48c3a26b5d238a5a9a90474d8ea689a78887713
parent75542e77b565c2af968e48c1b12b32f343d913ae (diff)
downloadbuild-f8db3f1d0824da5315df3415814ba76108157796.tar.gz
Static link ld.gold by mingw to avoid dependencies on libwinpthread-1.dll
Change-Id: I119c0a6c24304c4c3b0dbf59c12debcb8f8fc486
-rw-r--r--Makefile.in12
1 files changed, 9 insertions, 3 deletions
diff --git a/Makefile.in b/Makefile.in
index 94e2eaa..7537a77 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -311,10 +311,16 @@ BINUTILS_CONFIG_ARGS+= --with-cloog=${CLOOG_DIR} --with-isl=${ISL_DIR} --with-is
# links to the static C++ runtime to avoid depending on the host version
ifneq ($(host_os),darwin)
BINUTILS_CONFIG_ARGS+= \
- '--with-host-libstdcxx=-static-libgcc \
- -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' \
- --with-gold-ldflags='-static-libgcc -static-libstdc++' \
+ '--with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' \
--enable-install-libbfd
+ifneq ($(cur_host),$(cur_build))
+# static link to avoid dependencies on libwinpthread-1.dll in mingw
+BINUTILS_CONFIG_ARGS+= \
+ --with-gold-ldflags='-static-libgcc -static-libstdc++ -static'
+else
+BINUTILS_CONFIG_ARGS+= \
+ --with-gold-ldflags='-static-libgcc -static-libstdc++'
+endif
else
# In darwin ld doesn't allow both -static and -dynamic. Instead, we rely on explicit
# "-isysroot $(mac_sdk_root) -mmacosx-version-min=$(mac_sdk_version)" to establish