Skip to content

Commit

Permalink
[Rootfs] Add GCC 14.2 and make it default for riscv64 (#403)
Browse files Browse the repository at this point in the history
* [Rootfs] Add GCC 14.2 and make it default for riscv64

GCC 14 has support for the RISV-V Vector Extension 1.0 (RVV1.0), which is
important for packages like OpenBLAS.  `riscv64` is still niche enough that it's
OK to use a more recent, but also more capable, version of GCC as default one.

* [CI] Downgrade runner image to Ubuntu 22.04 to avoid problems

* Add gcc 14 toolchain for riscv64-linux-musl
  • Loading branch information
giordano authored Jan 12, 2025
1 parent 36a94b7 commit bcde7e8
Show file tree
Hide file tree
Showing 6 changed files with 364 additions and 7 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ jobs:
test:
name: Julia ${{ matrix.julia-version }} - x64 - runner ${{ matrix.runner }} - SquashFS ${{ matrix.squashfs }}
timeout-minutes: 60
runs-on: ubuntu-latest
# With unprivileged runner on Ubuntu 24.04 we run into
#
# --> Creating overlay workdir at /proc
# At line 572, ABORTED (13: Permission denied)!
runs-on: ubuntu-22.04
env:
BINARYBUILDER_RUNNER: ${{ matrix.runner }}
BINARYBUILDER_USE_SQUASHFS: ${{ matrix.squashfs }}
Expand Down
352 changes: 352 additions & 0 deletions Artifacts.toml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "BinaryBuilderBase"
uuid = "7f725544-6523-48cd-82d1-3fa08ff4056e"
authors = ["Elliot Saba <[email protected]>"]
version = "1.34.2"
version = "1.35.0"

[deps]
Bzip2_jll = "6e34b625-4abd-537c-b88f-471c36dfa7a0"
Expand Down
6 changes: 4 additions & 2 deletions src/Rootfs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ get_available_builds(name::String) =
unique!(sort!(VersionNumber.(join.(getindex.(split.(filter(x->startswith(x, name), keys(load_artifacts_toml(joinpath(dirname(@__DIR__), "Artifacts.toml")))), '.'), Ref(2:4)), '.'))))

const available_gcc_builds = [
# For the version of libstdc++ see also <https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html>.
GCCBuild(v"4.8.5", (libgfortran_version = v"3", libstdcxx_version = v"3.4.19", cxxstring_abi = "cxx03")),
GCCBuild(v"5.2.0", (libgfortran_version = v"3", libstdcxx_version = v"3.4.21", cxxstring_abi = "cxx11")),
GCCBuild(v"6.1.0", (libgfortran_version = v"3", libstdcxx_version = v"3.4.22", cxxstring_abi = "cxx11")),
Expand All @@ -400,6 +401,7 @@ const available_gcc_builds = [
GCCBuild(v"11.1.0", (libgfortran_version = v"5", libstdcxx_version = v"3.4.29", cxxstring_abi = "cxx11")),
GCCBuild(v"12.1.0", (libgfortran_version = v"5", libstdcxx_version = v"3.4.30", cxxstring_abi = "cxx11")),
GCCBuild(v"13.2.0", (libgfortran_version = v"5", libstdcxx_version = v"3.4.32", cxxstring_abi = "cxx11")),
GCCBuild(v"14.2.0", (libgfortran_version = v"5", libstdcxx_version = v"3.4.33", cxxstring_abi = "cxx11")),
## v"11.0.0-iains" is a very old build with some ABI incompatibilities with new versions (for example `libgcc_s`
## soversion, see https://github.com/JuliaLang/julia/issues/44435), let's pretend it never existed.
# GCCBuild(v"11.0.0-iains", (libgfortran_version = v"5", libstdcxx_version = v"3.4.28", cxxstring_abi = "cxx11")),
Expand Down Expand Up @@ -472,9 +474,9 @@ function gcc_version(p::AbstractPlatform,
GCC_builds = filter(b -> getversion(b) v"7", GCC_builds)
end

# We only have GCC 13 or newer for RISC-V.
# We only use GCC 14 or newer for riscv64.
if arch(p) == "riscv64"
GCC_builds = filter(b -> getversion(b) v"13", GCC_builds)
GCC_builds = filter(b -> getversion(b) v"14", GCC_builds)
end

# Rust on Windows requires binutils 2.25 (it invokes `ld` with `--high-entropy-va`),
Expand Down
3 changes: 1 addition & 2 deletions src/Runner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
# the wrappers before any additional arguments because we want this path to have
# precedence over anything else. In this way for example we avoid libraries
# from `CompilerSupportLibraries_jll` in `${libdir}` are picked up by mistake.
# Note 2: Compiler libraries for riscv64 ended up in `lib/` by mistake.
dir = "/opt/$(aatriplet(p))/$(aatriplet(p))/lib" * (nbits(p) == 32 || arch(p) == "riscv64" ? "" : "64")
dir = "/opt/$(aatriplet(p))/$(aatriplet(p))/lib" * (nbits(p) == 32 ? "" : "64")
append!(flags, ("-L$(dir)", "-Wl,-rpath-link,$(dir)"))
end
if lock_microarchitecture
Expand Down
2 changes: 1 addition & 1 deletion test/rootfs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ end
@test gcc_version(p, available_gcc_builds) == [v"7.1.0"]

p = Platform("armv7l", "linux"; march="neonvfpv4")
@test gcc_version(p, available_gcc_builds) == [v"5.2.0", v"6.1.0", v"7.1.0", v"8.1.0", v"9.1.0", v"10.2.0", v"11.1.0", v"12.1.0", v"13.2.0", v"12.0.1-iains"]
@test gcc_version(p, available_gcc_builds) == [v"5.2.0", v"6.1.0", v"7.1.0", v"8.1.0", v"9.1.0", v"10.2.0", v"11.1.0", v"12.1.0", v"13.2.0", v"14.2.0", v"12.0.1-iains"]

# When Rust is used on x86_64 Windows, we have to use at least binutils
# 2.25, which we bundle with at least GCC 5.
Expand Down

2 comments on commit bcde7e8

@giordano
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/122843

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.35.0 -m "<description of version>" bcde7e8adfca6ae53fc7b0828742996c67453d2e
git push origin v1.35.0

Please sign in to comment.