[llvm] [MC] Explicitly request executable stacks (PR #93478)

Slava Zakharin via llvm-commits llvm-commits at lists.llvm.org
Thu May 30 16:36:06 PDT 2024


vzakhari wrote:

> Thanks @MaskRay .
> 
> @vzakhari @kiranchandramohan would it make sense to allocate the trampoline buffer somewhere else other than the stack? Say, on the heap and free it upon leaving the function (it needs to be allocated just once per function as it is conceptually a temporary of the argument evaluation, so in that sense it is a bit like an `allocatable`).
> 
> We could use the Fortran runtime to allocate an executable buffer.

Hello @rofirrim,

Yes, we want to avoid requiring the executable stack for executing Fortran internal subprograms via procedure pointers.  Have you read https://flang.llvm.org/docs/InternalProcedureTrampolines.html#alternative-implementation-s and https://flang.llvm.org/docs/InternalProcedureTrampolines.html#implementation-options?  These are some options available to us, and there may be more (e.g. https://fortran-lang.discourse.group/t/is-creating-nested-subroutines-functions-considered-good-practice-in-fortran/6545/26).

https://github.com/llvm/llvm-project/pull/93478


More information about the llvm-commits mailing list