-
Notifications
You must be signed in to change notification settings - Fork 7
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-12.4 targeting arm64 bootstrap with Xcode 16 (macOS 15): “error: ‘_Float16’ does not name a type” #24
Comments
Perhaps the support was not added upstream at that point (I do not think we make any darwin-specific provisions for _Float16 - only for float 128.) This will need some archeology to see what's missing - is there a work-around that you are aware of? |
Still looking for the problem. I think it's very telling that it works for C but not C++. |
AH.... another clang extension I fear (_Float16 is not a C++ type AFAIK). |
(as an aside .. I think that one of the causes of these cases is that the SDK headers are "system headers" and so have warnings suppressed - which means that things that might otherwise be flagged to the developers as clang extensions creep in - and then we're stuck with them - because the SDKs are "in the wild" and cannot be changed) |
confirmed: We support _Float16 (std::float16) from GCC-13 .. if this is a show-stopper, we'll have to see what would need back porting to fix it. |
Not sure why that is - although x86 did get the float16 support first. |
My previous comment got partially chewed up. Here’s what it should read:
|
"Works" - as in you can use it in a c++ program, or "works" as in the SDK does not require it and so there's no error? AFAICT we did not add the support until gcc-13. |
The compiler recognizes the type. This is mac-x86_64 running macOS 14.7, Xcode 16.0, at the HEAD of the releases/gcc-12 branch with a fix for the libunwind symbols that are no longer in the SDK:
I can also do a little arithmetic and then (after converting to |
OK. that's interesting; support for types is arch-dependent (but you mentioned that _Float16 works for Arm64 with C but not C++) .. so that implies the base support is there - I think I will need to do a build on Linux and repeat the experiment there; as noted, we have not (intentionally, at least) made any changes to _Float16 for the darwin port). |
OK.. I can confirm the observation (without needing xcode16 installed). Now I need to find out if this is an upstream (aarch64) issue or something we've somehow unintentionally introduced. x86 does do things differently - on macOS (at least on the i5 box I have macOS14.7 on) there's no h/w fp16 support - and so it's done in soft-float for both gcc-12 and 13 (and is the same for c and c++) .. whereas the Arm64 port is using native fp16 inns. |
Interesting. linux-arm64 behaves the same way: C knows the type, and C++ does not.
This is https://github.com/gcc-mirror/gcc/commits/releases/gcc-12/ at gcc-mirror/gcc@917b6c6. |
Ah, here we go! gcc-mirror/gcc b04208895fed gcc/c-family/c-common.cc, in That’s in generic common code. As you point out, x86_64 does its own thing. Here it is even as it exists on the releases/gcc-12 branch. |
It’d take some effort to backport gcc-mirror/gcc@b042088 to GCC 12, and I’m not sure if there were follow-ups required. It seems ill-advised to introduce generic Instead, markmentovai/gcc@8708938 shows a fixincludes hack to wrap the uses of In this case, I’ve limited it to With this fix and the fix described at iains/gcc-darwin-arm64#137, I’m able to build iains/gcc-12-branch gcc-12-4-darwin for macOS 15 on arm64; gcc-mirror/gcc@33ccc13 is also necessary for |
I totally agree that the _Float16 patch is a big one (I did not yet see how much of it is actually needed) It is, however, terribly sad to add new fixincludes when we've been trying hard to reduce them as much as possible (since they have caused other issues for downstream, including macports) @fxcoudert - I'd welcome your input too. |
Could we follow the x86_64 route, and define the _Float16 type by hand for the aarch64 target? (I think we were actually doing that in the first version of the ARM support, when Apple Silicon first came out, for _Float128.) |
If we can make that work (and given that this port will never be upstreamed on GCC-12, so we do not have to convince the Arm maintainers) - that would be nicer than the alternatives. Can we basically clone && update the float128 additions? NOTE; I do not have any time to look at this this week... |
plus I am assuming that the same thing will happen on GCC-11, which is needed as the bootstrap for D. |
ah .. maybe that's not the issue here; _Float16 is already enabled - but only for C - the change to allow it for C++ (std::float16) is what the big patch introduced - and the equally big question there is how much of that patch we'd need. |
Your thought process mimics my own. At #24 (comment), I thought it best to just make
I assumed that gcc-11 was out of support and thus out of scope, but if it’s in fact interesting or relevant, gcc-11 doesn’t have gcc-mirror/gcc@a684121, so when targeting x86_64, it won’t know
Yeah, this is the problem. gcc-mirror/gcc@b042088 does a bunch more than just |
The branch is no longer updated 'upstream' but, like macports and homebrew distros (Linux ones) have 'vendor' branches and tend to ship much older GCC versions as the default (with newer ones as an option). For Darwin, my intent is to support GCC-10 until we abandon OSX - 10.5..10.8 (since that's the oldest that can be bootstrapped with c++98). To support the 'D' front end we now need a D compiler, and the last GCC D version that can be built using C++ to start is GCC-11 .. so, even for newer macOS versions, I fear we will be supporting 11.5 for some time. So - I expect GCC-10.5-darwin and GCC-11.5-darwin to be LTS and will have to have at least the minimum fixes to deal with SDK/XCode issues unless/until we can find a way to cook up our own SDK. |
This is on mac-arm64 running macOS 15.0 24A335 with Xcode 16.0 16A242d. I expect that this would also occur targeting mac-arm64 on macOS 14 as long as Xcode 16 is used.
While bootstrapping gcc-12.4 from iains/gcc-12-branch gcc-12-4-darwin at gcc-12.4-darwin-r0:
This does not occur when using gcc-12.4 (mainline) targeting x86_64.
This does not occur when using gcc-13.3 or gcc-14.2 (your branches) targeting arm64.
The compiler being built does recognize
_Float16
in C mode:but not in C++ mode:
@iains
The text was updated successfully, but these errors were encountered: