ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-dev:50583] [Ruby trunk Bug#14876] /bin/sh: bad substitution since r63679 on Solaris
       [not found] <redmine.issue-14876.20180628030542@ruby-lang.org>
@ 2018-06-28  3:05 ` ngotogenome
  2018-06-28 12:02 ` [ruby-dev:50585] " ngotogenome
  2018-06-29 15:41 ` [ruby-dev:50586] " ngotogenome
  2 siblings, 0 replies; 3+ messages in thread
From: ngotogenome @ 2018-06-28  3:05 UTC (permalink / raw)
  To: ruby-dev

Issue #14876 has been reported by ngoto (Naohisa Goto).

----------------------------------------
Bug #14876: /bin/sh: bad substitution since r63679 on Solaris
https://bugs.ruby-lang.org/issues/14876

* 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
----------------------------------------
r63679以降、Solaris 上にて 64ビットでコンパイルすると、
mjit_config.h 作成中に以下のように "/bin/sh: bad substitution" エラーになります。

32ビットコンパイルでは発生しません。(rubyci.orgのSolarisは32ビットのみ)

r63679 で変更された部分が原因と思われますが、シェルとmakeの変数が複雑に入り乱れているため切り分けができていません。

~~~
cc -errtags=yes  -xO4 -xtarget=sparc64xplus -m64 -DRUBY_DEVEL=1 -DRUBY_EXPORT -DCANONICALIZATION_FOR_MATHN -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 -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   cc 
+ printf #define MJIT_CC_COMMON   
+ shift 
+ printf  "%s", cc 
+ echo 
+ quote MJIT_CFLAGS      MJIT_ARCHFLAG -w 
+ printf #define MJIT_CFLAGS      MJIT_ARCHFLAG 
+ shift 
+ printf  "%s", -w 
+ echo 
+ quote MJIT_OPTFLAGS    
+ printf #define MJIT_OPTFLAGS    
+ shift 
+ echo 
+ quote MJIT_DEBUGFLAGS  -g 
+ printf #define MJIT_DEBUGFLAGS  
+ shift 
+ printf  "%s", -g 
+ echo 
+ quote MJIT_LDSHARED    cc -G 
+ printf #define MJIT_LDSHARED    
+ shift 
+ printf  "%s", cc -G 
+ echo 
+ quote MJIT_DLDFLAGS    MJIT_ARCHFLAG -m64 -L/usr/local/64/lib -R/usr/local/64/lib 
+ printf #define MJIT_DLDFLAGS    MJIT_ARCHFLAG 
+ shift 
+ printf  "%s", -m64 -L/usr/local/64/lib -R/usr/local/64/lib 
+ echo 
+ quote MJIT_LIBS        -L/XXXXXXXXXX/lib 
+ printf #define MJIT_LIBS        
+ shift 
+ printf  "%s", -L/XXXXXXXXXX/lib 
+ echo 
+ echo #if 0 
/bin/sh: bad substitution
make: *** [mjit_config.h] Error 1
~~~




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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-dev:50585] [Ruby trunk Bug#14876] /bin/sh: bad substitution since r63679 on Solaris
       [not found] <redmine.issue-14876.20180628030542@ruby-lang.org>
  2018-06-28  3:05 ` [ruby-dev:50583] [Ruby trunk Bug#14876] /bin/sh: bad substitution since r63679 on Solaris ngotogenome
@ 2018-06-28 12:02 ` ngotogenome
  2018-06-29 15:41 ` [ruby-dev:50586] " ngotogenome
  2 siblings, 0 replies; 3+ messages in thread
From: ngotogenome @ 2018-06-28 12:02 UTC (permalink / raw)
  To: ruby-dev

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


r63232 で追加された `${arch%=*}` が "bad substitution" の原因でした。
前後の部分を引用します。

~~~
       $${archs:+echo} $${archs:+'#if 0'}; \
       for arch in $$archs; do \
           echo "#elif defined __$${arch%=*}__"; \
           quote "  MJIT_ARCHFLAG " -arch $${arch%=*}; \
       done; \
       $${archs:+echo} $${archs:+'#endif'}; \
~~~

従来、archs に値が入っていなかったのでforループには突入しなかったのが、
r63679 の変更で archs に値が入るようになって、露見したようです。


----------------------------------------
Bug #14876: /bin/sh: bad substitution since r63679 on Solaris
https://bugs.ruby-lang.org/issues/14876#change-72688

* 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
----------------------------------------
r63679以降、Solaris 上にて 64ビットでコンパイルすると、
mjit_config.h 作成中に以下のように "/bin/sh: bad substitution" エラーになります。

32ビットコンパイルでは発生しません。(rubyci.orgのSolarisは32ビットのみ)

r63679 で変更された部分が原因と思われますが、シェルとmakeの変数が複雑に入り乱れているため切り分けができていません。

~~~
cc -errtags=yes  -xO4 -xtarget=sparc64xplus -m64 -DRUBY_DEVEL=1 -DRUBY_EXPORT -DCANONICALIZATION_FOR_MATHN -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 -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   cc 
+ printf #define MJIT_CC_COMMON   
+ shift 
+ printf  "%s", cc 
+ echo 
+ quote MJIT_CFLAGS      MJIT_ARCHFLAG -w 
+ printf #define MJIT_CFLAGS      MJIT_ARCHFLAG 
+ shift 
+ printf  "%s", -w 
+ echo 
+ quote MJIT_OPTFLAGS    
+ printf #define MJIT_OPTFLAGS    
+ shift 
+ echo 
+ quote MJIT_DEBUGFLAGS  -g 
+ printf #define MJIT_DEBUGFLAGS  
+ shift 
+ printf  "%s", -g 
+ echo 
+ quote MJIT_LDSHARED    cc -G 
+ printf #define MJIT_LDSHARED    
+ shift 
+ printf  "%s", cc -G 
+ echo 
+ quote MJIT_DLDFLAGS    MJIT_ARCHFLAG -m64 -L/usr/local/64/lib -R/usr/local/64/lib 
+ printf #define MJIT_DLDFLAGS    MJIT_ARCHFLAG 
+ shift 
+ printf  "%s", -m64 -L/usr/local/64/lib -R/usr/local/64/lib 
+ echo 
+ quote MJIT_LIBS        -L/XXXXXXXXXX/lib 
+ printf #define MJIT_LIBS        
+ shift 
+ printf  "%s", -L/XXXXXXXXXX/lib 
+ echo 
+ echo #if 0 
/bin/sh: bad substitution
make: *** [mjit_config.h] Error 1
~~~




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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-dev:50586] [Ruby trunk Bug#14876] /bin/sh: bad substitution since r63679 on Solaris
       [not found] <redmine.issue-14876.20180628030542@ruby-lang.org>
  2018-06-28  3:05 ` [ruby-dev:50583] [Ruby trunk Bug#14876] /bin/sh: bad substitution since r63679 on Solaris ngotogenome
  2018-06-28 12:02 ` [ruby-dev:50585] " ngotogenome
@ 2018-06-29 15:41 ` ngotogenome
  2 siblings, 0 replies; 3+ messages in thread
From: ngotogenome @ 2018-06-29 15:41 UTC (permalink / raw)
  To: ruby-dev

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


r63679 で Makefile.in の562行目に追加された `archs="$${archs:-$(ARCH_FLAG:-arch=)}";` が悪さをしているようです。
この行は、Makefileの置換とシェルの置換が混ざっていて極めてわかりにくいのですが、
ARCH_FLAG="-arch i386 -arch x86_64" などが入っているとき「だけ」しか考慮されておらず、
ARCH_FLAG="-m64" や ARCH_FLAG="-march=i486" のときは想定外のようです。

ARCH_FLAG="-m64" のときは、mjit_config.h の末尾に以下が追加されることになります。
(シェルの `${arch%=*}` の置換は正常に行われたと仮定)

~~~
#if 0
#elif defined __-m64__
#define   MJIT_ARCHFLAG  "-arch", "-m64",
#endif
~~~

この `#elif defined __-m64__` というのはCのマクロとして明らかに異常と思いますし、
`#define   MJIT_ARCHFLAG  "-arch", "-m64",` というのも、 gcc のオプションとしてエラーになると思います。


----------------------------------------
Bug #14876: /bin/sh: bad substitution since r63679 on Solaris
https://bugs.ruby-lang.org/issues/14876#change-72717

* 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
----------------------------------------
r63679以降、Solaris 上にて 64ビットでコンパイルすると、
mjit_config.h 作成中に以下のように "/bin/sh: bad substitution" エラーになります。

32ビットコンパイルでは発生しません。(rubyci.orgのSolarisは32ビットのみ)

r63679 で変更された部分が原因と思われますが、シェルとmakeの変数が複雑に入り乱れているため切り分けができていません。

~~~
cc -errtags=yes  -xO4 -xtarget=sparc64xplus -m64 -DRUBY_DEVEL=1 -DRUBY_EXPORT -DCANONICALIZATION_FOR_MATHN -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 -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   cc 
+ printf #define MJIT_CC_COMMON   
+ shift 
+ printf  "%s", cc 
+ echo 
+ quote MJIT_CFLAGS      MJIT_ARCHFLAG -w 
+ printf #define MJIT_CFLAGS      MJIT_ARCHFLAG 
+ shift 
+ printf  "%s", -w 
+ echo 
+ quote MJIT_OPTFLAGS    
+ printf #define MJIT_OPTFLAGS    
+ shift 
+ echo 
+ quote MJIT_DEBUGFLAGS  -g 
+ printf #define MJIT_DEBUGFLAGS  
+ shift 
+ printf  "%s", -g 
+ echo 
+ quote MJIT_LDSHARED    cc -G 
+ printf #define MJIT_LDSHARED    
+ shift 
+ printf  "%s", cc -G 
+ echo 
+ quote MJIT_DLDFLAGS    MJIT_ARCHFLAG -m64 -L/usr/local/64/lib -R/usr/local/64/lib 
+ printf #define MJIT_DLDFLAGS    MJIT_ARCHFLAG 
+ shift 
+ printf  "%s", -m64 -L/usr/local/64/lib -R/usr/local/64/lib 
+ echo 
+ quote MJIT_LIBS        -L/XXXXXXXXXX/lib 
+ printf #define MJIT_LIBS        
+ shift 
+ printf  "%s", -L/XXXXXXXXXX/lib 
+ echo 
+ echo #if 0 
/bin/sh: bad substitution
make: *** [mjit_config.h] Error 1
~~~




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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-29 15:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-14876.20180628030542@ruby-lang.org>
2018-06-28  3:05 ` [ruby-dev:50583] [Ruby trunk Bug#14876] /bin/sh: bad substitution since r63679 on Solaris ngotogenome
2018-06-28 12:02 ` [ruby-dev:50585] " ngotogenome
2018-06-29 15:41 ` [ruby-dev:50586] " ngotogenome

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).