From 820fe4475f65b38f4ec6c7013d1ddfe4510058c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pekka=20J=C3=A4=C3=A4skel=C3=A4inen?= Date: Sat, 13 Jul 2019 12:20:52 +0300 Subject: [PATCH] Fix #91 by patching the produced ltmain.sh. This should be reported to libtoolize upstream? --- tce/autogen.sh | 2 ++ tce/ltmain.sh.patch | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 tce/ltmain.sh.patch diff --git a/tce/autogen.sh b/tce/autogen.sh index 5bce9bab38..a196fd52c4 100755 --- a/tce/autogen.sh +++ b/tce/autogen.sh @@ -1552,6 +1552,8 @@ if [ "x$config" = "x" ] ; then $VERBOSE_ECHO "Could not locate the configure template (from `pwd`)" fi +patch -p0 < ltmain.sh.patch || true + # summarize $ECHO "done" $ECHO diff --git a/tce/ltmain.sh.patch b/tce/ltmain.sh.patch new file mode 100644 index 0000000000..cd71b9df11 --- /dev/null +++ b/tce/ltmain.sh.patch @@ -0,0 +1,19 @@ +At least Ubuntu 18.04's libtoolize generates wrapper +scripts which _prepend_ the system path to the LD_LIBRARY_PATH, +causing the system's libllvm to be found before the user's +own installed LLVM (overridden using LB_LIBRARY_PATH). + +This patches it such that the path is appended to the path +instead. + +--- ltmain.sh.orig 2019-07-13 12:06:11.050523601 +0300 ++++ ltmain.sh 2019-07-13 12:06:46.427026644 +0300 +@@ -5479,7 +5479,7 @@ + if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var +- $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" ++ $shlibpath_var=\"\$$shlibpath_var:$temp_rpath\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed