Bug #15513
closedMJIT compilation terminated due to -Wfatal-errors on GCC 7.3.0
Description
GCC 7.3.0 で MJIT を有効にしてみたところ、生成されたヘッダファイルがコンパイルエラーになるようです。
GCC のバージョン¶
$ gcc --version
gcc (Gentoo 7.3.0-r3 p1.4) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
実行環境¶
$ uname -a
Linux localhost.localdomain 4.14.83-gentoo #3 SMP Mon Jan 7 13:56:38 JST 2019 x86_64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz GenuineIntel GNU/Linux
サンプルコード(/tmp/t.rb)¶
def calculate(a, b, n = 40_000_000)
n.times.count do
a = a * 16807 % 2147483647
b = b * 48271 % 2147483647
(a & 0xffff) == (b & 0xffff)
end
end
raise unless calculate(65, 8921) == 588
p result: calculate(699, 124)
実行結果¶
$ ruby --jit --jit-verbose=1 /tmp/t.rb
/tmp/_ruby_mjit_p18462u106.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u46.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u41.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u2.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u10.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u11.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u0.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u1.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u21.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u28.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u29.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u30.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u31.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u32.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u37.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u3.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u36.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u35.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u34.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u33.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u27.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u39.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u40.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u38.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u6.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u43.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u44.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u45.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u42.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u23.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u24.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u22.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u74.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u68.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u69.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u58.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u51.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u53.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u20.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u49.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u50.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u52.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u54.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u55.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u56.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u57.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u59.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u60.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u61.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u62.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u63.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u64.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u66.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u67.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u73.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u47.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u48.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u65.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u70.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u71.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u72.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u75.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u76.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u8.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u12.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u13.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u14.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u15.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u80.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u78.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u100.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u82.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u79.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u101.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u102.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u103.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u104.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u105.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u19.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u81.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u9.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u85.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u94.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u95.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u87.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u92.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u93.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u83.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u84.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u86.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u88.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u89.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u90.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u91.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u16.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u17.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u18.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u25.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u26.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u77.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u96.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u4.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u5.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u97.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u98.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u99.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
/tmp/_ruby_mjit_p18462u7.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp18462u0.h"
^
compilation terminated due to -Wfatal-errors.
{:result=>600}
Successful MJIT finish
Files
Updated by hsbt (Hiroshi SHIBATA) almost 6 years ago
- Status changed from Open to Assigned
- Assignee set to k0kubun (Takashi Kokubun)
Updated by k0kubun (Takashi Kokubun) almost 6 years ago
- Status changed from Assigned to Feedback
ご報告ありがとうございます。私も普段Linux上でgcc 7.3.0を使って開発をしていますが、現在同様の問題を再現できないので、デバッグのため以下の3つをいただけないでしょうか。
- (
rm -f /tmp/_ruby_mjit*
の後)ruby -v --jit-verbose=2 --jit-save-temps --disable-gems /tmp/t.rb
を実行したログ全体 - ↑のログに出現する
include/ruby-2.6.0/x86_64-linux/rb_mjit_min_header-2.6.0.h
ファイル (アップロードでお願いします) -
/tmp/_ruby_mjit*.c
ファイル (アップロードでお願いします)
Updated by kajisha (Hiroshi Kajisha) almost 6 years ago
- File rb_mjit_min_header-2.6.0.h rb_mjit_min_header-2.6.0.h added
- File _ruby_mjit_p23890u0.c _ruby_mjit_p23890u0.c added
- (rm -f /tmp/_ruby_mjit* の後) ruby -v --jit-verbose=2 --jit-save-temps --disable-gems /tmp/t.rb を実行したログ全体
以下実行ログになります。
$ ruby -v --jit-verbose=2 --jit-save-temps --disable-gems /tmp/t.rb
ruby 2.6.0p0 (2018-12-25 revision 66547) +JIT [x86_64-linux]
MJIT: CC defaults to /usr/bin/gcc
MJIT: tmp_dir is /tmp
Creating precompiled header
Starting process: /usr/bin/gcc /usr/bin/gcc -w -Wfatal-errors -fPIC -shared -w -pipe -O3 -o /tmp/_ruby_mjit_hp23890u0.h.gch /home/hiroshi/.asdf/installs/ruby/2.6.0/include/ruby-2.6.0/x86_64-linux/rb_mjit_min_header-2.6.0.h
start compilation: block in calculate@/tmp/t.rb:2 -> /tmp/_ruby_mjit_p23890u0.c
Starting process: /usr/bin/gcc /usr/bin/gcc -w -Wfatal-errors -fPIC -shared -w -pipe -O3 -o /tmp/_ruby_mjit_p23890u0.o /tmp/_ruby_mjit_p23890u0.c -c -L/home/hiroshi/.asdf/installs/ruby/2.6.0/lib -Wl,--compress-debug-sections=zlib -nostartfiles -nodefaultlibs -nostdlib
/tmp/_ruby_mjit_p23890u0.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp23890u0.h"
^
compilation terminated due to -Wfatal-errors.
compile_c_to_o: compile error: 1
Failed to generate so: /tmp/_ruby_mjit_p23890u0.so
{:result=>600}
Stopping worker thread
Successful MJIT finish
- ↑のログに出現する include/ruby-2.6.0/x86_64-linux/rb_mjit_min_header-2.6.0.h ファイル (アップロードでお願いします)
- /tmp/_ruby_mjit*.c ファイル (アップロードでお願いします)
添付いたしました。
Updated by k0kubun (Takashi Kokubun) almost 6 years ago
共有ありがとうございます。いただいたファイルを手元で同様のコマンドにてコンパイルしたところコンパイルエラーにならないので、先ほどのファイルが /tmp にある状態で(削除済であれば再度実行し、pXXXXX 部分をご変更ください)以下のコマンドのログをご共有いただけないでしょうか。
/usr/bin/gcc -w -Winvalid-pch -fPIC -shared -w -pipe -O3 -o /tmp/_ruby_mjit_p23890u0.o /tmp/_ruby_mjit_p23890u0.c -c -L/home/hiroshi/.asdf/installs/ruby/2.6.0/lib -Wl,--compress-debug-sections=zlib -nostartfiles -nodefaultlibs -nostdlib
-Wfatal-errors
を取り除き、 -Winvalid-pch
を追加しています。また、念のため ls -l /tmp/_ruby_mjit_hp23890u0.h.gch
の結果も確認したいです。
Updated by kajisha (Hiroshi Kajisha) almost 6 years ago
再起動で /tmp 以下が消えたため ruby -v --jit-verbose=2 --jit-save-temps --disable-gems /tmp/t.rb
から再度実行しました
$ ruby -v --jit-verbose=2 --jit-save-temps --disable-gems /tmp/t.rb
ruby 2.6.0p0 (2018-12-25 revision 66547) +JIT [x86_64-linux]
MJIT: CC defaults to /usr/bin/gcc
MJIT: tmp_dir is /tmp
Creating precompiled header
Starting process: /usr/bin/gcc /usr/bin/gcc -w -Wfatal-errors -fPIC -shared -w -pipe -O3 -o /tmp/_ruby_mjit_hp12174u0.h.gch /home/hiroshi/.asdf/installs/ruby/2.6.0/include/ruby-2.6.0/x86_64-linux/rb_mjit_min_header-2.6.0.h
start compilation: block in calculate@/tmp/t.rb:2 -> /tmp/_ruby_mjit_p12174u0.c
Starting process: /usr/bin/gcc /usr/bin/gcc -w -Wfatal-errors -fPIC -shared -w -pipe -O3 -o /tmp/_ruby_mjit_p12174u0.o /tmp/_ruby_mjit_p12174u0.c -c -L/home/hiroshi/.asdf/installs/ruby/2.6.0/lib -Wl,--compress-debug-sections=zlib -nostartfiles -nodefaultlibs -nostdlib
/tmp/_ruby_mjit_p12174u0.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp12174u0.h"
^
compilation terminated due to -Wfatal-errors.
compile_c_to_o: compile error: 1
Failed to generate so: /tmp/_ruby_mjit_p12174u0.so
{:result=>600}
Stopping worker thread
Successful MJIT finish
-Winvalid-pch
を付与して実行しました。
$ /usr/bin/gcc -w -Winvalid-pch -fPIC -shared -w -pipe -O3 -o /tmp/_ruby_mjit_p12174u0.o /tmp/_ruby_mjit_p12174u0.c -c -L/home/hiroshi/.asdf/installs/ruby/2.6.0/lib -Wl,--compress-debug-sections=zlib -nostartfiles -nodefaultlibs -nostdlib
/tmp/_ruby_mjit_p12174u0.c:1:39: error: one or more PCH files were found, but they were invalid
#include "/tmp/_ruby_mjit_hp12174u0.h"
^
/tmp/_ruby_mjit_p12174u0.c:1:10: fatal error: /tmp/_ruby_mjit_hp12174u0.h: No such file or directory
#include "/tmp/_ruby_mjit_hp12174u0.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
$ ls -l /tmp/_ruby_mjit_hp12174u0.h.gch
-rw------- 1 hiroshi hiroshi 9695664 Jan 8 08:34 /tmp/_ruby_mjit_hp12174u0.h.gch
Updated by wanabe (_ wanabe) almost 6 years ago
Dockerhub の gentoo/stage3-amd64:20190106 で再現しました。
Gentoo Linux では独自に https://gitweb.gentoo.org/proj/gcc-patches.git/tree/7.3.0/gentoo/13_all_default-ssp-fix.patch のようなパッチを当てていて、-nodefaultlibs オプションをつけると -fno-stack-protector
オプションもあわせて cc1 に渡されるようです。
83c3480156c5 /bug15513 # echo "void main() {}" > a.c && /usr/bin/gcc -v a.c -c 2>&1|grep cc1
/usr/libexec/gcc/x86_64-pc-linux-gnu/7.3.0/cc1 -quiet -v a.c -quiet -dumpbase a.c -mtune=generic -march=x86-64 -auxbase a -version -o /tmp/ccKwTDxC.s
83c3480156c5 /bug15513 # echo "void main() {}" > a.c && /usr/bin/gcc -v a.c -c -nodefaultlibs 2>&1|grep cc1
/usr/libexec/gcc/x86_64-pc-linux-gnu/7.3.0/cc1 -quiet -v a.c -quiet -dumpbase a.c -mtune=generic -march=x86-64 -auxbase a -version -fno-stack-protector -o /tmp/cc8GG9aZ.s
83c3480156c5 /bug15513 # gcc --version
gcc (Gentoo 7.3.0-r3 p1.4) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
このパッチが当てられた詳しい理由まではわかりませんでした。
Updated by k0kubun (Takashi Kokubun) almost 6 years ago
- Status changed from Feedback to Assigned
お二人ともご強力ありがとうございます。
Dockerhub の gentoo/stage3-amd64:20190106 で再現しました。
Gentoo Linux では独自に https://gitweb.gentoo.org/proj/gcc-patches.git/tree/7.3.0/gentoo/13_all_default-ssp-fix.patch のようなパッチを当てていて、-nodefaultlibs オプションをつけると -fno-stack-protector オプションもあわせて cc1 に渡されるようです。
リンカ向けに渡していたフラグが(少なくともそのGentoo Linuxの環境では)cc1に渡るフラグにも影響を与えるようになっていたのですね。なるほど。
そのDockerイメージを利用し、現時点での情報量で何らか対応できそうなので、後で直しておきます。
Updated by k0kubun (Takashi Kokubun) almost 6 years ago
- Status changed from Assigned to Closed
Applied in changeset trunk|r66817.
mjit_worker.c: pass -nostdlib when making pch as well
[Bug #15513]
Updated by k0kubun (Takashi Kokubun) almost 6 years ago
@kajisha (Hiroshi Kajisha) 多分 r66817 で直ると思うのですが、最新のtrunkでMJITが動くかご確認いただけないでしょうか。
Updated by k0kubun (Takashi Kokubun) almost 6 years ago
- Backport changed from 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN to 2.4: DONTNEED, 2.5: DONTNEED, 2.6: REQUIRED
Updated by kajisha (Hiroshi Kajisha) almost 6 years ago
- ruby -v changed from ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux] to ruby 2.7.0dev (2019-01-15 trunk 66823) [x86_64-linux]
下記のとおりコンパイルされることが確認できました!ありがとうございます。
$ time ruby -v --jit-verbose=2 --jit-save-temps --disable-gems /tmp/t.rb
ruby 2.7.0dev (2019-01-15 trunk 66823) +JIT [x86_64-linux]
MJIT: CC defaults to /usr/bin/gcc
MJIT: tmp_dir is /tmp
Creating precompiled header
Starting process: /usr/bin/gcc /usr/bin/gcc -w -Wfatal-errors -fPIC -shared -w -pipe -O3 -nodefaultlibs -nostdlib -o /tmp/_ruby_mjit_hp1832u0.h.gch /home/hiroshi/.asdf/installs/ruby/2.7.0-dev/include/ruby-2.7.0/x86_64-linux/rb_mjit_min_header-2.7.0.h
start compilation: block in calculate@/tmp/t.rb:2 -> /tmp/_ruby_mjit_p1832u0.c
Starting process: /usr/bin/gcc /usr/bin/gcc -w -Wfatal-errors -fPIC -shared -w -pipe -O3 -o /tmp/_ruby_mjit_p1832u0.o /tmp/_ruby_mjit_p1832u0.c -c -lgcc -L/home/hiroshi/.asdf/installs/ruby/2.7.0-dev/lib -Wl,--compress-debug-sections=zlib -nostartfiles -nodefaultlibs -nostdlib
Starting process: /usr/bin/gcc /usr/bin/gcc -shared -Wfatal-errors -fPIC -shared -w -pipe -O3 -o /tmp/_ruby_mjit_p1832u0.so /tmp/_ruby_mjit_p1832u0.o -lgcc -L/home/hiroshi/.asdf/installs/ruby/2.7.0-dev/lib -Wl,--compress-debug-sections=zlib -nostartfiles -nodefaultlibs -nostdlib
JIT success (81.1ms): block in calculate@/tmp/t.rb:2 -> /tmp/_ruby_mjit_p1832u0.c
{:result=>600}
Stopping worker thread
Successful MJIT finish
real 0m4.248s
user 0m4.470s
sys 0m0.084s
Updated by kajisha (Hiroshi Kajisha) almost 6 years ago
- ruby -v changed from ruby 2.7.0dev (2019-01-15 trunk 66823) [x86_64-linux] to ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux]
バージョンがかわってしまったので元にもどしました。
Updated by naruse (Yui NARUSE) almost 6 years ago
- Backport changed from 2.4: DONTNEED, 2.5: DONTNEED, 2.6: REQUIRED to 2.4: DONTNEED, 2.5: DONTNEED, 2.6: DONE
ruby_2_6 r66850 merged revision(s) 66817.