[Mesa-dev] [PATCH] Use IMP_LIB_EXT when checking for LLVM shared libraries

Aaron Watry awatry at gmail.com
Tue Sep 8 09:11:32 PDT 2015


On Mon, Sep 7, 2015 at 4:06 AM, Emil Velikov <emil.l.velikov at gmail.com>
wrote:

> Hi Jon,
>
> On 4 September 2015 at 14:00, Jon TURNEY <jon.turney at dronecode.org.uk>
> wrote:
> > When checking for LLVM shared libraries, use IMP_LIB_EXT for the
> extension for
> > shared libraries appropriate to the target, rather than hardcoding '.so'
> >
> > Also add some comments to explain why we have this circus of pain.
> >
> > Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
> > ---
> >  configure.ac | 33 +++++++++++++++++++++++++++------
> >  1 file changed, 27 insertions(+), 6 deletions(-)
> >
> > diff --git a/configure.ac b/configure.ac
> > index 90ba4fe..9960dd0 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -533,15 +533,32 @@ AM_CONDITIONAL(HAVE_COMPAT_SYMLINKS, test
> "x$HAVE_COMPAT_SYMLINKS" = xyes)
> >  dnl
> >  dnl library names
> >  dnl
> > +dnl Unfortunately we need to do a few things that libtool can't help us
> with,
> > +dnl so we need some knowledge of shared library filenames:
> > +dnl
> > +dnl LIB_EXT is the extension used when creating symlinks for alternate
> > +dnl filenames for a shared library which will be dynamically loaded
> > +dnl
> > +dnl IMP_LIB_EXT is the extension used when checking for the presence of
> a
> > +dnl the file for a shared library we wish to link with
> > +dnl
> >  case "$host_os" in
> >  darwin* )
> > -    LIB_EXT='dylib' ;;
> > +    LIB_EXT='dylib'
> > +    IMP_LIB_EXT=$LIB_EXT
> > +    ;;
> >  cygwin* )
> > -    LIB_EXT='dll' ;;
> > +    LIB_EXT='dll'
> > +    IMP_LIB_EXT='dll.a'
> > +    ;;
> >  aix* )
> > -    LIB_EXT='a' ;;
> > +    LIB_EXT='a'
> > +    IMP_LIB_EXT=$LIB_EXT
> > +    ;;
> >  * )
> > -    LIB_EXT='so' ;;
> > +    LIB_EXT='so'
> > +    IMP_LIB_EXT=$LIB_EXT
> > +    ;;
> >  esac
> >
> >  AC_SUBST([LIB_EXT])
> > @@ -2163,10 +2180,14 @@ if test "x$MESA_LLVM" != x0; then
> >
> >      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
> > +    dnl ourselves.
> > +    dnl (See https://llvm.org/bugs/show_bug.cgi?id=6823)
> >      if test "x$enable_llvm_shared_libs" = xyes; then
> >          dnl We can't use $LLVM_VERSION because it has 'svn' stripped
> out,
> >          LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version`
> > -        AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.so"],
> [llvm_have_one_so=yes])
> > +        AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.$IMP_LIB_EXT"],
> [llvm_have_one_so=yes])
> >
> >          if test "x$llvm_have_one_so" = xyes; then
> >              dnl LLVM was built using auto*, so there is only one shared
> object.
> > @@ -2174,7 +2195,7 @@ if test "x$MESA_LLVM" != x0; then
> >          else
> >              dnl If LLVM was built with CMake, there will be one shared
> object per
> >              dnl component.
> > -            AS_IF([test ! -f "$LLVM_LIBDIR/libLLVMTarget.so"],
> > +            AS_IF([test ! -f "$LLVM_LIBDIR/libLLVMTarget.$IMP_LIB_EXT"],
> Fwiw I would prefer if we drop support for non have_one_so file LLVM
> builds and just fail miserably, rather than having this around :-)
> I suspect that either a) llvm people may have dropped support for it,
> b) it's tested/used extremely rarely or c) busted with latest
> llvm/mesa.
>
>
FWIW, this still works just fine with current trunk LLVM.  I've been
building clover for r600g and also mesa/clover for radeonsi using an
exploded LLVM build (or whatever you want to call it) just fine for a while
now.  I don't need to split out the separate sub-modules of LLVM for any
reason, but that's how my cmake-based build script is configured to run.

--Aaron



> Tom how do you feel on the subject ? Can we drop this workaround,
> pretty please (/me does the puppy eyes)
>
> Thanks
> Emil
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150908/ad1bef14/attachment.html>


More information about the mesa-dev mailing list