pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/lang



Module Name:    pkgsrc
Committed By:   he
Date:           Sat Jul 18 09:12:39 UTC 2026

Modified Files:
        pkgsrc/lang/gcc12: Makefile distinfo
        pkgsrc/lang/gcc12-libs: Makefile
Added Files:
        pkgsrc/lang/gcc12/patches: patch-gcc_config_rs6000_netbsd.h

Log Message:
lang/gcc12: pull over the changes to rs6000/netbsd.h from our in-tree gcc.

This is so that this builds and runs on powerpc/11.0*.

The most important fix is that on powerpc, -msecure-plt is enabled by
default, so that resulting executables can be run with PAX_MPROTECT active.
Otherwise, we end up with executables with sections which have both
"write" and "execute" turned on, which PAX_MPROTECT rejects.

Fixes PR#60439.

Bump PKGREVISION for both gcc12 and gcc12-libs, to adhere to rules in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 pkgsrc/lang/gcc12/Makefile
cvs rdiff -u -r1.17 -r1.18 pkgsrc/lang/gcc12/distinfo
cvs rdiff -u -r1.12 -r1.13 pkgsrc/lang/gcc12-libs/Makefile
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/lang/gcc12/patches/patch-gcc_config_rs6000_netbsd.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/lang/gcc12/Makefile
diff -u pkgsrc/lang/gcc12/Makefile:1.14 pkgsrc/lang/gcc12/Makefile:1.15
--- pkgsrc/lang/gcc12/Makefile:1.14     Thu Apr  9 06:30:03 2026
+++ pkgsrc/lang/gcc12/Makefile  Sat Jul 18 09:12:38 2026
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.14 2026/04/09 06:30:03 mrg Exp $
+# $NetBSD: Makefile,v 1.15 2026/07/18 09:12:38 he Exp $
 
 PKGNAME=       ${GCC_PKGNAME}-${GCC12_DIST_VERSION}
 ## When bumping the PKGREVISION of this package the PKGREVISION of
 ## lang/gcc12-libs needs to be bumped to be at least 1 more than the
 ## PKGREVISION of this package!
-PKGREVISION=   2
+PKGREVISION=   3
 COMMENT=       The GNU Compiler Collection (GCC) - 12.0 Release Series
 
 LANGS=                 c

Index: pkgsrc/lang/gcc12/distinfo
diff -u pkgsrc/lang/gcc12/distinfo:1.17 pkgsrc/lang/gcc12/distinfo:1.18
--- pkgsrc/lang/gcc12/distinfo:1.17     Thu Apr  9 06:30:03 2026
+++ pkgsrc/lang/gcc12/distinfo  Sat Jul 18 09:12:38 2026
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.17 2026/04/09 06:30:03 mrg Exp $
+$NetBSD: distinfo,v 1.18 2026/07/18 09:12:38 he Exp $
 
 BLAKE2s (gcc-12.5.0-1.diff) = 2e5b0c6e8cececdddf451c07f55a47e693410cb4c50aedb8534ec345810d05c6
 SHA512 (gcc-12.5.0-1.diff) = 6137995194e2c5b1bbedef6efd1083018ee03cadbb29c2e1a8bda7ef49a76b13c307749f5a1ee4284d399d200a5a46aa888feacc2bfaf743de25f16b00640c76
@@ -19,6 +19,7 @@ SHA1 (patch-gcc_config_arm_elf.h) = 5774
 SHA1 (patch-gcc_config_arm_netbsd-eabi.h) = 85eb89de6f2e64fac50251f06d7e4eab35903dae
 SHA1 (patch-gcc_config_arm_netbsd-elf.h) = 367d83c808fd7b5b1989d0490b532ad06b425b31
 SHA1 (patch-gcc_config_nvptx_gen-opt.sh) = 67b8c84f198561c1d964a50946937a0a9cc26749
+SHA1 (patch-gcc_config_rs6000_netbsd.h) = b3f405f3dfdb5590b79f069b380291d2382c8ff7
 SHA1 (patch-gcc_config_rs6000_rs6000-logue.cc) = 8852ee6656836836b882f673448873190c44466b
 SHA1 (patch-gcc_config_rs6000_rs6000.cc) = 9aa2e73720f380c45a59e9e3b4c2b4fd0c4d689e
 SHA1 (patch-gcc_config_rs6000_sysv4.h) = be389b7b2a784ca4cd8dd8b8cefb03ae158d368c

Index: pkgsrc/lang/gcc12-libs/Makefile
diff -u pkgsrc/lang/gcc12-libs/Makefile:1.12 pkgsrc/lang/gcc12-libs/Makefile:1.13
--- pkgsrc/lang/gcc12-libs/Makefile:1.12        Thu Apr  9 06:30:04 2026
+++ pkgsrc/lang/gcc12-libs/Makefile     Sat Jul 18 09:12:38 2026
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 2026/04/09 06:30:04 mrg Exp $
+# $NetBSD: Makefile,v 1.13 2026/07/18 09:12:38 he Exp $
 
 GCC_PKGNAME=   gcc12
 .include       "../../lang/${GCC_PKGNAME}/version.mk"
@@ -9,7 +9,7 @@ PKGNAME=        ${GCC_PKGNAME}-libs-${GCC12_DIS
 ## The PKGREVISION of this package needs to be at least 1 more than the
 ## PKGREVISION of the lang/gcc12 package so that with the dependence pattern
 ## '{gcc12,gcc12-libs}>=12.1.*' pkg_add will choose gcc12-libs over gcc12.
-PKGREVISION=   3
+PKGREVISION=   4
 
 CATEGORIES=    lang
 MASTER_SITES=  # empty

Added files:

Index: pkgsrc/lang/gcc12/patches/patch-gcc_config_rs6000_netbsd.h
diff -u /dev/null pkgsrc/lang/gcc12/patches/patch-gcc_config_rs6000_netbsd.h:1.1
--- /dev/null   Sat Jul 18 09:12:39 2026
+++ pkgsrc/lang/gcc12/patches/patch-gcc_config_rs6000_netbsd.h  Sat Jul 18 09:12:38 2026
@@ -0,0 +1,100 @@
+$NetBSD: patch-gcc_config_rs6000_netbsd.h,v 1.1 2026/07/18 09:12:38 he Exp $
+
+Carry over changes from in-tree gcc in an attempt at
+making this build on NetBSD/powerpc.
+
+In particular this should enable -msecure-plt by default so that
+the compiler produces executables which will run with
+
+   security.pax.mprotect.enabled=1
+
+--- gcc/config/rs6000/netbsd.h.orig    2026-07-17 07:01:21.448909835 +0000
++++ gcc/config/rs6000/netbsd.h
+@@ -31,6 +31,12 @@
+       builtin_define ("__powerpc__");         \
+       builtin_assert ("cpu=powerpc");         \
+       builtin_assert ("machine=powerpc");     \
++      if (TARGET_SECURE_PLT)                  \
++        builtin_define ("_SECURE_PLT");               \
++      if (TARGET_SOFT_FLOAT)                  \
++        builtin_define ("_SOFT_FLOAT");               \
++      if (TARGET_ISEL)                                \
++        builtin_define ("__PPC_ISEL__");      \
+     }                                         \
+   while (0)
+ 
+@@ -62,6 +68,29 @@
+ #undef  PTRDIFF_TYPE
+ #define PTRDIFF_TYPE "int"
+ 
++/* Redefine some types that where redefined by rs6000 include files.  */
++
++#undef WCHAR_TYPE
++#define WCHAR_TYPE "int"
++
++#undef WCHAR_TYPE_SIZE
++#define WCHAR_TYPE_SIZE 32
++
++#undef WINT_TYPE
++#define WINT_TYPE "int"
++
++#undef INT64_TYPE
++#define INT64_TYPE "long long int"
++
++#undef UINT64_TYPE
++#define UINT64_TYPE "long long unsigned int"
++
++#undef INTMAX_TYPE
++#define INTMAX_TYPE "long long int"
++
++#undef UINTMAX_TYPE
++#define UINTMAX_TYPE "long long unsigned int"
++
+ /* Undo the spec mess from sysv4.h, and just define the specs
+    the way NetBSD systems actually expect.  */
+ 
+@@ -79,18 +108,39 @@
+ #define STARTFILE_SPEC NETBSD_STARTFILE_SPEC
+ 
+ #undef  ENDFILE_SPEC
+-#define ENDFILE_SPEC "%(netbsd_endfile_spec)"
++#define ENDFILE_SPEC NETBSD_ENDFILE_SPEC
+ 
+ #undef  LIB_SPEC
+ #define LIB_SPEC NETBSD_LIB_SPEC
+ 
+ #undef  SUBTARGET_EXTRA_SPECS
+ #define SUBTARGET_EXTRA_SPECS                                 \
+-  { "netbsd_link_spec",               NETBSD_LINK_SPEC_ELF },         \
+-  { "netbsd_entry_point",     NETBSD_ENTRY_POINT },           \
+-  { "netbsd_endfile_spec",    NETBSD_ENDFILE_SPEC },
++  { "cc1_secure_plt_default",  CC1_SECURE_PLT_DEFAULT_SPEC },   \
++  NETBSD_SUBTARGET_EXTRA_SPECS
+ 
++/*
++ * Add NetBSD specific defaults: -mstrict-align
++ */
++#undef TARGET_DEFAULT
++#define TARGET_DEFAULT (MASK_STRICT_ALIGN)
++
++/*
++ * We know we have the right binutils for this (we shouldn't need to do this
++ * but until the cross build does the right thing...)
++ */
++#undef TARGET_SECURE_PLT
++#define TARGET_SECURE_PLT secure_plt
++#undef HAVE_AS_TLS
++#define HAVE_AS_TLS 1
++#define POWERPC_NETBSD
++
++/* Attempt to enable execute permissions on the stack.  */
++//#define TRANSFER_FROM_TRAMPOLINE NETBSD_ENABLE_EXECUTE_STACK
++// XXXMRG use enable-execute-stack-mprotect.c ?
++#ifdef L_trampoline
++#undef TRAMPOLINE_SIZE
++#define TRAMPOLINE_SIZE 48
++#endif
+ 
+ /* Use standard DWARF numbering for DWARF debugging information.  */
+ #define RS6000_USE_DWARF_NUMBERING
+-



Home | Main Index | Thread Index | Old Index