Opened 15 years ago

Closed 15 years ago

#20937 closed defect (fixed)

qt4-mac @4.5.2 +universal fails on 10.6 due to -arch -arch

Reported by: eric.nodwell@… Owned by: mf2k (Frank Schima)
Priority: Normal Milestone:
Component: ports Version: 1.8.0
Keywords: snowleopard Cc: clubjuggler@…, markus@…, kiwi.2008@…, macports@…, ruud@…
Port: qt4-mac

Description

qt-mac @4.5.2 +universal fails on 10.6 (Snow Leopard). This is due to a double '-arch -arch' appearing in a build command. See the attached debug log qt4-mac_universal.log , generated from 'sudo port -d install qt4-mac +universal buildmakejobs=1'. (All the dependencies were also build with +universal).

The pertinent lines from the log are:

/usr/bin/g++-4.2 -arch x86_64 -arch i386 -Xarch_i386 -mmacosx-version-min=10.4 -Xarch_x86_64 -mmacosx-version-min=10.5 -arch -arch -Xarch_x86_64 -mmacosx-version-min=10.5 -o ../../../bin/moc release-shared/moc.o release-shared/preprocessor.o release-shared/generator.o release-shared/parser.o release-shared/token.o release-shared/main.o    -L/opt/macports/lib -L../bootstrap -lbootstrap -L/opt/macports/lib -lz -framework CoreServices
g++-4.2: Invalid arch name : -arch
make[1]: *** [../../../bin/moc] Error 1

This error is very similar to an error that afflicted gcc and was reported in #20280. In that case it was fixed in changeset r54512. I have however been unable to successfully copy that fix to qt4-mac/Portfile.

Note that this is different than the error that in generated for a non-universal build, which is reported in #20435.

Attachments (2)

qt4-mac_universal.log (846.2 KB) - added by eric.nodwell@… 15 years ago.
patch (1.7 KB) - added by royliu@… 15 years ago.
Proposed Patch for the "-arch -arch" problem

Download all attachments as: .zip

Change History (13)

Changed 15 years ago by eric.nodwell@…

Attachment: qt4-mac_universal.log added

comment:1 Changed 15 years ago by nerdling (Jeremy Lavergne)

Cc: clubjuggler@… added
Owner: changed from macports-tickets@… to erickt@…

comment:2 Changed 15 years ago by markus@…

Cc: markus@… added

Cc Me!

comment:3 Changed 15 years ago by kiwi.2008@…

Cc: kiwi.2008@… added

Cc Me!

comment:4 Changed 15 years ago by macports@…

Cc: macports@… added

Cc Me!

comment:5 Changed 15 years ago by ruud@…

Cc: ruud@… added

Cc Me!

comment:6 in reply to:  description Changed 15 years ago by jochen.mueck@…

Replying to eric.nodwell@…:

qt-mac @4.5.2 +universal fails on 10.6 (Snow Leopard). This is due to a double '-arch -arch' appearing in a build command. See the attached debug log qt4-mac_universal.log , generated from 'sudo port -d install qt4-mac +universal buildmakejobs=1'. (All the dependencies were also build with +universal).

The pertinent lines from the log are:

/usr/bin/g++-4.2 -arch x86_64 -arch i386 -Xarch_i386 -mmacosx-version-min=10.4 -Xarch_x86_64 -mmacosx-version-min=10.5 -arch -arch -Xarch_x86_64 -mmacosx-version-min=10.5 -o ../../../bin/moc release-shared/moc.o release-shared/preprocessor.o release-shared/generator.o release-shared/parser.o release-shared/token.o release-shared/main.o    -L/opt/macports/lib -L../bootstrap -lbootstrap -L/opt/macports/lib -lz -framework CoreServices
g++-4.2: Invalid arch name : -arch
make[1]: *** [../../../bin/moc] Error 1

This error is very similar to an error that afflicted gcc and was reported in #20280. In that case it was fixed in changeset r54512. I have however been unable to successfully copy that fix to qt4-mac/Portfile.

Note that this is different than the error that in generated for a non-universal build, which is reported in #20435.

Same here, but i think i solved the problem.. my output was

Command output: cd src/tools/bootstrap/ && /usr/bin/make -f Makefile 
make[1]: Nothing to be done for `first'.
cd src/tools/moc/ && /usr/bin/make -f Makefile 
make[1]: Nothing to be done for `first'.
cd src/tools/rcc/ && /usr/bin/make -f Makefile 
make[1]: Nothing to be done for `first'.
cd src/tools/uic/ && /usr/bin/make -f Makefile 
/usr/bin/g++-4.2 -arch x86_64 -arch i386 -Xarch_i386 -mmacosx-version-min=10.4 -Xarch_x86_64 -mmacosx-version-min=10.5 -arch -arch -Xarch_x86_64 -mmacosx-version-min=10.5 -o ../../../bin/uic .obj/release-shared/customwidgetsinfo.o .obj/release-shared/databaseinfo.o .obj/release-shared/driver.o .obj/release-shared/treewalker.o .obj/release-shared/ui4.o .obj/release-shared/validator.o .obj/release-shared/cppextractimages.o .obj/release-shared/cppwritedeclaration.o .obj/release-shared/cppwriteicondata.o .obj/release-shared/cppwriteicondeclaration.o .obj/release-shared/cppwriteiconinitialization.o .obj/release-shared/cppwriteincludes.o .obj/release-shared/cppwriteinitialization.o .obj/release-shared/main.o .obj/release-shared/uic.o    -L/opt/local/lib -L../bootstrap -lbootstrap -L/opt/local/lib -lz -framework CoreServices
g++-4.2: Invalid arch name : -arch
make[1]: *** [../../../bin/uic] Error 1
make: *** [sub-uic-make_default-ordered] Error 2

what i did then was

cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_aqua_qt4-mac/work/qt-mac-opensource-src-4.5.2
sudo open src/tools/bootstrap/Makefile
sudo open src/tools/moc/Makefile
sudo open src/tools/rcc/Makefile
sudo open src/tools/uic/Makefile

and looked for the "-arch -arch" arguments, wich turned out to be in the makefile.. deleting them seems to work for me.. still compiling right now.

comment:7 Changed 15 years ago by jochen.mueck@…

there are some more "-arch -arch" statements in src/corelib/Makefile.Debug and Makefile.Release

comment:8 Changed 15 years ago by jochen.mueck@…

now i searched for -arch -arch in the qt folder.. found about 380 Makefiles.. this could be done with a skript or something

Changed 15 years ago by royliu@…

Attachment: patch added

Proposed Patch for the "-arch -arch" problem

comment:9 Changed 15 years ago by royliu@…

This error is caused by the QT build system doing smart things under the hood and conflicting with the CPPFLAGS set by configure.universal_cflags. The solution is to null out all universal flags and go through the configure script's "-arch" switch. Please find patch attached.

comment:10 Changed 15 years ago by mf2k (Frank Schima)

Owner: changed from erickt@… to macsforever2000@…
Status: newassigned

comment:11 Changed 15 years ago by mf2k (Frank Schima)

Resolution: fixed
Status: assignedclosed

Your patch works. I applied it in r57219. Thanks!

Note: See TracTickets for help on using tickets.