Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#27815 closed defect (fixed)

qt4-mac @4.7.1 Missing symbols - build failure

Reported by: okmacports@… Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: Cc:
Port: qt4-mac

Description

qt4-mac won't build for me using OS X 10.6.5, complaining of missing symbols.

Removing the "-sdk" switch in configure solves the problem. See http://lists.qt.nokia.com/pipermail/qt-interest/2010-September/027631.html

Not sure if this problem was introduced in 10.6.4 or what, but commenting out this line in the Portfile resolves the issue:

configure.args-append -sdk ${SDK}

Attachments (1)

main.log.gz (159.1 KB) - added by okmacports@… 14 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 14 years ago by mf2k (Frank Schima)

Cc: michaelld removed
Owner: changed from macports-tickets@… to michaelld@…

Trac requires full email addresses.

comment:2 Changed 14 years ago by michaelld (Michael Dickens)

The current qt4-mac does build for me on 10.6.5, without change. Is the issue this ticket is about the one found in the link? If so, I'd guess it's more of a qmake build file issue in the corewlan library than an SDK issue. Can you post your log file with the error? Please compress it first, since it'll be pretty big I'd guess.

comment:3 in reply to:  2 ; Changed 14 years ago by okmacports@…

Yes, it's about 9MB. Here it is.

I wonder if it has something to do with the developer_dir setting in macports.conf. Because I have both iOS and MacOSX SDK's on my system, some ports fail to build if I leave the default as /Developer (they appear to assume, falsely, that the SDKs directory is there). Instead, I have set it to /Developer/Platforms/MacOSX.platform/Developer. That, in turn, has directories that used to be directly under /Developer (specifically, SDKs and Library).

It's probably not related to this particular package, but I have noticed that a great number of Python-related PATH problems crop up unless python_select is (a) installed AND (b) used at least once. In particular, the MacPorts site-packages directories aren't found by default. (The default installation has only the site-packages found in the /System/Library tree with the sole exception of /Library/Python/${pythonrelease} -- and none of the /opt/local tree. I assume those come from the Mac OS X installation.) It seems to me that this ought to be part of the base setup of MacPorts.

Changed 14 years ago by okmacports@…

Attachment: main.log.gz added

comment:4 in reply to:  3 ; Changed 14 years ago by okmacports@…

:info:build "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_aqua_qt4-mac/work/qt-everywhere-opensource-src-4.7.1/bin/qmake" -spec /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_aqua_qt4-mac/work/qt-everywhere-opensource-src-4.7.1/mkspecs/macx-g++ -o "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_aqua_qt4-mac/work/qt-everywhere-opensource-src-4.7.1/./src/plugins/codecs/kr" "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_aqua_qt4-mac/work/qt-everywhere-opensource-src-4.7.1/src/plugins/codecs/kr/kr.pro" :info:build Undefined symbols: :info:build "_SecKeychainSearchCreateFromAttributes", referenced from::info:build QCoreWlanEngine::connectToId(QString const&) in qcorewlanengine.o

comment:5 in reply to:  4 Changed 14 years ago by okmacports@…

grrr...use the Preview button, John...

Clearly you've identified the problem, the immediate error was:

:info:build "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_aqua_qt4-mac/work/qt-everywhere-opensource-src-4.7.1/bin/qmake"  -spec /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_aqua_qt4-mac/work/qt-everywhere-opensource-src-4.7.1/mkspecs/macx-g++ -o "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_aqua_qt4-mac/work/qt-everywhere-opensource-src-4.7.1/./src/plugins/codecs/kr" "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_aqua_qt4-mac/work/qt-everywhere-opensource-src-4.7.1/src/plugins/codecs/kr/kr.pro"
:info:build Undefined symbols:
:info:build   "_SecKeychainSearchCreateFromAttributes", referenced from:
:info:build       QCoreWlanEngine::connectToId(QString const&)  in qcorewlanengine.o

comment:6 Changed 14 years ago by ivanzoid@…

I had similar problem with qt4-mac (4.7.1), in my case it were not found symbols from CoreWLAN and Security frameworks when linking src/plugins/bearer/corewlan.

I fixed it by adding "-framework CoreWLAN -framework Security" to LIBS variable in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_aqua_qt4-mac/work/qt-everywhere-opensource-src-4.7.1/src/plugins/bearer/corewlan/Makefile.Release

comment:7 Changed 14 years ago by michaelld (Michael Dickens)

Ah; I see the issue. CoreWLAN is available on 10.6 only (not 10.5 or prior) -and- the QMake .pro file does:

contains(QT_CONFIG, corewlan) {
    isEmpty(QMAKE_MAC_SDK)|contains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10.6.sdk") {
         LIBS += -framework CoreWLAN -framework Security
         DEFINES += MAC_SDK_10_6
    }
}

which means that the LIBS are added only if the SDK is empty or it contains the "old usual" location -- but it won't work if you use an alternative location for the SDK in your ${developer_dir}. I'm looking into a generic fix.

comment:8 Changed 14 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: newclosed

Should be fixed in r74982. Do a "sudo port selfupdate" to get the changes, then try to build anew (again; sorry). I'm going to go ahead and close this ticket as fixed, but please do reopen if my patch doesn't work for this ticket's specific issue.

comment:9 in reply to:  8 Changed 14 years ago by okmacports@…

Replying to michaelld@…:

Should be fixed in r74982. Do a "sudo port selfupdate" to get the changes, then try to build anew (again; sorry). I'm going to go ahead and close this ticket as fixed, but please do reopen if my patch doesn't work for this ticket's specific issue.

I am happy to report that yes, it now builds, BUT ...

There is a fundamental problem, I think, with how it searches for the SDK directory.

In order for something like, say, cairo to build properly, the developer_dir variable in the macports.conf file has to be set to /Developer, where it then finds /Developer/Applications/Xcode.app.

BUT then it won't find the MacOSX SDKs. Alternatively, if I set developer_dir to /Developer/Platforms/MacOSX.platform/Developer, then qt4-mac finds the SDKs but cairo can't find Xcode.app.

As developer_dir is documented as defaulting to the output of xcode-select (in reality, xcode-select -print-path) I think it's best to leave that alone. Perhaps the best solution is to create another macports.conf variable, sdk_dir, which defaults to:

xcodebuild -version -sdk |grep -m1 '^Path: .*MacOSX.*SDKs.*' |sed 's,^Path: \(.*\)/[^/]*$,\1,'

which is to say, 
/Developer/Platforms/MacOSX.platform/Developer for cross-platform 10.6+ developers and (I think)
/Developer for the older structure

For the time being, I have set developer_dir to /Developer and created a symlink (ugh) from /Developer/SDKs to /Developer/Platforms/MacOSX.platform/Developer/SDKs. I hope that will be a very temporary workaround.

comment:10 Changed 14 years ago by okmacports@…

...the output of the xcodebuild statement should end with SDKs, that is:

/Developer/Platforms/MacOSX.platform/Developer/SDKs
and
/Developer/SDKs
Note: See TracTickets for help on using tickets.