Re: [PATCH v2] compiler-gcc.h: Disable __retain on gcc-11

Geert Uytterhoeven
2024-12-31T14:20:02Z

On Thu, Oct 3, 2024 at 2:57 PM Andreas Schwab <schwab@linux-m68k.org> wrote:
> On Okt 03 2024, Geert Uytterhoeven wrote:
> > On Thu, Oct 3, 2024 at 2:34 PM Andreas Schwab <schwab@linux-m68k.org> wrote:
> >> On Okt 03 2024, Geert Uytterhoeven wrote:
> >> > On Thu, Oct 3, 2024 at 2:11 PM Andreas Schwab <schwab@linux-m68k.org> wrote:
> >> >> On Okt 03 2024, Miguel Ojeda wrote:
> >> >> > Otherwise, does it mean we need a build-time test?
> >> >>
> >> >> A simple gcc version test definitely does not suffice.
> >> >>
> >> >> The suport for retain also depends on HAVE_INITFINI_ARRAY_SUPPORT, which
> >> >> is usually enabled by default (depends on glibc support, but that is
> >> >> much older), but can be disabled with --disable-initfini-array.
> >> >
> >> > FTR, no --disable-initfini-array seen here:
> >>
> >> --disable-initfini-array is the default for cross compilers.
> >
> > Apparently not for cross compilers targeting riscv64?
>
> Yes, targets in the aarch64 era or newer enable initfini_array by
> default. Also, gcc 12+ generally defaults to --enable-initfini-array on
> Linux as well.

As I have upgraded to Ubuntu 24.04.1 LTS, my main cross-compilers are
now based on gcc-13, which does not exhibit the issue (it can still be
reproduced by building with CC=arm-linux-gnueabi-gcc-11). Hence I have
no longer an immediate need for this patch, and will stop continuing
this non-conclusive discussion. The distro people can pick up my patch
when they get to gcc-11 ;-)

Happy 2025!

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds