[ruby-trunk - Bug #8227][Open] addr2line.c compile error on Solaris since r39887

Issue #8227 has been reported by ngoto (Naohisa G.).


Bug #8227: addr2line.c compile error on Solaris since r39887
https://bugs.ruby-lang.org/issues/8227

Author: ngoto (Naohisa G.)
Status: Open
Priority: Normal
Assignee: ngoto (Naohisa G.)
Category:
Target version:
ruby -v: ruby 2.1.0dev (2013-04-06) [sparc64-solaris2.10]

r39887以降、Solarisで以下のようなコンパイルエラーが発生します。
Solaris では、quad_t は別の意味の構造体が割り当てられており、u_quad_t は定義されおらず、
また、__inline は、GCC か Sun Studio 12 Update 1 以降でないと使えないためです。
(GCCは未確認)

fcc -O -KV9 -KVIS2 -DRUBY_EXPORT
-I/usr/local/64/lib/libffi-3.0.10/include -I/u
sr/local/64/include -I. -I.ext/include/sparc64-solaris2.10 -I./include
-I. -o
addr2line.o -c addr2line.c
“addr2line.c”, line 691: error: syntax error near int' "addr2line.c", line 691: error: function type is required for__inline’
“addr2line.c”, line 915: error: assignment from int' toquad_t’:
operator =' "addr2line.c", line 988: error: undeclared identifieru_quad_t’
“addr2line.c”, line 988: error: syntax error near )' "addr2line.c", line 988: error: syntax error near)’
“addr2line.c”, line 1006: error: assignment from quad_t' touintmax_t’: operator `=’

以下のようなパッチでコンパイルは通るようになります。

===================================================================
— addr2line.c (revision 40156)
+++ addr2line.c (working copy)
@@ -646,6 +646,19 @@
free(lines);
}

+#if defined(__sun)
+/* Solaris has different quad_t and does not have u_quad_t /
+# include “ruby/defines.h”
+# define quad_t LONG_LONG
+# define u_quad_t unsigned LONG_LONG
+/
__inline can only be used with GCC or Sun Studio 12 Update 1 or
later /
+# if defined(GNUC)
+# elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
+# else
+# define __inline inline
+# endif
+#endif /
defined(__sun) /
+
/
From FreeBSD’s lib/libstand/printf.c /
/
-

  • Copyright © 1986, 1988, 1991, 1993
    ===================================================================

Issue #8227 has been updated by naruse (Yui NARUSE).

add r40170

Backport #8227: addr2line.c compile error on Solaris since r39887
https://bugs.ruby-lang.org/issues/8227#change-38313

Author: ngoto (Naohisa G.)
Status: Assigned
Priority: Normal
Assignee: nagachika (Tomoyuki C.)
Category:
Target version:

r39887以降、Solarisで以下のようなコンパイルエラーが発生します。
Solaris では、quad_t は別の意味の構造体が割り当てられており、u_quad_t は定義されおらず、
また、__inline は、GCC か Sun Studio 12 Update 1 以降でないと使えないためです。
(GCCは未確認)

fcc -O -KV9 -KVIS2 -DRUBY_EXPORT
-I/usr/local/64/lib/libffi-3.0.10/include -I/u
sr/local/64/include -I. -I.ext/include/sparc64-solaris2.10 -I./include
-I. -o
addr2line.o -c addr2line.c
“addr2line.c”, line 691: error: syntax error near int' "addr2line.c", line 691: error: function type is required for__inline’
“addr2line.c”, line 915: error: assignment from int' toquad_t’:
operator =' "addr2line.c", line 988: error: undeclared identifieru_quad_t’
“addr2line.c”, line 988: error: syntax error near )' "addr2line.c", line 988: error: syntax error near)’
“addr2line.c”, line 1006: error: assignment from quad_t' touintmax_t’: operator `=’

以下のようなパッチでコンパイルは通るようになります。

===================================================================
— addr2line.c (revision 40156)
+++ addr2line.c (working copy)
@@ -646,6 +646,19 @@
free(lines);
}

+#if defined(__sun)
+/* Solaris has different quad_t and does not have u_quad_t /
+# include “ruby/defines.h”
+# define quad_t LONG_LONG
+# define u_quad_t unsigned LONG_LONG
+/
__inline can only be used with GCC or Sun Studio 12 Update 1 or
later /
+# if defined(GNUC)
+# elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
+# else
+# define __inline inline
+# endif
+#endif /
defined(__sun) /
+
/
From FreeBSD’s lib/libstand/printf.c /
/
-

  • Copyright © 1986, 1988, 1991, 1993
    ===================================================================

Issue #8227 has been updated by ngoto (Naohisa G.).

r40170 is fine on Solaris with Oracle Solaris Studio 12.3.

Backport #8227: addr2line.c compile error on Solaris since r39887
https://bugs.ruby-lang.org/issues/8227#change-38414

Author: ngoto (Naohisa G.)
Status: Assigned
Priority: Normal
Assignee: nagachika (Tomoyuki C.)
Category:
Target version:

r39887以降、Solarisで以下のようなコンパイルエラーが発生します。
Solaris では、quad_t は別の意味の構造体が割り当てられており、u_quad_t は定義されおらず、
また、__inline は、GCC か Sun Studio 12 Update 1 以降でないと使えないためです。
(GCCは未確認)

fcc -O -KV9 -KVIS2 -DRUBY_EXPORT
-I/usr/local/64/lib/libffi-3.0.10/include -I/u
sr/local/64/include -I. -I.ext/include/sparc64-solaris2.10 -I./include
-I. -o
addr2line.o -c addr2line.c
“addr2line.c”, line 691: error: syntax error near int' "addr2line.c", line 691: error: function type is required for__inline’
“addr2line.c”, line 915: error: assignment from int' toquad_t’:
operator =' "addr2line.c", line 988: error: undeclared identifieru_quad_t’
“addr2line.c”, line 988: error: syntax error near )' "addr2line.c", line 988: error: syntax error near)’
“addr2line.c”, line 1006: error: assignment from quad_t' touintmax_t’: operator `=’

以下のようなパッチでコンパイルは通るようになります。

===================================================================
— addr2line.c (revision 40156)
+++ addr2line.c (working copy)
@@ -646,6 +646,19 @@
free(lines);
}

+#if defined(__sun)
+/* Solaris has different quad_t and does not have u_quad_t /
+# include “ruby/defines.h”
+# define quad_t LONG_LONG
+# define u_quad_t unsigned LONG_LONG
+/
__inline can only be used with GCC or Sun Studio 12 Update 1 or
later /
+# if defined(GNUC)
+# elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
+# else
+# define __inline inline
+# endif
+#endif /
defined(__sun) /
+
/
From FreeBSD’s lib/libstand/printf.c /
/
-

  • Copyright © 1986, 1988, 1991, 1993
    ===================================================================