Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 338405 - sys-devel/binutils-2.20.1 patches for Loongson
Summary: sys-devel/binutils-2.20.1 patches for Loongson
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: MIPS Porters
URL: http://dev.lemote.com/code/linux-loon...
Whiteboard:
Keywords:
Depends on:
Blocks: mips-loongson
  Show dependency tree
 
Reported: 2010-09-23 03:43 UTC by Stuart Longland (RETIRED)
Modified: 2010-12-09 11:22 UTC (History)
2 users (show)

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


Attachments
Loongson 2F Fixups Patch for binutils-2.20 (10_all_binutils-2.20-mips-loongson2f-fixups.patch,17.32 KB, patch)
2010-09-23 03:46 UTC, Stuart Longland (RETIRED)
Details | Diff
MIPS TLS patch for binutils-2.20 (10_all_binutils-2.20-mips-tls.patch,402 bytes, patch)
2010-09-23 03:48 UTC, Stuart Longland (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stuart Longland (RETIRED) gentoo-dev 2010-09-23 03:43:36 UTC
Hi all,

The older Loongson 2F, and also it appears, the Loongson 2E suffer an issue regarding execution of NOP instructions which can lead to a hard lock on these systems.  I've experienced it a few times trying to compile software on the Loongson 2E systems I have here.  The bug is documented at the URL attached to this bug.

The patches attached here are from the Loongson overlay, and when combined with -Wa,-mfix-loongson2f-nop in CFLAGS, enables at the very least... stage 1 to be compiled without lockups.  The next set of O32 little endian MIPS-I and MIPS-III stages I produce will make use of this flag so that they work successfully on Loongson systems.

On MIPS-IV and big-endian systems, they will likely have the same patch for binutils, but I won't be including the extra flag to GCC... so should have no effect.
Comment 1 Stuart Longland (RETIRED) gentoo-dev 2010-09-23 03:46:41 UTC
Created attachment 248415 [details, diff]
Loongson 2F Fixups Patch for binutils-2.20

This is the main patch that fixes a couple of errata issues with the Loongson 2F, and is helpful on Loongson 2E.
Comment 2 Stuart Longland (RETIRED) gentoo-dev 2010-09-23 03:48:36 UTC
Created attachment 248417 [details, diff]
MIPS TLS patch for binutils-2.20

Also from loongson-overlay, this appears to fix a TLS issue.  Not much is known about the origins of this patch or what it fixes.  It'd be worth tracking down some more information on this particular patch before it gets rolled in.
Comment 3 Stuart Longland (RETIRED) gentoo-dev 2010-10-25 00:06:02 UTC
A heads up... I've successfully built O32 stages for little-endian MIPS-I/III/IV, as well as big-endian MIPS-I/III (MIPS-IV is coming... just battling some sysvinit and -lcrypt grief).

I believe Zhang Le has been using these on N32 little-endian MIPS-III for some time as they were taken from the Loongson overlay.

Given they don't seem to have broken anything, I believe they should be safe enough to merge into the tree.

Zhang Le: Do you happen to know anything about attachment 248417 [details, diff] (10_all_binutils-2.20-mips-tls.patch)?  From the content, it seems to be "TLS" related (hence my calling it "mips-tls") but that is a guess.

toolchain: How do we proceed from here?  Do I reassign the bug to you to get the patches added, or do I do that myself?  Are there any steps needed to be done before I do this?
Comment 4 Zhang Le (RETIRED) gentoo-dev 2010-10-25 03:50:31 UTC
(In reply to comment #3)

> I believe Zhang Le has been using these on N32 little-endian MIPS-III for some
> time as they were taken from the Loongson overlay.

Yes.

> 
> Given they don't seem to have broken anything, I believe they should be safe
> enough to merge into the tree.

Yes, please. Actually the patch is already in upstream.

> 
> Zhang Le: Do you happen to know anything about attachment 248417 [details, diff]
> (10_all_binutils-2.20-mips-tls.patch)?  From the content, it seems to be "TLS"
> related (hence my calling it "mips-tls") but that is a guess.

This is an unverified patch. I need to have it reviewed by upstream before we can incorporate it.
Comment 5 SpanKY gentoo-dev 2010-10-26 14:59:01 UTC
if the patches are in upstream cvs, please post links to their commits

there is a git mirror too:
http://sourceware.org/git/?p=binutils.git;a=summary
Comment 6 Stuart Longland (RETIRED) gentoo-dev 2010-10-27 02:55:04 UTC
This looks an awful lot like the first one.

http://sourceware.org/ml/binutils-cvs/2010-02/msg00178.html
http://sourceware.org/git/?p=binutils.git;a=commit;h=43ec71bb4c761538a3c8813856654de756661cce

Even if we only get that one in, that would suffice for most of the users who may wish to run Gentoo on Lemote hardware.  The other patch can join in after it has been verified.
Comment 7 Stuart Longland (RETIRED) gentoo-dev 2010-11-08 12:20:56 UTC
A heads up... binutils-2.21 will probably be released soon, which should include this, and many other MIPS-related fixes.

I'm downloading today's CVS snapshot to see what goodies they've got in store.  Hopefully one will fix this little gem:

https://bugs.webkit.org/show_bug.cgi?id=48222
Comment 8 SpanKY gentoo-dev 2010-12-09 11:22:11 UTC
2.21 is in the tree now and should contain the fixes