RISC-V qemu default that to false, which mean stack can't execute anything
by default, that's match RISC-V linux kernel behaviour, but the problem is
risc-v bare metal toolchain may execute code on stack *without* that tag,
that does not cause problems before for running tests on qemu user mode,
but...it causes problems once using newer qemu (with that patch).

Fangrui Song <mask...@google.com> 於 2023年9月6日 週三 04:53 寫道:

> On Tue, Sep 5, 2023 at 5:14 AM Kito Cheng via Gcc-patches <
> gcc-patches@gcc.gnu.org> wrote:
>
>> committed, thanks :)
>>
>> On Tue, Sep 5, 2023 at 3:18 PM Jeff Law via Gcc-patches
>> <gcc-patches@gcc.gnu.org> wrote:
>> >
>> >
>> >
>> > On 8/31/23 03:05, Kito Cheng wrote:
>> > > We only emit that on linux target before, that not problem before,
>> > > however Qemu has fix a bug to make qemu user mode honor
>> PT_GNU_STACK[1],
>> > > that will cause problem when we test baremetal with qemu.
>> > >
>> > > So the straightforward is enable that as well for non-linux toolchian,
>> > > the price is that will increase few bytes for each binary.
>> > >
>> > > [1]
>> https://github.com/qemu/qemu/commit/872f3d046f2381e3f416519e82df96bd60818311
>> > >
>> > > gcc/ChangeLog:
>> > >
>> > >       * config/riscv/linux.h (TARGET_ASM_FILE_END): Move ...
>> > >       * config/riscv/riscv.cc (TARGET_ASM_FILE_END): to here.
>> > OK.
>> > jeff
>>
>
> Does
> https://github.com/qemu/qemu/commit/872f3d046f2381e3f416519e82df96bd60818311
> use #define EXSTACK_DEFAULT true
> for riscv?
>
>
>
>
> --
> 宋方睿
>

Reply via email to