Project

General

Profile

Bug #15519

addr2line compile error on RHEL7

Added by vo.x (Vit Ondruch) over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
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

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

Updated by vo.x (Vit Ondruch) over 1 year ago

#3

Updated by nobu (Nobuyoshi Nakada) over 1 year ago

  • Status changed from Open to Closed

Applied in changeset trunk|r66768.


Get rid of C99 feature for now [ruby-core:90949] [Bug #15519]

Updated by k0kubun (Takashi Kokubun) over 1 year ago

I agree r66768 should be backported to 2.6 to fix it safely. But at the same time,

It should be fixed IMO, unless #15347 is accepted.

I think the build error should be fixed regardless of #15347 acceptance. Due to r66605, I believe trunk works on the same environment without r66768, as it's just saying "use option -std=c99 or -std=gnu99 to compile your code".

vo.x (Vit Ondruch) Could you double-check r66767 (or any commit after r66605 and before r66768) can be built on your environment?

Updated by k0kubun (Takashi Kokubun) over 1 year ago

If it doesn't work, please upload the full command logs of ./configure and make (on the slightly older trunk, r66767 as said above), or at least configure flags and CFLAGS if you don't want to show a full output.

Updated by naruse (Yui NARUSE) over 1 year ago

  • Backport changed from 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: REQUIRED to 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: DONE

ruby_2_6 r66800 merged revision(s) 66768.

#7

Updated by usa (Usaku NAKAMURA) about 1 year ago

  • Backport changed from 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: DONE to 2.4: DONTNEED, 2.5: DONTNEED, 2.6: DONE

Also available in: Atom PDF