Bug 1087374

Summary: Rebuild of binutils-2.24-11.fc21.src.rpm fails with GCC 4.9.0
Product: [Fedora] Fedora Reporter: Zoltan Boszormenyi <zboszor>
Component: binutilsAssignee: Nick Clifton <nickc>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: jakub, nickc
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-19 11:21:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Fix compilation error with GCC 4.9.0 none

Description Zoltan Boszormenyi 2014-04-14 09:34:55 UTC
Description of problem:

One of my development machines has Fedora 21 Rawhide and building OpenEmbedded/Yocto on it failed at binutils 2.24. The problem is not with OE/Yocto, it's a bug in a macro in binutils uncovered by the recent introduction of GCC 4.9 into Rawhide. The new GCC has enabled -Wunused-value for -Wall and together with -Werror, it's turned into a compilation error. The last lines of the compiler output (from rpmbuild --rebuild binutils-2.24-11.fc21.src.rpm) is:

subsegs.c: In function 'subseg_change':
subsegs.c:70:37: error: right-hand operand of comma expression has no effect [-Werror=unused-value]
       bfd_set_section_userdata (stdoutput, seg, seginfo);
                                     ^
subsegs.c: In function 'subseg_get':
subsegs.c:172:40: error: right-hand operand of comma expression has no effect [-Werror=unused-value]
       bfd_set_section_userdata (stdoutput, secptr, seginfo);
                                        ^
cc1: all warnings being treated as errors
make[4]: *** [subsegs.o] Error 1
make[4]: *** Waiting for unfinished jobs....
write.c: In function 'record_alignment':
write.c:366:40: error: right-hand operand of comma expression has no effect [-Werror=unused-value]
     bfd_set_section_alignment (stdoutput, seg, align);
                                        ^
cc1: all warnings being treated as errors
make[4]: *** [write.o] Error 1
config/obj-elf.c: In function 'obj_elf_init_stab_section':
config/obj-elf.c:1940:34: error: right-hand operand of comma expression has no effect [-Werror=unused-value]
   bfd_set_section_alignment (stdoutput, seg, 2);
                                  ^
cc1: all warnings being treated as errors

Version-Release number of selected component (if applicable):

$ rpm -q gcc
gcc-4.9.0-0.10.fc21.x86_64

The version of binutils is at
http://koji.fedoraproject.org/koji/buildinfo?buildID=507201

How reproducible:

Obviously always.

Steps to Reproduce:
1. Install Fedora 21 Rawhide with GCC 4.9
2. Try to rebuild binutils from the koji link.
3.

Actual results:

Compiler error.

Expected results:

Package should be built properly.

Additional info:

Comment 1 Zoltan Boszormenyi 2014-04-14 09:59:15 UTC
Created attachment 886079 [details]
Fix compilation error with GCC 4.9.0

This patch fixes the compilation error.

Comment 2 Zoltan Boszormenyi 2014-04-14 10:29:56 UTC
Although the patch fixes building binutils, GCC 4.9.0 causes regressions in the binutils checks. Here are the dejagnu headers and summaries as seen in the terminal.

Test Run By zozo on Mon Apr 14 11:49:06 2014
Native configuration is x86_64-redhat-linux-gnu

		=== binutils tests ===

Schedule of variations:
    unix

Running target unix

...

		=== binutils Summary ===

# of expected passes           19
# of unexpected failures       70
# of unresolved testcases       2
# of untested testcases		6
# of unsupported tests		1

------------------------------------

Test Run By zozo on Mon Apr 14 11:49:14 2014
Native configuration is x86_64-redhat-linux-gnu

		=== gas tests ===

Schedule of variations:
    unix

Running target unix

...

		=== gas Summary ===

# of expected passes          185
# of unexpected failures      576

------------------------------------

Test Run By zozo on Mon Apr 14 11:51:36 2014
Native configuration is x86_64-redhat-linux-gnu

		=== ld tests ===

Schedule of variations:
    unix

Running target unix

...

		=== ld Summary ===

# of expected passes		25
# of unexpected failures	738
# of expected failures		43
# of unresolved testcases	59
# of untested testcases		1

------------------------------------

Test Run By zozo on Mon Apr 14 11:49:14 2014
Native configuration is x86_64-redhat-linux-gnu

		=== gas tests ===

Schedule of variations:
    unix

Running target unix

...

		=== gas Summary ===

# of expected passes		185
# of unexpected failures	576
../as-new 2.24

Test Run By zozo on Mon Apr 14 11:51:36 2014
Native configuration is x86_64-redhat-linux-gnu

		=== ld tests ===

Schedule of variations:
    unix

Running target unix

...

		=== ld Summary ===

# of expected passes		25
# of unexpected failures	738
# of expected failures		43
# of unresolved testcases	59
# of untested testcases		1
/home/zozo/rpmbuild/BUILD/binutils-2.24/ld/ld-new -znorelro 2.24

Test Run By zozo on Mon Apr 14 11:49:06 2014
Native configuration is x86_64-redhat-linux-gnu

		=== binutils tests ===

Schedule of variations:
    unix

Running target unix

...

		=== binutils Summary ===

# of expected passes		19
# of unexpected failures	70
# of unresolved testcases	2
# of untested testcases		6
# of unsupported tests		1

Comment 3 Nick Clifton 2014-04-22 11:29:24 UTC
Hi Zoltan,

  Thanks for the bug report.  I have imported that fix from the FSF mainline sources which uses inline functions rather than macros.  This is now in the binutils-2.24-12.fc21 release.

  As for the 4.9 induced regressions, I will have to spend some more time investigating them.

Cheers
  Nick

Comment 4 Jaroslav Reznik 2015-03-03 17:00:23 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 5 Fedora End Of Life 2016-07-19 11:21:12 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.