Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions bin/ruby-build
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,16 @@ is_freebsd() {
[ "$(uname -s)" = "FreeBSD" ]
}

is_fedora() {
[ -r /etc/os-release ] || return 1
# shellcheck disable=SC1091
source /etc/os-release
# Treat Aurora, Bazzite, BlueFin, uCore, and other Fedora variants as "fedora".
if [[ "${ID_LIKE:-$ID}" != "fedora" || ( $# -gt 0 && "$VERSION_ID" -lt "$1") ]]; then
return 1
fi
}

freebsd_package_prefix() {
local package="$1"
pkg info --prefix "$package" 2>/dev/null | cut -wf2
Expand Down Expand Up @@ -712,6 +722,15 @@ build_package_standard() {
fi
if [ -z "$CC" ] && is_mac 1010; then
export CC=clang
elif [ "$ruby_semver" -lt 300200 ] && is_fedora 42; then
# Fedora 42+ has updated to GCC v15. GCC v15 changed the default
# mode from gnu17 to gnu23: https://gcc.gnu.org/gcc-15/changes.html#c
#
# Ruby < 3.2 can't compile on GCC v15 in the default mode of gnu23.
#
# TODO: Consider changing this to check for GCC v15 specifically
# rather than inspecting the OS itself.
export CFLAGS="-std=gnu17 $CFLAGS"
fi
# ./configure --prefix=/path/to/ruby
# shellcheck disable=SC2086,SC2153
Expand Down