2015/03/06 (金)

2015-03-06:rbenv install 2.2.0 コンパイルエラー

CentOS5.8(32bit)なマシンに ruby 環境を、と rbenv で 2.2.0 を用意しようとして、コンパイルエラーを喰らった。
ログには

vm_exec.c: In function ‘vm_exec_core’:
vm_exec.c:127: error: unable to find a register to spill in class ‘SIREG’
vm_exec.c:127: error: this is the insn:
(insn:HI 8524 8522 8525 1038 vm.c:644 (parallel [
            (set (reg:SI 2 cx [2550])
                (const_int 0 [0x0]))
            (set (reg/f:SI 2547 [ proc ])
                (plus:SI (ashift:SI (reg:SI 2 cx [2549])
                        (const_int 2 [0x2]))
                    (reg:SI 5 di [orig:1030 D.47295 ] [1030])))
            (set (reg/f:SI 2548 [ block ])
                (plus:SI (ashift:SI (reg:SI 2 cx [2549])
                        (const_int 2 [0x2]))
                    (reg/v/f:SI 1033 [ blockptr ])))
            (set (mem/s:BLK (reg:SI 5 di [orig:1030 D.47295 ] [1030]) [13 .block+0 S20 A32])
                (mem/s:BLK (reg/v/f:SI 1033 [ blockptr ]) [13 S20 A32]))
            (use (reg:SI 2 cx [2549]))
            (use (reg:SI 19 dirflag))
        ]) 528 {*rep_movsi} (insn_list:REG_DEP_TRUE 8516 (insn_list:REG_DEP_TRUE 8521 (insn_list:REG_DEP_TRUE 8522 (nil))))

といったものが。
“error: unable to find a register to spill in class ‘SIREG’”でググると、違いファイルのエラーだけど先人が質問してて、それに matz が答えているのを発見。

Compile error for HEAD
https://www.ruby-forum.com/topic/127124

曰く、

I think we hit the GCC bug. akr said he would file this to gcc list.
For the time being, turn off optimizer by removing -O2 option from
Makefile.

とのことで、たしかに

# CFLAGS="-O0" rbenv install 2.2.0

これでコンパイルは通った。

しかし、上の記事、日付見ると2007年だぞ。なんでいまさらこんなのにひっかかるんだ。。。

comment