[Mesa-dev] [PATCH] configure: Check llvm-config --shared-mode

Aaron Watry awatry at gmail.com
Tue Aug 15 03:00:42 UTC 2017


On Mon, Aug 14, 2017 at 7:54 PM, Michel Dänzer <michel at daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> https://bugs.llvm.org/show_bug.cgi?id=6823 still affects current LLVM.
> llvm-config --libs only reports the single shared library if LLVM was
> built with -DLLVM_LINK_LLVM_DYLIB=ON. llvm-config --shared-mode reports
> "shared" in that case, "static" otherwise (even if LLVM was built with
> -DLLVM_BUILD_LLVM_DYLIB=ON).
>
> Fixes: 3d8da1f678e1 ("configure: Trust LLVM >= 4.0 llvm-config --libs
>                       for shared libraries")
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>

Thanks Michel,

Fixes a build error I've been encountering tonight with all of the
combinations of llvm builds I've tried (VC_REV=on/off,
shared_libraries=1/0, dylib=1/0

Tested-by: Aaron Watry <awatry at gmail.com>

FYI: I've settled for now on LLVM_APPEND_VC_REV=ON,
BUILD_SHARED_LIBS=1 amongst the rest of my llvm build flags.
Previously, I was able to get away with VC_REV=off,
LLVM_BULID_LLVM_DYLIB=1.

--Aaron

> ---
>  configure.ac | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/configure.ac b/configure.ac
> index 3fe47c7bbc..de15ac2fca 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -2624,7 +2624,7 @@ if test "x$enable_llvm" = xyes; then
>      LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`"
>
>      if test "x$enable_llvm_shared_libs" = xyes; then
> -        if test $LLVM_VERSION_MAJOR -lt 4; then
> +        if test `$LLVM_CONFIG --shared-mode` = static; then
>              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.
> --
> 2.14.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list