FS#6295 - build failure on Mac OSX 10.9 and 10.10
Attached to Project:
OpenTTD
Opened by ad (dunn) - Monday, 04 May 2015, 00:14 GMT
Last edited by Michael Lutz (michi_cc) - Sunday, 08 January 2017, 21:29 GMT
Opened by ad (dunn) - Monday, 04 May 2015, 00:14 GMT
Last edited by Michael Lutz (michi_cc) - Sunday, 08 January 2017, 21:29 GMT
|
DetailsInitially reported on SO (http://stackoverflow.com/questions/21154984/linker-returning-undefined-symbols-for-symbols-that-are-in-a-library-being-lin), there's a section in config.lib that's preventing OpenTTD from building on recent versions of OSX. It's adding flags that cause linker errors; here's what the build logs look like: https://gist.github.com/dunn/aa8207603cd1eebd1479
Attached is a patch that's been used by MacPorts as well as Homebrew for a while without problems. |
This task depends upon
Closed by Michael Lutz (michi_cc)
Sunday, 08 January 2017, 21:29 GMT
Reason for closing: Implemented
Additional comments about closing: In r27727.
Sunday, 08 January 2017, 21:29 GMT
Reason for closing: Implemented
Additional comments about closing: In r27727.
That is not acceptable.
Rather than causing havoc at other systems by deleting crucial settings, your patch should add checks that prevents adding bad settings for systems like yours.
Likely config.lib should check for GCC here.
For Yosemite, I didn't need to update any ports or other packages (although my system does have a macports trees that was installed under Mavericks, which may still be supplying some packages).
The patch posted here was originally written by me (https://github.com/macports/macports-ports/commit/196a1cff4caa62f3f3773a10ceb9a1b4d9051f31) and later tagged with "Upstream-Status: Inappropriate [configuration]". MacPorts has a policy of always building against the host system, not against one of the OS X SDKs like the binaries built by OpenTTD are. It is probably not appropriate to be merged here.
I did not investigate what the issue with the 10.5 minimum version is, since the code was inappropriate for MacPorts' guidelines anyway. My best guess would be that the compiler uses libstdc++ (due to -mmacosx-version-min 10.5) but the linker uses libc++ (because LDFLAGS doesn't contain a deployment target). Note that forcing a deployment target that makes the compiler use libstdc++ also requires you to build any C++ dependencies with the same setting (which is also why I removed it for MacPorts).
Feel free to reach out to cal@macports.org if you need help figuring out this C++ standard library mess on OS X.