Bug 98842 - mesa 13.0.1 build broken under debian8
Summary: mesa 13.0.1 build broken under debian8
Status: RESOLVED INVALID
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: 13.0
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL: https://bugs.freedesktop.org/show_bug...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-24 07:09 UTC by yjdwbj
Modified: 2017-09-11 15:04 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
attachment-4137-0.html (6.98 KB, text/html)
2016-12-04 14:41 UTC, yjdwbj
Details

Description yjdwbj 2016-11-24 07:09:35 UTC
~/mesa-13.0.1/build# ../autogen.sh --enable-dri --enable-glx --enable-vdpau  --enable-opencl --enable-opencl-icd   --enable-glx-tls --with-llvm-prefix=/root/clang+llvm-3.8.1-x86_64-linux-gnu-debian8 --disable-llvm-shared-libs --enable-egl --enable-gbm --enable-texture-float --enable-xa --with-gallium-drivers=$GLL_DRV --with-dri-drivers=radeon --with-egl-platforms=drm,x11 --enable-gles1 --enable-gles2 --enable-osmesa && make -j 10

# make install
[....]

 /bin/mkdir -p '/usr/local/lib'
 /bin/bash ../../libtool   --mode=install /usr/bin/install -c   libGL.la '/usr/local/lib'
libtool: install: warning: relinking `libGL.la'
libtool: install: (cd /root/mesa-13.0.1/build/src/glx; /bin/bash /root/mesa-13.0.1/build/libtool  --silent --tag CC --mode=relink gcc -I../../../include -I../../../include/GL/internal -I../../../src -I../../../src/loader -I../../../src/mapi -I../../../src/mapi/glapi -I../../src/mapi -I../../src/mapi/glapi -fvisibility=hidden -DGLX_SHARED_GLAPI -DXF86VIDMODE -D_REENTRANT -DDEFAULT_DRIVER_DIR=\"/usr/local/lib/dri\" -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D_GNU_SOURCE -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS -DNDEBUG -DTEXTURE_FLOAT_ENABLED -DUSE_X86_64_ASM -DHAVE_XLOCALE_H -DHAVE_SYS_SYSCTL_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_DLOPEN -DHAVE_POSIX_MEMALIGN -DHAVE_LIBDRM -DGLX_USE_DRM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_TLS -DHAVE_ALIAS -DHAVE_DRI3 -DHAVE_MINCORE -DHAVE_ST_VDPAU -DHAVE_LLVM=0x0308 -DMESA_LLVM_VERSION_PATCH=1 -I/usr/local/include -I/usr/local/include/libdrm -I/usr/local/include -DGL_LIB_NAME=\"libGL.so.1\" -g -O2 -Wall -std=c99 -Werror=implicit-function-declaration -Werror=missing-prototypes -fno-math-errno -fno-trapping-math -no-undefined -version-number 1:2 -Wl,-Bsymbolic -Wl,--gc-sections -Wl,--no-undefined -o libGL.la -rpath /usr/local/lib libglx.la ../../src/mapi/glapi/libglapi.la ../../src/mapi/shared-glapi/libglapi.la -lXext -lXdamage -lXfixes -lX11-xcb -lX11 -lxcb-glx -lxcb-dri2 -lxcb -lXxf86vm -L/usr/local/lib -ldrm -lm -lpthread -ldl )
./.libs/libglx.a(libloader_la-loader.o): In function `drm_get_pci_id_for_fd':
/root/mesa-13.0.1/build/src/loader/../../../src/loader/loader.c:278: undefined reference to `drmGetDevice'
/root/mesa-13.0.1/build/src/loader/../../../src/loader/loader.c:288: undefined reference to `drmFreeDevice'
./.libs/libglx.a(libloader_la-loader.o): In function `drm_get_id_path_tag_for_fd':
/root/mesa-13.0.1/build/src/loader/../../../src/loader/loader.c:148: undefined reference to `drmGetDevice'
/root/mesa-13.0.1/build/src/loader/../../../src/loader/loader.c:152: undefined reference to `drmFreeDevice'
./.libs/libglx.a(libloader_la-loader.o): In function `loader_get_user_preferred_fd':
/root/mesa-13.0.1/build/src/loader/../../../src/loader/loader.c:182: undefined reference to `drmGetDevices'
/root/mesa-13.0.1/build/src/loader/../../../src/loader/loader.c:220: undefined reference to `drmFreeDevices'
/root/mesa-13.0.1/build/src/loader/../../../src/loader/loader.c:215: undefined reference to `drmFreeDevices'
collect2: error: ld returned 1 exit status
libtool: install: error: relink `libGL.la' with the above command before installing it
Makefile:758: recipe for target 'install-libLTLIBRARIES' failed
make[5]: *** [install-libLTLIBRARIES] Error 1
make[5]: Leaving directory '/root/mesa-13.0.1/build/src/glx'
Makefile:1061: recipe for target 'install-am' failed
make[4]: *** [install-am] Error 2
make[4]: Leaving directory '/root/mesa-13.0.1/build/src/glx'
Makefile:898: recipe for target 'install-recursive' failed
make[3]: *** [install-recursive] Error 1
make[3]: Leaving directory '/root/mesa-13.0.1/build/src/glx'
Makefile:854: recipe for target 'install-recursive' failed
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory '/root/mesa-13.0.1/build/src'
Makefile:1011: recipe for target 'install' failed
make[1]: *** [install] Error 2
make[1]: Leaving directory '/root/mesa-13.0.1/build/src'
Makefile:641: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
Comment 1 Emil Velikov 2016-11-24 15:53:47 UTC
Can you search through your system for the following files libdrm.so and libdrm.pc.
For both, provide the exact location. And the contents in for the latter.

Thanks
Comment 2 yjdwbj 2016-11-25 09:03:45 UTC
(In reply to Emil Velikov from comment #1)
> Can you search through your system for the following files libdrm.so and
> libdrm.pc.
> For both, provide the exact location. And the contents in for the latter.
> 
> Thanks

# ls /usr/local/lib/libdrm_*                                                           
/usr/local/lib/libdrm_amdgpu.la    /usr/local/lib/libdrm_amdgpu.so.1.0.0  /usr/local/lib/libdrm_radeon.so.1                         
/usr/local/lib/libdrm_amdgpu.so    /usr/local/lib/libdrm_radeon.la        /usr/local/lib/libdrm_radeon.so.1.0.1                     
/usr/local/lib/libdrm_amdgpu.so.1  /usr/local/lib/libdrm_radeon.so 


~/mesa-13.0.1/build/src/glx# ls /usr/local/lib/pkgconfig/libdrm.pc                                                
/usr/local/lib/pkgconfig/libdrm.pc                                                                                                  
root@ebd207b11d70:~/mesa-13.0.1/build/src/glx# cat /usr/local/lib/pkgconfig/libdrm.pc                                               
prefix=/usr/local                                                                                                                   
exec_prefix=${prefix}                                                                                                               
libdir=${exec_prefix}/lib                                                                                                           
includedir=${prefix}/include                                                                                                        
~                                                                                                                                   
Name: libdrm                                                                                                                        
Description: Userspace interface to kernel DRM services                                                                             
Version: 2.4.71                                                                                                                     
Libs: -L${libdir} -ldrm                                                                                                             
Cflags: -I${includedir} -I${includedir}/libdrm
Comment 3 Emil Velikov 2016-11-25 15:49:22 UTC
libdrm_* files are irrelevant here. libdrm.so* is the ones of interest.

Are you sure your system does not have other libdrm.so* and libdrm.pc files ?
Comment 4 Emil Velikov 2016-11-25 15:49:51 UTC
The only things which comes to mind is that you have the system ones (in /usr/lib or similar for Debian) and we and up picking the wrong one during relink due to a libtool feature (more like a bug imho).

I.e. we end up with something like the following (check with $make V=1 install)
... -L/usr/lib ... -L/usr/local/lib ... -ldrm ...

Some solutions/workarounds include:
 - teach libtool to use the same link line on relink
I have no success on this one, yet.
 - use chroot (or similar solution)
Needs some setup, but should work
 - temporary move/upgrade the specified package
A bit nasty, does not scale but should work.
 - use another libtool ?
Don't recall how exactly slibtool performed here.
Comment 5 yjdwbj 2016-12-04 14:41:05 UTC
Created attachment 128331 [details]
attachment-4137-0.html

no , have another libdrm package.

dpkg -l  | grep "libdrm"
ri  libdrm-dev:amd64
2.4.58-2                             amd64        Userspace interface to
kernel DRM services -- development files
ri  libdrm-intel1:amd64
2.4.58-2                             amd64        Userspace interface to
intel-specific kernel DRM services -- runtime
ri  libdrm-intel1:i386
2.4.58-2                             i386         Userspace interface to
intel-specific kernel DRM services -- runtime
rc  libdrm-nouveau1a:amd64
2.4.40-1~deb7u2                      amd64        Userspace interface to
nouveau-specific kernel DRM services -- runtime
rc  libdrm-nouveau1a:i386
2.4.40-1~deb7u2                      i386         Userspace interface to
nouveau-specific kernel DRM services -- runtime
ri  libdrm-nouveau2:amd64
2.4.58-2                             amd64        Userspace interface to
nouveau-specific kernel DRM services -- runtime
ri  libdrm-nouveau2:i386
2.4.58-2                             i386         Userspace interface to
nouveau-specific kernel DRM services -- runtime
ri  libdrm-radeon1:amd64
2.4.58-2                             amd64        Userspace interface to
radeon-specific kernel DRM services -- runtime
ri  libdrm-radeon1:i386
2.4.58-2                             i386         Userspace interface to
radeon-specific kernel DRM services -- runtime
ii  libdrm2:amd64
2.4.58-2                             amd64        Userspace interface to
kernel DRM services -- runtime
ii  libdrm2:i386
2.4.58-2                             i386         Userspace interface to
kernel DRM services -- runtime

----------------------------------------------------------------------


 dpkg -L libdrm2:amd64
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/libdrm2
/usr/share/doc/libdrm2/changelog.Debian.gz
/usr/share/doc/libdrm2/NEWS.Debian.gz
/usr/share/doc/libdrm2/copyright
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libdrm.so.2.4.0
/usr/lib/x86_64-linux-gnu/libdrm.so.2

-------------------------------------------------------------------------------
michael@debian:~$ dpkg -L libdrm-dev:amd64
/.
/usr
/usr/share
/usr/share/man
/usr/share/man/man3
/usr/share/man/man3/drmHandleEvent.3.gz
/usr/share/man/man3/drmAvailable.3.gz
/usr/share/man/man3/drmModeGetResources.3.gz
/usr/share/man/man7
/usr/share/man/man7/drm-memory.7.gz
/usr/share/man/man7/drm-kms.7.gz
/usr/share/man/man7/drm.7.gz
/usr/share/doc
/usr/share/doc/libdrm-dev
/usr/share/doc/libdrm-dev/changelog.Debian.gz
/usr/share/doc/libdrm-dev/copyright
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libdrm_nouveau.a
/usr/lib/x86_64-linux-gnu/libdrm.a
/usr/lib/x86_64-linux-gnu/pkgconfig
/usr/lib/x86_64-linux-gnu/pkgconfig/libdrm_intel.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/libdrm.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/libdrm_radeon.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/libdrm_nouveau.pc
/usr/lib/x86_64-linux-gnu/libdrm_intel.a
/usr/lib/x86_64-linux-gnu/libdrm_radeon.a
/usr/include
/usr/include/xf86drmMode.h
/usr/include/xf86drm.h
/usr/include/libdrm
/usr/include/libdrm/intel_debug.h
/usr/include/libdrm/r600_pci_ids.h
/usr/include/libdrm/radeon_bo_gem.h
/usr/include/libdrm/nouveau_drm.h
/usr/include/libdrm/drm.h
/usr/include/libdrm/savage_drm.h
/usr/include/libdrm/drm_sarea.h
/usr/include/libdrm/r128_drm.h
/usr/include/libdrm/intel_bufmgr.h
/usr/include/libdrm/drm_fourcc.h
/usr/include/libdrm/mach64_drm.h
/usr/include/libdrm/sis_drm.h
/usr/include/libdrm/intel_aub.h
/usr/include/libdrm/radeon_bo_int.h
/usr/include/libdrm/radeon_drm.h
/usr/include/libdrm/radeon_cs_gem.h
/usr/include/libdrm/via_drm.h
/usr/include/libdrm/nouveau.h
/usr/include/libdrm/radeon_surface.h
/usr/include/libdrm/vmwgfx_drm.h
/usr/include/libdrm/radeon_cs_int.h
/usr/include/libdrm/qxl_drm.h
/usr/include/libdrm/radeon_cs.h
/usr/include/libdrm/i915_drm.h
/usr/include/libdrm/mga_drm.h
/usr/include/libdrm/radeon_bo.h
/usr/include/libdrm/drm_mode.h
/usr/share/man/man7/drm-gem.7.gz
/usr/share/man/man7/drm-ttm.7.gz
/usr/share/man/man7/drm-mm.7.gz
/usr/lib/x86_64-linux-gnu/libdrm_nouveau.so
/usr/lib/x86_64-linux-gnu/libdrm_radeon.so
/usr/lib/x86_64-linux-gnu/libdrm_intel.so
/usr/lib/x86_64-linux-gnu/libdrm.so


2016-11-25 23:49 GMT+08:00 <bugzilla-daemon@freedesktop.org>:

> *Comment # 3 <https://bugs.freedesktop.org/show_bug.cgi?id=98842#c3> on
> bug 98842 <https://bugs.freedesktop.org/show_bug.cgi?id=98842> from Emil
> Velikov <emil.l.velikov@gmail.com> *
>
> libdrm_* files are irrelevant here. libdrm.so* is the ones of interest.
>
> Are you sure your system does not have other libdrm.so* and libdrm.pc files ?
>
> ------------------------------
> You are receiving this mail because:
>
>    - You reported the bug.
>
>
Comment 6 Emil Velikov 2017-09-11 15:04:29 UTC
So it's a case exactly as described in comment 4.

If you're using non-system libraries (dependencies) you need to ensure that those are picked. Simplest way is to set LD_LIBRARY_PATH. In your case

$ export LD_LIBRARY_PATH=/usr/local/lib/
$ .../autogen.sh ...
$ ...

Comment 4 has other suggestions if you don't like this one.


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.