CVS commit: pkgsrc/cross/ppc-morphos-gcc

"Jonathan Schleifer" <[email protected]>
Newsgroups gmane.os.netbsd.devel.pkgsrc.cvs
Message-ID <[email protected]>
Module Name:	pkgsrc
Committed By:	js
Date:		Wed Aug 12 23:20:23 UTC 2026

Modified Files:
	pkgsrc/cross/ppc-morphos-gcc: Makefile
Added Files:
	pkgsrc/cross/ppc-morphos-gcc/files: restore_r13-insn.diff
Removed Files:
	pkgsrc/cross/ppc-morphos-gcc/files: no-shrink-wrap-for-baserel.diff

Log Message:
cross/ppc-morphos-gcc: Import restore_r13-insn.diff


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 pkgsrc/cross/ppc-morphos-gcc/Makefile
cvs rdiff -u -r1.1 -r0 \
    pkgsrc/cross/ppc-morphos-gcc/files/no-shrink-wrap-for-baserel.diff
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/cross/ppc-morphos-gcc/files/restore_r13-insn.diff

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
(unnamed) (text/x-diff, 3.5 KB)
Modified files:

Index: pkgsrc/cross/ppc-morphos-gcc/Makefile
diff -u pkgsrc/cross/ppc-morphos-gcc/Makefile:1.14 pkgsrc/cross/ppc-morphos-gcc/Makefile:1.15
--- pkgsrc/cross/ppc-morphos-gcc/Makefile:1.14	Wed Aug  5 22:50:43 2026
+++ pkgsrc/cross/ppc-morphos-gcc/Makefile	Wed Aug 12 23:20:23 2026
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.14 2026/08/05 22:50:43 js Exp $
+# $NetBSD: Makefile,v 1.15 2026/08/12 23:20:23 js Exp $
 
 DISTNAME=	gcc-15.2.0
-PKGREVISION=	10
+PKGREVISION=	11
 PKGNAME=	ppc-morphos-${DISTNAME}
 CATEGORIES=	cross
 MASTER_SITES=	${MASTER_SITE_GNU:=gcc/gcc-${PKGVERSION_NOREV}/}
@@ -55,7 +55,7 @@ pre-patch:
 	${RUN} cd ${WRKSRC} && ${PATCH} -p0 <${FILESDIR}/fix-saveds.diff
 	${RUN} cd ${WRKSRC} && ${PATCH} -p0 <${FILESDIR}/objc-saveds.diff
 	${RUN} cd ${WRKSRC} && ${PATCH} -p1 <${FILESDIR}/libcpp-disable-canonicalize.diff
-	${RUN} cd ${WRKSRC} && ${PATCH} -p0 <${FILESDIR}/no-shrink-wrap-for-baserel.diff
+	${RUN} cd ${WRKSRC} && ${PATCH} -p0 <${FILESDIR}/restore_r13-insn.diff
 	${RUN} cd ${WRKSRC} && ${PATCH} -p0 <${FILESDIR}/const-baserel.diff
 	${RUN} cd ${WRKSRC} && ${PATCH} -p0 <${FILESDIR}/save-r13-baserel.diff
 	${RUN} find ${WRKSRC} -name configure -print0 | xargs -0 -r perl -i.orig -p -e "s|toolexecdir='\\\$$\(libdir\)/gcc/\\\$$\(target_alias\)'|toolexecdir='\\\$$(libdir)/gcc-lib/\\\$$(target_alias)'|g;"

Added files:

Index: pkgsrc/cross/ppc-morphos-gcc/files/restore_r13-insn.diff
diff -u /dev/null pkgsrc/cross/ppc-morphos-gcc/files/restore_r13-insn.diff:1.1
--- /dev/null	Wed Aug 12 23:20:23 2026
+++ pkgsrc/cross/ppc-morphos-gcc/files/restore_r13-insn.diff	Wed Aug 12 23:20:23 2026
@@ -0,0 +1,57 @@
+Make restore_r13 an insn with properly declared registers and clobbers.
+
+--- gcc/config/rs6000/rs6000.md.orig	2026-08-12 21:46:35.039143013 +0000
++++ gcc/config/rs6000/rs6000.md
+@@ -201,6 +201,7 @@
+    UNSPECV_SPEC_BARRIER         ; Speculation barrier
+    UNSPECV_PLT16_LO
+    UNSPECV_PLT_PCREL
++   UNSPECV_RESTORE_R13
+   ])
+ 
+ ; The three different kinds of epilogue.
+@@ -11341,6 +11342,16 @@
+   [(set (match_dup 0) (high:P (match_dup 1)))
+    (set (match_dup 0) (lo_sum:P (match_dup 0) (match_dup 1)))])
+ 
++
++;; baserel - inspired by load_toc_v4_pic_si
++(define_insn "restore_r13"
++  [(set (reg:SI 13)
++	(unspec_volatile:SI [(reg:SI 12)] UNSPECV_RESTORE_R13))
++   (clobber (reg:SI LR_REGNO))]
++  "TARGET_BASEREL"
++  "bl __restore_r13"
++  [(set_attr "type" "branch")])
++
+ ;;
+ ;;
+ ;;
+--- gcc/config/rs6000/rs6000.cc.orig	2026-08-12 22:19:12.210389558 +0000
++++ gcc/config/rs6000/rs6000.cc
+@@ -10224,6 +10224,9 @@ rs6000_conditional_register_usage (void)
+   if (fixed_regs[2] && (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2))
+     call_used_regs[2] = 0;
+ 
++  if (TARGET_BASEREL)
++    fixed_regs[13] = call_used_regs[13] = 1;
++
+   if (DEFAULT_ABI == ABI_V4 && flag_pic == 2)
+     fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1;
+ 
+--- gcc/config/rs6000/rs6000-logue.cc.orig	2026-08-12 22:00:17.645715902 +0000
++++ gcc/config/rs6000/rs6000-logue.cc
+@@ -3955,12 +3955,7 @@ rs6000_emit_prologue (void)
+   if (info->baserel_save_p && TARGET_BASEREL)
+     {
+       /* Call __restore_r13 */
+-      rtx restore_r13_ref = gen_rtx_SYMBOL_REF (Pmode, "__restore_r13");
+-      SYMBOL_REF_FLAGS (restore_r13_ref) |= (SYMBOL_FLAG_LOCAL | SYMBOL_FLAG_FUNCTION);
+-
+-      emit_call_insn (gen_call (gen_rtx_MEM (SImode, restore_r13_ref), const0_rtx, const0_rtx));
+-
+-      emit_insn (gen_blockage ());
++      emit_insn (gen_restore_r13 ());
+     }
+ #endif
+
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.