Skip to content

[RFC] Add GCC 10 and Clang 14 toolchain support (parallel branch) - #201

Open
zarinn3pal wants to merge 2 commits into
rake-compiler:mainfrom
zarinn3pal:add-gcc10-support
Open

[RFC] Add GCC 10 and Clang 14 toolchain support (parallel branch)#201
zarinn3pal wants to merge 2 commits into
rake-compiler:mainfrom
zarinn3pal:add-gcc10-support

Conversation

@zarinn3pal

@zarinn3pal zarinn3pal commented Jul 29, 2026

Copy link
Copy Markdown

Add GCC 10 and Clang 14 Toolchain Support

Fixes #200

Summary

This PR upgrades the cross-compilation toolchains across all supported MRI platforms to meet modern C++ standard requirements and resolve compatibility issues with contemporary libraries like Abseil.

Toolchain Upgrades:

  • GNU Linux targets (x86_64, aarch64, arm, x86): GCC 9.x → GCC 10.5.0
  • Musl Linux targets (all architectures): Unpinned GCC → GCC 10.3.0 (explicit version)
  • Darwin/macOS targets (x86_64-darwin, arm64-darwin): Clang 10 → Clang 14.0.6

Problem Statement

Issue #200 identified that Abseil 20260526.0 requires GCC 10 or higher per Google's Foundational C++ Support Policy. Current rake-compiler-dock images are based on Ubuntu 20.04 with GCC 9.x toolchains, causing cross-compilation failures.

Changes

1. GNU Linux Targets (Dockerfile.mri.erb)

  • Install explicit versioned packages: gcc-10-*, g++-10-*.
  • Configure update-alternatives to set GCC 10 as system default.

2. Musl Linux Targets (build/mk_musl_cross.sh)

  • Critical fix: Pin GCC_VER = 10.3.0 in config.mak.
  • Pin BINUTILS_VER = 2.33.1 (newest version compatible with GCC 10).
  • Eliminates non-deterministic builds from unpinned upstream dependencies.

3. Darwin/macOS Targets (Dockerfile.mri.erb + build/mk_osxcross.sh)

  • Install Clang 14 from official LLVM APT repository.
  • Update all llvm-10 references to llvm-14.
  • Configure update-alternatives for clang/clang++ commands.
  • Update osxcross build to use LLVM 14 toolchain.

4. Cross-Architecture Build Support (Dockerfile.mri.erb)

  • Use existing TARGETPLATFORM to detect buildx host architecture.
  • Install native vs. cross-compiler packages based on host for aarch64-linux-gnu and x86_64-linux-gnu targets(Also fixes ci failures).

Given the significant toolchain changes, I recommend treating this as a parallel branch rather than merging directly to main . To resolve the issue at its core, the base ubuntu version upgrade will be a better solution.

Comment thread build/mk_osxcross.sh
set -x
UNATTENDED=1 SDK_VERSION=11.1 OSX_VERSION_MIN=10.13 USE_CLANG_AS=1 ./build.sh
ln -s /usr/bin/llvm-config-10 /usr/bin/llvm-config
ln -s /usr/bin/llvm-config-14 /usr/bin/llvm-config

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I wonder if this can be a part of update-alternatives, but it might be out of scope of this PR. feel free to leave it as is.

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.

GCC 10 support

2 participants