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.2 build failing, syntax & redefinition errors, since 2024-04 #267
Comments
On angharad, I'm reinstalling all my brew formulae to make sure I had fresh, official from-bottle installations.
It's going slow, due to breakage or warnings with various deprecated or removed formulae, a bunch of file permission denied errors when reinstalling qt@5, and my terminal hanging. TODO: Finish this. |
Oho! Look at this GCC bug #111632 "gcc fails to bootstrap when using libc++" on GCC's Bugzilla, from 2023-09. (Following FreeBSD bug 274041.) Looks like it's about this here issue, with the same "do_not_use_toupper_with_safe_ctype" toupper redefinition and
And a comment calls out Xcode 15.3 specifically:
The comments seem to say a non-bootstrapped build would work, but is not supported. Or something like that. Or maybe these patches just enable the non-bootstrapped At least one of those patches made it to the patches/gcc-13 branch on 2024-04-03 just a few days ago, so a fix may be forthcoming. So hmmm, why is it breaking for me even when I used
TODO: Try replacing my main /Applications/Xcode.app with a 15.2 version. UPDATE: Still broke on angharad. I deleted /Applications/Xcode.app (the one I got from the app store) and replaced it with a freshly unzipped Xcode 15.2, and did UPDATE: Tests on other computers:
I'm gonna call that a good test and an indication that Xcode 15.3 broke gcc, and I can do a workaround by creating a fresh machine that has never had Xcode 15.3 installed. Gonna do that for a build box. |
Sheesh. Looks like this issue was already reported to upstream Homebrew and the cause diagnosed, but I didn't recognize it because the bug report in the homebrew-core repo was "error in catching C++ exceptions" and didn't look like the same problem; the GCC build failure itself only came up several comments down, and the "brew install gcc fails with CLT 15.3" bug that looks like my exact problem here was in the iains/gcc-13-branch repo of GCC, which I don't watch. A comment there has instructions on how to successfully downgrade Xcode, including the CLT, which may get the build working on my main machines again. You have to also remove the CLT and reinstall an older version of it from the developer downloads (search "Xcode command line tools 15.1", or maybe this URL here is a direct download); that does not track the version of Xcode itself you have installed. (Do Interestingly, the Developer Downloads for "command line tools" has CLT versions 15.1 and 15.3, but no download for a CLT 15.2, even though there's an Xcode 15.2 download. Dunno what's up with that. I'll try downgrading my CLT to 15.1, and maybe download Xcode to 15.1 to match, and see how that works. Tests
References
TODO
|
Downgrading angharad to Xcode 15.2 and Xcode CLT 15.1 worked!
I think that means I can build all of Octave.app on my main machines again instead of specially-configured VMs. |
Looks like a gotcha with the CLT downgrade: the Software Update in System Settings > General will offer to upgrade the CLT. Dunno if that always happens when it's installed from a package, or just if you had previously done an Maybe there's a CLI for software update that allows you to be selective. |
Looks like the downgrade worked. With Xcode 15.2 and Xcode CLT 15.1, I got a successful build on both Intel and AS. I posted that as 8.4.0 beta3. Considering this closed. Will just continue to use the older Xcode until The core Homebrew builds are fixed. |
UPDATE: Fixed with new gcc, 2024-05?As of the new gcc 14.1.0 package in core Homebrew from mid 2024, this seems fixed. I can now build the gcc package from source without error, using the latest Xcode 15.3 or 15.4 and Xcode CLT 15.3, on both Intel and AS. The workaround of downgrading Xcode seems no longer necessary. |
My GCC builds started failing when I came back early 2024-04 to do an RC build for 8.4.0, at the same time Qt 5.x builds started failing for me. Xcode had update from 15.2 to 15.3 in the mean time, but GCC is still failing with 15.2 and 15.1 for me, too.
This is blocking all Octave.app builds, including getting any 8.x or 9.x releases out.
Happens during the octapp biuld, and also when I do
brew reinstall --build-from-source gcc
in my regular Homebrew installations.I'm handling the GCC build failure under this separate ticket here, because the Qt build failure was fixed by rolling back to Xcode 15.2, but the gcc failure wasn't, so may not be the same cause. And this is a complex enough problem, may as well have two focused tickets anyway.
See discussion under the linked Qt 5 build failure under Xcode 15.3 ticket, because there's some gcc-specific discussion in the comments there from before I created this separate gcc-specific ticket.
Symptoms
Results of various build attempts, done 2024-04-07 and later:
Those are all gcc 13.2.0, using the core Homebrew gcc formula, done with
brew reinstall --build-from-source gcc
, after usingsudo xcode-select -s /Applications/Xcode-<version>.app/Contents/Developer
to set the version of Xcode to use.The errors look like this:
I haven't checked exhaustively to see if they're all the same under the various Xcodes and arches. But they look similar in a brief skim.
Diagnosis
To see which versions of Xcode and Xcode CLT you're running:
References
UPDATE: Fixed with new gcc, 2024-05
As of the new gcc 14.1.0 package in core Homebrew from mid 2024, this seems fixed. I can now build the gcc package from source without error, using the latest Xcode 15.3 or 15.4 and Xcode CLT 15.3. The workaround of downgrading Xcode seems no longer necessary.
The text was updated successfully, but these errors were encountered: