Opened 10 months ago

Closed 9 months ago

Last modified 9 months ago

#56543 closed defect (fixed)

qt4-mac: Remove unneeded linker flags

Reported by: sideeffect42 (Takashi Yoshi) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: kencu (Ken)
Port: qt4-mac

Description

On my G4 (running Mac OS X 10.4.11 Tiger) compiling qt4-mac fails with:

--->  Building qt4-mac
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/qt-everywhere-opensource-src-4.8.7" && /usr/bin/make -w all 
make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/qt-everywhere-opensource-src-4.8.7'
cd src/tools/bootstrap/ && /usr/bin/make -f Makefile all
make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/qt-everywhere-opensource-src-4.8.7/src/tools/bootstrap'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/qt-everywhere-opensource-src-4.8.7/src/tools/bootstrap'
cd src/tools/moc/ && /usr/bin/make -f Makefile all
make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/qt-everywhere-opensource-src-4.8.7/src/tools/moc'
/opt/local/bin/g++-apple-4.2 -L/opt/local/lib -Wl,-headerpad_max_install_names -lcrypto -ldbus-1 -ljpeg -llcms -lssl -lz -arch ppc -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -Xarch_ppc -mmacosx-version-min=10.4 -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/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/qt-everywhere-opensource-src-4.8.7/src/tools/bootstrap -lbootstrap -framework CoreServices -framework ApplicationServices -lz -lz
/usr/bin/ld: can't locate file for: -llcms
collect2: ld returned 1 exit status
make[1]: *** [../../../bin/moc] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/qt-everywhere-opensource-src-4.8.7/src/tools/moc'
make: *** [sub-moc-all-ordered] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/qt-everywhere-opensource-src-4.8.7'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/qt-everywhere-opensource-src-4.8.7" && /usr/bin/make -w all 
Exit code: 2
Error: Failed to build qt4-mac: command execution failed

After port install lcms the build continues.

I don't know if others versions of OS X are also afftected.

Change History (13)

comment:1 Changed 10 months ago by michaelld (Michael Dickens)

Cc: kencu added

Interesting. My install on 10.12 doesn't seem to require lcms[2]. It looks like the culprit here is "moc", during linking.

If you succeeded in installing qt4-mac, I'd be curious what the following returns:

otool -L /opt/local/libexec/qt4/bin/moc

My 10.4 PPC install isn't far enough along to test out this issue & won't be any time soon. I'll add someone who might be able to test (kencu).

Last edited 10 months ago by ryandesign (Ryan Schmidt) (previous) (diff)

comment:2 Changed 10 months ago by michaelld (Michael Dickens)

Cc: michaelld@… removed
Owner: set to michaelld
Status: newassigned

comment:3 Changed 10 months ago by kencu (Ken)

Here you go:

$ otool -L /opt/local/libexec/qt4/bin/moc
/opt/local/libexec/qt4/bin/moc:
	/opt/local/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
	/opt/local/lib/libdbus-1.3.dylib (compatibility version 18.0.0, current version 18.12.0)
	/opt/local/lib/libjpeg.9.dylib (compatibility version 12.0.0, current version 12.0.0)
	/opt/local/lib/liblcms.1.dylib (compatibility version 2.0.0, current version 2.19.0)
	/opt/local/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
	/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 18.0.0)
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 22.0.0)
	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.9)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 368.28.0)

comment:4 Changed 10 months ago by kencu (Ken)

I do have lcms installed on that system, BTW, but not sure how it was pulled in:

$ port -v installed lcms
The following ports are currently installed:
  lcms @1.19_5 (active) platform='darwin 8' archs='ppc' date='2016-07-17T22:40:00-0700'

comment:5 Changed 10 months ago by sideeffect42 (Takashi Yoshi)

I just checked on 10.5.8 (installed from binary tarball)

$ otool -L /opt/local/libexec/qt4/bin/moc
/opt/local/libexec/qt4/bin/moc:
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 32.0.0)
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 34.0.0)
	/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 476.0.0)

$ port -v installed lcms
The following ports are currently installed:
  lcms @1.19_5 (active) platform='darwin 9' archs='ppc' date='2017-09-10T16:51:21+0200'

It appears lcms is only needed on Tiger.

Last edited 10 months ago by sideeffect42 (Takashi Yoshi) (previous) (diff)

comment:6 Changed 10 months ago by michaelld (Michael Dickens)

OK thx. Can you do a quick PR on this one, Ken? I won't be able to get to it until mid-week at earliest (even though its a simple change). Thx!

comment:7 Changed 10 months ago by michaelld (Michael Dickens)

Or Takashi ... doesn't really matter to me who does the PR .../

comment:8 Changed 10 months ago by jmroot (Joshua Root)

It's not clear that it's actually needed on Tiger either, the Portfile just explicitly adds -llcms to configure.ldflags when ${MINOR} == 4 (line 629).

comment:9 Changed 10 months ago by michaelld (Michael Dickens)

Fair enough. Can someone try building qt4-mac on Tiger with that section commented out & see if it works?

comment:10 Changed 10 months ago by sideeffect42 (Takashi Yoshi)

The I commented out the configure.ldflags-append line locally. It seems to be there to fix a compiler bug in Tiger? (https://trac.macports.org/changeset/72792/trunk/dports)

I've let it compile for about an hour or so without any errors. I can't let it finish the compilation because it takes forever, but I would assume that the hard-coded ldflags are not needed anymore with apple-gcc42.

comment:11 Changed 9 months ago by sideeffect42 (Takashi Yoshi)

Summary: qt4-mac: Should depend on lcmsqt4-mac: Remove unneeded linker flags

I could finally let the qt4-mac compilation finish on 10.4.

Qt 4 works without the additional hardcoded linker flags, so these lines (627-630) can be removed from the Portfile:

    # required linking flags?

    configure.ldflags-append -lcrypto -ldbus-1 -ljpeg -llcms \
        -lssl -lz

comment:12 Changed 9 months ago by michaelld (Michael Dickens)

Resolution: fixed
Status: assignedclosed

In 6d88302cfb4f922bf25021e50703df95cd0ba008/macports-ports (master):

qt4-mac: remove unnecessary linking flags

Closes: #56543

comment:13 Changed 9 months ago by michaelld (Michael Dickens)

Awesome; thx!

Note: See TracTickets for help on using tickets.