Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 492898 - sys-devel/gcc built with sys-devel/binutils-2.23.1 fails if writing to std::cerr on sparc
Summary: sys-devel/gcc built with sys-devel/binutils-2.23.1 fails if writing to std::c...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: Sparc64 Linux
: Normal critical (vote)
Assignee: Gentoo Toolchain Maintainers
URL: http://gcc.gnu.org/bugzilla/show_bug....
Whiteboard:
Keywords:
: 494270 (view as bug list)
Depends on: 494670
Blocks:
  Show dependency tree
 
Reported: 2013-11-29 21:03 UTC by Rolf Eike Beer
Modified: 2014-01-19 03:43 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rolf Eike Beer archtester 2013-11-29 21:03:14 UTC
This simple test program segfaults:

std::cerr << "test";

if it is built with a gcc that was built with binutils 2.23.[12]. If the gcc is built with binutils 2.22-r1 it works. It is not sufficient if the program is linked with binutils 2.22-r1 and the gcc was built with 2.23.[12]. I have tested with gcc versions 4.5.4 (from stage3 tarball), 4.6.4, 4.7.2, and 4.8.2 (vanilla), all show the same error. After I rebuild 4.8.2 (this time with Gentoo patches) using the downgraded binutils it worked.

The behavior was reproduced by another user on an independent machine.


Reproducible: Always
Comment 1 SpanKY gentoo-dev 2013-11-30 18:20:06 UTC
i think the "on sparc" part is critical.  we would have noticed already if this was a wider problem.
Comment 2 Gergő 2013-12-06 11:38:12 UTC
Seems that's why emerging cmake fails (configuration phase : Boostrap.cmk/cmake SIGSEGV in libstdc++.so.6.0.14)
(even I used pure stage3-sparc64-20130804 or stage3-sparc64-20131104)
I think that's a same issue: http://forums.gentoo.org/viewtopic-p-7411850.html

After downgrading binutils to 2.22-r1 and simply re-emerging gcc, things are working fine (thanks Rolf Eike Beer)
Comment 3 Rolf Eike Beer archtester 2013-12-06 18:40:11 UTC
That's how I noticed it in the first place. ;)
Comment 4 Chase Rayfield 2013-12-14 21:38:22 UTC
I'm on gcc 4.7.3 and binutils 2.23.52.0.2.20130423

cat test.c
#include <iostream>
using namespace::std;
int main(){
std::cerr << "test";
return 0;
}
g++ test.c && ./a.out
test

cmake also builds here. More details in the cmake bug report. https://bugs.gentoo.org/show_bug.cgi?id=494270
Comment 5 SpanKY gentoo-dev 2013-12-16 06:26:13 UTC
*** Bug 494270 has been marked as a duplicate of this bug. ***
Comment 6 Raúl Porcel (RETIRED) gentoo-dev 2013-12-16 06:59:25 UTC
Upgrading to binutils-2.23.2 and reemerging gcc fixes it for me.
Comment 7 SpanKY gentoo-dev 2013-12-16 16:28:54 UTC
Rolf: can you double check ?  your report says 2.23.[12] ...
Comment 8 Rolf Eike Beer archtester 2013-12-18 16:17:27 UTC
Indeed, rebuilding the compiler (I tested only 4.8.2) with 2.23.2 fixed it. I had the assumption that I already did this.
Comment 9 SpanKY gentoo-dev 2013-12-18 19:57:22 UTC
ok, let's start the stabilization process for 2.23.2
Comment 10 Agostino Sarubbo gentoo-dev 2013-12-18 20:00:13 UTC
(In reply to SpanKY from comment #9)
> ok, let's start the stabilization process for 2.23.2

I'd also suggest to make a new revision for gcc that has this version of binutils as DEPEND, to be sure that all people will recompile gcc after the binutils upgrade.
Comment 11 SpanKY gentoo-dev 2013-12-18 21:30:15 UTC
(In reply to Agostino Sarubbo from comment #10)

i don't see why that'd guarantee a recompile.  that'd only make sure binutils-2.23.2 was installed before gcc itself is built.
Comment 12 Agostino Sarubbo gentoo-dev 2013-12-19 05:57:35 UTC
(In reply to SpanKY from comment #11)
> (In reply to Agostino Sarubbo from comment #10)
> 
> i don't see why that'd guarantee a recompile.  that'd only make sure
> binutils-2.23.2 was installed before gcc itself is built.

If you make a new revision with the stable keyword(for sparc) it will compile first the new binutils version and then gcc itself.
Comment 13 SpanKY gentoo-dev 2013-12-22 04:38:15 UTC
(In reply to Agostino Sarubbo from comment #12)

that is true, but that's not something we generally do as it's kind of ugly to manage.  if the # of people impacted here is small, then it's reasonable to just say "rebuild it by hand".
Comment 14 Ryan Hill (RETIRED) gentoo-dev 2013-12-23 21:26:35 UTC
I've been holding the removal of the lto USE flag on GCC for just such an occasion.  It will trigger the rebuild you want.
Comment 15 SpanKY gentoo-dev 2014-01-19 03:43:48 UTC
2.23.2 is stable now on sparc