Skip to content

build-gcc.sh: bump to 12.5.0 - #172

Merged
cho-m merged 1 commit into
mainfrom
gcc-12
Aug 3, 2026
Merged

build-gcc.sh: bump to 12.5.0#172
cho-m merged 1 commit into
mainfrom
gcc-12

Conversation

@cho-m

@cho-m cho-m commented Aug 3, 2026

Copy link
Copy Markdown
Member

Draft to test out newer GCC to align binary hardening with modern distros' glibc. Also want to see tarball size if we strip binaries on install.

GCC 12 provides -D_FORTIFY_SOURCE=31 which is default on Ubuntu 24.042. This allows similar hardening level for Homebrew's glibc.

Footnotes

  1. https://best.openssf.org/Compiler-Hardening-Guides/Compiler-Options-Hardening-Guide-for-C-and-C++.html#-D_FORTIFY_SOURCE=3

  2. https://wiki.ubuntu.com/ToolChain/CompilerFlags#A-D_FORTIFY_SOURCE.3D3

GCC 12 provides `-D_FORTIFY_SOURCE=3`[^1] which is default on Ubuntu
24.04[^2]. This allows similar hardening level for Homebrew's glibc.

[^1]: https://best.openssf.org/Compiler-Hardening-Guides/Compiler-Options-Hardening-Guide-for-C-and-C++.html#-D_FORTIFY_SOURCE=3
[^2]: https://wiki.ubuntu.com/ToolChain/CompilerFlags#A-D_FORTIFY_SOURCE.3D3
@cho-m
cho-m marked this pull request as ready for review August 3, 2026 17:35
Copilot AI review requested due to automatic review settings August 3, 2026 17:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the GCC bootstrap build script to use a newer GCC release and to reduce the resulting artifact size by stripping installed binaries, in service of aligning toolchain hardening capabilities with modern distro defaults.

Changes:

  • Bump GCC version from 10.5.0 to 12.5.0 (and update the tarball SHA256).
  • Use make install-strip instead of make install to strip binaries during install.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread build-gcc.sh
@cho-m
cho-m merged commit cbb32a7 into main Aug 3, 2026
20 checks passed
@cho-m
cho-m deleted the gcc-12 branch August 3, 2026 17:44

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

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.

4 participants