[03/11] Fix issues with removing no-reorder directives

Message ID 20250123134308.1785777-5-aleksandar.rakic@htecgroup.com (mailing list archive)
State New
Headers
Series Improve Mips target |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent

Commit Message

Aleksandar Rakic Jan. 23, 2025, 1:42 p.m. UTC
  1. Added -O2 to the Makefile to ensure that assembly sources have
   their delay slots filled.

2. Also move the no-reorder directive into the PIC section of the
   setjmp code.

Cherry-picked 4e451260675b2e54535eafc2df35d92653acd084
from https://github.com/MIPS/glibc

Signed-off-by: Andrew Bennett <andrew.bennett@imgtec.com>
Signed-off-by: Faraz Shahbazker <fshahbazker@wavecomp.com>
Signed-off-by: Aleksandar Rakic <aleksandar.rakic@htecgroup.com>
---
 sysdeps/mips/Makefile     | 2 ++
 sysdeps/mips/bsd-setjmp.S | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
  

Patch

diff --git a/sysdeps/mips/Makefile b/sysdeps/mips/Makefile
index d189973aa0..17ddc2a97c 100644
--- a/sysdeps/mips/Makefile
+++ b/sysdeps/mips/Makefile
@@ -18,9 +18,11 @@  CPPFLAGS-crtn.S += $(pic-ccflag)
 endif
 
 ASFLAGS-.os += $(pic-ccflag)
+
 # libc.a and libc_p.a must be compiled with -fPIE/-fpie for static PIE.
 ASFLAGS-.o += $(pie-default)
 ASFLAGS-.op += $(pie-default)
+ASFLAGS += -O2
 
 ifeq ($(subdir),elf)
 
diff --git a/sysdeps/mips/bsd-setjmp.S b/sysdeps/mips/bsd-setjmp.S
index 7e4d7dcb0b..8c06b9957c 100644
--- a/sysdeps/mips/bsd-setjmp.S
+++ b/sysdeps/mips/bsd-setjmp.S
@@ -28,8 +28,8 @@ 
 	.option pic2
 #endif
 ENTRY (setjmp)
-	.set	noreorder
 #ifdef __PIC__
+	.set	noreorder
 	.cpload t9
 	.set	reorder
 	la	t9, C_SYMBOL_NAME (__sigsetjmp)