<div dir="ltr"><div><div><div><div><div><div><div>This still doesn't quite give what you want.  One can also have an llvm with component shared libs.  So there's three different options for llvm library configurations: a single shared lib, component shared libs, or component static libs.  To ensure you're getting just the static libs or just the shared libs, you'll need to wrap the link lines in -Bstatic or -Bdynamic.  Something like (in pseudo code, not actual make or autoconf syntax):<br><span style="font-family:monospace,monospace"><br></span></div><span style="font-family:monospace,monospace">if use_llvm<br>then<br>  if use_llvm_shared<br></span></div><div><span style="font-family:monospace,monospace">  then<br></span></div><div><span style="font-family:monospace,monospace">    if single_library<br></span></div><div><span style="font-family:monospace,monospace">    then<br>      </span><span style="font-family:monospace,monospace"># (whatever logic you need to deal with the different library </span><span style="font-family:monospace,monospace">naming issues)</span></div><span style="font-family:monospace,monospace">      LLVM_LIBS="-lLLVM'" or LLVM_LIBS="-LLVM-3.7"</span><br></div><font face="monospace,monospace">    else # use llvm component libs<br></font></div><font face="monospace,monospace">      LLVM_LIBS="-Wl,--push-state,-Bdynamic `$LLVM_CONFIG --libs $</font><font face="monospace,monospace">LLVM_COMPONENTS` -Wl,--pop-state"<br></font></div><font face="monospace,monospace">    endif<br></font></div><font face="monospace,monospace">  else # use_llvm_static<br></font><font face="monospace,monospace">    LLVM_LIBS="-Wl,--push-state,-Bstatic `$LLVM_CONFIG --libs $</font><font face="monospace,monospace">LLVM_COMPONENTS` -Wl,--pop-state"</font></div><font face="monospace,monospace">  endif<br><br></font><div><font face="monospace,monospace">  LLVM_LIBS="</font><font face="monospace,monospace"><font face="monospace,monospace">-L`$LLVM_CONFIG --libdir` $LLVM_LIBS"<br></font>endif<br></font></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">- Chuck<br></div></div></div>
<br><div class="gmail_quote">On Mon, Apr 18, 2016 at 11:01 PM, Jonathan Gray <span dir="ltr"><<a href="mailto:jsg@jsg.id.au" target="_blank">jsg@jsg.id.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This patch is still required for master.<br>
<div class="HOEnZb"><div class="h5"><br>
On Sun, Feb 28, 2016 at 02:47:03PM +1100, Jonathan Gray wrote:<br>
> When building with --disable-llvm-shared-libs use llvm-config --libfiles<br>
> instead of of --libs so the full path to the .a files is used instead of<br>
> -lname.<br>
><br>
> Otherwise at install time gallium_dri.a is installed of gallium_dri.so<br>
> and the hardlinking of gallium_dri.so to other names fails.<br>
><br>
> Cc: "11.2 11.1" <<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.org</a>><br>
> Signed-off-by: Jonathan Gray <<a href="mailto:jsg@jsg.id.au">jsg@jsg.id.au</a>><br>
> ---<br>
>  <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> | 5 ++++-<br>
>  1 file changed, 4 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
> index 6f970d7..3e2923f 100644<br>
> --- a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
> +++ b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
> @@ -2304,13 +2304,14 @@ if test "x$MESA_LLVM" != x0; then<br>
>      if ! $LLVM_CONFIG --libs ${LLVM_COMPONENTS} >/dev/null; then<br>
>         AC_MSG_ERROR([Calling ${LLVM_CONFIG} failed])<br>
>      fi<br>
> -    LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`"<br>
><br>
>      dnl llvm-config may not give the right answer when llvm is a built as a<br>
>      dnl single shared library, so we must work the library name out for<br>
>      dnl ourselves.<br>
>      dnl (See <a href="https://llvm.org/bugs/show_bug.cgi?id=6823" rel="noreferrer" target="_blank">https://llvm.org/bugs/show_bug.cgi?id=6823</a>)<br>
>      if test "x$enable_llvm_shared_libs" = xyes; then<br>
> +        LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`"<br>
> +<br>
>          dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,<br>
>          LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version`<br>
>          AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.$IMP_LIB_EXT"], [llvm_have_one_so=yes])<br>
> @@ -2337,6 +2338,8 @@ if test "x$MESA_LLVM" != x0; then<br>
>             dnl already added all of these objects to LLVM_LIBS.<br>
>          fi<br>
>      else<br>
> +        LLVM_LIBS="`$LLVM_CONFIG --libfiles ${LLVM_COMPONENTS}`"<br>
> +<br>
>          AC_MSG_WARN([Building mesa with statically linked LLVM may cause compilation issues])<br>
>          dnl We need to link to llvm system libs when using static libs<br>
>          dnl However, only llvm 3.5+ provides --system-libs<br>
> --<br>
> 2.7.0<br>
><br>
> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div>