Repository navigation
Expand file tree
/
Copy path2.6.10
More file actions
49 lines (44 loc) · 2.44 KB
/
Copy path2.6.10
File metadata and controls
49 lines (44 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# platforms: ubuntu-resolute-amd64 ubuntu-resolute-arm64
install_bundler() {
"$PREFIX_PATH"/bin/gem install bundler:1.17.3
"$PREFIX_PATH"/bin/gem install bundler:2.4.22
}
# -O3 because leaving this empty does not mean "use configure's default". ruby-build
# exports it as CFLAGS, which supersedes configure's own optflags, so an empty value builds
# at -O0 — measured 2-3x slower than the same source at -O3.
#
# -fno-strict-overflow guards fixnum overflow checks that assume signed overflow wraps —
# undefined behaviour GCC exploits from -O2 up. 2.6 uses builtin overflow intrinsics and
# doesn't strictly need it, but it's free (within noise here) and keeps every definition
# in this repo on the same flags.
RUBY_CFLAGS="-O3 -fno-strict-overflow"
case "$(cc -v 2>&1)" in
*gcc*)
RUBY_CFLAGS+=" -Wno-discarded-qualifiers"
RUBY_CFLAGS+=" -Wno-incompatible-pointer-types"
RUBY_CFLAGS+=" -Wno-int-conversion"
RUBY_CFLAGS+=" -Wno-return-type"
# GCC 15 porting: Use -std=gnu99 with relaxed type checking
RUBY_CFLAGS+=" -std=gnu99 -Wno-error=implicit-function-declaration"
;;
*clang*)
RUBY_CFLAGS+=" -Wno-incompatible-function-pointer-types"
RUBY_CFLAGS+=" -Wno-int-conversion"
RUBY_CFLAGS+=" -Wno-return-type"
;;
esac
export RUBY_CFLAGS
# Disable BASERUBY to avoid erb dependency issues on Arch Linux
# (system Ruby 3.4+ doesn't include erb bundled gem, which breaks bootstrap)
package_option ruby configure --with-baseruby=no
package_option ruby configure --with-out-ext=tcl --with-out-ext=tk --disable-install-doc
# No MJIT. GCC 15 compiles as C23 by default, where `int (*)()` no longer means "any
# arguments", so 2.6's ANYARGS prototypes stop matching. The -std=gnu99 above covers the
# interpreter, but tool/transform_mjit_header.rb checks the JIT header with its own flags
# and ignores CFLAGS, so the build dies there ("passing argument 2 of 'rb_hash_foreach'
# from incompatible pointer type", -Wfatal-errors). MJIT was experimental and off by
# default in 2.6; dropping it skips the header rather than patching the tool.
package_option ruby configure --disable-jit-support
install_package "openssl-1.1.1w" "https://www.openssl.org/source/openssl-1.1.1w.tar.gz#cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8" openssl
install_package "ruby-2.6.10" "https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.10.tar.bz2#399e1f13e7fedc3c6ae2ff541bbf26c44dfb63b07b6c186fdd15b4e526e27e9c" enable_shared standard
install_bundler