Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Jan 2020 03:46:59 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r356594 - stable/12/lib/csu/mips
Message-ID:  <202001100346.00A3kx3o026199@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Fri Jan 10 03:46:58 2020
New Revision: 356594
URL: https://svnweb.freebsd.org/changeset/base/356594

Log:
  MFC r356327-r356328: mips: csu: fix compilation w/ LLVM
  
  r356327:
  mips: csu: fix compilation w/ LLVM
  
  GCC issues the warning, but with LLVM it is fatal- no matching .cprestore
  with .cpload. Reserve some place on the stack and and add the proper
  .cprestore to pair it with.
  
  nop added in the !o32 branch to fill out delay slot instruction, just in
  case.
  
  r356328:
  mips !o32: fix csu build

Modified:
  stable/12/lib/csu/mips/crt.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/csu/mips/crt.h
==============================================================================
--- stable/12/lib/csu/mips/crt.h	Fri Jan 10 03:37:52 2020	(r356593)
+++ stable/12/lib/csu/mips/crt.h	Fri Jan 10 03:46:58 2020	(r356594)
@@ -34,10 +34,14 @@
     "bal	1f		\n"					\
     "nop			\n"					\
     "1:				\n"					\
-    ".cpload $ra		\n"					\
+    ".cpload	$ra		\n"					\
+    "addu	$sp, $sp, -8	\n"					\
     ".set reorder		\n"					\
+    ".cprestore	4		\n"					\
     ".local	" __STRING(func) "\n"					\
-    "jal	" __STRING(func)
+    "jal	" __STRING(func) "\n"					\
+    "nop			\n"					\
+    "addu	$sp, $sp, 8	\n"
 #else
 #define	INIT_CALL_SEQ(func)						\
     ".set noreorder		\n"					\
@@ -47,7 +51,8 @@
     ".set reorder		\n"					\
     ".cpsetup $ra, $v0, 1b	\n"					\
     ".local	" __STRING(func) "\n"					\
-    "jal	" __STRING(func)
+    "jal	" __STRING(func) "\n"					\
+    "nop			\n"
 #endif
 
 #endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001100346.00A3kx3o026199>