link failure when package is built with -O3 (14.10)

Bug #1352836 reported by Matthias Klose
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-4.9 (Ubuntu)
Fix Released
glibc (Ubuntu)

Bug Description

this can be reproduced in a 14.10 chroot, with -proposed enabled.

link failure when the okteta package is built with -O3 (14.10), it succeeds when built with -O2.
search for "error:" in the build log. There is no error message from the linker.

looking at the history of build failures this seems to be seen first with GCC 4.9 as the default GCC..

workaround with -O2:

Matthias Klose (doko)
Changed in gcc-4.9 (Ubuntu):
importance: Undecided → High
status: New → Confirmed
Matthias Klose (doko)
description: updated
Revision history for this message
William J. Schmidt (wschmidt-g) wrote :

Referred to Alan Modra for initial investigation.

Revision history for this message
Alan Modra (amodra) wrote :

If LTO was used here I'd say this was but that doesn't appear to be the case from the log.

Revision history for this message
Alan Modra (amodra) wrote :

It's not a linker error, and x86_64 mainline gcc 4.10.0 20140727 fails similarly.

nm bytearraymodel_p.o | grep __warn
                 U __warn_memset_zero_len

Linking this object file against libc_nonshared.a (which is where this symbol is defined) generates the linker warning which is turned into an error by -Wl,--fatal-warnings.

So a gcc bug.

Revision history for this message
Alan Modra (amodra) wrote :

Upstream bugzilla with reduced testcase at

Revision history for this message
Alan Modra (amodra) wrote :

So the upstream bug was closed as a dup of another bug, 61294. The fix for that bugzilla was to implement a new -Wmemset-transposed-args, and remove the memset warning from system headers (/usr/include/bits/string3.h). However, the glibc side of that fix has not yet been committed.

The alternatives then are
1) rip out the memset macro from string3.h and backport the 61294 fix to ubuntu gcc, if it isn't there already
2) don't compile okteta with -Wl,--fatal-warnings and ignore the false positive
3) don't compile okteta with -O3
4) modify core/bytearraymodel_p.cpp ByteArrayModelPrivate::fill, adding "if (fillLength != 0)" before the memset call.

If it were up to me, I'd go with (4).

Revision history for this message
Matthias Klose (doko) wrote :

uploaded okteta with the code fix

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-4.9 - 4.9.1-7ubuntu1

gcc-4.9 (4.9.1-7ubuntu1) utopic; urgency=medium

  * Update to SVN 20140817 (r214074) from the gcc-4_9-branch.
  * Fix PR middle-end/61294, -Wmemset-transposed-args, taken from the trunk.
    LP: #1352836.
  * Update the Linaro support to 4.9-2014.08.
  * Fix PR tree-optimization/59586, graphite segfault, taken from the trunk.
    LP: #1227789.

gcc-4.9 (4.9.1-7) unstable; urgency=medium

  * Build-depend on dpkg-dev (>= 1.17.11).
 -- Matthias Klose <email address hidden> Sun, 17 Aug 2014 21:30:42 +0200

Changed in gcc-4.9 (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Matthias, or anyone else affected,

Accepted gccgo-4.9 into trusty-proposed. The package will build now and be available at in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See for documentation 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 . Thank you in advance!

tags: added: verification-needed
Revision history for this message
Steve Langasek (vorlon) wrote :

This bug was not identified with gccgo, only with gcc, which is not applicable to the in-progress gccgo-4.9 SRU. Marking as resolved.

tags: removed: verification-needed
Revision history for this message
Steve Langasek (vorlon) wrote : Update Released

The verification of the Stable Release Update for gccgo-4.9 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.

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.