Project

General

Profile

Actions

Bug #15519

closed

addr2line compile error on RHEL7

Added by vo.x (Vit Ondruch) almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux]
[ruby-core:90949]

Description

I am observing following compilation:

gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -mtune=generic -fPIC -m64 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -DCANONICALIZATION_FOR_MATHN   -I. -I.ext/include/x86_64-linux -I./include -I. -I./enc/unicode/11.0.0  -o dln.o -c dln.c
addr2line.c: In function 'di_find_abbrev':
addr2line.c:1210:5: error: 'for' loop initial declarations are only allowed in C99 mode
     for (uint64_t n = uleb128(&p); abbrev_number != n; n = uleb128(&p)) {
     ^
addr2line.c:1210:5: note: use option -std=c99 or -std=gnu99 to compile your code
addr2line.c: In function 'debug_info_read':
addr2line.c:1558:9: error: 'for' loop initial declarations are only allowed in C99 mode
         for (int i=offset; i < num_traces; i++) {
         ^
make: *** [addr2line.o] Error 1
make: *** Waiting for unfinished jobs....

This happens on RHEL7 with following compiler:

$ rpm -q gcc
gcc-4.8.5-16.el7_4.3.x86_64

This was probably introduced by r65077. It should be fixed IMO, unless #15347 is accepted.


Files

0001-Don-t-use-C99-features-yet.patch (1.92 KB) 0001-Don-t-use-C99-features-yet.patch vo.x (Vit Ondruch), 01/09/2019 04:25 PM

Related issues 1 (0 open1 closed)

Related to Ruby master - Misc #15347: Require C99ClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0