Project

General

Profile

Backport #8227

addr2line.c compile error on Solaris since r39887

Added by ngoto (Naohisa Goto) over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
[ruby-dev:47229]

Description

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 identifier
u_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 (c) 1986, 1988, 1991, 1993


Related issues

Precedes Backport200 - Backport #8144: test_segv_test(TestRubyOptions) test failureRejectedActions

Associated revisions

Revision 5427a5df
Added by ngoto (Naohisa Goto) over 6 years ago

  • addr2line.c: quad_t and u_quad_t is not available on Solaris. __inline is not available with old compilers on Solaris. [ruby-dev:47229] [Bug #8227]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 40161
Added by ngoto (Naohisa Goto) over 6 years ago

  • addr2line.c: quad_t and u_quad_t is not available on Solaris. __inline is not available with old compilers on Solaris. [ruby-dev:47229] [Bug #8227]

Revision 40161
Added by ngoto (Naohisa Goto) over 6 years ago

  • addr2line.c: quad_t and u_quad_t is not available on Solaris. __inline is not available with old compilers on Solaris. [ruby-dev:47229] [Bug #8227]

Revision 40161
Added by ngoto (Naohisa Goto) over 6 years ago

  • addr2line.c: quad_t and u_quad_t is not available on Solaris. __inline is not available with old compilers on Solaris. [ruby-dev:47229] [Bug #8227]

Revision 40161
Added by ngoto (Naohisa Goto) over 6 years ago

  • addr2line.c: quad_t and u_quad_t is not available on Solaris. __inline is not available with old compilers on Solaris. [ruby-dev:47229] [Bug #8227]

Revision 40161
Added by ngoto (Naohisa Goto) over 6 years ago

  • addr2line.c: quad_t and u_quad_t is not available on Solaris. __inline is not available with old compilers on Solaris. [ruby-dev:47229] [Bug #8227]

Revision 40161
Added by ngoto (Naohisa Goto) over 6 years ago

  • addr2line.c: quad_t and u_quad_t is not available on Solaris. __inline is not available with old compilers on Solaris. [ruby-dev:47229] [Bug #8227]

Revision 35cc23f4
Added by nagachika (Tomoyuki Chikanaga) over 6 years ago

merge revision(s) 39866,39887,39921,40161,40170: [Backport #8144] [Backport #8227]

    * addr2line.c (rb_dump_backtrace_with_lines): output line at once.

    * addr2line.c (kprintf): added from FreeBSD libstand's printf.
      this is consided as async signal safe function.

    * addr2line.c (rb_dump_backtrace_with_lines): use kfprintf.
      [Bug #8144] [ruby-core:53632]

    * addr2line.c (putce): suppress unused return value warning.

    * addr2line.c: quad_t and u_quad_t is not available on Solaris.
      __inline is not available with old compilers on Solaris.
      [ruby-dev:47229] [Bug #8227]

    * addr2line.c: use more generic type:
      * u_char -> unsigned char
      * u_short -> unsigned short
      * u_int -> unsigned int
      * u_long -> unsigned long
      * quad_t -> int64_t
      * u_quad_t -> uint64_t

    * addr2line.c (imax): inline is defined by configure.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@40253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 40253
Added by nagachika (Tomoyuki Chikanaga) over 6 years ago

merge revision(s) 39866,39887,39921,40161,40170: [Backport #8144] [Backport #8227]

* addr2line.c (rb_dump_backtrace_with_lines): output line at once.

* addr2line.c (kprintf): added from FreeBSD libstand's printf.
  this is consided as async signal safe function.

* addr2line.c (rb_dump_backtrace_with_lines): use kfprintf.
  [Bug #8144] [ruby-core:53632]

* addr2line.c (putce): suppress unused return value warning.

* addr2line.c: quad_t and u_quad_t is not available on Solaris.
  __inline is not available with old compilers on Solaris.
  [ruby-dev:47229] [Bug #8227]

* addr2line.c: use more generic type:
  * u_char -> unsigned char
  * u_short -> unsigned short
  * u_int -> unsigned int
  * u_long -> unsigned long
  * quad_t -> int64_t
  * u_quad_t -> uint64_t

* addr2line.c (imax): inline is defined by configure.

History

#1

Updated by ngoto (Naohisa Goto) over 6 years ago

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

This issue was solved with changeset r40161.
Naohisa, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • addr2line.c: quad_t and u_quad_t is not available on Solaris. __inline is not available with old compilers on Solaris. [ruby-dev:47229] [Bug #8227]
#2

Updated by nagachika (Tomoyuki Chikanaga) over 6 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport200
  • Status changed from Closed to Assigned
  • Assignee changed from ngoto (Naohisa Goto) to nagachika (Tomoyuki Chikanaga)

I'll backport r39887 and r39921 for #8144. r40161 should be backported at the same time.

Updated by ngoto (Naohisa Goto) over 6 years ago

r40170 is fine on Solaris with Oracle Solaris Studio 12.3.

#5

Updated by nagachika (Tomoyuki Chikanaga) over 6 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r40253.
Naohisa, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 39866,39887,39921,40161,40170: [Backport #8144] [Backport #8227]

* addr2line.c (rb_dump_backtrace_with_lines): output line at once.

* addr2line.c (kprintf): added from FreeBSD libstand's printf.
  this is consided as async signal safe function.

* addr2line.c (rb_dump_backtrace_with_lines): use kfprintf.
  [Bug #8144] [ruby-core:53632]

* addr2line.c (putce): suppress unused return value warning.

* addr2line.c: quad_t and u_quad_t is not available on Solaris.
  __inline is not available with old compilers on Solaris.
  [ruby-dev:47229] [Bug #8227]

* addr2line.c: use more generic type:
  * u_char -> unsigned char
  * u_short -> unsigned short
  * u_int -> unsigned int
  * u_long -> unsigned long
  * quad_t -> int64_t
  * u_quad_t -> uint64_t

* addr2line.c (imax): inline is defined by configure.

Also available in: Atom PDF