Two `ar` runs into libcrypto.a can overlap under make -j and drop each other's objects, which breaks every Ruby 2.3 and older build on the ubuntu-26.04 runners. The `-j 1` that used to prevent this stopped taking effect when 3a4d3fb0 moved MAKE_OPTS after the package options, and 6663720f removed it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The configure script of Ruby 2.7.8 is generated by Autoconf 2.71, which
runs AC_PROG_CC (setting CFLAGS=-g -O2) before Ruby's own
`test -z "${CFLAGS+set}"` check, so the cflags configure variable is
silently ignored and Ruby 2.7 was still compiled as C23 on GCC 15.
Ruby 3.0+ unset CFLAGS again in that case, and the tarballs of 2.0 to
2.5 ship an Autoconf 2.69 configure which runs the check first.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
GCC 15 defaults to C23, which Ruby < 3.2 can't compile as. Detect the
GCC version instead of the OS, so that e.g. Ubuntu 26.04 is handled too.
The flag keeps going through the cflags configure variable, except for
Ruby 2.6 where it goes on CC, because its MJIT header check runs a bare
$(CC) and would otherwise fail.
Ported from https://github.com/ruby/ruby-builder/pull/31
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Ruby/OpenSSL 3.2.4, 3.3.3 and 4.0.2 added OpenSSL 4 support and ship
with Ruby 3.3.12, 3.4.10 and 4.0.6. Widen the needs_openssl upper
bound to 4.x.x for those releases and later, including the matching
development definitions, so an installed OpenSSL 4 is used instead of
vendoring OpenSSL 3. Make update-cruby apply the same boundaries to
new definitions, and cover a 4.x.x upper bound in the build tests.
Signed-off-by: Patrick Linnane <patrick@linnane.io>
The macOS 27 SDK declares both as available since macOS 27.0, and
`AC_CHECK_FUNCS` detects them regardless of the deployment target, so
Ruby built on macOS 26 with the Command Line Tools 27 calls weakly
linked NULL symbols and crashes miniruby during the build.
https://bugs.ruby-lang.org/issues/22311https://github.com/rbenv/ruby-build/issues/2640
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Exporting CFLAGS overrides Ruby's default optflags/debugflags/warnflags,
notably losing -O3 and silently producing a much slower (-O0) Ruby.
The cflags configure variable is appended to those defaults instead.
Keep prepending to CFLAGS when the user already overrides CFLAGS,
since configure ignores cflags when CFLAGS is given.
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
normalize_semver("dev") returned 0, so ruby-dev was treated as older
than any released version and version-gated workarounds misfired.
Notably the Fedora 42+ -std=gnu17 workaround for Ruby < 3.2 was
applied to ruby-dev builds, which do not need it.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
"Additional" was misleading: passing CFLAGS to Ruby's configure replaces
the default optflags/debugflags/warnflags, so e.g. RUBY_CFLAGS=-march=native
silently builds an unoptimized (-O0) Ruby. Document the overriding
semantics and point to RUBY_CONFIGURE_OPTS=cflags=... for adding flags.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Exporting CFLAGS overrides Ruby's default optflags/debugflags/warnflags,
notably losing -O3 and silently producing a much slower (-O0) Ruby.
The cflags configure variable is appended to those defaults instead.
Keep prepending to CFLAGS when the user already overrides CFLAGS,
since configure ignores cflags when CFLAGS is given.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>