Browse Source

extras/tools: Patch libtool to find the compiler-rt that clang uses by default

When libtool links DLLs that include C++ code, it does so by
passing -nostdlib and manually adding the compiler built-in
default libraries. When linking, clang specifies the compiler-rt
library by passing the full path to the .a file, instead of using
-L + -l. libtool currently doesn't pick up such a full path to
a static library as a library it should include.

This patch is a custom libtool patch from chromium os [1],
upstreaming is in progress at [2].

[1] 88201a517e
[2] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27866
pull/68/head
Martin Storsjö 9 years ago
parent
commit
5c7092dfe6
  1. 20
      extras/tools/libtool-2.4.6-clang-libs.patch
  2. 1
      extras/tools/tools.mak

20
extras/tools/libtool-2.4.6-clang-libs.patch

@ -0,0 +1,20 @@
Libtool checks only for libraries linked as -l* when trying to
find internal compiler libraries. Clang, however uses the absolute
path to link its internal libraries e.g. compiler_rt. This patch
handles clang's statically linked libraries when finding internal
compiler libraries.
https://crbug.com/749263
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27866
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -7531,7 +7544,7 @@
for p in `eval "$output_verbose_link_cmd"`; do
case $prev$p in
- -L* | -R* | -l*)
+ -L* | -R* | -l* | */libclang_rt.*.a)
# Some compilers place space between "-{L,R}" and the path.
# Remove the space.
if test x-L = "$p" ||

1
extras/tools/tools.mak

@ -88,6 +88,7 @@ libtool: libtool-$(LIBTOOL_VERSION).tar.gz
$(UNPACK)
$(APPLY) libtool-2.4.2-bitcode.patch
$(APPLY) libtool-2.4.2-san.patch
$(APPLY) libtool-2.4.6-clang-libs.patch
$(MOVE)
.libtool: libtool .automake

Loading…
Cancel
Save