[Mesa-dev] Mesa (master): configure.ac: honour LLVM_LIBDIR when linking against LLVM
Michel Dänzer
michel at daenzer.net
Thu Nov 10 06:46:06 UTC 2016
On 10/11/16 06:47 AM, Emil Velikov wrote:
> Module: Mesa
> Branch: master
> Commit: a39ad185932eab4f25a0cb2b112c10d8700ef242
> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a39ad185932eab4f25a0cb2b112c10d8700ef242
>
> Author: Emil Velikov <emil.velikov at collabora.com>
> Date: Mon Oct 24 18:11:33 2016 +0100
>
> configure.ac: honour LLVM_LIBDIR when linking against LLVM
>
> Currently if one uses a non-default prefix, the path won't get
> propagated and we'll fail at link-time.
>
> A very quick and easy example is to install to /usr/local.
> At this point, llvm-config will be picked even without the
> --with-llvm-prefix, but regardless of the latter linking will fail.
>
> Currently people can workaround that via LD_LIBRARY_PATH.
>
> Cc: "12.0 13.0" <mesa-stable at lists.freedesktop.org>
> Cc: Tom Stellard <thomas.stellard at amd.com>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> Reviewed-by: Marek Olšák <marek.olsak at amd.com>
>
> ---
>
> configure.ac | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 4761c59..2181313 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1985,8 +1985,6 @@ AC_SUBST([LLVM_BINDIR])
> AC_SUBST([LLVM_CFLAGS])
> AC_SUBST([LLVM_CPPFLAGS])
> AC_SUBST([LLVM_CXXFLAGS])
> -AC_SUBST([LLVM_LIBDIR])
> -AC_SUBST([LLVM_LIBS])
> AC_SUBST([LLVM_LDFLAGS])
> AC_SUBST([LLVM_INCLUDEDIR])
> AC_SUBST([LLVM_VERSION])
> @@ -2542,7 +2540,9 @@ if test "x$MESA_LLVM" != x0; then
> LLVM_LIBS="$LLVM_LIBS `$LLVM_CONFIG --system-libs`"
> fi
> fi
> + LLVM_LIBS="$LLVM_LIBDIR $LLVM_LIBS"
> fi
> +AC_SUBST([LLVM_LIBS])
This broke llvmpipe's make check for me, see below. Prepending -L to
$LLVM_LIBDIR fixes it; however, $LLVM_LDFLAGS already contains
-L$LLVM_LIBDIR, so maybe the problem you were trying to fix (what was
that exactly?) could be fixed by just adding/moving LLVM_LDFLAGS in the
right places?
make: Entering directory '/home/daenzer/src/mesa-git/mesa/build-amd64/src/gallium/drivers/llvmpipe'
make lp_test_format lp_test_arit lp_test_blend lp_test_conv lp_test_printf
make[1]: Entering directory '/home/daenzer/src/mesa-git/mesa/build-amd64/src/gallium/drivers/llvmpipe'
/bin/bash ../../../../libtool --tag=CXX --mode=link g++ -I../../../../../src/gallium/drivers/llvmpipe/include -I../../../../../src -I../../../../../include -I../../../../../src/gallium/include -I../../../../../src/gallium/auxiliary -I../../../../../src/gallium/drivers -I../../../../../src/gallium/winsys -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D_GNU_SOURCE -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS -DDEBUG -DUSE_LIBGLVND_GLX=1 -DTEXTURE_FLOAT_ENABLED -DUSE_X86_64_ASM -DHAVE_XLOCALE_H -DHAVE_SYS_SYSCTL_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_DLOPEN -DHAVE_POSIX_MEMALIGN -DUSE_LIBGLVND_GLX=1 -DHAVE_LIBDRM -DHAVE_SHA1 -DGLX_USE_DRM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_TLS -DHAVE_ALIAS -DHAVE_DRI3 -DHAVE_MINCORE -DHAVE_ST_VDPAU -DHAVE_LLVM=0x0400 -DMESA_LLVM_VERSION_PATCH=0 -fvisibility=hidden -I/home/daenzer/src/llvm-git/llvm/include -I/home/daenzer/src/llvm-git/llvm/build-amd64/include -W -Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -Werror=date-time -std=c++11 -fno-omit-frame-pointer -ftree-vectorize -fno-rtti -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Werror=pointer-arith -Werror=vla -g -O2 -Wall -fno-math-errno -fno-trapping-math -ggdb3 -fno-omit-frame-pointer -O3 -ftree-vectorize -march=amdfam10 -mtune=native -o lp_test_format lp_test_format.o lp_test_main.o libllvmpipe.la ../../../../src/gallium/auxiliary/libgallium.la ../../../../src/util/libmesautil.la /home/daenzer/src/llvm-git/llvm/build-amd64/lib -lLLVM-4.0.0svn -ldl -lpthread
libtool: link: g++ -I../../../../../src/gallium/drivers/llvmpipe/include -I../../../../../src -I../../../../../include -I../../../../../src/gallium/include -I../../../../../src/gallium/auxiliary -I../../../../../src/gallium/drivers -I../../../../../src/gallium/winsys -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D_GNU_SOURCE -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS -DDEBUG -DUSE_LIBGLVND_GLX=1 -DTEXTURE_FLOAT_ENABLED -DUSE_X86_64_ASM -DHAVE_XLOCALE_H -DHAVE_SYS_SYSCTL_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_DLOPEN -DHAVE_POSIX_MEMALIGN -DUSE_LIBGLVND_GLX=1 -DHAVE_LIBDRM -DHAVE_SHA1 -DGLX_USE_DRM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_TLS -DHAVE_ALIAS -DHAVE_DRI3 -DHAVE_MINCORE -DHAVE_ST_VDPAU -DHAVE_LLVM=0x0400 -DMESA_LLVM_VERSION_PATCH=0 -fvisibility=hidden -I/home/daenzer/src/llvm-git/llvm/include -I/home/daenzer/src/llvm-git/llvm/build-amd64/include -W -Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -Werror=date-time -std=c++11 -fno-omit-frame-pointer -ftree-vectorize -fno-rtti -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Werror=pointer-arith -Werror=vla -g -O2 -Wall -fno-math-errno -fno-trapping-math -ggdb3 -fno-omit-frame-pointer -O3 -ftree-vectorize -march=amdfam10 -mtune=native -o lp_test_format lp_test_format.o lp_test_main.o /home/daenzer/src/llvm-git/llvm/build-amd64/lib ./.libs/libllvmpipe.a -L/home/daenzer/src/llvm-git/llvm/build-amd64/lib ../../../../src/gallium/auxiliary/.libs/libgallium.a ../../../../src/util/.libs/libmesautil.a -lnettle -lLLVM-4.0.0svn -ldl -lpthread
/usr/bin/ld: cannot find /home/daenzer/src/llvm-git/llvm/build-amd64/lib: File format not recognized
collect2: error: ld returned 1 exit status
Makefile:1034: recipe for target 'lp_test_format' failed
make[1]: *** [lp_test_format] Error 1
make[1]: Leaving directory '/home/daenzer/src/mesa-git/mesa/build-amd64/src/gallium/drivers/llvmpipe'
Makefile:1424: recipe for target 'check-am' failed
make: *** [check-am] Error 2
make: Leaving directory '/home/daenzer/src/mesa-git/mesa/build-amd64/src/gallium/drivers/llvmpipe'
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
More information about the mesa-dev
mailing list