Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#21424 closed defect (fixed)

mesa: can't build i386 on Snow Leopard

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version: 1.8.0
Keywords: Cc: srm@…, nerdling (Jeremy Lavergne)
Port: mesa

Description

When setting build_arch to i386 on a Snow Leopard machine, mesa still tries to build x86_64, which then fails when it can't link with the 32-bit libX11 and libXext that are installed.

ld: warning: in /32mp/lib/libX11.dylib, file is not of required architecture
ld: warning: in /32mp/lib/libXext.dylib, file is not of required architecture
$ lipo -info /32mp/lib/{libX11,libXext}.dylib 
Non-fat file: /32mp/lib/libX11.dylib is architecture: i386
Non-fat file: /32mp/lib/libXext.dylib is architecture: i386

Attachments (1)

mesa.txt (101.4 KB) - added by ryandesign (Ryan Carsten Schmidt) 15 years ago.

Download all attachments as: .zip

Change History (13)

Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: mesa.txt added

comment:1 Changed 15 years ago by srm@…

I had the same problem here on Snow Leopard. Set build_arch to i386 in macports.conf and it didn't work. I've added the following lines to the Portfile's post_patch section

        reinplace "s:CFLAGS = :CFLAGS = -arch i386:g" ${worksrcpath}/configs/darwin
        reinplace "s:CXXFLAGS = :CXXFLAGS = -arch i386:g" ${worksrcpath}/configs/darwin

        #set correct flags for the AppleBuild
        reinplace "s:GL_CFLAGS=:GL_CFLAGS=-arch i386 :g" ${worksrcpath}/../AppleSGLX-57/Makefile
        reinplace "s:GL_LDFLAGS=:GL_LDFLAGS=-arch i386 :g" ${worksrcpath}/../AppleSGLX-57/Makefile
        reinplace "s:\$\(CC\) tests/glxinfo:\$\(CC\) -arch i386 tests/glxinfo:g" ${worksrcpath}/../AppleSGLX-57/Makefile
        reinplace "s:\$\(CC\) tests/glxgears:\$\(CC\) -arch i386 tests/glxgears:g" ${worksrcpath}/../AppleSGLX-57/Makefile

It works now. Probably due to "use_config no" there's no hope using normal configure._.append and the different build's didn't use the correct C/XXFlags

comment:2 Changed 15 years ago by srm@…

Cc: srm@… added

Cc Me!

comment:3 in reply to:  1 Changed 15 years ago by srm@…

snip

I've added the following lines to the Portfile's post_patch section

snap

Given that these lines are quite specific to my system (at least to this apple system, see the paths) it is at least a hint for other stressed fellows.

comment:4 Changed 15 years ago by srm@…

another line has probably to be changed:

#This is used for building the tests.
#The tests don't require installation.
$(TEST_BUILD_DIR)/libGL.dylib: $(OBJECTS)
        -if ! test -d $(TEST_BUILD_DIR); then $(MKDIR) $(TEST_BUILD_DIR); fi
        $(CC) -O0 -ggdb3 -o $@ -dynamiclib -lXplugin -framework ApplicationServices -framework CoreFoundation -L$(X11_DIR)/lib -lX11 -lXext -W$

add -arch i386 behind $(CC)

comment:5 Changed 15 years ago by srm@…

sorry for the mess I'm producing in this worklog, just wanted to mention that it's file ${worksrcpath}/../AppleSGLX-57/Makefile for the snippet above

*out*

comment:6 Changed 14 years ago by nerdling (Jeremy Lavergne)

Cc: snc@… added

I feel we can always do these changes by simply inserting configure.build_arch if we're doing a non-universal build.

This built for me (on an x86_64) with build_arch set to i386 after completing the aforementioned patches.

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

Resolution: worksforme
Status: newclosed

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

It builds fine for me on a 32bit SL

comment:9 Changed 14 years ago by nerdling (Jeremy Lavergne)

Did you build as i386 on an x86_64 arch?

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

Resolution: worksforme
Status: closedreopened

Ah, sorry for the confusion. It works +universal for me, but I'll try your configuration in a bit...

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

Resolution: fixed
Status: reopenedclosed

Fixed in r61548.

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

Thanks Ryan! I've been swamped.

Note: See TracTickets for help on using tickets.