Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#22963 closed defect (fixed)

mesa: libGLU and libglut aren't universal if file port is installed

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version: 1.8.1
Keywords: Cc:
Port: mesa

Description

After installing mesa +universal, two of its three libraries are not universal:

$ cd /opt/local/var/macports/software/mesa/7.6_1+hw_render+universal && find . -type f | xargs -n 1 lipo -info 2>/dev/null
Architectures in the fat file: ./opt/local/bin/glxgears are: x86_64 i386 
Architectures in the fat file: ./opt/local/bin/glxinfo are: x86_64 i386 
Architectures in the fat file: ./opt/local/lib/libGL.1.2.dylib are: x86_64 i386 
Non-fat file: ./opt/local/lib/libGLU.1.3.dylib is architecture: x86_64
Non-fat file: ./opt/local/lib/libglut.3.7.dylib is architecture: x86_64

This is on Snow Leopard.

Attachments (1)

mesa-ryandesign.txt.bz2 (12.1 KB) - added by ryandesign (Ryan Carsten Schmidt) 14 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 14 years ago by jeremyhu (Jeremy Huddleston Sequoia)

$ file /opt/local/lib/libglut.3.7.dylib 
/opt/local/lib/libglut.3.7.dylib: Mach-O universal binary with 2 architectures
/opt/local/lib/libglut.3.7.dylib (for architecture i386):	Mach-O dynamically linked shared library i386
/opt/local/lib/libglut.3.7.dylib (for architecture x86_64):	Mach-O 64-bit dynamically linked shared library x86_64

Mine was built before r61548

comment:2 in reply to:  1 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to jeremyhu@…:

Mine was built before r61548

So was mine (October 18, 2009).

comment:3 Changed 14 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Using current trunk, it's building fine for me...

libGL.dylib is from AppleSGLX, so the others are from mesa, but they should be built right since RC_CFLAGS is being set:

DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_Users_jeremy_src_macports-trunk_dports_x11_mesa/work/Mesa-7.6" && /usr/bin/make default INSTALL_DIR=/opt/local CC=/usr/bin/gcc-4.2 CXX=/usr/bin/g++-4.2 RC_CFLAGS="-arch x86_64 -arch i386"'
work/destroot/opt/local/lib/libglut.dylib:     Mach-O universal binary with 2 architectures
work/destroot/opt/local/lib/libglut.dylib (for architecture i386):	Mach-O dynamically linked shared library i386
work/destroot/opt/local/lib/libglut.dylib (for architecture x86_64):	Mach-O 64-bit dynamically linked shared library x86_64

Can you attach the build log?

Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: mesa-ryandesign.txt.bz2 added

comment:4 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Sure, here it is. I made it like this:

sudo port -d build mesa build.jobs=1 +universal

comment:5 Changed 14 years ago by jeremyhu (Jeremy Huddleston Sequoia)

I see "-arch x86_64 -arch i386" throughout the build... I'm perplexed. It looks the same as mine here...

comment:6 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

I see a UsingTheRightCompiler notice in there, but fixing it doesn't affect this issue.

The archflags are in there when calling gcc to build the .o files, yes, but not when calling mklib to put them all together into the .dylib. So now I'm confused why libGL.dylib is ending up universal at all. :)

comment:7 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed
Summary: mesa: libGLU and libglut aren't universalmesa: libGLU and libglut aren't universal if file port is installed

I still don't know why libGL was being built universal, but I found out why libGLU and libglut weren't: I had the "file" port installed. mklib gets the list of architectures to build the dylibs for from the output of the "file" program, but the version of the "file" program provided by the "file" port doesn't output that information when there is more than one arch in the file. I fixed it to use "lipo -info" instead, and shortened their code quite a bit; you may want to contribute that patch back to them, since it also fixes the bug in their code where it would misinterpret arch ppc64 as being both arch ppc64 and arch ppc.

I wasn't sure if I should bump the revision (so I didn't in r61769) because this issue only affects those building universal when they have the "file" port installed.

comment:8 Changed 14 years ago by jeremyhu (Jeremy Huddleston Sequoia)

I've pushed the changes upstream. Thanks.

Note: See TracTickets for help on using tickets.