Bug 45458 - mesa will not compile in 32bit mode on a 64bit machine that is setup to do that
Summary: mesa will not compile in 32bit mode on a 64bit machine that is setup to do that
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-31 11:18 UTC by Kevin DeKorte
Modified: 2012-01-31 20:30 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Kevin DeKorte 2012-01-31 11:18:23 UTC
git ffe376d5a74dee837dc1a421de29ae551087630f

./autogen.sh --prefix=/usr --libdir=/usr/lib --with-dri-drivers="" --with-galliu
m-drivers=r600,swrast --enable-gallium-egl --enable-openvg --enable-gles1 --enab
le-gles2 --enable-texture-float --enable-vdpau --enable-xvmc --enable-osmesa --e
nable-32-bit --enable-gallium-llvm --enable-texture-float

This command worked properly on 1/30/2012. I'm guessing that the LDFLAGS is not properly set in the Makefile. In my Makefile in src/glsl LDFLAGS is not set. It should contain something like -m32 or $(ARCH_FLAGS)



gmake[4]: Entering directory `/home/kdekorte/git/mesa-32/src/glsl'
  CXXLD  libglsl.la
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.6.2/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.6.2/../../../../lib64/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/../lib64/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.6.2/../../../../lib64/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/../lib64/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.6.2/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/gcc/x86_64-redhat-linux/4.6.2/../../../../lib64/crti.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/gcc/x86_64-redhat-linux/4.6.2/crtbeginS.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/gcc/x86_64-redhat-linux/4.6.2/crtendS.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/gcc/x86_64-redhat-linux/4.6.2/../../../../lib64/crtn.o' is incompatible with i386 output
collect2: ld returned 1 exit status
gmake[4]: *** [libglsl.la] Error 1
gmake[4]: Leaving directory `/home/kdekorte/git/mesa-32/src/glsl'
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory `/home/kdekorte/git/mesa-32/src/glsl'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/home/kdekorte/git/mesa-32/src/glsl'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/home/kdekorte/git/mesa-32/src'
make: *** [default] Error 1
Comment 1 Kevin DeKorte 2012-01-31 11:58:45 UTC
After additional research it appears the build triplet is wrong. I don't think that the --enable-32-bit flag is being honored by libglsl
Comment 2 Kenneth Graunke 2012-01-31 12:13:40 UTC
Yeah, I'm pretty sure this broke a while back.  It -should- work if you do:

CFLAGS='-m32' CXXFLAGS='-m32' ./autogen.sh --enable-32-bit --more-options-here

Which also has the added benefit of allowing you to select whether you want -O2 or not.  That said, it'd probably be nice to add -m32 to CFLAGS and CXXFLAGS when --enable-32-bit is passed.  Matt, do you agree?
Comment 3 Matt Turner 2012-01-31 12:19:37 UTC
If that fixes it, then yeah.

The real solution is to automake everything and then kill the --enable-{32,64}-bit flags.
Comment 4 Kevin DeKorte 2012-01-31 12:21:22 UTC
Adding those flags before autogen does seem to fix it, but shouldn't that be what --enable-32-bit does?
Comment 5 Kevin DeKorte 2012-01-31 12:22:28 UTC
I think we want the --enable-32-bit so that we can build 32bit binaries on a 64bit machine so that we can run 32bit applications.
Comment 6 Matt Turner 2012-01-31 12:33:05 UTC
(In reply to comment #4)
> Adding those flags before autogen does seem to fix it, but shouldn't that be
> what --enable-32-bit does?

Yes. Please send a patch. :)

(In reply to comment #5)
> I think we want the --enable-32-bit so that we can build 32bit binaries on a
> 64bit machine so that we can run 32bit applications.

No, with proper automake you specify --build, --target, --host to do this, not hacky --enable-32-bit flags.
Comment 7 Ian Romanick 2012-01-31 15:47:23 UTC
32-bit-on-64-bit builds have been broken for some time.  I report this back in October of 2011: bug #41700.
Comment 8 Kevin DeKorte 2012-01-31 16:12:40 UTC
I had this working yesterday and with the patch in bug #45466 I can get to compile again.
Comment 9 Matt Turner 2012-01-31 20:30:59 UTC
Patches reverts. So, fixed, I guess.


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.