[ruby-dev:50673] [Ruby trunk Bug#15319] Since r65735, tool/mjit_archflag.sh related error on Solaris 10
From:
nobu@...
Date:
2018-11-21 03:51:42 UTC
List:
ruby-dev #50673
Issue #15319 has been updated by nobu (Nobuyoshi Nakada).
Makefile.inの呼び出し側で `indent=$${archs:+' '} define_arch_flags` と渡すのはどうでしょうか。
----------------------------------------
Bug #15319: Since r65735, tool/mjit_archflag.sh related error on Solaris 10
https://bugs.ruby-lang.org/issues/15319#change-74998
* Author: ngoto (Naohisa Goto)
* Status: Open
* Priority: Normal
* Assignee: nobu (Nobuyoshi Nakada)
* Target version:
* ruby -v:
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
r65735以降、手元の Solaris 10 上でのコンパイルがエラーになります。
コンパイラは gcc, Oracle Developer Studio のどちらでもダメでした。
r65738においてのgccでの最後の方のコンパイル時の出力を抜粋すると以下の通りです。
~~~
gcc -O -m64 -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -DRUBY_DEVEL=1 -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -fPIE -DCANONICALIZATION_FOR_MATHN -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -std=gnu99 -D_XOPEN_SOURCE=600 -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -I./enc/unicode/10.0.0 -o math.o -c math.c
+ echo #ifndef RUBY_MJIT_CONFIG_H
+ echo #define RUBY_MJIT_CONFIG_H 1
+ echo
sep=
+ quote MJIT_MIN_HEADER_NAME /include/ruby-2.6.0/sparc64-solaris2.10/rb_mjit_min_header-2.6.0.h
+ printf #define MJIT_MIN_HEADER_NAME
+ shift
+ printf "%s" /include/ruby-2.6.0/sparc64-solaris2.10/rb_mjit_min_header-2.6.0.h
+ echo
sep=,
+ quote MJIT_CC_COMMON /usr/local/64/bin/gcc
+ printf #define MJIT_CC_COMMON
+ shift
+ printf "%s", /usr/local/64/bin/gcc
+ echo
+ quote MJIT_CFLAGS MJIT_ARCHFLAG -w
+ printf #define MJIT_CFLAGS MJIT_ARCHFLAG
+ shift
+ printf "%s", -w
+ echo
+ quote MJIT_OPTFLAGS -O3
+ printf #define MJIT_OPTFLAGS
+ shift
+ printf "%s", -O3
+ echo
+ quote MJIT_DEBUGFLAGS -ggdb3
+ printf #define MJIT_DEBUGFLAGS
+ shift
+ printf "%s", -ggdb3
+ echo
+ quote MJIT_LDSHARED /usr/local/64/bin/gcc -shared
+ printf #define MJIT_LDSHARED
+ shift
+ printf "%s", /usr/local/64/bin/gcc -shared
+ echo
+ quote MJIT_DLDFLAGS MJIT_ARCHFLAG -L/usr/local/64/lib -R/usr/local/64/lib
+ printf #define MJIT_DLDFLAGS MJIT_ARCHFLAG
+ shift
+ printf "%s", -L/usr/local/64/lib -R/usr/local/64/lib
+ echo
+ quote MJIT_LIBS -Wl,-rpath,/XXXXXXXXXX/lib -L/XXXXXXXXXX/lib
+ printf #define MJIT_LIBS
+ shift
+ printf "%s", -Wl,-rpath,/XXXXXXXXXX/lib -L/XXXXXXXXXX/lib
+ echo
+ quote PRELOADENV "LD_PRELOAD_64"
+ printf #define PRELOADENV "LD_PRELOAD_64"
+ shift
+ echo
+ } define_arch_flags
/bin/sh: }: not found
+ echo
+ echo #endif /* RUBY_MJIT_CONFIG_H */
gcc -O -m64 -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -DRUBY_DEVEL=1 -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -fPIE -DCANONICALIZATION_FOR_MATHN -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -std=gnu99 -D_XOPEN_SOURCE=600 -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -I./enc/unicode/10.0.0 -o mjit.o -c mjit.c
In file included from mjit.c:18:0:
mjit_worker.c:242:20: error: 'MJIT_ARCHFLAG' undeclared here (not in a function)
mjit_worker.c:242:20: error: expected '}' before string constant
mjit_worker.c:255:5: error: initializer element is not constant
mjit_worker.c:255:5: error: (near initialization for 'CC_DLDFLAGS_ARGS[0]')
mjit_worker.c:255:5: error: expected '}' before string constant
make: *** [mjit.o] Error 1
~~~
`/bin/sh: }: not found` というのがSolarisの/bin/shが出したエラーのようですが、これはMakefile.in (から作成されたMakefile)内の mjit_config.h を作成する部分の `@{` に対応した `}` のような気がします。
もしかすると /bin/sh ではなく make 側の問題の可能性もあるでしょうか?
以下のバージョンのGNU Make を使っています。
~~~
$ /usr/local/bin/make --version
GNU Make 3.82
Built for sparc-sun-solaris2.10
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
~~~
--
https://bugs.ruby-lang.org/