You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ruby-dev and Ruby < 3.2 compiled with -O0 on Fedora 42+ #2637
diff --git i/bin/ruby-build w/bin/ruby-build
index 52fc7e0b..c5fb8b36 100755
--- i/bin/ruby-build+++ w/bin/ruby-build@@ -748,7 +748,15 @@ build_package_standard() {
#
# TODO: Consider changing this to check for GCC v15 specifically
# rather than inspecting the OS itself.
- export CFLAGS="-std=gnu17 $CFLAGS"+ if [ "${CFLAGS+defined}" ]; then+ export CFLAGS="-std=gnu17 $CFLAGS"+ else+ # Use the `cflags` configure variable, which Ruby's configure appends to+ # its default optflags/debugflags/warnflags, unlike CFLAGS which would+ # override them and notably lose the -O3, producing a much slower Ruby.+ # configure ignores `cflags` when CFLAGS is given, hence the branch above.+ export cflags="-std=gnu17 $cflags"+ fi
fi
# ./configure --prefix=/path/to/ruby
# shellcheck disable=SC2086,SC2153
There is also another bug here, that ruby-dev is considered < 3.2.
Activity
eregon commentedon Aug 31, 2026
Using
cflagsinstead ofCFLAGSis the obvious fix, that appends instead of overrides, giving:There is also another bug here, that
ruby-devis considered < 3.2.eregon commentedon Aug 31, 2026
BTW
RUBY_CFLAGSalso overrides CFLAGS, which means getting-O0unless one has a-Oflag inRUBY_CFLAGS.fix(rpm-armhf): pass the ARM architecture as a compile flag