Date: Wed, 11 Sep 2019 14:00:50 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 233361] mips build with BSD_CRTBEGIN, Clang, LLD fails Message-ID: <bug-233361-227-EswvfsAYCq@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-233361-227@https.bugs.freebsd.org/bugzilla/> References: <bug-233361-227@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233361 --- Comment #5 from Kyle Evans <kevans@freebsd.org> --- I use the following patch in my local mips-llvm branch: commit 9783fdf63c8a4e1775a494b47b7f3648b65779ab Author: Kyle Evans <kevans@FreeBSD.org> 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 (https://github.com/freebsd/freebsd/compare/master...kevans91:mips-llvm?expand=1), 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 CLANG_BOOTSTRAP+LD_BOOTSTRAP. -- You are receiving this mail because: You are the assignee for the bug.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-233361-227-EswvfsAYCq>
