ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-dev:50669] [Ruby trunk Bug#15319] Since r65735, tool/mjit_archflag.sh related error on Solaris 10
       [not found] <redmine.issue-15319.20181119093526@ruby-lang.org>
@ 2018-11-19  9:35 ` ngotogenome
  2018-11-19  9:44 ` [ruby-dev:50670] " ngotogenome
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: ngotogenome @ 2018-11-19  9:35 UTC (permalink / raw)
  To: ruby-dev

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

----------------------------------------
Bug #15319: Since r65735, tool/mjit_archflag.sh related error on Solaris 10
https://bugs.ruby-lang.org/issues/15319

* 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/

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

* [ruby-dev:50670] [Ruby trunk Bug#15319] Since r65735, tool/mjit_archflag.sh related error on Solaris 10
       [not found] <redmine.issue-15319.20181119093526@ruby-lang.org>
  2018-11-19  9:35 ` [ruby-dev:50669] [Ruby trunk Bug#15319] Since r65735, tool/mjit_archflag.sh related error on Solaris 10 ngotogenome
@ 2018-11-19  9:44 ` ngotogenome
  2018-11-19 13:36 ` [ruby-dev:50671] " nobu
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: ngotogenome @ 2018-11-19  9:44 UTC (permalink / raw)
  To: ruby-dev

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


どうやら `	indent=$${archs+  } define_arch_flags; \` の行で/bin/shのエラーが発生しているようです。

つまり `${archs+ }` の閉じ括弧が単体のコマンドとして認識されているようです。


----------------------------------------
Bug #15319: Since r65735, tool/mjit_archflag.sh related error on Solaris 10
https://bugs.ruby-lang.org/issues/15319#change-74936

* 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/

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

* [ruby-dev:50671] [Ruby trunk Bug#15319] Since r65735, tool/mjit_archflag.sh related error on Solaris 10
       [not found] <redmine.issue-15319.20181119093526@ruby-lang.org>
  2018-11-19  9:35 ` [ruby-dev:50669] [Ruby trunk Bug#15319] Since r65735, tool/mjit_archflag.sh related error on Solaris 10 ngotogenome
  2018-11-19  9:44 ` [ruby-dev:50670] " ngotogenome
@ 2018-11-19 13:36 ` nobu
  2018-11-21  3:28 ` [ruby-dev:50672] [Ruby trunk Bug#15319][Open] " ngotogenome
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: nobu @ 2018-11-19 13:36 UTC (permalink / raw)
  To: ruby-dev

Issue #15319 has been updated by nobu (Nobuyoshi Nakada).


これでどうでしょうか。

```diff
diff --git a/Makefile.in b/Makefile.in
index f1d5258ad9..b8db70f5c8 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -601,7 +601,7 @@ mjit_config.h:
 	quote "MJIT_DLDFLAGS    MJIT_ARCHFLAG" $(MJIT_DLDFLAGS); \
 	quote "MJIT_LIBS       " $(LIBRUBYARG_SHARED); \
 	quote 'PRELOADENV       "@PRELOADENV@"'; \
-	indent=$${archs+  } define_arch_flags; \
+	indent="$${archs+  }" define_arch_flags; \
 	echo; \
 	echo '#endif /* RUBY_MJIT_CONFIG_H */'; \
 	} > $@
```

----------------------------------------
Bug #15319: Since r65735, tool/mjit_archflag.sh related error on Solaris 10
https://bugs.ruby-lang.org/issues/15319#change-74948

* 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/

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

* [ruby-dev:50672] [Ruby trunk Bug#15319][Open] Since r65735, tool/mjit_archflag.sh related error on Solaris 10
       [not found] <redmine.issue-15319.20181119093526@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2018-11-19 13:36 ` [ruby-dev:50671] " nobu
@ 2018-11-21  3:28 ` ngotogenome
  2018-11-21  3:51 ` [ruby-dev:50673] [Ruby trunk Bug#15319] " nobu
  2018-11-21 16:44 ` [ruby-dev:50674] [Ruby trunk Bug#15319][Open] " ngotogenome
  5 siblings, 0 replies; 6+ messages in thread
From: ngotogenome @ 2018-11-21  3:28 UTC (permalink / raw)
  To: ruby-dev

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

Status changed from Closed to Open

r65808 の修正後、別のエラーになりました。(r65894で確認)

抜粋すると、bash等のローカル変数作成用の予約語 `local` がSolarisの/bin/shでは普通のコマンド扱いされています。

~~~
+ local indent= 
/bin/sh: local: not found
~~~

tool/mjit_archflag.sh の以下の行が原因と思われます。

~~~
define_arch_flags() {
    local indent=${archs:+'  '}
    ${archs:+echo} ${archs:+'#if 0'}
~~~

このスクリプトの現在の使われ方を見る限りは、 `indent` をグローバル変数にしても変わらない気がしますので、local を外して良いでしょうか?


----------------------------------------
Bug #15319: Since r65735, tool/mjit_archflag.sh related error on Solaris 10
https://bugs.ruby-lang.org/issues/15319#change-74997

* 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/

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

* [ruby-dev:50673] [Ruby trunk Bug#15319] Since r65735, tool/mjit_archflag.sh related error on Solaris 10
       [not found] <redmine.issue-15319.20181119093526@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2018-11-21  3:28 ` [ruby-dev:50672] [Ruby trunk Bug#15319][Open] " ngotogenome
@ 2018-11-21  3:51 ` nobu
  2018-11-21 16:44 ` [ruby-dev:50674] [Ruby trunk Bug#15319][Open] " ngotogenome
  5 siblings, 0 replies; 6+ messages in thread
From: nobu @ 2018-11-21  3:51 UTC (permalink / raw)
  To: ruby-dev

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/

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

* [ruby-dev:50674] [Ruby trunk Bug#15319][Open] Since r65735, tool/mjit_archflag.sh related error on Solaris 10
       [not found] <redmine.issue-15319.20181119093526@ruby-lang.org>
                   ` (4 preceding siblings ...)
  2018-11-21  3:51 ` [ruby-dev:50673] [Ruby trunk Bug#15319] " nobu
@ 2018-11-21 16:44 ` ngotogenome
  5 siblings, 0 replies; 6+ messages in thread
From: ngotogenome @ 2018-11-21 16:44 UTC (permalink / raw)
  To: ruby-dev

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

Status changed from Closed to Open

r65902にて、シェルのエラーは出なくなったのですが、mjit_worker.cのコンパイルエラーは出続けています。

~~~
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,/XXXXX/sparc64-gcc-trunk/lib -L/XXXXX/sparc64-gcc-trunk/lib 
+ printf #define MJIT_LIBS        
+ shift 
+ printf  "%s", -Wl,-rpath,/XXXXX/sparc64-gcc-trunk/lib -L/XXXXX/sparc64-gcc-trunk/lib 
+ echo 
+ quote PRELOADENV       "LD_PRELOAD_64" 
+ printf #define PRELOADENV       "LD_PRELOAD_64" 
+ shift 
+ echo 
indent=
+ define_arch_flags 
+ quote MJIT_ARCHFLAG   -m64 -m64 
+ printf #define MJIT_ARCHFLAG   -m64 
+ shift 
+ printf  "%s", -m64 
+ echo 
+ 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:248:20: error: 'm64' undeclared here (not in a function)
mjit_worker.c:248:20: error: expected '}' before string constant
mjit_worker.c:261:5: error: wrong type argument to unary minus
mjit_worker.c:261:5: error: initializer element is not constant
mjit_worker.c:261:5: error: (near initialization for 'CC_DLDFLAGS_ARGS[0]')
mjit_worker.c:261:5: error: expected '}' before string constant
make: *** [mjit.o] Error 1
~~~

mjit_config.h の中身は以下の通りです。

~~~
#ifndef RUBY_MJIT_CONFIG_H
#define RUBY_MJIT_CONFIG_H 1

#define MJIT_MIN_HEADER_NAME "/include/ruby-2.6.0/sparc64-solaris2.10/rb_mjit_min_header-2.6.0.h"
#define MJIT_CC_COMMON   "/usr/local/64/bin/gcc",
#define MJIT_CFLAGS      MJIT_ARCHFLAG "-w",
#define MJIT_OPTFLAGS    "-O3",
#define MJIT_DEBUGFLAGS  "-ggdb3",
#define MJIT_LDSHARED    "/usr/local/64/bin/gcc", "-shared",
#define MJIT_DLDFLAGS    MJIT_ARCHFLAG "-L/usr/local/64/lib", "-R/usr/local/64/lib",
#define MJIT_LIBS        "-Wl,-rpath,/XXXXX/sparc64-gcc-trunk/lib", "-L/XXXXX/sparc64-gcc-trunk/lib",
#define PRELOADENV       "LD_PRELOAD_64"
#define MJIT_ARCHFLAG   -m64 "-m64",

#endif /* RUBY_MJIT_CONFIG_H */
~~~

上記の末尾から3行目の `#define MJIT_ARCHFLAG   -m64 "-m64",` に含まれるダブルクオートで囲まれない素の`-m64`がエラーの原因と思います。

この部分は tool/mjit_archflag.sh の以下の行で生成されたように見えます。
この行の `${arch_flag:- /* no flag */}` の部分が、ダブルクオートで囲まれない `-m64` が出力される直接の原因と思われます。
このコードは、`$arch_flag`が空のときに `/* no flag */` を出力させたい意図で書かれたのは何となくわかるのですが、`$arch_flag`に値がセットされているときには何を出力させたかったのでしょうか?

~~~
    quote "MJIT_ARCHFLAG   ${arch_flag:- /* no flag */}" ${arch_flag}
~~~



----------------------------------------
Bug #15319: Since r65735, tool/mjit_archflag.sh related error on Solaris 10
https://bugs.ruby-lang.org/issues/15319#change-75010

* 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/

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

end of thread, other threads:[~2018-11-21 16:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-15319.20181119093526@ruby-lang.org>
2018-11-19  9:35 ` [ruby-dev:50669] [Ruby trunk Bug#15319] Since r65735, tool/mjit_archflag.sh related error on Solaris 10 ngotogenome
2018-11-19  9:44 ` [ruby-dev:50670] " ngotogenome
2018-11-19 13:36 ` [ruby-dev:50671] " nobu
2018-11-21  3:28 ` [ruby-dev:50672] [Ruby trunk Bug#15319][Open] " ngotogenome
2018-11-21  3:51 ` [ruby-dev:50673] [Ruby trunk Bug#15319] " nobu
2018-11-21 16:44 ` [ruby-dev:50674] [Ruby trunk Bug#15319][Open] " 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).