On 10/26/26 13:52, Kirill A. Korinsky wrote:
> On Mon, 26 Oct 2026 13:49:28 +0100,
> Martijn van Duren <[email protected]> wrote:
>>
>> Diff below contains 3 things and is widely discussed with kirill@, and
>> gone through miod, but sending it here so other people get a chance to
>> chime in.
>> 1) The report keyword results in an #error with newer gcc build system.
>>    Simply removing the keyword suggested by kirill@.
>> 2) LINK_SPEC is already defined in gcc itself and causes a lot of
>>    redefine noise. Going for the gcc definition as suggested by kirill@.
>> 3) upstream gcc has the same stack protector logic as was recently
>>    fixed in base by miod@. This fixes similar build issues found with
>>    gcc-16. Confirmed by miod@.
>>
>> OK?
>>
> 
> I think you need revision bump in Makefile.
> 
> Otherwise OK kirill@

All 3 patches are in alpha-specific code, which currently doesn't build,
so I don't think the revision bump is _needed_, especially considering
it will trigger quite a hefty rebuild for slower architectures, but I
can bump it if desired.> 
>> martijn@
>>
>> diff /usr/ports
>> path + /usr/ports
>> commit - 3eff4995526c542b34b298dfecc2ca0816223f67
>> blob - 7e52e1631fd8664214ee99b79e895e58771f431a
>> file + lang/gcc/16/patches/patch-gcc_config_alpha_alpha_md
>> --- lang/gcc/16/patches/patch-gcc_config_alpha_alpha_md
>> +++ lang/gcc/16/patches/patch-gcc_config_alpha_alpha_md
>> @@ -1,6 +1,28 @@
>>  Index: gcc/config/alpha/alpha.md
>>  --- gcc/config/alpha/alpha.md.orig
>>  +++ gcc/config/alpha/alpha.md
>> +@@ -467,15 +467,15 @@
>> +         (plus:DI (match_operand:DI 1 "reg_no_subreg_operand" "r,r,r")
>> +             (match_operand:DI 2 "const_int_operand" "K,L,n")))]
>> +   "NONSTRICT_REG_OK_FP_BASE_P (operands[1])
>> +-   && INTVAL (operands[2]) >= 0
>> +-   /* This is the largest constant an lda+ldah pair can add, minus
>> ++   && INTVAL (operands[2]) < 0
>> ++   /* This is the largest constant an lda+ldah pair can subtract, minus
>> +       an upper bound on the displacement between SP and AP during
>> +       register elimination.  See INITIAL_ELIMINATION_OFFSET.  */
>> +    && INTVAL (operands[2])
>> +-   < (0x7fff8000
>> +-      - FIRST_PSEUDO_REGISTER * UNITS_PER_WORD
>> +-      - ALPHA_ROUND(crtl->outgoing_args_size)
>> +-      - (ALPHA_ROUND (get_frame_size ()
>> ++   >= ((HOST_WIDE_INT) -0x7fffffff /* - (HOST_WIDE_INT) 0x8000 */
>> ++      + FIRST_PSEUDO_REGISTER * UNITS_PER_WORD
>> ++      + ALPHA_ROUND(crtl->outgoing_args_size)
>> ++      + (ALPHA_ROUND (get_frame_size ()
>> +                       + max_reg_num () * UNITS_PER_WORD
>> +                       + crtl->args.pretend_args_size)
>> +          - crtl->args.pretend_args_size))"
>>  @@ -4953,7 +4953,8 @@
>>     if (CONST_INT_P (operands[1])
>>         && INTVAL (operands[1]) < 32768)
>> commit - 3eff4995526c542b34b298dfecc2ca0816223f67
>> blob - 9fb76b06167a7cc7f1aa5a3309e7339f0bf68ec3
>> file + lang/gcc/16/patches/patch-gcc_config_alpha_alpha_opt
>> --- lang/gcc/16/patches/patch-gcc_config_alpha_alpha_opt
>> +++ lang/gcc/16/patches/patch-gcc_config_alpha_alpha_opt
>> @@ -6,7 +6,7 @@ Index: gcc/config/alpha/alpha.opt
>>   Emit IEEE-conformant code, without inexact exceptions.
>>   
>>  +mno-ieee
>> -+Target Report RejectNegative InverseMask(IEEE)
>> ++Target RejectNegative InverseMask(IEEE)
>>  +Emit non-IEEE-conformant code
>>  +
>>   mieee-with-inexact
>> commit - 3eff4995526c542b34b298dfecc2ca0816223f67
>> blob - bc6b41ec3410694d603eb9fe58a90a2c1b54354e
>> file + lang/gcc/16/patches/patch-gcc_config_alpha_openbsd_h
>> --- lang/gcc/16/patches/patch-gcc_config_alpha_openbsd_h
>> +++ lang/gcc/16/patches/patch-gcc_config_alpha_openbsd_h
>> @@ -1,7 +1,7 @@
>>  Index: gcc/config/alpha/openbsd.h
>>  --- gcc/config/alpha/openbsd.h.orig
>>  +++ gcc/config/alpha/openbsd.h
>> -@@ -41,6 +41,28 @@ along with GCC; see the file COPYING3.  If not see
>> +@@ -41,6 +41,19 @@ along with GCC; see the file COPYING3.  If not see
>>   #undef ENDFILE_SPEC
>>   #define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
>>   
>> @@ -9,15 +9,6 @@ Index: gcc/config/alpha/openbsd.h
>>  +#define TARGET_DEFAULT \
>>  +   (MASK_FPREGS | MASK_IEEE | MASK_IEEE_CONFORMANT)
>>  +
>> -+#define LINK_SPEC \
>> -+  "%{!shared:%{!nostdlib:%{!r:%{!e*:-e __start}}}} \
>> -+   %{shared:-shared} %{R*} \
>> -+   %{static:-Bstatic} \
>> -+   %{!static:-Bdynamic} \
>> -+   %{rdynamic:-export-dynamic} \
>> -+   %{assert*} \
>> -+   %{!static:-dynamic-linker /usr/libexec/ld.so}"
>> -+
>>  +/* As an elf system, we need crtbegin/crtend stuff.  */
>>  +#undef STARTFILE_SPEC
>>  +#define STARTFILE_SPEC "\
>>
> 

Reply via email to