Ruby 1.8.7-p385 を GCC8.2.1(CentOS8標準)でコンパイルするとmake testが通らなかった。
make testが失敗する
動作確認
make test 成功
CentOS 7 の compat-gcc-44 でビルドしたもの
b = 10**80
正常
p b
100000000000000000000000000000000000000000000000000000000000000000000000000000000
make test 失敗
- CentOS 8 の GCC8.2.1 (CentOS8標準)
b = 10**80
0になる・・・
p b
0
0除算エラー
a = b * 9 * 7
p a.modulo(b)
-:4:in `modulo': divided by 0 (ZeroDivisionError)
from -:4
make test 失敗 その2
- GCC 6.5.0 でビルドした場合、core dump吐いて終了
# ./ruby -v
ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]
# ./ruby
b = 10**80
p b
Floating point exception (core dumped)
rbenvメモ
- rbenv でインストールすると
make test
がされないので注意。
# -k を付けて rbenv install を実行すると ソースが残る。
/root/.rbenv/bin/rbenv install 1.8.7-p375 -k
cd /root/.rbenv/sources/1.8.7-p375/ruby-1.8.7-p375/
make test
rbenvについて
cd /root/.rbenv/plugins/ruby-build/bin/
# インストールスクリプト
rbenv-install
# rbenv-install が ruby-buildを呼ぶ。ここで make される
ruby-build
ここで make が行われる
修正
ruby-build
@@ -592,6 +592,8 @@
{ "$MAKE" $MAKE_OPTS ${!PACKAGE_MAKE_OPTS} "${!PACKAGE_MAKE_OPTS_ARRAY}"
} >&4 2>&1
+
+ "$MAKE" test >&4 2>&1
}
build_package_standard_install() {