Bug 76848

Summary: /usr/bin/ld: cannot find -lLLVM-3.3
Product: Mesa Reporter: Vinson Lee <vlee>
Component: OtherAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: medium CC: emil.l.velikov
Version: gitKeywords: regression
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: automake: move GALLIUM_DRI_LIB_DEPS to Automake.inc

Description Vinson Lee 2014-03-31 16:22:30 UTC
mesa: d681b22ed77274a805c6c8e81925c18eeb57a968 (master 10.2.0-devel)

$ make check
[...]
 CC       compiler/tests/r300_compiler_tests-unit_test.o
  CCLD     r300_compiler_tests
/usr/bin/ld: cannot find -lLLVM-3.3
Comment 1 Emil Velikov 2014-03-31 19:55:33 UTC
Hi Vinson,

Do you have a commit/configure options that can be used to reproduce the problem ? Running make check works fine[1] on my system using llvm 3.4 (provided by Arch) and the following config.

    ./autogen.sh \
    --prefix=/usr \
    --sysconfdir=/etc \
    --with-dri-driverdir=/usr/lib/xorg/modules/dri \
    --with-dri-drivers= \
    --with-gallium-drivers=r300 \
    --enable-opengl \
    --enable-gles1 \
    --enable-gles2 \
    --enable-openvg \
    --enable-dri \
    --enable-glx \
    --enable-vdpau \
    --enable-egl \
    --enable-osmesa \
    --enable-xa \
    --enable-gbm \
    --disable-xlib-glx \
    --enable-gallium-egl \
    --enable-gallium-gbm \
    --enable-gallium-llvm \
    --enable-glx-tls \
    --enable-driglx-direct \
    --enable-shared-glapi \
    --disable-debug \
    --enable-texture-float \
    --enable-asm

[1] make check for r300 has always been failing for OOT builds due to unrelated reasons, but it seems to build/link just fine.
Comment 2 Vinson Lee 2014-03-31 21:12:52 UTC
Fedora 20
./autogen.sh --with-dri-drivers= --with-gallium-drivers=r300
make
make check
Comment 3 Emil Velikov 2014-03-31 22:00:02 UTC
Don't have Fedora 20 at hand and the config works fine under Arch. I'm suspecting a bug in the llvm package and/or non standard libdir (llvm-config --libdir).

Can you bisect ?
Comment 4 Vinson Lee 2014-03-31 22:56:19 UTC
2d9c33009a62b704e64b49b87ed1cee9c8dcb12b is the first bad commit
commit 2d9c33009a62b704e64b49b87ed1cee9c8dcb12b
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Tue Mar 11 13:34:53 2014 +0000

    gallium/targets: move LLVM_LIBS handling inside Automake.inc
    
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

:040000 040000 8bea3c15c0401596f567832b30c3030e1c702c14 dceb32cb4fe209284f129450a1cd3c25f1655ac4 M	src
bisect run success
Comment 5 Emil Velikov 2014-04-01 01:11:45 UTC
Created attachment 96690 [details] [review]
automake: move GALLIUM_DRI_LIB_DEPS to Automake.inc

Nice, I forgot the "special" handling of GALLIUM_DRI_LIB_DEPS. The attached commit should resolve the problem although I cannot check it locally as I still cannot reproduce the problem.
Comment 6 Emil Velikov 2014-04-01 02:58:36 UTC
If the patch in commit 5 does not resolve the problem the following two will be needed to resolve the "funny" situation.

[1] http://patchwork.freedesktop.org/patch/23307/
[2] http://patchwork.freedesktop.org/patch/23309/
Comment 7 Vinson Lee 2014-04-03 16:45:30 UTC
attachment 96690 [details] [review] alone does not fix make check.

With all three patches applied, make check passes.

Tested-by: Vinson Lee <vlee@freedesktop.org>
Comment 8 Emil Velikov 2014-04-05 13:12:55 UTC
Thanks for the confirmation Vinson.

Pushed to master

Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Tue Apr 1 02:05:57 2014 +0100

    automake: move GALLIUM_DRI_LIB_DEPS to Automake.inc

    With recent commit we started de-duplicating all of the compiler/
    linker flags moving their handling inside Automake.inc.

    This did not take into consideration that the above variable was set
    at configure time, leading to issues on certain build combinations.

    Move the variable to where it's used/handled thus cleaning up
    configure.ac.

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76848
    Tested-by: Vinson Lee <vlee@freedesktop.org>
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

commit ba5eba500884c85792b3de38c90a70b4b11dc432
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Tue Apr 1 02:34:08 2014 +0100

    automake: introduce GALLIUM_COMMON_LIB_DEPS

    Rather than copying the core four dependencies all over gallium,
    introduce the above variable to avoid all the duplication.

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76848
    Tested-by: Vinson Lee <vlee@freedesktop.org>
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

commit c8129604ef8a8c4e71e304b4deb66ebb818a7758
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Tue Apr 1 02:45:22 2014 +0100

    drivers/r300: use GALLIUM_COMMON_LIB_DEPS

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76848
    Tested-by: Vinson Lee <vlee@freedesktop.org>
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.