Opened 15 years ago

Closed 15 years ago

#20992 closed defect (fixed)

qt4-mac +universal fails due to -arch problems

Reported by: jochen@… Owned by: erickt@…
Priority: Normal Milestone:
Component: ports Version: 1.8.0
Keywords: Qt universal -arch Cc: clubjuggler@…, mf2k (Frank Schima), eatdespain@…, smgava@…, royliu@…, sharky@…
Port: qt4-mac

Description

Similar to ticket #20937 building the current qt4-mac with +universal does also not build on Leopard with too many -arch specifications on linking. The following command

/usr/bin/g++-4.0 -arch i386 -arch x86_64 -Xarch_i386 -mmacosx-version-min=10.4 -Xarch_x86_64 -mmacosx-version-min=10.5 -arch -Xarch_x86_64 -mmacosx-version-min=10.5 -arch -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/local/lib -L../bootstrap -lbootstrap -L/opt/local/lib -lz -framework CoreServices

results in this error:

g++-4.0: Invalid arch name : -Xarch_x86_64

See attached log file for details.

Attachments (4)

qt4-mac.log (14.3 KB) - added by jochen@… 15 years ago.
build log
port_installed.txt (5.9 KB) - added by smgava@… 15 years ago.
macports.conf (5.3 KB) - added by smgava@… 15 years ago.
Portfile (9.2 KB) - added by royliu@… 15 years ago.
The patched Portfile.

Download all attachments as: .zip

Change History (30)

Changed 15 years ago by jochen@…

Attachment: qt4-mac.log added

build log

comment:1 Changed 15 years ago by jochen@…

Cc: erickt@… added

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

Cc: clubjuggler@… added; erickt@… removed

Isn't this identical to the cited ticket?

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

Owner: changed from erickt@… to erickt@…

comment:4 in reply to:  2 Changed 15 years ago by jochen@…

Replying to snc@…:

Isn't this identical to the cited ticket?

Maybe, maybe not. Symptoms are quite similar...

Most importantly, the cited ticket is for 10.6, but I also see it on 10.5.

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

Cc: macsforever2000@… added

Cc Me!

comment:6 Changed 15 years ago by eatdespain@…

Cc: eatdespain@… added

Cc Me!

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

Cc: smgava@… added

cc reporter of dup #22658.

comment:8 in reply to:  7 ; Changed 15 years ago by smgava@…

Replying to macsforever2000@…:

cc reporter of dup #22658.

wait a minute. the bug i reported was current on 10.6... this bug is about a problem on 10.5, and the original bug it's said to duplicate, #20937 , which was for 10.6, has been closed for ages... but the bug i reported is current for 10.6.

comment:9 in reply to:  8 ; Changed 15 years ago by mf2k (Frank Schima)

Summary: qt4-mac 4.5.2_1 +universal fails on 10.5 due to -arch problemsqt4-mac +universal fails due to -arch problems

Replying to smgava@…:

wait a minute. the bug i reported was current on 10.6... this bug is about a problem on 10.5, and the original bug it's said to duplicate, #20937 , which was for 10.6, has been closed for ages... but the bug i reported is current for 10.6.

The error is the same. The problem is that qt4-mac does not currently build universal. Snow Leopard (10.6) had not been released when that ticket was filed. Now we know the problem exists on Snow Leopard too. There is no need to have a separate ticket for that fact.

comment:10 in reply to:  9 Changed 15 years ago by mf2k (Frank Schima)

Replying to macsforever2000@…:

Snow Leopard (10.6) had not been released when that ticket was filed.

I meant that Snow Leopard had not been released when this ticket was filed.

comment:11 in reply to:  9 ; Changed 15 years ago by smgava@…

Replying to macsforever2000@…:

Replying to smgava@…:

wait a minute. the bug i reported was current on 10.6... this bug is about a problem on 10.5, and the original bug it's said to duplicate, #20937 , which was for 10.6, has been closed for ages... but the bug i reported is current for 10.6.

The error is the same. The problem is that qt4-mac does not currently build universal. Snow Leopard (10.6) had not been released when that ticket was filed. Now we know the problem exists on Snow Leopard too. There is no need to have a separate ticket for that fact.

ok, then do you mean that qt4-mac will build ok not universal? i have an x86_64 mac and would very much like to get this package built, how then can i tell macports to build for that arch only? macports builds universal by default...

if you can change ticket flags, can you update this one to version 1.8.99 too? thnx

comment:12 in reply to:  11 Changed 15 years ago by jochen@…

Btw, a while ago I had updated qt4-mac-devel to use Qt-4.6 beta1, which should support Snow Leopard. Please check it out and improve it as you see fit. It's unsupported, though.

comment:13 in reply to:  11 ; Changed 15 years ago by mf2k (Frank Schima)

Replying to smgava@…:

ok, then do you mean that qt4-mac will build ok not universal? i have an x86_64 mac and would very much like to get this package built, how then can i tell macports to build for that arch only? macports builds universal by default...

Yes, qt4-mac builds just fine on Snow Leopard on 64-bit Intel Macs. There have been some problems building it, see also #20199 but that is not the problem you are seeing. Macports does not, however, build universal by default. Can you post the output of port installed?

You probably changed something in your macports.conf file to make universal the default. What does your "build_arch" line look like? If you are running from svn trunk (1.8.99), I recommend you delete or move aside your macports.conf file and use the default one. You can find those files in /opt/local/etc/macports unless you have a different $prefix. Warning: you likely will have to reinstall all of the dependents of qt4-mac as non-universal too. The easiest thing to do it uninstall everything and reinstall what you need.

if you can change ticket flags, can you update this one to version 1.8.99 too? thnx

Well other people have reported the problem with version 1.8.0 and the latest release is 1.8.1. The version of macports is not terribly important in this case and is not the cause of the problem.

Changed 15 years ago by smgava@…

Attachment: port_installed.txt added

Changed 15 years ago by smgava@…

Attachment: macports.conf added

comment:14 in reply to:  13 ; Changed 15 years ago by smgava@…

Replying to macsforever2000@…:

Replying to smgava@…:

ok, then do you mean that qt4-mac will build ok not universal? i have an x86_64 mac and would very much like to get this package built, how then can i tell macports to build for that arch only? macports builds universal by default...

hmm, seems like its actually building for 1386 and x86_64... (details below) ??

Yes, qt4-mac builds just fine on Snow Leopard on 64-bit Intel Macs. There have been some problems building it, see also #20199 but that is not the problem you are seeing. Macports does not, however, build universal by default. Can you post the output of port installed?

i attached it as a file.

You probably changed something in your macports.conf file to make universal the default. What does your "build_arch" line look like? If you are running from svn trunk (1.8.99), I recommend you delete or move aside your macports.conf file and use the default one. You can find those files in /opt/local/etc/macports unless you have a different $prefix. Warning: you likely will have to reinstall all of the dependents of qt4-mac as non-universal too. The easiest thing to do it uninstall everything and reinstall what you need.

i'll attach my macports.conf file too. but i've never changed it since i originally installed 1.8.1 and then svn over the top.

if you can change ticket flags, can you update this one to version 1.8.99 too? thnx

Well other people have reported the problem with version 1.8.0 and the latest release is 1.8.1. The version of macports is not terribly important in this case and is not the cause of the problem.

ok. thanks for the pointers, i'll try re-installing for x86_64 only from 1.8.1 (i got this error there too which is why i tried 1.8.99) and report how it goes. hopefully i don't strike any of the other problem :/ this whole thing started with trying to install the port of digikam, which pulled in qt4 giving the error here and kdelibs4 which gave a different problem i've also filed a bug for.

comment:15 in reply to:  14 ; Changed 15 years ago by mf2k (Frank Schima)

Replying to smgava@…:

Replying to macsforever2000@…:

Replying to smgava@…:

ok, then do you mean that qt4-mac will build ok not universal? i have an x86_64 mac and would very much like to get this package built, how then can i tell macports to build for that arch only? macports builds universal by default...

hmm, seems like its actually building for 1386 and x86_64... (details below) ??

Yes, qt4-mac builds just fine on Snow Leopard on 64-bit Intel Macs. There have been some problems building it, see also #20199 but that is not the problem you are seeing. Macports does not, however, build universal by default. Can you post the output of port installed?

i attached it as a file.

You probably changed something in your macports.conf file to make universal the default. What does your "build_arch" line look like? If you are running from svn trunk (1.8.99), I recommend you delete or move aside your macports.conf file and use the default one. You can find those files in /opt/local/etc/macports unless you have a different $prefix. Warning: you likely will have to reinstall all of the dependents of qt4-mac as non-universal too. The easiest thing to do it uninstall everything and reinstall what you need.

i'll attach my macports.conf file too. but i've never changed it since i originally installed 1.8.1 and then svn over the top.

So you are not doing anything unusual and also you are not building anything universal. But according to your port installed output, qt4-mac is installed and active already. So i don't understand the problem you are having.

comment:16 in reply to:  15 Changed 15 years ago by smgava@…

Replying to macsforever2000@…:

So you are not doing anything unusual and also you are not building anything universal. But according to your port installed output, qt4-mac is installed and active already. So i don't understand the problem you are having.

when kdelibs4 failed to build it gave errors about symbols missing in libQtUiTools.a so i tried to rebuild all of the qt4 libs by doing an "upgrade --force" of qt4-mac. then i got the "Invalid arch name : -Xarch_x86_64" while qt4-mac was _re_building.

anyway i wiped everything, including all my configs, re-installed from the 1.8.1 image, and tried installing digikam again. this time qt4-mac is building ok, but kdelibs4 still falls over with the error i reported there about undefined symbols "QUiLoader::QUiLoader(QObject*)" etc., that i've already reported on kdelibs4. :(

so, i don't know why i was getting that -arch problem when rebuilding qt4 but it went away after a clean macports install.

comment:17 Changed 15 years ago by royliu@…

Is the version of MacPorts being used compiled from source? If so, I've found that LDFLAGS is set to

-arch x86_64

After some digging, I found that these variables control the architecture flags (at least in the trunk):

configure.cc_archflags
configure.cxx_archflags
configure.objc_archflags
configure.ld_archflags

Consequently, I've patched the Portfile and attached the new version.

comment:18 Changed 15 years ago by royliu@…

Cc: royliu@… added

Cc Me!

Changed 15 years ago by royliu@…

Attachment: Portfile added

The patched Portfile.

comment:19 Changed 15 years ago by sharky@…

I have included some of your changes to the flags in the latest qt4-mac port (4.6.0), could you please check whether this fixes your problem?

comment:20 Changed 15 years ago by sharky@…

Cc: sharky@… added

Cc Me!

comment:21 Changed 15 years ago by royliu@…

Thanks for the looking into. Still doesn't build. Trying nulling out configure.ld_archflags, too?

comment:22 Changed 15 years ago by sharky@…

Touching configure.ld_archflags gave me an error saying that option does not exist, which is why I removed it. From what I saw, those flags I did add got me further into the build process, I no longer got an error complaining that the flags were invalid. What failed the build for me was the fact that libdbus was reported as being for the wrong architecture, presumably because it wasn't built with +universal.

Could you post your current error message?

comment:23 Changed 15 years ago by royliu@…

I got the error as originally posted in this thread. Here's my take: since qt built fine before and the Portfile didn't change much, it's likely that the problem originates from the port program itself being changed (I built from trunk recently). Here's my setup:

  1. Check out and install Macports base from trunk.
  2. Grep for 'ld_archflags' to verify that the option exists.
  3. If qt configures without +universal, then it'll most likely build (which takes too long).

If 3 works, then try it for your +universal build, too.

comment:24 Changed 15 years ago by sharky@…

I see, using configure.ld_archflags requires the SVN version of "port". I have commited a change in r62510 with which I can perform steps 1-3 which you describe. Could you please retry your build and close the ticket if the build with +universal works?

comment:25 in reply to:  24 Changed 15 years ago by royliu@…

It works! May I presume that this bug be closed, if others are seeing similar successes?

Replying to sharky@…:

I see, using configure.ld_archflags requires the SVN version of "port". I have commited a change in r62510 with which I can perform steps 1-3 which you describe. Could you please retry your build and close the ticket if the build with +universal works?

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

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.