Opened 4 years ago

Closed 2 years ago

#61953 closed defect (fixed)

gcc-devel: SDK version mismatch

Reported by: aivazis (Michael Aivazis) Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: mascguy (Christopher Nielsen), michaelld (Michael Dickens), cjones051073 (Chris Jones)
Port: gcc-devel

Description (last modified by ryandesign (Ryan Carsten Schmidt))

the gcc/g++ that come with gcc-devel are unable to find the system headers due to a mismatch in the name of the SDK:

~/tmp/c++>gcc -v -v -v str.c -o str
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/arm64-apple-darwin20/11.0.0/lto-wrapper
Target: arm64-apple-darwin20
Configured with: /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc-devel/gcc-devel/work/gcc-darwin-arm64-f335f738078a35dd48a0aaacbe58a0b7b11c86ce/configure --prefix=/opt/local --build=arm64-apple-darwin20 --enable-languages=c,c++,objc,obj-c++,lto,fortran,jit --libdir=/opt/local/lib/gcc-devel --includedir=/opt/local/include/gcc-devel --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-devel --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-devel --with-gxx-include-dir=/opt/local/include/gcc-devel/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 --enable-host-shared --disable-tls --with-pkgversion='MacPorts gcc-devel 11-20201205_0' --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk

but

~/tmp/c++>ls /Library/Developer/CommandLineTools/SDKs/MacOSX
MacOSX.sdk/      MacOSX10.15.sdk/ MacOSX11.1.sdk/

Change History (8)

comment:1 Changed 4 years ago by kencu (Ken)

We have no good plan for this just yet.

We have up until now tried to use an SDK that matches the system version we are building on, but that plan no longer seems viable.

While we debate the alternative, you will have to rebuild gcc (and many other ports) from source to pick up the name of your current SDK.

And whenever you upgrade your Xcode / CLTs, the same thing will happen.

We may decide to bake in MacOSX.sdk instead of a system-specific sdk, but this is still under debate.

comment:2 Changed 4 years ago by kencu (Ken)

Keywords: sysroot macOS 11.0 11.1 removed
Port: gcc-devel added
Summary: SDK version mismatch in gcc-develgcc-devel: SDK version mismatch

comment:3 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)

comment:4 Changed 2 years ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:5 Changed 2 years ago by mascguy (Christopher Nielsen)

Cc: michaelld cjones051073 added

Is this still an issue?

comment:6 Changed 2 years ago by aivazis (Michael Aivazis)

I'm not sure. I have moved to gcc12, which works. Once in a while I get a linker warning about code that was built for a newer version than linked, but this seems to be more annoying than harmful. If there are no other volunteers, i'd be willing to try a recent gcc-devel install and test it.

comment:7 Changed 2 years ago by kencu (Ken)

this was supposed to have been fixed by this commit:

https://github.com/macports/macports-ports/commit/e8866c5019d60832527850b4e50fdc1de8878716

so I believe it is fixed.

comment:8 in reply to:  7 Changed 2 years ago by mascguy (Christopher Nielsen)

Resolution: fixed
Status: newclosed

Replying to kencu:

this was supposed to have been fixed by this commit:

https://github.com/macports/macports-ports/commit/e8866c5019d60832527850b4e50fdc1de8878716

so I believe it is fixed.

Great, thanks Ken!

Note: See TracTickets for help on using tickets.