Skip to content
Snippets Groups Projects
Commit 5c7092df authored by Martin Storsjö's avatar Martin Storsjö
Browse files

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
parent 4118b49f
No related branches found
No related tags found
No related merge requests found
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" ||
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment