[flang-commits] [flang] [flang] Handle -S assemble only flag in flang-to-external-fc (PR #78979)

David Spickett via flang-commits flang-commits at lists.llvm.org
Mon Jan 22 06:20:14 PST 2024


https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/78979

Flang was recently updated on Compiler Explorer and by default it's in assemble only mode, you have to enable linking and executing.

This means that the default output for flang-to-external-fc is nothing, as it doesn't know what `-S` means. You'd have to know to enable the link to binary option to see any output.

Handle `-S` so that users of Compiler Explorer don't have to wonder why the "compiler" is broken.

>From d92348a7ef0653b46f12aa7e2bdd6672d00806c2 Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at linaro.org>
Date: Mon, 22 Jan 2024 14:15:17 +0000
Subject: [PATCH] [flang] Handle -S assemble only flag in flang-to-external-fc

Flang was recently updated on Compiler Explorer and by default
it's in assemble only mode, you have to enable linking and executing.

This means that the default output for flang-to-external-fc is
nothing, as it doesn't know what `-S` means. You'd have to know
to enable the link to binary option to see any output.

Handle `-S` so that users of Compiler Explorer don't have to wonder
why the "compiler" is broken.
---
 flang/tools/f18/flang-to-external-fc.in | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/flang/tools/f18/flang-to-external-fc.in b/flang/tools/f18/flang-to-external-fc.in
index 24ceda3b7812cf5..bd16c030121cbb9 100755
--- a/flang/tools/f18/flang-to-external-fc.in
+++ b/flang/tools/f18/flang-to-external-fc.in
@@ -108,6 +108,10 @@ parse_args()
           COMPILE_ONLY="True"
         fi
 
+        if [[ $1 == "-S" ]]; then
+          COMPILE_ONLY="True"
+        fi
+
         if [[ $1 == "-E" ]]; then
           PREPROCESS_ONLY="True"
         fi



More information about the flang-commits mailing list