From: Kito Cheng <kito.cheng@gmail.com>
To: Andrew Pinski <apinski@marvell.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 1/2] Fix PR 110066: crash with -pg -static on riscv
Date: Sun, 23 Jul 2023 11:35:29 +0800 [thread overview]
Message-ID: <CA+yXCZAH5VqjQ39jxk7rnfNZCvjbfk4hiDkOm=pHUJtOF04KAQ@mail.gmail.com> (raw)
In-Reply-To: <20230723010645.1622083-1-apinski@marvell.com>
[-- Attachment #1: Type: text/plain, Size: 2570 bytes --]
OK for trunk, thanks:)
Andrew Pinski via Gcc-patches <gcc-patches@gcc.gnu.org> 於 2023年7月23日 週日
09:07 寫道:
> 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.
> ---
> libgcc/config.host | 4 ++--
> libgcc/config/riscv/t-crtstuff | 5 +++++
> 2 files changed, 7 insertions(+), 2 deletions(-)
> create mode 100644 libgcc/config/riscv/t-crtstuff
>
> diff --git a/libgcc/config.host b/libgcc/config.host
> index 9d7212028d0..c94d69d84b7 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 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
> --
> 2.39.1
>
>
next prev parent reply other threads:[~2023-07-23 3:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-23 1:06 Andrew Pinski
2023-07-23 1:06 ` [PATCH 2/2] AARCH64: Turn off unwind tables for crtbeginT.o Andrew Pinski
2023-07-24 15:55 ` Richard Sandiford
2023-07-25 7:06 ` Richard Biener
2023-07-23 3:35 ` Kito Cheng [this message]
2024-05-08 16:07 ` [PATCH 1/2] Fix PR 110066: crash with -pg -static on riscv Andrew Pinski
2023-07-23 6:46 ` Andreas Schwab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CA+yXCZAH5VqjQ39jxk7rnfNZCvjbfk4hiDkOm=pHUJtOF04KAQ@mail.gmail.com' \
--to=kito.cheng@gmail.com \
--cc=apinski@marvell.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).