On Fri, 2014-10-24 at 23:54 +0000, Emil Velikov wrote:
> On 24/10/14 17:03, Jan Vesely wrote:
> > -Wl,--exclude-libs prevents automatic export of symbols
> > 
> > 
> > CC: Kai Wasserbach <k...@dev.carbon-project.org>
> > CC: Emil Velikov <emil.l.veli...@gmail.com>
> > Signed-off-by: Jan Vesely <jan.ves...@rutgers.edu>
> > ---
> > 
> > Kai,
> > can you try this patch with your setup, and check whether LLVM symbols are
> > exported from mesa library? (and it's still working)
> > 
> > Emil,
> > would it help to have --exclude-libs ALL enabled globally?
> > 
> Haven't really looked up on the documentation about it, yet there should
> be no (unneeded) exported symbols thanks to the version scripts.
> As such I'm not entirely sure what this patch (attempts to) resolve :(

you are right. I don't know why I thought it was still a problem.
In that case the attached patch should fix compiling with llvm static
libs (#70410)

jan

> 
> -Emil
> 
> > jan
> > 
> >  configure.ac | 10 +++++++++-
> >  1 file changed, 9 insertions(+), 1 deletion(-)
> > 
> > diff --git a/configure.ac b/configure.ac
> > index 3c76deb..b4b4b13 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -1981,7 +1981,15 @@ if test "x$MESA_LLVM" != x0; then
> >             dnl already added all of these objects to LLVM_LIBS.
> >          fi
> >      else
> > -        AC_MSG_WARN([Building mesa with staticly linked LLVM may cause 
> > compilation issues])
> > +        AC_MSG_WARN([Building mesa with statically linked LLVM may cause 
> > compilation issues])
> > +   dnl Don't export symbols automatically
> > +   dnl TODO: Do we want to list llvm libs explicitly here?
> > +   LLVM_LDFLAGS+=" -Wl,exclude-libs ALL"
> > +   dnl We need to link to llvm system libs when using static libs
> > +   dnl However, only llvm 3.5+ provides --system-libs
> > +   if test $LLVM_VERSION_MAJOR -eq 3 -a $LLVM_VERSION_MINOR -ge 5; then
> > +           LLVM_LIBS+=" `$LLVM_CONFIG --system-libs`"
> > +   fi
> >      fi
> >  fi
> >  
> > 
> 

-- 
Jan Vesely <jan.ves...@rutgers.edu>
From 1cf52d23a3e3bda69c83e436e2109da896d51436 Mon Sep 17 00:00:00 2001
From: Jan Vesely <jan.ves...@rutgers.edu>
Date: Thu, 23 Oct 2014 17:17:07 -0400
Subject: [Mesa-dev][PATCH v2 1/1] configure: include llvm systemlibs when using
 static llvm

v2: drop -WL,--exclude-libs, it's not necessary
    fix tabs/spaces

Signed-off-by: Jan Vesely <jan.ves...@rutgers.edu>
---
 configure.ac | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 3c76deb..14204e5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1981,7 +1981,12 @@ if test "x$MESA_LLVM" != x0; then
            dnl already added all of these objects to LLVM_LIBS.
         fi
     else
-        AC_MSG_WARN([Building mesa with staticly linked LLVM may cause compilation issues])
+        AC_MSG_WARN([Building mesa with statically linked LLVM may cause compilation issues])
+        dnl We need to link to llvm system libs when using static libs
+        dnl However, only llvm 3.5+ provides --system-libs
+        if test $LLVM_VERSION_MAJOR -eq 3 -a $LLVM_VERSION_MINOR -ge 5; then
+            LLVM_LIBS="$LLVM_LIBS `$LLVM_CONFIG --system-libs`"
+        fi
     fi
 fi
 
-- 
1.9.3

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to