gcc-as-needed.diff patch broke mpx support in GCC

Bug #1623418 reported by Alexander Ivchenko on 2016-09-14
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc
Unknown
Unknown
binutils (Ubuntu)
Medium
Unassigned
Xenial
Medium
Unassigned
Yakkety
Undecided
Unassigned
gcc-5 (Ubuntu)
Medium
Matthias Klose
Xenial
Medium
Unassigned
Yakkety
Undecided
Unassigned
gcc-6 (Ubuntu)
Medium
Unassigned
Yakkety
Undecided
Unassigned

Bug Description

[SRU Justification]
gcc-5 from Ubuntu is configured with MPX support, but it is broken due
to always-added linker option "-as-needed".

[Test case]
1. Pass -mmpx to gcc when building an arbitrary project on x86.
2. Verify with ldd that the resulting executable is not linked against libmpx.so because the -as-needed flag has discarded the mpx library from being linked in.
3. Install binutils and gcc-5 from -proposed.
4. Rebuild the target, again with -mmpx.
5. Verify with ldd that the new executable is linked against libmpx.so.
6. Verify that there are no regressions in the binutils testsuite on any architectures, by manually checking the results in the build log.

[Regression potential]
This binutils patch implements new --push-state / --pop-state options which will not be used in the common case, only when -mmpx is passed. When these flags are not in use, which is the default, it should have no effect on the behavior of the toolchain, so risk of regression is minimal.

Here is the GCC upstream bug & fix

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77267

https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=240057

Would it be possible to backport this fix to Ubuntu gcc-5 build?

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1623418/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
affects: ubuntu → gcc-5 (Ubuntu)
tags: added: yakkety
tags: added: rls-y-incoming
Changed in gcc-5 (Ubuntu):
assignee: nobody → Matthias Klose (doko)
Alexander Ivchenko (aivchenk) wrote :

Hi Matthias,

Is there any chance that the fix could be backported to gcc-5+Ubuntu?

Matthias Klose (doko) on 2016-12-02
no longer affects: gcc-6 (Ubuntu Xenial)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package binutils - 2.27.51.20161212-1ubuntu1

---------------
binutils (2.27.51.20161212-1ubuntu1) zesty; urgency=medium

  * Merge with Debian; remaining changes:
    - Build from upstream sources.

 -- Matthias Klose <email address hidden> Mon, 12 Dec 2016 14:07:30 +0100

Changed in binutils (Ubuntu):
status: New → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-6 - 6.2.1-7ubuntu1

---------------
gcc-6 (6.2.1-7ubuntu1) zesty; urgency=medium

  * Merge with Debian; remaining changes:
    - Build from upstream sources.

gcc-6 (6.2.1-7) unstable; urgency=medium

  * GCC 6.3.0 release candidate.
  * Update to SVN 20161215 (r243686, 6.2.1) from the gcc-6-branch.
    - Fix PR libstdc++/78465, PR c++/78761, PR c++/78252, PR target/59874,
      PR target/78796, PR tree-optimization/77673, PR target/72717 (PPC),
      PR rtl-optimization/71496, PR c++/78701.
  * Drop build dependency on g++-5.
  * Fix PR c++/78774, proposed for the gcc-6-branch.
  * Apply patches for zlib security issues CVE-2016-9840, CVE-2016-9841,
    CVE-2016-9842, CVE-2016-9843.
  * Ignore dpkg's pie specs when pie is not enabled. Addresses: #848129.

 -- Matthias Klose <email address hidden> Thu, 15 Dec 2016 22:50:24 +0100

Changed in gcc-6 (Ubuntu):
status: New → Fix Released
Steve Langasek (vorlon) on 2017-02-23
description: updated

Hello Alexander, or anyone else affected,

Accepted binutils into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/binutils/2.26.1-1ubuntu1~16.04.4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in binutils (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed
Changed in gcc-5 (Ubuntu):
importance: Undecided → Medium
Changed in binutils (Ubuntu Xenial):
importance: Undecided → Medium
Changed in gcc-6 (Ubuntu):
importance: Undecided → Medium
Changed in gcc-5 (Ubuntu Xenial):
importance: Undecided → Medium
Changed in binutils (Ubuntu):
importance: Undecided → Medium
Łukasz Zemczak (sil2100) wrote :

Hello Alexander, or anyone else affected,

Accepted binutils into yakkety-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/binutils/2.27-8ubuntu2.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in binutils (Ubuntu Yakkety):
status: New → Fix Committed
Matthias Klose (doko) wrote :

the binutils xenial and yakkety updates have the new option available in gold.

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-5 - 5.4.1-8ubuntu1

---------------
gcc-5 (5.4.1-8ubuntu1) zesty; urgency=medium

  * Merge with Debian; remaining changes:
    - Build from upstream sources.

gcc-5 (5.4.1-8) unstable; urgency=medium

  * Update to SVN 20170304 (r245892, 5.4.1) from the gcc-5-branch.
    - Fix PR libstdc++/79789, PR target/79514 (x86), PR target/79544 (PPC),
      PR lto/79579, PR target/79749 (sparc).
  * Build-depend on gnat-5 again.

 -- Matthias Klose <email address hidden> Sat, 04 Mar 2017 13:16:08 +0100

Changed in gcc-5 (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.