Issue #14446 has been updated by ngoto (Naohisa Goto).


Close済ですが追記します。

r62240 にて -m64 などの ARCH_FLAG がmjitヘッダ生成時に渡るようになり、(r62285 より前の時点で)Ruby本体のビルド自体はエラー無く正常終了するようになっていました。(r62265 にて確認)

なお、生成されたヘッダを使ったJITは残念ながら上手くいかないようでしたが詳細は未確認です。それが必要になったら別チケットを切ります。

----------------------------------------
Bug #14446: Solaris 10 上の Oracle Developer Studio 12.5 および 12.6 の64ビットコンパイル時のmjit関係のエラー
https://bugs.ruby-lang.org/issues/14446#change-70279

* Author: ngoto (Naohisa Goto)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Solaris 10 上にて、Oracle Developer Studio 12.5 または 12.6 にて64ビットコンパイル時、以下のエラーでコンパイルに失敗します。

64ビットバイナリの作成には -m64 (もっと古いバージョンのコンパイラでは -xarch=v9)をCFLAGSやLDFLAGSに付ける必要があるのですが、 ./tool/transform_mjit_header.rb がそれに対応していない(CFLAGS相当が決め打ち)なのが原因のように見えます。

~~~
$ export CC=cc
$ export CXX=CC
$ export CPPLAGS="-I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include"
$ export CFLAGS="-errtags=yes  -xO4 -xtarget=sparc64xplus -m64"
$ export CXXFLAGS=$CFLAGS
$ export LDFLAGS="-m64 -L/usr/local/64/lib -R/usr/local/64/lib"
$ export DLDFLAGS=$LDFLAGS
$ export MAKE=/usr/local/64/bin/make
$ ./configure --prefix=/XXXXX/sparc64-cc126-trunk --build=sparc64-sun-solaris2.10 --with-tclConfig-dir=/usr/local/64/lib --with-tkConfig-dir=/usr/local/64/lib
(中略)
$ /usr/local/64/bin/make V=1
	BASERUBY = /usr/local/64/bin/ruby --disable=gems
	CC = cc
	LD = /usr/ccs/bin/ld
	LDSHARED = cc -G
	CFLAGS = -errtags=yes  -xO4 -xtarget=sparc64xplus -m64
	XCFLAGS = -DRUBY_DEVEL=1 -DRUBY_EXPORT
	CPPFLAGS = -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include  -D_XOPEN_SOURCE=600   -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -I./enc/unicode/10.0.0 -DMJIT_HEADER_BUILD_DIR=".ext/include/sparc64-solaris2.10" -DLIBRUBYARG_SHARED="-L/XXXXX/sparc64-cc126-trunk/lib
" -DLIBRUBY_LIBDIR="/XXXXX/sparc64-cc126-trunk/lib" -DMJIT_HEADER_INSTALL_DIR="/XXXXX/sparc64-cc126-trunk/include/ruby-2.6.0/sparc64-solaris2.10"
	DLDFLAGS = -m64  -L/usr/local/64/lib -R/usr/local/64/lib  -m64
	SOLIBS = 
	LANG = C
	LC_ALL = 
	LC_CTYPE = 
cc: Studio 12.6 Sun C 5.15 SunOS_sparc 2017/05/30
cc  -errtags=yes  -xO4 -xtarget=sparc64xplus -m64 -DRUBY_DEVEL=1 -DRUBY_EXPORT -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include  -D_XOPEN_SOURCE=600   -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -I./enc/unicode/10.0.0 -DMJIT_HEADER_BUILD_DIR=\"".ext/include/sparc64-solaris2.10"\" -DLIBRUBYARG_SHARED=\""-L/XXXXX/sparc64-cc126-trunk/lib "\" -DLIBRUBY_LIBDIR=\""/XXXXX/sparc64-cc126-trunk/lib"\" -DMJIT_HEADER_INSTALL_DIR=\""/XXXXX/sparc64-cc126-trunk/include/ruby-2.6.0/sparc64-solaris2.10"\" -o main.o -c ./main.c
(中略)
cc -E  -errtags=yes  -xO4 -xtarget=sparc64xplus -DRUBY_DEVEL=1 -DRUBY_EXPORT -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include  -D_XOPEN_SOURCE=600   -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -I./enc/unicode/10.0.0 -DMJIT_HEADER_BUILD_DIR=\"".ext/include/sparc64-solaris2.10"\" -DLIBRUBYARG_SHARED=\""-L/user/gen-info/ngoto/testruby/daily/sparc64-cc126-trunk/lib "\" -DLIBRUBY_LIBDIR=\""/XXXXX/sparc64-cc126-trunk/lib"\" -DMJIT_HEADER_INSTALL_DIR=\""/XXXXX/sparc64-cc126-trunk/include/ruby-2.6.0/sparc64-solaris2.10"\" -DMJIT_HEADER ./vm.c -o vm.new
./tool/ifchange rb_mjit_header.h vm.new
rb_mjit_header.h updated
./miniruby -I./lib -I. -I.ext/common  ./tool/transform_mjit_header.rb "cc" rb_mjit_header.h .ext/include/sparc64-solaris2.10/rb_mjit_min_header-2.6.0.h
error in initial header file:
"include/ruby/ruby.h", line 104: zero or negative subscript
"include/ruby/ruby.h", line 108: zero or negative subscript
"./include/ruby/st.h", line 58: zero or negative subscript
"internal.h", line 252: warning: shift count negative or too big: >> 32
"internal.h", line 408: warning: shift count negative or too big: << 63
"internal.h", line 1501: warning: shift count negative or too big: >> 63
"internal.h", line 1538: warning: shift count negative or too big: >> 60
cc: acomp failed for /var/tmp/20180205-11459-t2wq56.c
make: *** [.ext/include/sparc64-solaris2.10/rb_mjit_min_header-2.6.0.h] Error 1
~~~




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>