--- Comment #5 from Kyle Evans <> ---
I use the following patch in my local mips-llvm branch:

commit 9783fdf63c8a4e1775a494b47b7f3648b65779ab
Author: Kyle Evans <>
Date:   Mon Aug 19 13:18:47 2019 -0500

    Hack around .cprestore anger

diff --git a/lib/csu/mips/crt.h b/lib/csu/mips/crt.h
index 1d967b73ffe..a90d8661f34 100644
--- a/lib/csu/mips/crt.h
+++ b/lib/csu/mips/crt.h
@@ -29,12 +29,14 @@
 #define        HAVE_CTORS
 #define        CTORS_CONSTRUCTORS
 #ifdef __mips_o32
+/* The .cprestore is bogus, as we do elsewhere */
 #define        INIT_CALL_SEQ(func)                                            
     ".set noreorder            \n"                                     \
     "bal       1f              \n"                                     \
     "nop                       \n"                                     \
     "1:                                \n"                                    
     ".cpload $ra               \n"                                     \
+    ".cprestore 12             \n"                                     \
     ".set reorder              \n"                                     \
     ".local    " __STRING(func) "\n"                                   \
     "jal       " __STRING(func)

I fake the .cprestore based on what we do for _mcount in
^/sys/mips/include/profile.h. Whether this is wrong or not, I do not know, but
it results in a functional world along with the rest of my mips-llvm patches
some of which were stolen from jhb. This branch results in a functional
CLANG_BOOTSTRAP+LLD_BOOTSTRAP world and kernel for mips32, but mips64 kernel is
horribly broken in weird ways with both llvm8 and projects/clang900-import and

You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________ mailing list
To unsubscribe, send any mail to ""

Reply via email to