Bug 52435 - Classic DRI drivers fail to install when libdricore8.1.0.so isn't already in the system
Summary: Classic DRI drivers fail to install when libdricore8.1.0.so isn't already in ...
Status: RESOLVED NOTABUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: All Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-24 09:09 UTC by Laurent carlier
Modified: 2012-09-29 08:29 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Possible fix (2.64 KB, patch)
2012-07-24 09:09 UTC, Laurent carlier
Details | Splinter Review

Description Laurent carlier 2012-07-24 09:09:42 UTC
Created attachment 64595 [details] [review]
Possible fix

mesa from git/x86_64;
with the following install script:

make -C src/mesa/drivers/dri/radeon DESTDIR="${pkgdir}" install
make -C src/mesa/drivers/dri/r200 DESTDIR="${pkgdir}" install
# gallium3D driver for r300,r600
make -C src/gallium/targets/dri-r300 DESTDIR="${pkgdir}" install
make -C src/gallium/targets/dri-r600 DESTDIR="${pkgdir}" install

Produce:

---8<---
make: Entering directory `/build/src/mesa-git/src/mesa/drivers/dri/radeon'
/bin/mkdir -p ../../../../../lib;
ln -f .libs/radeon_dri.so ../../../../../lib/radeon_dri.so;
make[1]: Entering directory `/build/src/mesa-git/src/mesa/drivers/dri/radeon'
make[1]: Nothing to be done for `install-exec-am'.
 /bin/mkdir -p '/build/pkg/ati-dri-git/usr/lib/xorg/modules/dri'
 /bin/sh ../../../../../libtool   --mode=install /usr/bin/install -c   
radeon_dri.la '/build/pkg/ati-dri-git/usr/lib/xorg/modules/dri'
libtool: install: warning: relinking `radeon_dri.la'
libtool: install: (cd /build/src/mesa-git/src/mesa/drivers/dri/radeon; /bin/sh 
/build/src/mesa-git/libtool  --silent --tag CC --mode=relink gcc -DRADEON_R100 
-I../../../../../include -I../../../../../src/ -I../../../../../src/mapi -
I../../../../../src/mesa/ -I../../../../../src/mesa/drivers/dri/common -
I../../../../../src/mesa/drivers/dri/radeon/server -D_GNU_SOURCE -DPTHREADS -
DTEXTURE_FLOAT_ENABLED -DUSE_X86_64_ASM -DHAVE_POSIX_MEMALIGN -DIN_DRI_DRIVER 
-DUSE_XCB -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_TLS -
DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DHAVE_ALIAS -
DHAVE_MINCORE -DHAVE_LIBUDEV -DHAVE_LLVM=0x0301 -DFEATURE_GL=1 -DFEATURE_ES1=1 
-DFEATURE_ES2=1 -I/usr/include/libdrm -march=x86-64 -mtune=generic -O2 -pipe -
fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wall -std=c99 
-Werror=implicit-function-declaration -Werror=missing-prototypes -fno-strict-
aliasing -fno-builtin-memcmp -march=x86-64 -mtune=generic -O2 -pipe -fstack-
protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -module -avoid-version 
-shared -Wl,-O1,--sort-common,--as-needed,-z,relro -o radeon_dri.la -rpath 
/usr/lib/xorg/modules/dri radeon_buffer_objects.lo radeon_common_context.lo 
radeon_common.lo radeon_dma.lo radeon_debug.lo radeon_fbo.lo radeon_fog.lo 
radeon_mipmap_tree.lo radeon_pixel_read.lo radeon_queryobj.lo radeon_span.lo 
radeon_texture.lo radeon_tex_copy.lo radeon_tile.lo radeon_context.lo 
radeon_ioctl.lo radeon_screen.lo radeon_state.lo radeon_state_init.lo 
radeon_tex.lo radeon_texstate.lo radeon_tcl.lo radeon_swtcl.lo radeon_maos.lo 
radeon_sanity.lo radeon_blit.lo 
../../../../../src/mesa/libdricore/libdricore8.1.0.la -ldrm -lexpat -lm -
lpthread -ldl -ldrm_radeon ../common/libdricommon.la -inst-prefix-dir 
/build/pkg/ati-dri-git)
/usr/bin/ld: cannot find -ldricore8.1.0
collect2: error: ld returned 1 exit status
libtool: install: error: relink `radeon_dri.la' with the above command before 
installing it
make[1]: *** [install-driLTLIBRARIES] Error 1
make[1]: Leaving directory `/build/src/mesa-git/src/mesa/drivers/dri/radeon'
make: *** [install-am] Error 2
make: Leaving directory `/build/src/mesa-git/src/mesa/drivers/dri/radeon'
---8<---
Comment 1 Jon Turney 2012-07-24 13:09:58 UTC
Um, error might be correct.

For some reason, libtool has determined it needs to relink these driver libraries when installing them, so you need have an installed libdricore as well.

So why not 'make -C src/mesa/dricore DESTDIR="${pkgdir}" install' first?

(Presumably, if you used the top-level install target, we would do all these things in the correct order for you)
Comment 2 Laurent carlier 2012-07-24 13:27:11 UTC
(In reply to comment #1)
> Um, error might be correct.
> 
> For some reason, libtool has determined it needs to relink these driver
> libraries when installing them, so you need have an installed libdricore as
> well.
> 
> So why not 'make -C src/mesa/dricore DESTDIR="${pkgdir}" install' first?
> 
> (Presumably, if you used the top-level install target, we would do all these
> things in the correct order for you)

AFAIK (not tested) it should not properly link as well as ${pkgdir}/usr/lib isn't necesseraly in the search path of libtool/linker
Comment 3 Laurent carlier 2012-07-24 14:20:37 UTC
(In reply to comment #1)
> Um, error might be correct.
> 
> For some reason, libtool has determined it needs to relink these driver
> libraries when installing them, so you need have an installed libdricore as
> well.
> 
> So why not 'make -C src/mesa/dricore DESTDIR="${pkgdir}" install' first?
> 
> (Presumably, if you used the top-level install target, we would do all these
> things in the correct order for you)

I've tried also that and it raise the error:

  cd ${srcdir}/mesa-git

  ./autogen.sh --prefix=/usr --sysconfdir=/etc \
  --with-dri-driverdir=/usr/lib/xorg/modules/dri \
  --with-gallium-drivers=r300,r600,nouveau,swrast,svga \
  --with-egl-platforms=drm,x11 \
  --enable-gallium-llvm \
  --enable-gallium-egl \
  --enable-glx-tls \
  --enable-glx \
  --enable-gles1 \
  --enable-gles2 \
  --enable-egl \
  --enable-r600-llvm-compiler \
  --enable-shared-glapi \
  --enable-texture-float \
  --enable-xa \
  --enable-gbm \
  --enable-osmesa \
  --enable-vdpau 

  make
  make -C src/mesa/drivers/dri/radeon DESTDIR="${pkgdir}" install

--> error

The fix i've found is to add -L$(top_builddir)\/$(LIB_DIR) in the Makefile.am files for radeon,r200,i915,i965,nouveau drivers (see patch provided)

You can find various forum thread about libtool and relinking problems.
Comment 4 Matt Turner 2012-09-27 23:48:12 UTC
I think this is fixed. Reopen if you can still reproduce.
Comment 5 Laurent carlier 2012-09-28 07:00:06 UTC
Not fixed:

==> Starting package_ati-dri-git()...
make: Entering directory `/build/src/mesa-git/src/mesa/drivers/dri/radeon'
/usr/bin/mkdir -p ../../../../../lib;
ln -f .libs/radeon_dri.so ../../../../../lib/radeon_dri.so;
make[1]: Entering directory `/build/src/mesa-git/src/mesa/drivers/dri/radeon'
make[1]: Nothing to be done for `install-exec-am'.
 /usr/bin/mkdir -p '/build/pkg/ati-dri-git/usr/lib/xorg/modules/dri'
 /bin/sh ../../../../../libtool   --mode=install /usr/bin/install -c   radeon_dri.la '/build/pkg/ati-dri-git/usr/lib/xorg/modules/dri'
libtool: install: warning: relinking `radeon_dri.la'
libtool: install: (cd /build/src/mesa-git/src/mesa/drivers/dri/radeon; /bin/sh /build/src/mesa-git/libtool  --silent --tag CC --mode=relink gcc -DRADEON_R100 -I../../../../../include -I../../../../../src/ -I../../../../../src/mapi -I../../../../../src/mesa/ -I../../../../../src/mesa/drivers/dri/common -I../../../../../src/mesa/drivers/dri/radeon/server -D_GNU_SOURCE -DPTHREADS -DTEXTURE_FLOAT_ENABLED -DUSE_X86_64_ASM -DHAVE_DLOPEN -DHAVE_POSIX_MEMALIGN -DIN_DRI_DRIVER -DUSE_XCB -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_TLS -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DHAVE_ALIAS -DHAVE_MINCORE -DHAVE_LIBUDEV -DHAVE_LLVM=0x0301 -DFEATURE_GL=1 -DFEATURE_ES1=1 -DFEATURE_ES2=1 -I/usr/include/libdrm -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wall -std=c99 -Werror=implicit-function-declaration -Werror=missing-prototypes -fno-strict-aliasing -fno-builtin-memcmp -module -avoid-version -shared -Wl,-O1,--sort-common,--as-needed,-z,relro -o radeon_dri.la -rpath /usr/lib/xorg/modules/dri radeon_buffer_objects.lo radeon_common_context.lo radeon_common.lo radeon_dma.lo radeon_debug.lo radeon_fbo.lo radeon_fog.lo radeon_mipmap_tree.lo radeon_pixel_read.lo radeon_queryobj.lo radeon_span.lo radeon_texture.lo radeon_tex_copy.lo radeon_tile.lo radeon_context.lo radeon_ioctl.lo radeon_screen.lo radeon_state.lo radeon_state_init.lo radeon_tex.lo radeon_texstate.lo radeon_tcl.lo radeon_swtcl.lo radeon_maos.lo radeon_sanity.lo radeon_blit.lo ../../../../../src/mesa/libdricore/libdricore9.1.0.la -ldrm -lexpat -lm -lpthread -ldl -ldrm_radeon ../common/libdricommon.la -inst-prefix-dir /build/pkg/ati-dri-git)
/usr/bin/ld: cannot find -ldricore9.1.0
collect2: error: ld returned 1 exit status
libtool: install: error: relink `radeon_dri.la' with the above command before installing it
make[1]: *** [install-driLTLIBRARIES] Error 1
make[1]: Leaving directory `/build/src/mesa-git/src/mesa/drivers/dri/radeon'
make: *** [install-am] Error 2
make: Leaving directory `/build/src/mesa-git/src/mesa/drivers/dri/radeon'
==> ERROR: A failure occurred in package_ati-dri-git().
    Aborting...
==> ERROR: Build failed, check /var/lib/archbuild/mesagit-x86_64/lordh/build
Comment 6 Ian Romanick 2012-09-28 15:13:25 UTC
From the original filing date, I assume this also occurs on the 9.0 release branch?  If so, this sounds like a release blocker...
Comment 7 Matt Turner 2012-09-28 18:11:08 UTC
Okay, I can reproduce.

> make -C src/mesa/drivers/dri/radeon DESTDIR="${pkgdir}" install

This is the relevant part. I guess I don't understand why you want to run make install on individual directories?

Anyway, from the manual (http://www.gnu.org/software/libtool/manual/html_node/Install-mode.html):

> inst-prefix is also used to insure that if the installed object must be relinked upon installation, that it is relinked against the libraries in inst-prefix-dir/prefix, not prefix.

Thus, you need to make install libdricore into the inst-prefix before you can make install DRI drivers that depend on it.

I did

> make -C src/mesa/libdricore/ DESTDIR=`pwd`/p install

before

> make -C src/mesa/drivers/dri/radeon DESTDIR=`pwd`/p install

and everything worked.

As such, I think this isn't a bug. Let me know if you agree.
Comment 8 Laurent carlier 2012-09-29 08:28:51 UTC
Sure, it's not a real bug.

Closing.


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.