When crosscompiling, building GLU 32 bit on 64 bit system fails: CXXLD libGLU.la /usr/lib/x86_64-linux-gnu/libGL.so: could not read symbols: File in wrong format collect2: error: ld returned 1 exit status make: *** [libGLU.la] Error 1 I use the following to build: if [ "$BUILD32" = "true" ]; then echo "Building 32 bit" export CFLAGS='-m32' export CXXFLAGS='-m32' export LLVM_CONFIG='/usr/bin/llvm-config32' ./autogen.sh --build=x86_64-pc-linux-gnu --host=i686-pc-linux-gnu --prefix=/usr --libdir=/usr/lib/i386-linux-gnu --includedir=/usr/include/i386-linux-gnu fi make -j $NUM_THREADS
I built with both CFLAGS="-m32" CXXFLAGS="-m32" ./autogen.sh --prefix=/usr --libdir=/usr/lib32 --build=x86_64-pc-linux-gnu --host=i686-pc-linux-gnu and CFLAGS="-m32" CXXFLAGS="-m32" ./autogen.sh --prefix=/usr --libdir=/usr/lib32 locally and it works. This is some kind of problem local to you.
(In reply to comment #2) > I built with both > > CFLAGS="-m32" CXXFLAGS="-m32" ./autogen.sh --prefix=/usr --libdir=/usr/lib32 > --build=x86_64-pc-linux-gnu --host=i686-pc-linux-gnu > > and > > CFLAGS="-m32" CXXFLAGS="-m32" ./autogen.sh --prefix=/usr --libdir=/usr/lib32 > > locally and it works. This is some kind of problem local to you. Maybe you can help me identify my problem then. Doing ldconfig -p | grep libGL.so returns libGL.so.1 (libc6,x86-64, OS ABI: Linux 2.4.20) => /usr/lib/libGL.so.1 libGL.so.1 (libc6) => /usr/lib32/libGL.so.1 libGL.so (libc6,x86-64, OS ABI: Linux 2.4.20) => /usr/lib/libGL.so libGL.so (libc6) => /usr/lib32/libGL.so so the linker knows it exists. Everything is where it is expected to be from what I can see. Any clue where I should dig?
I've found out what is wrong. By comparing Makefile with another project, it seems GL_LIBS is defined as GL_LIBS = -L/usr/lib/x86_64-linux-gnu -lGL, but it should only be GL_LIBS = -lGL. If GL_LIBS was only defined as -lGL, it would work for both 32 and 64 bit (tested).
This sounds to me like a libtool issue, bug #50754 has possible fix you could try for this.
(In reply to comment #5) > This sounds to me like a libtool issue, bug #50754 has possible fix you > could try for this. For now, I'm just setting PKG_CONFIG_PATH to the 32 bit or the 64 bit path as needed. However, I know by default both my paths are set in the PKG_CONFIG_PATH variable and I was a trick I used to fix a similar problem with mesa.
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.