Project

General

Profile

Actions

Backport #8227

closed

addr2line.c compile error on Solaris since r39887

Added by ngoto (Naohisa Goto) about 11 years ago. Updated about 11 years ago.


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' to quad_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' to uintmax_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 1 (0 open1 closed)

Precedes Backport200 - Backport #8144: test_segv_test(TestRubyOptions) test failureRejectednaruse (Yui NARUSE)Actions
Actions #1

Updated by ngoto (Naohisa Goto) about 11 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]
Actions #2

Updated by nagachika (Tomoyuki Chikanaga) about 11 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) about 11 years ago

r40170 is fine on Solaris with Oracle Solaris Studio 12.3.

Actions #5

Updated by nagachika (Tomoyuki Chikanaga) about 11 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.
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0