RISC-V: Fix nested function trampolines.

Message ID 20180714200633.27663-1-jimw@sifive.com
State New
Headers show
  • RISC-V: Fix nested function trampolines.
Related show

Commit Message

Jim Wilson July 14, 2018, 8:06 p.m.
This fixes an oversight.  I suspect that there was a RISC-V QEMU bug allowing
stacks to be executable by default, so we didn't see the problem until we
started running the gcc testsuite on hardware.  This was also confused by the
late ABI change to the cache flush support when upstreaming the glibc support.
And the linux kernel bug we just found a couple of days ago.  Anyways,
trampolines work now, if you have all of the right patches.

This was tested with a native riscv64-linux bootstrap and make check.  It
fixes 69 gcc failures, 49 gfortran failures, and 1 objc failure.  It also fixes
one gnat failure, which is how I happened to notice that gcc was broken too.

Kito/Ruslan - You may need a similar change to the config/riscv-freebsd.h file.
I don't have a setup where I can test that.



	* config/riscv/linux.h (TARGET_ASM_FILE_END): New.
 gcc/config/riscv/linux.h | 2 ++
 1 file changed, 2 insertions(+)



diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index 85561846dad..e208c95fe13 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -66,3 +66,5 @@  along with GCC; see the file COPYING3.  If not see
       %{rdynamic:-export-dynamic} \
       -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack