Bug 94394 - Compile Mesa , specific compilation , /usr/bin/ld: cannot find -ldrm
Summary: Compile Mesa , specific compilation , /usr/bin/ld: cannot find -ldrm
Status: RESOLVED INVALID
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: 11.2
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
: 94443 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-03-04 20:03 UTC by tele
Modified: 2016-04-09 17:24 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description tele 2016-03-04 20:03:04 UTC
Hi! On 64 bit system I have only 64 bit packages,
    but I have Steam, part wine in 32bit and needs 32 bit driver,
    Problem is with Mesa, my linux distribution
    not provide Mesa 32bit package for 64 bit system,
    I tried add 32 bit repository, but it want all 32 bit dependencies.

AMD ATI driver (example)
$ locate fglrx_dri.so
/usr/lib/dri/fglrx_dri.so
/usr/lib64/dri/fglrx_dri.so


Nvidia driver (example)
$ locate libnvidia-glcore.so.352.63
/usr/lib/nvidia-current/libnvidia-glcore.so.352.63
/usr/lib64/nvidia-current/libnvidia-glcore.so.352.63

Mesa (example)
$ locate swrast_dri.so
/usr/lib64/dri/kms_swrast_dri.so
/usr/lib64/dri/swrast_dri.so

I created "wish" Steam 64 bit, but what do with games 32bit,
and 32bit apps from wine ?

So I need 32 bit drivers,
 - How compile Mesa ? 
 - I need install all 32 bit dependencies before compile on 64 bit system ?

Default compilation working without errors,
 but I have only 64 bit drivers.

I tried compile for 32 bit like this

#=========================================
./configure CC="gcc -m32" CXX="g++ -m32" --build=x86_64-pc-linux-gnu --host=i686-pc-linux-gnu --disable-static

http://wklejto.pl/249041
#=========================================

make
#============================
$ make
Making all in src
make[1]: Entering directory '/home/gg/Downloads/Down1/mesa-11.1.2/src'
Making all in .
make[2]: Entering directory '/home/gg/Downloads/Down1/mesa-11.1.2/src'
make[2]: Nie ma nic do zrobienia w 'all-am'.
make[2]: Leaving directory '/home/gg/Downloads/Down1/mesa-11.1.2/src'
Making all in gtest
make[2]: Entering directory '/home/gg/Downloads/Down1/mesa-11.1.2/src/gtest'
make[2]: Nie ma nic do zrobienia w 'all'.
make[2]: Leaving directory '/home/gg/Downloads/Down1/mesa-11.1.2/src/gtest'
Making all in util
make[2]: Entering directory '/home/gg/Downloads/Down1/mesa-11.1.2/src/util'
make  all-recursive
make[3]: Entering directory '/home/gg/Downloads/Down1/mesa-11.1.2/src/util'
Making all in .
make[4]: Entering directory '/home/gg/Downloads/Down1/mesa-11.1.2/src/util'
make[4]: Nie ma nic do zrobienia w 'all-am'.
make[4]: Leaving directory '/home/gg/Downloads/Down1/mesa-11.1.2/src/util'
Making all in tests/hash_table
make[4]: Entering directory '/home/gg/Downloads/Down1/mesa-11.1.2/src/util/tests/hash_table'
make[4]: Nie ma nic do zrobienia w 'all'.
make[4]: Leaving directory '/home/gg/Downloads/Down1/mesa-11.1.2/src/util/tests/hash_table'
make[3]: Leaving directory '/home/gg/Downloads/Down1/mesa-11.1.2/src/util'
make[2]: Leaving directory '/home/gg/Downloads/Down1/mesa-11.1.2/src/util'
Making all in mapi/glapi/gen
make[2]: Entering directory '/home/gg/Downloads/Down1/mesa-11.1.2/src/mapi/glapi/gen'
make  all-am
make[3]: Entering directory '/home/gg/Downloads/Down1/mesa-11.1.2/src/mapi/glapi/gen'
make[3]: Nie ma nic do zrobienia w 'all-am'.
make[3]: Leaving directory '/home/gg/Downloads/Down1/mesa-11.1.2/src/mapi/glapi/gen'
make[2]: Leaving directory '/home/gg/Downloads/Down1/mesa-11.1.2/src/mapi/glapi/gen'
Making all in mapi
make[2]: Entering directory '/home/gg/Downloads/Down1/mesa-11.1.2/src/mapi'
make  all-recursive
make[3]: Entering directory '/home/gg/Downloads/Down1/mesa-11.1.2/src/mapi'
make[4]: Entering directory '/home/gg/Downloads/Down1/mesa-11.1.2/src/mapi'
  CCLD     es1api/libGLESv1_CM.la
/usr/bin/ld: skipping incompatible /usr/lib64/libdrm.so when searching for -ldrm
/usr/bin/ld: cannot find -ldrm
collect2: error: ld returned 1 exit status
Makefile:1187: commands for your object 'es1api/libGLESv1_CM.la' failed
make[4]: *** [es1api/libGLESv1_CM.la] Error 1
make[4]: Leaving directory '/home/gg/Downloads/Down1/mesa-11.1.2/src/mapi'
Makefile:1637: commands for your object 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/home/gg/Downloads/Down1/mesa-11.1.2/src/mapi'
Makefile:1102: commands for your object 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/gg/Downloads/Down1/mesa-11.1.2/src/mapi'
Makefile:685: commands for your object 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/gg/Downloads/Down1/mesa-11.1.2/src'
Makefile:630: commands for your object 'all-recursive' failed
make: *** [all-recursive] Error 1
#============================
Comment 1 Emil Velikov 2016-03-04 21:10:43 UTC
I tend to recommend people getting latest mesa from their distribution. Although that's not always possible.

That aside the issue here is that you've not set the PKG_CONFIG_PATH variable to point to the 32bit .pc files, as mentioned in the instructions [1]

If you've set it and compilation still fails, feel free to reopen. For the future please attach files to bugzilla, just in case ;-)

Thanks
Emil

[1] http://www.mesa3d.org/autoconf.html
Comment 2 tele 2016-03-04 23:10:12 UTC
 - Do I need all 32 bit dependencies before compile on 64 bit system ?

#========================
$ echo $PKG_CONFIG_PATH
/usr/lib64/pkgconfig

$ echo $PKG_CONFIG_PATH
/usr/lib64/pkgconfig

$ ld -ldrm --verbose
...
attempt to open /usr/lib64/libdrm.so succeeded
-ldrm (/usr/lib64/libdrm.so)
libm.so.6 needed by /usr/lib64/libdrm.so
found libm.so.6 at /lib64/libm.so.6
libc.so.6 needed by /usr/lib64/libdrm.so
found libc.so.6 at /lib64/libc.so.6
ld-linux-x86-64.so.2 needed by /lib64/libc.so.6
found ld-linux-x86-64.so.2 at /lib64/ld-linux-x86-64.so.2
ld: warning: cannot find entry symbol _start; not setting start address


$ ls /usr/lib64/pkgconfig | grep libdrm.pc
libdrm.pc
#========================

./configure CC="gcc -m32" CXX="g++ -m32" --build=x86_64-pc-linux-gnu --host=i686-pc-linux-gnu --disable-static  PKG_CONFIG_PATH=/usr/lib64/pkgconfig

http://wklejto.pl/249051

make snd the same error
http://wklejto.pl/249052
Comment 3 tele 2016-03-04 23:11:24 UTC
* - Do I need install all 32 bit dependencies before compile on 64 bit system ?
Comment 4 Emil Velikov 2016-03-04 23:52:35 UTC
You are attempting to do a 32bit build on a 64bit platform. Thus the 32bit dependencies should be met, there is no other way ;-)
The PKG... variable should be set before the configure call, and must point the the .pc files for the 32bit libraries. 

So something like the following

$ export PKG_CONFIG_PATH=/usr/lib/pkgconfig
$ ./configure ...

As configure runs it will prompt for the missing libraries. Install those and retry,

If you want to build 64bit mesa on a 64bit platform, you don't need any 32bit libraries.

Hope that makes things clearer.
Comment 5 Emil Velikov 2016-03-08 13:06:39 UTC
*** Bug 94443 has been marked as a duplicate of this bug. ***
Comment 6 tele 2016-04-09 17:24:30 UTC
 Thanks people !

                problem SOLVED


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.