Dealing with Xcode 9 + macOS <= 10.12 and missing functions
Leonardo Brondani Schenkel
leonardo at schenkel.net
Fri Sep 29 08:14:48 UTC 2017
I have been bitten by this when building Python  but I noticed that
many other ports  have been affected by the following:
- You have macOS 10.12 or earlier
- You don't have the command line tools installed
- You update all apps from App Store and end up upgrading Xcode to 9
(which only includes the 10.13 SDK)
- A port needs to be installed from source
- The port build system is based on autotools or similar
- Autotools tries to check for a function that was introduced in 10.13,
such as 'utimenstat' or 'futimens'
- The headers claim the function is available, so the source ends up
using it; it will fail later at either link-time or run-time
This seems to be an issue in XCode 9 to me, since I believe that when
setting the deployment target to 10.12 or earlier it should not be
exposing symbols that are not available at runtime.
Homebrew was affected by this too. Their solution  was to set
environment variables at configure-time to tell autotools not to attempt
to use the functions. The same can be done in a port-by-port basis on
MacPorts by using `convigure.env`.
I'm writing this because I am wondering if this should be addressed on a
port-by-port basis or if it makes sense to have something done globally
in MacPorts to mitigate the issue?
I have seen some very recent message posted in the list (I don't
remember if it was in -dev or -users) that touched this subject, but I
looked at the archives and I could not find it.
More information about the macports-dev