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

2017-08-18 Thread Emil Velikov
On 16 August 2017 at 07:40, Michel Dänzer  wrote:
> From: Michel Dänzer 
>
> 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).
>
I think your summary nicely covers why I am so hesitant about changing
anything around LLVM detection :-(

Regardless, thanks for making things more robust!

> v2: Keep the LLVM < 4.0 test. (llvm-config --shared-mode is actually
> available since LLVM 3.8, but that would make the test too
> complicated :)
>
> Fixes: 3d8da1f678e1 ("configure: Trust LLVM >= 4.0 llvm-config --libs
>   for shared libraries")
> Tested-by: Dieter Nützel  # v1
> Signed-off-by: Michel Dänzer 

Patch works on my end and seems correct.
Reviewed-by: Emil Velikov 

-Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2017-08-16 Thread Dieter Nützel

Tested-by: Dieter Nützel 

with

./autogen.sh --prefix=/usr/local --with-dri-drivers="" 
--with-gallium-drivers=r600,radeonsi,swrast --with-platforms=drm,x11 
--enable-nine --enable-texture-float --enable-opencl --enable-opencl_icd 
--with-vulkan-drivers=radeon


again.

Dieter

Am 16.08.2017 08:40, schrieb Michel Dänzer:

From: Michel Dänzer 

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).

v2: Keep the LLVM < 4.0 test. (llvm-config --shared-mode is actually
available since LLVM 3.8, but that would make the test too
complicated :)

Fixes: 3d8da1f678e1 ("configure: Trust LLVM >= 4.0 llvm-config --libs
  for shared libraries")
Tested-by: Dieter Nützel  # v1
Signed-off-by: Michel Dänzer 
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index e3babd3909..52645bb44f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2646,7 +2646,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_VERSION_MAJOR -lt 4 -o "`$LLVM_CONFIG
--shared-mode ${LLVM_COMPONENTS}`" = 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.

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev