1
0
Fork 0

Switch from static to dynamically-linked libstdc++

When using C++11 code that can possibly throw exceptions (such as
std::make_shared(...) linking libstdc++.a using Clang on MSYS2
will generate errors such as:

  libstdc++.a(eh_personality.o): duplicate section
  `.rdata$_ZTSSt9exception[_ZTSSt9exception]' has different size

Although potential suggested fixes involve allowing duplicate symbols,
-Wl,--allow-multiple-definition, this solution can introduce unexpected
behavior when one symbol clobbers another symbol.

To solve this, switching to dynamic linking of the libstdc++ library
appears to be all that's needed.
This commit is contained in:
krcroft 2020-01-05 19:41:05 -08:00 committed by Patryk Obara
parent cc7d6b6e43
commit c776239c3c

View file

@ -2,4 +2,4 @@
ar="llvm-ar${postfix}"
ld="llvm-link${postfix}"
ranlib="llvm-ranlib${postfix}"
ldflags+=(-static-libgcc -static-libstdc++)
ldflags+=(-static-libgcc)