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.
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.
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.
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?
(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.
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
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.
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
2.21 is in the tree now and should contain the fixes