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

Bug #1623418 reported by Alexander Ivchenko
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc
Fix Released
Medium
binutils (Ubuntu)
Fix Released
Medium
Unassigned
Xenial
Fix Released
Medium
Unassigned
Yakkety
Won't Fix
Undecided
Unassigned
gcc-5 (Ubuntu)
Fix Released
Medium
Matthias Klose
Xenial
Fix Released
Medium
Unassigned
Yakkety
Won't Fix
Undecided
Unassigned
gcc-6 (Ubuntu)
Fix Released
Medium
Unassigned
Yakkety
Won't Fix
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?

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

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)
Revision history for this message
Alexander Ivchenko (aivchenk) wrote :

Hi Matthias,

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

Matthias Klose (doko)
no longer affects: gcc-6 (Ubuntu Xenial)
Revision history for this message
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
Revision history for this message
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)
description: updated
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

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
Mathew Hodson (mhodson)
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
Revision history for this message
Ł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
Revision history for this message
Matthias Klose (doko) wrote :

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

tags: added: verification-done
removed: verification-needed
Revision history for this message
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
Revision history for this message
Brian Murray (brian-murray) wrote :

I'm a bit confused as to how the verification was done given that step 3 says the following:

"3. Install binutils and gcc-5 from -proposed."

I don't see a gcc-5 in -proposed for xenial or yakkety. Could somebody explain the discrepancy?

tags: added: verification-needed
removed: verification-done
Revision history for this message
Matthias Klose (doko) wrote :

the binutils part was checked by looking at gold to accept the new options.

Revision history for this message
Łukasz Zemczak (sil2100) wrote : Change of SRU verification policy

As part of a recent change in the Stable Release Update verification policy we would like to inform that for a bug to be considered verified for a given release a verification-done-$RELEASE tag needs to be added to the bug where $RELEASE is the name of the series the package that was tested (e.g. verification-done-xenial). Please note that the global 'verification-done' tag can no longer be used for this purpose.

Thank you!

Revision history for this message
Adam Conrad (adconrad) wrote : Update Released

The verification of the Stable Release Update for binutils has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

tags: added: verification-done-xenial
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package binutils - 2.26.1-1ubuntu1~16.04.4

---------------
binutils (2.26.1-1ubuntu1~16.04.4) xenial-proposed; urgency=medium

  * SRU
  * POWER backports (LP: #1655181)
    - Don't treat .opd section specially when ELFv2.
    - Fix PowerPC64 ELFv1 undefined weak functions.
    - Modify POWER9 support to match final ISA 3.0 documentation.
  * Fix PR gold/18989. Implement --push-state/--pop-state. LP: #1623418.

 -- Matthias Klose <email address hidden> Fri, 10 Feb 2017 02:30:30 +0100

Changed in binutils (Ubuntu Xenial):
status: Fix Committed → Fix Released
Adam Conrad (adconrad)
Changed in binutils (Ubuntu Yakkety):
status: Fix Committed → Won't Fix
Changed in gcc-5 (Ubuntu Yakkety):
status: New → Won't Fix
Changed in gcc-6 (Ubuntu Yakkety):
status: New → Won't Fix
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Alexander, or anyone else affected,

Accepted gcc-5 into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gcc-5/5.4.0-6ubuntu1~16.04.5 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-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. 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 gcc-5 (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed verification-needed-xenial
removed: verification-done-xenial
Revision history for this message
Matthias Klose (doko) wrote :

$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ gcc -fcheck-pointer-bounds -mmpx foo.c
$ ldd a.out
        linux-vdso.so.1 => (0x00007fff289d1000)
        libmpx.so.0 => /usr/lib/x86_64-linux-gnu/libmpx.so.0 (0x00007fce0497a000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fce045b0000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fce04393000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fce04b81000)

tags: added: verification-done-xenial
removed: verification-needed-xenial
tags: removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-5 - 5.4.0-6ubuntu1~16.04.5

---------------
gcc-5 (5.4.0-6ubuntu1~16.04.5) xenial-proposed; urgency=medium

  * SRU
  * Fix PR target/77267 (x86), taken from the trunk. LP: #1623418.
  * Fix hangs w/ asan binaries on arm64 (Dann Frazier). LP: #1709727.
  * Linaro branch only: Fix PR target/79041, aarch64 backend emitting
    R_AARCH64_ADR_PREL_PG_HI21 relocation despite -mpc-relative-literal-loads
    option being used (Dan Frazier). LP: #1695093.

 -- Matthias Klose <email address hidden> Wed, 23 Aug 2017 11:35:00 +0200

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

Other bug subscribers

Remote bug watches

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