[clang] [flang][driver] Add -fno-fortran-main (link time) option to remove Fortran_main from link line (PR #74139)

via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 1 12:49:28 PST 2023


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 1f8f9e3163f6367258281f50b9d0492855c996e8 44b684ae43a6da37bb56c5b699628c6807257ad9 -- clang/lib/Driver/ToolChains/CommonArgs.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 2899f07cb7..a72e256825 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1123,7 +1123,8 @@ void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args,
   // the correct libraries to link against as dependents in the object file.
   if (!TC.getTriple().isKnownWindowsMSVCEnvironment()) {
     // if -fno-fortran-main has been passed, skip linking Fortran_main.a
-    bool DontLinkFortranMain = Args.getLastArg(options::OPT_no_fortran_main) != nullptr;
+    bool DontLinkFortranMain =
+        Args.getLastArg(options::OPT_no_fortran_main) != nullptr;
     if (!DontLinkFortranMain) {
       // The --whole-archive option needs to be part of the link line to
       // make sure that the main() function from Fortran_main.a is pulled

``````````

</details>


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


More information about the cfe-commits mailing list