Closed lukaso closed 1 month ago
SDKROOT
will be respected by either GCC or clang compilers when building;
however the GCC build system is generic - it has no idea that SDKROOT
exists (or, indeed, MACOSX_DEPLOYMENT_TARGET
). The configure needs to be passed --with-sysroot=/path/to/buildtime/SDK
NOTE that this does not cause a problem to the built compiler - which will still override the configure-time setting with an SDKROOT
or --sysroot=
passed at runtime.
If it's important to be able to use SDKROOT
at configure time - please file an enhancement bug on the GCC bugzilla (https://gcc.gnu.org/bugzilla) and cc me - this is not specific to the branches here.
--with-sysroot
should be correctly set in the build according to the macports configuration parameter, due to
However, @lukaso if you check the configure step for your build you can see
debug:configure system: cd "/Users/circleci/macports-gimp3-x86_64/var/macports/build/_Users_circleci_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc14/libgcc14/work/build" && /Users/circleci/macports-gimp3-x86_64/var/macports/build/_Users_circleci_macports-gimp3-x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc14/libgcc14/work/gcc-14.1.0/configure --prefix=/Users/circleci/macports-gimp3-x86_64 --build=x86_64-apple-darwin23 --enable-languages=c,c++,objc,obj-c++,lto,fortran --libdir=/Users/circleci/macports-gimp3-x86_64/lib/libgcc --infodir=/Users/circleci/macports-gimp3-x86_64/share/info --mandir=/Users/circleci/macports-gimp3-x86_64/share/man --datarootdir=/Users/circleci/macports-gimp3-x86_64/share/gcc-14 --with-local-prefix=/Users/circleci/macports-gimp3-x86_64 --with-system-zlib --disable-nls --program-suffix=-mp-14 --with-gxx-include-dir=/Users/circleci/macports-gimp3-x86_64/include/gcc/c++/ --with-gmp=/Users/circleci/macports-gimp3-x86_64 --with-mpfr=/Users/circleci/macports-gimp3-x86_64 --with-mpc=/Users/circleci/macports-gimp3-x86_64 --with-isl=/Users/circleci/macports-gimp3-x86_64 --with-zstd=/Users/circleci/macports-gimp3-x86_64 --enable-checking=release --disable-multilib --enable-lto --enable-libstdcxx-time --with-build-config=bootstrap-debug --with-as=/Users/circleci/macports-gimp3-x86_64/bin/as --with-ld=/Users/circleci/macports-gimp3-x86_64/bin/ld-classic --with-ar=/Users/circleci/macports-gimp3-x86_64/bin/ar --with-bugurl=https://trac.macports.org/newticket --enable-host-shared --with-darwin-extra-rpath=/Users/circleci/macports-gimp3-x86_64/lib/libgcc --with-libiconv-prefix=/Users/circleci/macports-gimp3-x86_64 --disable-tls --with-gxx-libcxx-include-dir="/Users/circleci/macports-gimp3-x86_64/libexec/gcc14/libc++/include/c++/v1" --with-pkgversion="MacPorts gcc14 14.1.0_0+stdlib_flag" --with-sysroot="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
so for whatever reason this is not being propagated here and the build is using --with-sysroot="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
So @lukaso this is not an upstream issue. You ned to investigate why in your builds the SDK you wish to use is not making its way to this point and address that.
OK, I see what is happening. See the comment at this line
and the subsequent regex.
So this is intentional.
@iains Please feel free to close this as this is an internal MacPorts issue.
closed - as macports internal - but you are welcome to file an upstream (i.e. GCC bugzilla) enhancement request for GCC configure to recognise SDKROOT if that seems useful.
FWIW: Personally, I prefer not to have important configuration information hidden in environment variables; those do not show in the 'config.status' in the build directory, nor in the output of gcc -v
for the built compiler ..
Having said that, there are some (unusual) build cases for which one does need to use MACOSX_DEPLOYMENT_TARGET
.
closed - as macports internal - but you are welcome to file an upstream (i.e. GCC bugzilla) enhancement request for GCC configure to recognise SDKROOT if that seems useful.
FWIW: Personally, I prefer not to have important configuration information hidden in environment variables; those do not show in the 'config.status' in the build directory, nor in the output of
gcc -v
for the built compiler ..Having said that, there are some (unusual) build cases for which one does need to use
MACOSX_DEPLOYMENT_TARGET
.
well, if you use the AC_ARG_VAR
autoconf macro for it, that helps a bit...
On 14.5 when building gcc14, the
SDKROOT
variable is not used to fixup includes. This is the Macports issue: https://trac.macports.org/ticket/70328#comment:8This has only turned up recently when libgcc was switched from gcc 13 to gcc 14 (I believe), but it may be generic to both gcc 13 and gcc 14.
The build error:
Setup with:
And
When looking in
AvailabilityInternal.h
it looks like it's ignoring theSDKROOT
setting.This is at the top:
libgcc14-main.log AvailabilityInternal.h.txt