Bug #9702

r45488以降、SolarisStudioで ext/readline がコンパイルエラー(readline 6.2使用)

Added by Naohisa Goto over 1 year ago. Updated over 1 year ago.

[ruby-dev:48089]
Status:Closed
Priority:Normal
Assignee:-
ruby -v:ruby 2.2.0dev (2014-04-04) [sparc64-solaris2.10] Backport:2.0.0: DONE, 2.1: DONE

Description

r45488以降、Solarisにて、ext/readline が下記のようにコンパイルエラーになります。コンパイラは SolarisStudio 12.3 です。
readline 6.2 との組み合わせになります。

(前略)
cd ext/readline && exec make -w V=1 all
make[2]: Entering directory `/XXXXXXXXXX/ext/readline'
cc -I. -I../../.ext/include/sparc64-solaris2.10 -I../.././include -I../.././ext/readline -DRUBY_EXTCONF_H=\"extconf.h\"  -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include   -KPIC  -xO1 -xtarget=sparc64viiplus -m64 -o readline.o -c readline.c
"/usr/local/64/include/readline/rltypedefs.h", line 61: identifier redeclared: Function
        current : function(void) returning int
        previous: function() returning int : "/usr/local/64/include/readline/rltypedefs.h", line 34
cc: acomp failed for readline.c
make[2]: *** [readline.o] Error 2
make[2]: Leaving directory `/XXXXXXXXXX/ext/readline'
make[1]: *** [ext/readline/all] Error 2
make[1]: Leaving directory `/XXXXXXXXXX'
make: *** [build-ext] Error 2

ext/readline/extconf.rbreadline.have_type("rl_hook_func_t") に、 rl_hook_func_t は存在するはずにもかかわらず、失敗しているのが原因のようです。

extconf.hmkmf.log を添付します。

extconf.h Magnifier - ext/readline/extconf.h (1.39 KB) Naohisa Goto, 04/04/2014 02:17 PM

mkmf.log Magnifier - ext/readline/mkmf.log (73.8 KB) Naohisa Goto, 04/04/2014 02:18 PM


Related issues

Related to Ruby trunk - Bug #9578: ‘Function’ undeclared in readline.c Closed 02/28/2014
Related to Backport21 - Backport #9630: Backport readline-6.3 support. Closed 03/13/2014
Related to Backport200 - Backport #9631: Backport readline-6.3 support. Closed 03/13/2014

Associated revisions

Revision 45518
Added by Nobuyoshi Nakada over 1 year ago

readline/extconf.rb: rl_hook_func_t

  • ext/readline/extconf.rb (rl_hook_func_t): check pointer type. [Bug #9702]

Revision 45518
Added by Nobuyoshi Nakada over 1 year ago

readline/extconf.rb: rl_hook_func_t

  • ext/readline/extconf.rb (rl_hook_func_t): check pointer type. [Bug #9702]

Revision 45754
Added by Usaku NAKAMURA over 1 year ago

merge revision(s) 45518: [Backport #9702]

* ext/readline/extconf.rb (rl_hook_func_t): check pointer type.
   [Bug #9702]

Revision 45773
Added by Tomoyuki Chikanaga over 1 year ago

merge revision(s) r45518: [Backport #9578] [Backport #9630] [Backport #9702]

* ext/readline/extconf.rb (rl_hook_func_t): check pointer type.
   [Bug #9702]

History

#1 Updated by Naohisa Goto over 1 year ago

  • Related to Bug #9578: ‘Function’ undeclared in readline.c added

#2 Updated by Naohisa Goto over 1 year ago

have_type() 内ではsizeof を使って型のサイズをとれるかを元に型の有無を判定しているようですが、
調べたところ、sizeof を関数(関数ポインタではなく)に使うのは未定義動作のようです。

http://stackoverflow.com/questions/12259101/why-is-the-size-of-a-function-in-c-always-1-byte

#3 Updated by Nobuyoshi Nakada over 1 year ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r45518.


readline/extconf.rb: rl_hook_func_t

  • ext/readline/extconf.rb (rl_hook_func_t): check pointer type. [Bug #9702]

#4 Updated by Naohisa Goto over 1 year ago

#5 Updated by Nobuyoshi Nakada over 1 year ago

  • Description updated (diff)
  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN to 2.0.0: REQUIRED, 2.1: REQUIRED

#6 Updated by Naohisa Goto over 1 year ago

#7 Updated by Usaku NAKAMURA over 1 year ago

  • Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED to 2.0.0: DONE, 2.1: REQUIRED

backported into ruby_2_0_0 at r45754.

#8 Updated by Tomoyuki Chikanaga over 1 year ago

  • Backport changed from 2.0.0: DONE, 2.1: REQUIRED to 2.0.0: DONE, 2.1: DONE

r45518 was backported to ruby_2_1 branch at r45773.

Also available in: Atom PDF