diff options
author | Andrew Pinski <apinski@marvell.com> | 2023-07-22 08:52:42 -0700 |
---|---|---|
committer | Andrew Pinski <apinski@marvell.com> | 2023-07-22 21:55:22 -0700 |
commit | bbc1a102735c72e3c5a4dede8ab382813d12b058 (patch) | |
tree | b41ec1d7a1f724e0411ccd8f21541c2ca5e3df77 /libgcc | |
parent | f33fdf9e7c0386397576330db880c2ba85314a9c (diff) | |
download | gcc-bbc1a102735c72e3c5a4dede8ab382813d12b058.zip gcc-bbc1a102735c72e3c5a4dede8ab382813d12b058.tar.gz gcc-bbc1a102735c72e3c5a4dede8ab382813d12b058.tar.bz2 |
Fix PR 110066: crash with -pg -static on riscv
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.
OK?
libgcc/ChangeLog:
* config.host (riscv*-*-linux*): Add t-crtstuff to tmake_file.
(riscv*-*-freebsd*): Likewise.
* config/riscv/t-crtstuff: New file.
Diffstat (limited to 'libgcc')
-rw-r--r-- | libgcc/config.host | 4 | ||||
-rw-r--r-- | libgcc/config/riscv/t-crtstuff | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/libgcc/config.host b/libgcc/config.host index 9d72120..c94d69d 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1304,12 +1304,12 @@ pru-*-*) tm_file="$tm_file pru/pru-abi.h" ;; riscv*-*-linux*) - tmake_file="${tmake_file} riscv/t-softfp${host_address} t-softfp riscv/t-elf riscv/t-elf${host_address} t-slibgcc-libgcc" + tmake_file="${tmake_file} riscv/t-crtstuff riscv/t-softfp${host_address} t-softfp riscv/t-elf riscv/t-elf${host_address} t-slibgcc-libgcc" extra_parts="$extra_parts crtbegin.o crtend.o crti.o crtn.o crtendS.o crtbeginT.o" md_unwind_header=riscv/linux-unwind.h ;; riscv*-*-freebsd*) - tmake_file="${tmake_file} riscv/t-softfp${host_address} t-softfp riscv/t-elf riscv/t-elf${host_address} t-slibgcc-libgcc" + tmake_file="${tmake_file} riscv/t-crtstuff riscv/t-softfp${host_address} t-softfp riscv/t-elf riscv/t-elf${host_address} t-slibgcc-libgcc" extra_parts="$extra_parts crtbegin.o crtend.o crti.o crtn.o crtendS.o crtbeginT.o" ;; riscv*-*-*) diff --git a/libgcc/config/riscv/t-crtstuff b/libgcc/config/riscv/t-crtstuff new file mode 100644 index 0000000..685d11b --- /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 |