Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 180498 - sys-devel/binutil-2.17.50.0.16 segault when built with gcc-4.1.2
Summary: sys-devel/binutil-2.17.50.0.16 segault when built with gcc-4.1.2
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-31 21:35 UTC by Leonardo Valeri Manera
Modified: 2007-10-07 02:17 UTC (History)
0 users

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


Attachments
output of paludis --info (paludis-info.txt,9.98 KB, text/plain)
2007-06-01 15:45 UTC, Leonardo Valeri Manera
Details
log of paludis -i gmp (gmp_ld_segafault.log,303.52 KB, text/plain)
2007-06-01 15:46 UTC, Leonardo Valeri Manera
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leonardo Valeri Manera 2007-05-31 21:35:51 UTC
There are a few packages that will cause ld to segfault if 2.17.50.0.16 is built with gcc-4.1.2.

One of them is gmp-4.2.1-r1 - there were a few other failures when I tried to emerge system with that combo, but I've since forgotten (sorry :()

Using gcc-4.1.1-r3 (or previous) or binutils-2.17.50.0.15 fixes the issue.

I'm not sure who this bug should go to (or even if its a meaningful bugreport) so please tell me if I need to report it upstream somewhere (or maybe just ack it upstream) or if you want my emerge --info (well, paludis --info), or a log of the build, or what.

I did not report this initially, but its happened on another box I happen to be installing on atm, so that makes 2 boxes out of 2.

Reproducible: Always

Steps to Reproduce:
1.build binutils-2.17.50.0.16 with gcc-4.1.2
2.emerge gmp

Actual Results:  
ld segfaults
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-05-31 21:52:41 UTC
Reopen with emerge --info output and a complete build log of whatever segfaults for you. Thanks.
Comment 2 Leonardo Valeri Manera 2007-06-01 15:45:32 UTC
Created attachment 120874 [details]
output of paludis --info
Comment 3 Leonardo Valeri Manera 2007-06-01 15:46:16 UTC
Created attachment 120875 [details]
log of paludis -i gmp
Comment 4 Leonardo Valeri Manera 2007-06-01 15:48:50 UTC
There you go.

GCC-4.1.2
Binutils-2.17.50.0.16 compiled w. GCC-4.1.2
Comment 5 SpanKY gentoo-dev 2007-06-01 16:05:22 UTC
try building things with sane CFLAGS/LDFLAGS

CFLAGS="-O2 -pipe"
CXXFLAGS="-O2 -pipe"
LDFLAGS=""
Comment 6 Leonardo Valeri Manera 2007-06-01 20:20:30 UTC
> try building things with sane CFLAGS/LDFLAGS
> 
> CFLAGS="-O2 -pipe"
> CXXFLAGS="-O2 -pipe"
> LDFLAGS=""
> 

Thank you for the condescending comment, but if it works with flags y in version x, and it doesn in version x+1, than its a _regression_. Ever heard of that term? ;p

Lets lay out the sitatuon:

I have flags that have compiled and run a system with 0 issues for months.

ANd in case they're wondering I had toned the wilder ones down for that log.

They work with GCC-4.2.1 + Binutils-2.17.50.0.15
The whole system compiles and runs without issues.

They work with GCC-4.1.1 + Binutils-2.17.50.0.16
The whole system compiles without issue, and it runs far so fine, though admittedly I havent used _every_ package in world in the 2 weeks i've been poking this issue.

They _dont_ work (only for 2 or 3 packages, because there is a _BUG_ in .16 that makes it segfault when building a few packages) with GCC-4.1.2 and binutils-2.17.50.0.16 with certain flags.

Now, are you gonna quit being unhelpful - I dont care if you solve it or not, Ive got 2 working fixes for this that dont involve toning down my flags - and maybe we'll get this fixed upstream, or do I have to talk to them myself?
Comment 7 Leonardo Valeri Manera 2007-06-02 10:00:55 UTC
Nailed it.

-mfpmath=see causes ld to segfault when building a few c++ libraries, _if_and_only_if_ binutils-2.17.50.0.16 is built with gcc-4.1.2. So far gmp causes this, there's a few more, i'm rebuilding system to see which ones - might help nail down exactly what code is giving ld grief.

when using gcc-4.1.1-r3 or binutils-2.17.50.0.15, -mfpmath=see gives no issues.

just to be sure, I tried this with binutils compiled with extremely conservative flags: empty LDFLAGS and only -march= -O2 -pipe for CFLAGS. Tested on a P4 machine and on an athlon-xp, behavior is identical.

hard to say, at this point, if this is entirely LD's fault, but the fact that this behavior only happens with .16 makes me think the ball is at least partly in binutils' court.

we're not talking of the notoriously buggy -mfmath=387,sse here, but only of pure sse fpmath. considering ld .16 is necessary to even build some qt libs under gcc-4.2.0, I can't help wonder if this happens with that gcc version too, but i'm not quite ready for that particular bush of thorns quite yet.
Comment 8 Leonardo Valeri Manera 2007-06-02 19:02:56 UTC
Got another one. This time its a c file, addext.lo, in package gettext-1.16.1.

Again the culprit is -mfpmath=sse (in CFLAGS this time) but once again, if one uses binutils-2.17.50.0.15 or gcc-4.1.1, the package compiles cleanly, and indeed works properly, at least w. gcc-4.1.1 and binutils-2.17.50.0.15.

if gettext was malfunctioning, i think i'd have noticed in the 2-3 months ive been using bin utils 2.17.50 and this flagset. :)
Comment 9 Leonardo Valeri Manera 2007-06-02 23:04:58 UTC
curiouser and curiouser.

on my p4, once again if downgrading to binutils .15 or gcc 4.1.1 everything builds fine.

however, its not -mfpmath=sse that makes gmp kill ld-2.17.50.0.16, but -freorder-blocks-and-partition.

something about gcc-4.1.2-generated code _really_ irks binutils .16...
Comment 10 SpanKY gentoo-dev 2007-10-07 02:17:14 UTC
not going to bother investigating unless binutils-2.18 fails ... but even then, you need to rebuild things with sane flags