Skip to content
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

0_Rootfs: Add GCC 14 #10132

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

0_Rootfs: Add GCC 14 #10132

wants to merge 4 commits into from

Conversation

eschnett
Copy link
Contributor

@eschnett
Copy link
Contributor Author

I'm looking for comments on these changes. If they look fine I can generate and deploy the artifacts.

@imciner2
Copy link
Member

Have you looked through the patches to see which are already upstream and included in the GCC 14 release? I know for sure that you need to drop the gcc9_vsnprintf-str patch since it is already upstream, and I would suspect also the gcc1220-libgomp-win patch should be dropped.

@eschnett
Copy link
Contributor Author

There is a gazillion patches which don't apply any more. Since most are applied via patch || true that doesn't matter. Should I remove all that are not necessary?

I assume that's only GCC patches you're talking about, not anything related to binutils or glibc?

@imciner2
Copy link
Member

IMO, when adding a new GCC version we should verify all the patches are either being applied or are no longer needed and dropped. Keeping a lot of old patches that don't apply present in the new GCC's directory clutters things up.

@eschnett
Copy link
Contributor Author

This is GCC 14.2. Is that the version we're going to use?

@giordano
Copy link
Member

IMO, when adding a new GCC version we should verify all the patches are either being applied or are no longer needed and dropped.

Agreed, I don't like the patch || true style, it's hard to change it for old versions we should avoid it for new stuff

@eschnett
Copy link
Contributor Author

It's impossible to avoid. There are too many combinations of (GCC, glibc, binutils, architecture), and who knows which patches are necessary for what combination.

So far, the patches are separated by GCC version only. We could separate them by binutils and glibc version as well, but that might not cover all the cases. (For example, the configure flags necessary for glibc 2.17 depend on the GCC version.)

Furthermore, I don't think anyone has tried to re-build an older GCC version in a long time, so I'd assume that's all bit-rotted away.

@eschnett
Copy link
Contributor Author

@giordano
Copy link
Member

Furthermore, I don't think anyone has tried to re-build an older GCC version in a long time, so I'd assume that's all bit-rotted away.

I haven't tried very recently, but the build scripts are surprisingly somewhat robust.

For the benefit of future readers (myself included) what was the problem with JuliaPackaging/BinaryBuilderBase.jl#398 (comment)?

@eschnett
Copy link
Contributor Author

I added this comment to explain:

        # These flags are necessary for GCC 14. GCC 14 defaults to a
        # modern version of C, too modern for the old glibc libraries we are
        # trying to build. Various configure tests would fail otherwise. (Why
        # declare variables or functions if they default to int anyway?)
        GLIBC_CFLAGS="${CFLAGS} -g -O2 -Wno-implicit-int -Wno-implicit-function-declaration -Wno-builtin-declaration-mismatch -Wno-array-parameter"

0_RootFS/gcc_sources.jl Outdated Show resolved Hide resolved
@giordano
Copy link
Member

I haven't tried very recently, but the build scripts are surprisingly somewhat robust.

JuliaPackaging/BinaryBuilderBase.jl#318 rebuilt gcc 4-12 for *86*-linux-gnu little over one year ago, and since then the only major change was the upgrade to GCC 13. Unless we did something super bad there, the script is supposed to still be working for all those versions.

@imciner2
Copy link
Member

I haven't tried very recently, but the build scripts are surprisingly somewhat robust.

I also rebuilt GCC 11-12 to fix headers and GCC 11-13 for the new Mingw version in January and it worked with no hiccups: #8005

# setting, glibc will build C versions of these files instead.
GLIBC_CONFIGURE_OVERRIDES+=( CXX=false )

# These flags are necessary for GCC 14. GCC 14 defaults to a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be guarded by an if based on the gcc version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea.

@eschnett
Copy link
Contributor Author

I see this error while building for x86_64-apple-darwin14:

[02:47:00] Assertion failed: targetAtom != NULL (/workspace/srcdir/cctools-port/cctools/ld64/src/ld/ld.hpp: Fixup: 776)
[02:47:00] collect2: fatal error: ld terminated with signal 6 [Aborted], core dumped
[02:47:00] compilation terminated.
[02:47:00] make[1]: *** [Makefile:1005: libgcc_s.dylib] Error 1

What's the likely fix? Update to a newer macOS SDK? Or try a different binutils?

@giordano
Copy link
Member

Cctools more than binutils:

# MacOS doesn't actually use binutils, it uses cctools
binutils_sources = [
GitSource("https://github.com/tpoechtrager/apple-libtapi.git",
"a66284251b46d591ee4a0cb4cf561b92a0c138d8"),
GitSource("https://github.com/tpoechtrager/cctools-port.git",
"634a084377ee2e2932c66459b0396edf76da2e9f"),
]
Maybe it's time to upgrade to a newer version (as we do for binutils), for example https://github.com/tpoechtrager/cctools-port/tree/1010.6-ld64-951.9

@eschnett
Copy link
Contributor Author

Why is there no aarch64-apple-darwin* architecture for GCC?

@giordano
Copy link
Member

For that architecture we build a fork of GCC: https://github.com/iains/gcc-darwin-arm64/. Upstream GCC still doesn't support it, I think.

@eschnett
Copy link
Contributor Author

I'm giving up on building GCC 14 for x86_64-apple-darwin14. I've added my current state to the PR. I cannot figure out how to build the new version of cctools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide GCC 14
3 participants