[MacPorts] #59665: gcc9 pre-built binary can't access system SDK with Xcode 11.2 under Mojave
MacPorts
noreply at macports.org
Mon Nov 11 15:21:56 UTC 2019
#59665: gcc9 pre-built binary can't access system SDK with Xcode 11.2 under Mojave
------------------------+------------------------
Reporter: EJFielding | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.6.2
Keywords: gcc9 | Port: gcc9, gcc7
------------------------+------------------------
My MacBook running Mojave 10.14.6 has been upgraded to Xcode 11.2 (this
was not my choice as my employer installs updates on our work computers).
The pre-built binary for the gcc9 port has the system 10.14 SDK hard-coded
to be found in the Xcode directory
`/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk`,
but this is not available in Xcode 11.x, including 11.2.
With gcc9 selected, I can't compile a simple configuration test that
contains only `#include "Python.h"`
{{{
gcc conftest_0.c
-I/opt/local/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m
/opt/local/include
In file included from /opt/local/lib/gcc9/gcc/x86_64-apple-darwin18/9.2.0
/include-fixed/syslimits.h:7,
from /opt/local/lib/gcc9/gcc/x86_64-apple-darwin18/9.2.0
/include-fixed/limits.h:34,
from
/opt/local/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m/Python.h:11,
from conftest_0.c:2:
/opt/local/lib/gcc9/gcc/x86_64-apple-darwin18/9.2.0/include-
fixed/limits.h:194:61: error: no include path in which to search for
limits.h
194 | #include_next <limits.h> /* recurse down to the real one */
| ^
In file included from
/opt/local/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m/Python.h:25,
from conftest_0.c:2:
/opt/local/lib/gcc9/gcc/x86_64-apple-darwin18/9.2.0/include-
fixed/stdio.h:78:10: fatal error: _stdio.h: No such file or directory
78 | #include <_stdio.h>
| ^~~~~~~~~~
compilation terminated.
}}}
The output of `cpp -v` shows the problem:
{{{
cpp -v
Using built-in specs.
COLLECT_GCC=cpp
Target: x86_64-apple-darwin18
Configured with:
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc9/gcc9/work/gcc-9.2.0/configure
--prefix=/opt/local --build=x86_64-apple-darwin18 --enable-
languages=c,c++,objc,obj-c++,lto,fortran --libdir=/opt/local/lib/gcc9
--includedir=/opt/local/include/gcc9 --infodir=/opt/local/share/info
--mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-9 --with-
local-prefix=/opt/local --with-system-zlib --disable-nls --program-
suffix=-mp-9 --with-gxx-include-dir=/opt/local/include/gcc9/c++/ --with-
gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-
isl=/opt/local --enable-stage1-checking --disable-multilib --enable-lto
--enable-libstdcxx-time --with-build-config=bootstrap-debug --with-
as=/opt/local/bin/as --with-ld=/opt/local/bin/ld --with-
ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket
--disable-tls --with-pkgversion='MacPorts gcc9 9.2.0_1' --with-
sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
Thread model: posix
gcc version 9.2.0 (MacPorts gcc9 9.2.0_1)
COLLECT_GCC_OPTIONS='-E' '-v' '-mmacosx-version-min=10.14.0'
'-asm_macosx_version_min=10.14' '-mtune=core2'
/opt/local/libexec/gcc/x86_64-apple-darwin18/9.2.0/cc1 -E -quiet -v
-D__DYNAMIC__ - -fPIC -mmacosx-version-min=10.14.0 -mtune=core2
ignoring nonexistent directory
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/opt/local/include"
ignoring nonexistent directory "/opt/local/lib/gcc9/gcc/x86_64-apple-
darwin18/9.2.0/../../../../../x86_64-apple-darwin18/include"
ignoring nonexistent directory
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include"
ignoring nonexistent directory
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks"
ignoring nonexistent directory
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
/opt/local/lib/gcc9/gcc/x86_64-apple-darwin18/9.2.0/include
/opt/local/lib/gcc9/gcc/x86_64-apple-darwin18/9.2.0/include-fixed
End of search list.
}}}
I had the same problem with gcc7, and I found that I was able to get it
working by forcing the installation of the command line tools from Xcode
10.3 and rebuilding the gcc7 port from source (which took more than an
hour on this relatively new MacBook Pro).
--
Ticket URL: <https://trac.macports.org/ticket/59665>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list