[Mesa-dev] [PATCH] configure: Strip LLVMX86Asm* dependencies.

Gustaw Smolarczyk wielkiegie at gmail.com
Sun Dec 4 10:34:35 UTC 2016


They are picked automatically by the provided llvm-config flags, but are
not needed.

Fixes loading radv through a vulkan loader.

Cc: 13.0 <mesa-stable at lists.freedesktop.org>
---

It's work-around for:
https://lists.freedesktop.org/archives/mesa-dev/2016-October/130765.html

Since there are other people than me dealing with this issue, might
as well propose a patch that work-arounds it for me for these other
people to benefit from.

It's my first patch to the stable release, I hope I did it right.

 configure.ac | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index f62bc61e50..9d191edd97 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2493,6 +2493,13 @@ if test "x$HAVE_RADEON_VULKAN" = "xyes"; then
     radeon_llvm_check "radv" "3" "9" "0"
 fi
 
+strip_unwanted_llvm_libs() {
+    # Use \> (marks the end of the word)
+    echo `$1` | sed \
+	-e 's/-lLLVMX86AsmPrinter\>//g' \
+	-e 's/-lLLVMX86AsmParser\>//g'
+}
+
 dnl Set LLVM_LIBS - This is done after the driver configuration so
 dnl that drivers can add additional components to LLVM_COMPONENTS.
 dnl Previously, gallium drivers were updating LLVM_LIBS directly
@@ -2505,7 +2512,7 @@ if test "x$MESA_LLVM" != x0; then
     if ! $LLVM_CONFIG --libs ${LLVM_COMPONENTS} >/dev/null; then
        AC_MSG_ERROR([Calling ${LLVM_CONFIG} failed])
     fi
-    LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`"
+    LLVM_LIBS=`strip_unwanted_llvm_libs "$LLVM_CONFIG --libs ${LLVM_COMPONENTS}"`
 
     dnl llvm-config may not give the right answer when llvm is a built as a
     dnl single shared library, so we must work the library name out for
-- 
2.11.0.rc2



More information about the mesa-dev mailing list