-
-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GCC-13/14 bottle not working with newer MacOSX SDKs #194778
Comments
Works for me:
That said, passing
What's the output of your |
r2 release only just came out. We will update GCC 14 to use it soon and build a macOS 15 bottle. GCC 13 is probably further away, but patches could probably be applied without too much work. GCC 12 and earlier is harder. |
@Bo98 Is somewhere described how the patch file can be created? I was testing/helping Iains and it would be easier for me to adapt the Homebrew recipe. Right now I was hacking/adapting several locations in my project such that the path, etc. were right. This said, there are some important fixes (e.g. iains/gcc-14-branch#12) in r2 and I am looking forward for an updated official gcc bottle. |
@anddebol Which OS are you running the tests? |
@fxcoudert might have the command. On a basic level it's a diff between We use diffs because we also ship for Linux and only want to apply the changes to macOS at this time. |
Also importantly, we will need to rebuild the new bottles when CI machines have been updated to latest Xcode on each macOS version. The diff file is as @Bo98 explained: I remove some readme files, testsuite changes, and other things that are irrelevant to homebrew (to keep the size minimal). |
It doesn't work (stdio errors) for me with --sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk (which is now is default on my system) Maybe it is Intel and not AppleSilicon issue?
brew config:
brew doctor:
|
GCC does not guarantee compatibility between major macOS SDK versions. You need to use the SDK that it was built against. Other configurations are (sadly) not always working, because Apple introduces incompatible changes in their SDK headers. Homebrew builds each GCC against the SDK headers for that macOS version. So on macOS 14 you will need to use the macOS 14 SDKs. |
Updating to latest patch release in #194797 But the root cause remains this:
We try and do as best we can, but it does not always work. |
Thanks, @fxcoudert! |
@anddebol I assume you are still running on macOS Sonoma? When you install the Command Line Tools 16 it actually adds two folders: MacOSX14.x.sdk and MacOSX15.y.sdk. I was also not aware of this, but when compiling on macOS Sonoma you need to explicitly pass the correct sysroot folder. |
GCC (or at least the way we build it) should default to the SDK it was built against so you shouldn't need to explicitly set the SDK as long as you have the Command Line Tools installed. If you are building GCC itself from source yourself, then yes you should provide |
@Bo98 You are right. I still have an issue, but this doesn't seem to be gcc related, but eventually CMake and/or Conan related. When I've installed both XCT 15 and 16 on macOS Sonoma it seems that the sysroot gets overridden somehow and I must explicitly set the Why does e.g. the following command on macOS 14 show to the macOS 15.x SDK and not the 14.x SDK directory?
|
Could be a CMake bug. Try passing
to CMake. As for what
and see if that helps. |
For CMake, the default is it chooses the latest SDK, so either set the The correct SDK can be subjective so tools using the latest aren't necessarily wrong - but can be risky for certain use cases. If you are writing in Swift using only Apple Frameworks and not low-level APIs, the latest SDK is often desirable and the best choice as it supports availability attributes, gives errors on APIs that Apple have decided they want to stop using even on older macOS (e.g. in macOS 15 they obsoleted the old screen sharing API and really don't want you to use it anymore even on macOS 14) and it allows you to do things like This is sort of why Xcode.app only ships with the macOS 15 SDK, but the Command Line Tools ships with both macOS 14 SDK and macOS 15 SDK. If you're developing in Xcode.app, you're probably making a macOS app. For everything else, you're probably aware of the command line anyway. For Homebrew, we always use the host SDK for everything except for software written in Swift and other software that only works with the full Xcode.app (e.g. things using
Secondly,
However, the behaviour of selecting the system/host SDK is broken when it comes to minor versions. The latest SDK for macOS 14 is 14.5, but the latest OS version for macOS 14 is 14.7. If you run 14.7, What about TLDR: don't bother trying to get it to work and just do If you're embedding the SDK into a build (e.g. you are building GCC itself), the CLT's |
They might have finally fixed this...
|
Haven't checked macOS 15, so will be nice if they have. You want to check |
But I didn't check the return value of |
I also experience some bugs with ldd (not linking shared hdf5_hl and netcdf properly), and a bit afraid to update to Sequoia now. Can the miss match of OS/SDK version be also a culprit, and I actually need to update the OS? What would be and a safer option? |
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputVerification
brew doctor
output saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
Updating CLT to 16 will break gcc includes
What happened (include all command output)?
since latest gcc bottle is not built vs. CLT 16.0 it compiling with it will produce stdio.h errors similar to this issue (similar issue)
What did you expect to happen?
Bottle is updated to use (https://github.com/iains/gcc-14-branch/releases/tag/gcc-14.2-darwin-r2)
Step-by-step reproduction instructions (by running
brew
commands)The text was updated successfully, but these errors were encountered: