Bug #15519
closedaddr2line compile error on RHEL7
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
Updated by vo.x (Vit Ondruch) over 5 years ago
- Related to Misc #15347: Require C99 added
Updated by vo.x (Vit Ondruch) over 5 years ago
Updated by nobu (Nobuyoshi Nakada) over 5 years ago
- Status changed from Open to Closed
Updated by k0kubun (Takashi Kokubun) over 5 years 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 5 years 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 5 years 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.
Updated by usa (Usaku NAKAMURA) over 5 years ago
- Backport changed from 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: DONE to 2.4: DONTNEED, 2.5: DONTNEED, 2.6: DONE