[flang-commits] [flang] [flang][docs] Add a mention about -fsafe-trampoline to FAQ.md (PR #207656)

Yusuke MINATO via flang-commits flang-commits at lists.llvm.org
Tue Jul 7 17:48:30 PDT 2026


https://github.com/yus3710-fj updated https://github.com/llvm/llvm-project/pull/207656

>From ee7aa26f1925e287a92c45b0c73e2c83b37985ae Mon Sep 17 00:00:00 2001
From: Yusuke MINATO <minato.yusuke at fujitsu.com>
Date: Fri, 3 Jul 2026 15:27:03 +0900
Subject: [PATCH 1/6] [flang][docs] Add a mention about `-fsafe-trampoline` to
 FAQ.md

---
 flang/docs/FAQ.md | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/flang/docs/FAQ.md b/flang/docs/FAQ.md
index 0b0b6ebdacf0b..5957b0e731757 100644
--- a/flang/docs/FAQ.md
+++ b/flang/docs/FAQ.md
@@ -50,3 +50,7 @@ ld.lld: error: src.o: requires an executable stack, but -z execstack is not spec
 flang-22: error: linker command failed with exit code 1 (use -v to see invocation)
 $ flang src.f90 -fuse-ld=lld -Wl,-z,execstack
 ```
+
+Since LLVM 23, Flang has a new compiler flag `-fsafe-trampoline`, which is disabled by default.
+If this is enabled, the trampoline is generated on a dedicated `mmap`'d region instead of the stack.
+Therefore, we **strongly recommend** using this flag to reduce the security risk.

>From eb1cbf9198f1bcd923e8e10e17ec9d3ef1b07b34 Mon Sep 17 00:00:00 2001
From: Yusuke MINATO <minato.yusuke at fujitsu.com>
Date: Tue, 7 Jul 2026 09:32:37 +0900
Subject: [PATCH 2/6] address some comments

---
 flang/docs/FAQ.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/flang/docs/FAQ.md b/flang/docs/FAQ.md
index 5957b0e731757..fe937a6c52fa7 100644
--- a/flang/docs/FAQ.md
+++ b/flang/docs/FAQ.md
@@ -51,6 +51,6 @@ flang-22: error: linker command failed with exit code 1 (use -v to see invocatio
 $ flang src.f90 -fuse-ld=lld -Wl,-z,execstack
 ```
 
-Since LLVM 23, Flang has a new compiler flag `-fsafe-trampoline`, which is disabled by default.
+Since LLVM 23, Flang has a new compiler flag `-fsafe-trampoline`, which is disabled by default and is currently supported on x86-64 and AArch64 targets.
 If this is enabled, the trampoline is generated on a dedicated `mmap`'d region instead of the stack.
-Therefore, we **strongly recommend** using this flag to reduce the security risk.
+Where supported, we recommend using this flag to reduce the security risk.

>From b6532ce946e8c69dbb2b5ef2fedafc12de039fbb Mon Sep 17 00:00:00 2001
From: Yusuke MINATO <minato.yusuke at fujitsu.com>
Date: Wed, 8 Jul 2026 09:20:31 +0900
Subject: [PATCH 3/6] Update flang/docs/FAQ.md

Co-authored-by: Tarun Prabhu <tarunprabhu at gmail.com>
---
 flang/docs/FAQ.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/flang/docs/FAQ.md b/flang/docs/FAQ.md
index fe937a6c52fa7..c220d469380ce 100644
--- a/flang/docs/FAQ.md
+++ b/flang/docs/FAQ.md
@@ -53,4 +53,4 @@ $ flang src.f90 -fuse-ld=lld -Wl,-z,execstack
 
 Since LLVM 23, Flang has a new compiler flag `-fsafe-trampoline`, which is disabled by default and is currently supported on x86-64 and AArch64 targets.
 If this is enabled, the trampoline is generated on a dedicated `mmap`'d region instead of the stack.
-Where supported, we recommend using this flag to reduce the security risk.
+Where supported, we recommend using this flag to reduce the security risk of an executable stack.

>From 6ce14faa5d128df9798a6ccae07faf928fc3fd62 Mon Sep 17 00:00:00 2001
From: Yusuke MINATO <minato.yusuke at fujitsu.com>
Date: Wed, 8 Jul 2026 09:36:04 +0900
Subject: [PATCH 4/6] Update flang/docs/FAQ.md

Co-authored-by: Tarun Prabhu <tarunprabhu at gmail.com>

>From c52ff041cbafaf538f6d44fc825375bf3f44787f Mon Sep 17 00:00:00 2001
From: Yusuke MINATO <minato.yusuke at fujitsu.com>
Date: Wed, 8 Jul 2026 09:42:22 +0900
Subject: [PATCH 5/6] Update flang/docs/FAQ.md

Co-authored-by: Tarun Prabhu <tarunprabhu at gmail.com>

>From 5adc4e779a8bf332cea6e0509b9069eee9dd67d0 Mon Sep 17 00:00:00 2001
From: Yusuke MINATO <minato.yusuke at fujitsu.com>
Date: Wed, 8 Jul 2026 09:46:17 +0900
Subject: [PATCH 6/6] Update flang/docs/FAQ.md

Co-authored-by: Tarun Prabhu <tarunprabhu at gmail.com>



More information about the flang-commits mailing list