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

Martin Storsjö git at videolan.org
Wed Feb 28 10:59:02 CET 2018


vlc | branch: master | Martin Storsjö <martin at martin.st> | Tue Feb 27 12:41:40 2018 +0200| [5c7092dfe6ee45f38c9ff7063678956ace155815] | committer: Martin Storsjö

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] https://chromium.googlesource.com/chromiumos/overlays/portage-stable/+/88201a517e3a797e4197bacc4959785a934c08d6
[2] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27866

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5c7092dfe6ee45f38c9ff7063678956ace155815
---

 extras/tools/libtool-2.4.6-clang-libs.patch | 20 ++++++++++++++++++++
 extras/tools/tools.mak                      |  1 +
 2 files changed, 21 insertions(+)

diff --git a/extras/tools/libtool-2.4.6-clang-libs.patch b/extras/tools/libtool-2.4.6-clang-libs.patch
new file mode 100644
index 0000000000..93ec23bd1b
--- /dev/null
+++ b/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" ||
+
diff --git a/extras/tools/tools.mak b/extras/tools/tools.mak
index fa90c4c833..a7a459fb96 100644
--- a/extras/tools/tools.mak
+++ b/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



More information about the vlc-commits mailing list