On Jul 22 2023, Andrew Pinski via Gcc-patches wrote: > The problem -fasynchronous-unwind-tables is on by default for riscv linux > We need turn it off for crt*.o because it would make __EH_FRAME_BEGIN__ point > to .eh_frame data from crtbeginT.o instead of the user-defined object > during static linking. > > This turns it off.
Since this is a recurring problem, and difficult to notice (see how long the aarch64 case went unnoticed), it should be fixed generically, instead of having to patch every case separately. > diff --git a/libgcc/config/riscv/t-crtstuff b/libgcc/config/riscv/t-crtstuff > new file mode 100644 > index 00000000000..685d11b3e66 > --- /dev/null > +++ b/libgcc/config/riscv/t-crtstuff > @@ -0,0 +1,5 @@ > +# -fasynchronous-unwind-tables -funwind-tables is on by default for riscv > linux > +# We turn it off for crt*.o because it would make __EH_FRAME_BEGIN__ point > +# to .eh_frame data from crtbeginT.o instead of the user-defined object > +# during static linking. > +CRTSTUFF_T_CFLAGS += -fno-asynchronous-unwind-tables -fno-unwind-tables What about CRTSTUFF_T_CFLAGS_S? -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."