+cc $MAINTAINER

On Fri, Oct 16, 2026 at 04:19:26PM -0400, Brad Smith wrote:
> On 2026-10-16 5:29 a.m., Kirill A. Korinsky wrote:
> > On Fri, 16 Oct 2026 09:27:30 +0200,
> > Brad Smith <[email protected]> wrote:
> > > Some fixes for bootgcc..
> > > 
> > > - Sync the hppa bits over from lang/gcc/8 to bootgcc
> > > - Fix ONLY_FOR_ARCHS no point for m88k
> > > 
> > > 
> > I wonder why have you drop support of m88k from bootgcc?
> 
> There is no m88k support.

You mean it doesn't have patches for OpenBSD/m88k, but it has support
for m88k on other systems.  I'm not sure we need to care about that
though.  ONLY_FOR_ARCHS = ${GCC4_ARCHS} conveys the intended meaning,
and nobody runs bulk builds on m88k anyway.

I don't really object to that part of the diff either.

> > I have no mean to test it so, I have no idea does it work or no.

Here's a diff that was successfully tested by miod@ last year.
Pascal, Kirill: ok?


Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/bootgcc/Makefile,v
diff -u -p -r1.12 Makefile
--- Makefile    16 Feb 2025 22:12:43 -0000      1.12
+++ Makefile    16 Oct 2026 21:32:05 -0000
@@ -5,7 +5,7 @@ DPB_PROPERTIES = parallel
 V = 8.4.0
 FULL_VERSION = $V
 FULL_PKGVERSION = $V
-REVISION = 8
+REVISION = 9
 
 COMMENT =      GNU Compiler Collection; bootstrap package
 PKGNAME =      bootgcc-${FULL_PKGVERSION}
Index: patches/patch-gcc_common_opt
===================================================================
RCS file: /cvs/ports/lang/bootgcc/patches/patch-gcc_common_opt,v
diff -u -p -r1.2 patch-gcc_common_opt
--- patches/patch-gcc_common_opt        11 Mar 2022 19:28:50 -0000      1.2
+++ patches/patch-gcc_common_opt        16 Oct 2026 21:32:05 -0000
@@ -59,6 +59,15 @@ Index: gcc/common.opt
  Process #ident directives.
  
  fif-conversion
+@@ -1779,7 +1787,7 @@ Common Report Var(flag_ivopts) Init(1) Optimization
+ Optimize induction variables on trees.
+ 
+ fjump-tables
+-Common Var(flag_jump_tables) Init(1) Optimization
++Common Var(flag_jump_tables) Init(0) Optimization
+ Use jump tables for sufficiently large switch statements.
+ 
+ fkeep-inline-functions
 @@ -2387,7 +2395,7 @@ Common RejectNegative Joined Var(common_deferred_optio
  -fstack-limit-symbol=<name>   Trap if the stack goes past symbol <name>.
  
Index: patches/patch-gcc_config_pa_pa-openbsd_h
===================================================================
RCS file: /cvs/ports/lang/bootgcc/patches/patch-gcc_config_pa_pa-openbsd_h,v
diff -u -p -r1.2 patch-gcc_config_pa_pa-openbsd_h
--- patches/patch-gcc_config_pa_pa-openbsd_h    11 Mar 2022 19:28:50 -0000      
1.2
+++ patches/patch-gcc_config_pa_pa-openbsd_h    16 Oct 2026 21:32:05 -0000
@@ -1,7 +1,12 @@
+Update OpenBSD-specific configuration on hppa for:
+- PIE support.
+- make __builtin_return_address() not try to read from text sections.
+- put switch() jump tables in .rodata in order not to read from text sections.
+
 Index: gcc/config/pa/pa-openbsd.h
 --- gcc/config/pa/pa-openbsd.h.orig
 +++ gcc/config/pa/pa-openbsd.h
-@@ -138,14 +138,15 @@ along with GCC; see the file COPYING3.  If not see
+@@ -138,17 +138,31 @@ along with GCC; see the file COPYING3.  If not see
     %{shared:-shared} %{R*} \
     %{static:-Bstatic} \
     %{!static:-Bdynamic} \
@@ -21,3 +26,19 @@ Index: gcc/config/pa/pa-openbsd.h
  #undef ENDFILE_SPEC
  #define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
  
++/* Find the return address associated with the frame given by
++   FRAMEADDR.
++   The default code in pa.h invokes return_addr_rtx(), which attemps to
++   read code at the return pointer in order to check for an export stub.
++   This is not possible under OpenBSD as code is not readable; but such
++   export stubs are not used under OpenBSD anymay.  */
++#undef RETURN_ADDR_RTX
++#define RETURN_ADDR_RTX(COUNT, FRAMEADDR)                              \
++  ((COUNT) == 0 ? get_hard_reg_initial_val (Pmode, 2) : NULL_RTX)
++
+ #define OBSD_HAS_CORRECT_SPECS
+ 
+ #define HAVE_ENABLE_EXECUTE_STACK
++
++#undef JUMP_TABLES_IN_TEXT_SECTION
++#define JUMP_TABLES_IN_TEXT_SECTION 0


-- 
jca

Reply via email to