Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "[flang][Driver] Let the linker fail on multiple definitions of main()" #74120

Closed
wants to merge 1 commit into from

Conversation

tblah
Copy link
Contributor

@tblah tblah commented Dec 1, 2023

Reverts #73124

This caused a regression building programs which implement main() in C and then call into some Fortran code, and which link using flang-new.

reproducer:
main.c

int main(void) {
  // call fortran code
  return 0;
}

fortran.f90

function pow(a, b)
  real :: a, b, pow
  pow = a ** b
end function
! note: no PROGRAM statement
clang -c main.c -o main.o
flang-now -c fortran.f90 -o fortran.o
flang-new fortran.o main.o -o out

This can be built with gfortran

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' flang:driver flang Flang issues not falling into any other category labels Dec 1, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Dec 1, 2023

@llvm/pr-subscribers-flang-driver

@llvm/pr-subscribers-clang-driver

Author: Tom Eccles (tblah)

Changes

Reverts llvm/llvm-project#73124

This caused a regression building programs which implement main() in C and then call into some Fortran code, and which link using flang-new.

reproducer:
main.c

int main(void) {
  // call fortran code
  return 0;
}

fortran.f90

function pow(a, b)
  real :: a, b, pow
  pow = a ** b
end function
! note: no PROGRAM statement
clang -c main.c -o main.o
flang-now -c fortran.f90 -o fortran.o
flang-new fortran.o main.o -o out

This can be built with gfortran


Full diff: https://github.com/llvm/llvm-project/pull/74120.diff

15 Files Affected:

  • (modified) clang/lib/Driver/ToolChains/CommonArgs.cpp (+1-47)
  • (modified) clang/lib/Driver/ToolChains/CommonArgs.h (+1-1)
  • (modified) clang/lib/Driver/ToolChains/Darwin.cpp (+1-1)
  • (modified) clang/lib/Driver/ToolChains/DragonFly.cpp (+1-1)
  • (modified) clang/lib/Driver/ToolChains/FreeBSD.cpp (+1-1)
  • (modified) clang/lib/Driver/ToolChains/Gnu.cpp (+1-1)
  • (modified) clang/lib/Driver/ToolChains/Haiku.cpp (+1-1)
  • (modified) clang/lib/Driver/ToolChains/MSVC.cpp (+1-1)
  • (modified) clang/lib/Driver/ToolChains/MinGW.cpp (+1-1)
  • (modified) clang/lib/Driver/ToolChains/NetBSD.cpp (+1-1)
  • (modified) clang/lib/Driver/ToolChains/OpenBSD.cpp (+1-1)
  • (modified) clang/lib/Driver/ToolChains/Solaris.cpp (+1-1)
  • (removed) flang/test/Driver/Inputs/no_duplicate_main.ll (-7)
  • (modified) flang/test/Driver/linker-flags.f90 (+2-2)
  • (removed) flang/test/Driver/no_duplicate_main.f90 (-14)
diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 0ae8e2dce32e94a..a50ce53dd5d7d5c 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1116,60 +1116,14 @@ bool tools::addOpenMPRuntime(ArgStringList &CmdArgs, const ToolChain &TC,
   return true;
 }
 
-void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args,
+void tools::addFortranRuntimeLibs(const ToolChain &TC,
                                   llvm::opt::ArgStringList &CmdArgs) {
   // These are handled earlier on Windows by telling the frontend driver to add
   // the correct libraries to link against as dependents in the object file.
   if (!TC.getTriple().isKnownWindowsMSVCEnvironment()) {
-    // 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
-    // in by the linker.  Determine if --whole-archive is active when
-    // flang will try to link Fortran_main.a.  If it is, don't add the
-    // --whole-archive flag to the link line.  If it's not, add a proper
-    // --whole-archive/--no-whole-archive bracket to the link line.
-    bool WholeArchiveActive = false;
-    for (auto *Arg : Args.filtered(options::OPT_Wl_COMMA))
-      if (Arg)
-        for (StringRef ArgValue : Arg->getValues()) {
-          if (ArgValue == "--whole-archive")
-            WholeArchiveActive = true;
-          if (ArgValue == "--no-whole-archive")
-            WholeArchiveActive = false;
-        }
-
-    if (!WholeArchiveActive)
-      CmdArgs.push_back("--whole-archive");
     CmdArgs.push_back("-lFortran_main");
-    if (!WholeArchiveActive)
-      CmdArgs.push_back("--no-whole-archive");
-
-    // Perform regular linkage of the remaining runtime libraries.
     CmdArgs.push_back("-lFortranRuntime");
     CmdArgs.push_back("-lFortranDecimal");
-  } else {
-    unsigned RTOptionID = options::OPT__SLASH_MT;
-    if (auto *rtl = Args.getLastArg(options::OPT_fms_runtime_lib_EQ)) {
-      RTOptionID = llvm::StringSwitch<unsigned>(rtl->getValue())
-                       .Case("static", options::OPT__SLASH_MT)
-                       .Case("static_dbg", options::OPT__SLASH_MTd)
-                       .Case("dll", options::OPT__SLASH_MD)
-                       .Case("dll_dbg", options::OPT__SLASH_MDd)
-                       .Default(options::OPT__SLASH_MT);
-    }
-    switch (RTOptionID) {
-    case options::OPT__SLASH_MT:
-      CmdArgs.push_back("/WHOLEARCHIVE:Fortran_main.static.lib");
-      break;
-    case options::OPT__SLASH_MTd:
-      CmdArgs.push_back("/WHOLEARCHIVE:Fortran_main.static_dbg.lib");
-      break;
-    case options::OPT__SLASH_MD:
-      CmdArgs.push_back("/WHOLEARCHIVE:Fortran_main.dynamic.lib");
-      break;
-    case options::OPT__SLASH_MDd:
-      CmdArgs.push_back("/WHOLEARCHIVE:Fortran_main.dynamic_dbg.lib");
-      break;
-    }
   }
 }
 
diff --git a/clang/lib/Driver/ToolChains/CommonArgs.h b/clang/lib/Driver/ToolChains/CommonArgs.h
index 25d68345a9f9ebf..a74dfebd6e5cad9 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.h
+++ b/clang/lib/Driver/ToolChains/CommonArgs.h
@@ -117,7 +117,7 @@ bool addOpenMPRuntime(llvm::opt::ArgStringList &CmdArgs, const ToolChain &TC,
                       bool IsOffloadingHost = false, bool GompNeedsRT = false);
 
 /// Adds Fortran runtime libraries to \p CmdArgs.
-void addFortranRuntimeLibs(const ToolChain &TC, const llvm::opt::ArgList &Args,
+void addFortranRuntimeLibs(const ToolChain &TC,
                            llvm::opt::ArgStringList &CmdArgs);
 
 /// Adds the path for the Fortran runtime libraries to \p CmdArgs.
diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp
index f09bc27d7d2c0e6..f6b78f62375f238 100644
--- a/clang/lib/Driver/ToolChains/Darwin.cpp
+++ b/clang/lib/Driver/ToolChains/Darwin.cpp
@@ -678,7 +678,7 @@ void darwin::Linker::ConstructJob(Compilation &C, const JobAction &JA,
   // to generate executables.
   if (getToolChain().getDriver().IsFlangMode()) {
     addFortranRuntimeLibraryPath(getToolChain(), Args, CmdArgs);
-    addFortranRuntimeLibs(getToolChain(), Args, CmdArgs);
+    addFortranRuntimeLibs(getToolChain(), CmdArgs);
   }
 
   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs))
diff --git a/clang/lib/Driver/ToolChains/DragonFly.cpp b/clang/lib/Driver/ToolChains/DragonFly.cpp
index 9942fc632e0a917..181d0ad0d834b2b 100644
--- a/clang/lib/Driver/ToolChains/DragonFly.cpp
+++ b/clang/lib/Driver/ToolChains/DragonFly.cpp
@@ -153,7 +153,7 @@ void dragonfly::Linker::ConstructJob(Compilation &C, const JobAction &JA,
     // AddRunTimeLibs).
     if (D.IsFlangMode()) {
       addFortranRuntimeLibraryPath(ToolChain, Args, CmdArgs);
-      addFortranRuntimeLibs(ToolChain, Args, CmdArgs);
+      addFortranRuntimeLibs(ToolChain, CmdArgs);
       CmdArgs.push_back("-lm");
     }
 
diff --git a/clang/lib/Driver/ToolChains/FreeBSD.cpp b/clang/lib/Driver/ToolChains/FreeBSD.cpp
index b7c9e0e51cdb666..3be0bf3789e1c40 100644
--- a/clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ b/clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -310,7 +310,7 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
     // AddRunTimeLibs).
     if (D.IsFlangMode()) {
       addFortranRuntimeLibraryPath(ToolChain, Args, CmdArgs);
-      addFortranRuntimeLibs(ToolChain, Args, CmdArgs);
+      addFortranRuntimeLibs(ToolChain, CmdArgs);
       if (Profiling)
         CmdArgs.push_back("-lm_p");
       else
diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
index b875991844ffff5..16cf5707227264d 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -564,7 +564,7 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
   // AddRunTimeLibs).
   if (D.IsFlangMode()) {
     addFortranRuntimeLibraryPath(ToolChain, Args, CmdArgs);
-    addFortranRuntimeLibs(ToolChain, Args, CmdArgs);
+    addFortranRuntimeLibs(ToolChain, CmdArgs);
     CmdArgs.push_back("-lm");
   }
 
diff --git a/clang/lib/Driver/ToolChains/Haiku.cpp b/clang/lib/Driver/ToolChains/Haiku.cpp
index e0d94035823fd37..3fe92054ac53e15 100644
--- a/clang/lib/Driver/ToolChains/Haiku.cpp
+++ b/clang/lib/Driver/ToolChains/Haiku.cpp
@@ -118,7 +118,7 @@ void haiku::Linker::ConstructJob(Compilation &C, const JobAction &JA,
     // AddRunTimeLibs).
     if (D.IsFlangMode()) {
       addFortranRuntimeLibraryPath(ToolChain, Args, CmdArgs);
-      addFortranRuntimeLibs(ToolChain, Args, CmdArgs);
+      addFortranRuntimeLibs(ToolChain, CmdArgs);
     }
 
     CmdArgs.push_back("-lgcc");
diff --git a/clang/lib/Driver/ToolChains/MSVC.cpp b/clang/lib/Driver/ToolChains/MSVC.cpp
index 8a4a174c90ea855..4966d102c51f1ac 100644
--- a/clang/lib/Driver/ToolChains/MSVC.cpp
+++ b/clang/lib/Driver/ToolChains/MSVC.cpp
@@ -131,7 +131,7 @@ void visualstudio::Linker::ConstructJob(Compilation &C, const JobAction &JA,
 
   if (C.getDriver().IsFlangMode()) {
     addFortranRuntimeLibraryPath(TC, Args, CmdArgs);
-    addFortranRuntimeLibs(TC, Args, CmdArgs);
+    addFortranRuntimeLibs(TC, CmdArgs);
 
     // Inform the MSVC linker that we're generating a console application, i.e.
     // one with `main` as the "user-defined" entry point. The `main` function is
diff --git a/clang/lib/Driver/ToolChains/MinGW.cpp b/clang/lib/Driver/ToolChains/MinGW.cpp
index 5d7f8675daf8d28..39d767795445dbe 100644
--- a/clang/lib/Driver/ToolChains/MinGW.cpp
+++ b/clang/lib/Driver/ToolChains/MinGW.cpp
@@ -249,7 +249,7 @@ void tools::MinGW::Linker::ConstructJob(Compilation &C, const JobAction &JA,
 
   if (C.getDriver().IsFlangMode()) {
     addFortranRuntimeLibraryPath(TC, Args, CmdArgs);
-    addFortranRuntimeLibs(TC, Args, CmdArgs);
+    addFortranRuntimeLibs(TC, CmdArgs);
   }
 
   // TODO: Add profile stuff here
diff --git a/clang/lib/Driver/ToolChains/NetBSD.cpp b/clang/lib/Driver/ToolChains/NetBSD.cpp
index 240bf5764b9cce2..90b195a007caa78 100644
--- a/clang/lib/Driver/ToolChains/NetBSD.cpp
+++ b/clang/lib/Driver/ToolChains/NetBSD.cpp
@@ -325,7 +325,7 @@ void netbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
     // AddRunTimeLibs).
     if (D.IsFlangMode()) {
       addFortranRuntimeLibraryPath(ToolChain, Args, CmdArgs);
-      addFortranRuntimeLibs(ToolChain, Args, CmdArgs);
+      addFortranRuntimeLibs(ToolChain, CmdArgs);
       CmdArgs.push_back("-lm");
     }
 
diff --git a/clang/lib/Driver/ToolChains/OpenBSD.cpp b/clang/lib/Driver/ToolChains/OpenBSD.cpp
index 21b9004ef2d52d1..133b5ff13a4c7e2 100644
--- a/clang/lib/Driver/ToolChains/OpenBSD.cpp
+++ b/clang/lib/Driver/ToolChains/OpenBSD.cpp
@@ -237,7 +237,7 @@ void openbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
     // AddRunTimeLibs).
     if (D.IsFlangMode()) {
       addFortranRuntimeLibraryPath(ToolChain, Args, CmdArgs);
-      addFortranRuntimeLibs(ToolChain, Args, CmdArgs);
+      addFortranRuntimeLibs(ToolChain, CmdArgs);
       if (Profiling)
         CmdArgs.push_back("-lm_p");
       else
diff --git a/clang/lib/Driver/ToolChains/Solaris.cpp b/clang/lib/Driver/ToolChains/Solaris.cpp
index 485730da7df1f8c..32b6cbe647da6ad 100644
--- a/clang/lib/Driver/ToolChains/Solaris.cpp
+++ b/clang/lib/Driver/ToolChains/Solaris.cpp
@@ -226,7 +226,7 @@ void solaris::Linker::ConstructJob(Compilation &C, const JobAction &JA,
     // these dependencies need to be listed before the C runtime below.
     if (D.IsFlangMode()) {
       addFortranRuntimeLibraryPath(getToolChain(), Args, CmdArgs);
-      addFortranRuntimeLibs(getToolChain(), Args, CmdArgs);
+      addFortranRuntimeLibs(getToolChain(), CmdArgs);
       CmdArgs.push_back("-lm");
     }
     if (Args.hasArg(options::OPT_fstack_protector) ||
diff --git a/flang/test/Driver/Inputs/no_duplicate_main.ll b/flang/test/Driver/Inputs/no_duplicate_main.ll
deleted file mode 100644
index ff2b19dfe9e288b..000000000000000
--- a/flang/test/Driver/Inputs/no_duplicate_main.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; Create the symbol 'main'; does not have to be the correct
-; signature for 'main', we just need the symbol for the linker
-; to fail during the test.
-
-define i32 @main() {
-  ret i32 0
-}
diff --git a/flang/test/Driver/linker-flags.f90 b/flang/test/Driver/linker-flags.f90
index ea91946316cfaa6..85c4d60b3f09862 100644
--- a/flang/test/Driver/linker-flags.f90
+++ b/flang/test/Driver/linker-flags.f90
@@ -28,7 +28,7 @@
 !       executable and may find the GNU linker from MinGW or Cygwin.
 ! UNIX-LABEL:  "{{.*}}ld{{(\.exe)?}}"
 ! UNIX-SAME: "[[object_file]]"
-! UNIX-SAME: "--whole-archive" "-lFortran_main" "--no-whole-archive" "-lFortranRuntime" "-lFortranDecimal" "-lm"
+! UNIX-SAME: "-lFortran_main" "-lFortranRuntime" "-lFortranDecimal" "-lm"
 
 ! DARWIN-LABEL:  "{{.*}}ld{{(\.exe)?}}"
 ! DARWIN-SAME: "[[object_file]]"
@@ -38,7 +38,7 @@
 
 ! HAIKU-LABEL:  "{{.*}}ld{{(\.exe)?}}"
 ! HAIKU-SAME: "[[object_file]]"
-! HAIKU-SAME: "--whole-archive" "-lFortran_main" "--no-whole-archive" "-lFortranRuntime" "-lFortranDecimal"
+! HAIKU-SAME: "-lFortran_main" "-lFortranRuntime" "-lFortranDecimal"
 
 ! MINGW-LABEL:  "{{.*}}ld{{(\.exe)?}}"
 ! MINGW-SAME: "[[object_file]]"
diff --git a/flang/test/Driver/no_duplicate_main.f90 b/flang/test/Driver/no_duplicate_main.f90
deleted file mode 100644
index 4e33f4f2aeba3f7..000000000000000
--- a/flang/test/Driver/no_duplicate_main.f90
+++ /dev/null
@@ -1,14 +0,0 @@
-! UNSUPPORTED: system-windows
-
-! RUN: %flang -x ir -o %t.c-object -c %S/Inputs/no_duplicate_main.ll
-! RUN: %flang -o %t -c %s
-! RUN: not %flang -o %t.exe %t %t.c-object 2>&1
-
-! TODO: potentially add further checks to ensure that proper
-!       linker error messages are detected and checked via
-!       FileCheck.
-
-program main_dupes
-    ! Irrelevant what to do in here.
-    ! Test is supposed to fail at link time.
-end program main_dupes

@mjklemm
Copy link
Contributor

mjklemm commented Dec 1, 2023

The above fails with ifort/ifx:

[2023-12-01 19:01:24 CET] [1] iris ~/tm*/fo*/ftn_main_dupes [0:0] (main *=)> cat prg.c
int main(void) {
  // call fortran code
  return 0;
}
[2023-12-01 19:01:27 CET] iris ~/tm*/fo*/ftn_main_dupes [0:0] (main *=)> cat ftn.f90
function pow(a, b)
  real :: a, b, pow
  pow = a ** b
end function
[2023-12-01 19:01:31 CET] iris ~/tm*/fo*/ftn_main_dupes [0:0] (main *=)> ifx -o ftn.o -c ftn.f90 && icc -o prg.o -c prg.c && ifx -o bla prg.o ftn.o
icc: remark #10441: The Intel(R) C++ Compiler Classic (ICC) is deprecated and will be removed from product release in the second half of 2023. The Intel(R) oneAPI DPC++/C++ Compiler (ICX) is the recommended compiler moving forward. Please transition to use this compiler. Use '-diag-disable=10441' to disable this message.
ld: prg.o: in function `main':
prg.c:(.text+0x0): multiple definition of `main'; /net/software/x86_64/oneapi/compiler/2023.1.0/linux/compiler/lib/intel64_lin/for_main.o:for_main.c:(.text+0x0): first defined here
ld: /net/software/x86_64/oneapi/compiler/2023.1.0/linux/compiler/lib/intel64_lin/for_main.o: in function `main':
for_main.c:(.text+0x19): undefined reference to `MAIN__'
[2023-12-01 19:01:34 CET] [1] iris ~/tm*/fo*/ftn_main_dupes [0:0] (main *=)> ifort -o ftn.o -c ftn.f90 && icc -o prg.o -c prg.c && ifort -o bla prg.o ftn.o
icc: remark #10441: The Intel(R) C++ Compiler Classic (ICC) is deprecated and will be removed from product release in the second half of 2023. The Intel(R) oneAPI DPC++/C++ Compiler (ICX) is the recommended compiler moving forward. Please transition to use this compiler. Use '-diag-disable=10441' to disable this message.
ld: prg.o: in function `main':
prg.c:(.text+0x0): multiple definition of `main'; /net/software/x86_64/oneapi/compiler/2023.1.0/linux/bin/intel64/../../compiler/lib/intel64_lin/for_main.o:for_main.c:(.text+0x0): first defined here
ld: /net/software/x86_64/oneapi/compiler/2023.1.0/linux/bin/intel64/../../compiler/lib/intel64_lin/for_main.o: in function `main':
for_main.c:(.text+0x19): undefined reference to `MAIN__'

To get gfortran's behavior one could also use -Wl,--allow-multiple-definition which would then allow the linker to pick the C main function and ignore the main function from Fortran_main.a

@tblah
Copy link
Contributor Author

tblah commented Dec 1, 2023

For what it's worth, armflang follows gfortran's behavior.

As there isn't consensus amongst fortran compilers, I'm unsure which behavior we should follow. What do other's think?

@mjklemm
Copy link
Contributor

mjklemm commented Dec 1, 2023

For what it's worth, armflang follows gfortran's behavior.

So does the "old legacy flang", which I guess is the basis for armflang. AOCC's flang shows the same behavior.

As there isn't consensus amongst fortran compilers, I'm unsure which behavior we should follow. What do other's think?

I guess, we could agree that the current behavior of flang-new ignoring the Fortran program unit that is present, is not correct either. :-)

Could you please see if -Wl,--allow-multiple-definition would help to resolve the issue in the application?

@mjklemm
Copy link
Contributor

mjklemm commented Dec 1, 2023

BTW, flang legacy has this: -fno-fortran-main Don't link in Fortran main

Adding that command line option might be the right choice. If everyone agrees, I can see if I can get this added.

@tblah
Copy link
Contributor Author

tblah commented Dec 1, 2023

Could you please see if -Wl,--allow-multiple-definition would help to resolve the issue in the application?

Surprisingly not.

ld.lld: error: undefined symbol: _QQEnvironmentDefaults
>>> referenced by Fortran_main.c
>>>               Fortran_main.c.o:(.text.main+0x8) in archive [...]/libFortran_main.a
>>> referenced by Fortran_main.c
>>>               Fortran_main.c.o:(.text.main+0xC) in archive [...]/lib/libFortran_main.a

ld.lld: error: undefined symbol: _QQmain
>>> referenced by Fortran_main.c
>>>               Fortran_main.c.o:(.text.main+0x18) in archive [...]/lib/libFortran_main.a
flang-new: error: linker command failed with exit code 1 (use -v to see invocation)

@mjklemm
Copy link
Contributor

mjklemm commented Dec 1, 2023

I have opened PR #74139 to provide an alternate solution to this. Please have a look there.

@tblah Would you mind trying this new option with one application code to see if that will help?

@tblah
Copy link
Contributor Author

tblah commented Dec 4, 2023

@tblah Would you mind trying this new option with one application code to see if that will help?

Yes this flag works for me, thanks! I think it would be a shame to require a flag not needed for classic-flang or gfortran, but we can come back to this. This solution is good enough for me now. Thanks!

mjklemm added a commit that referenced this pull request Dec 11, 2023
…rtran_main from link line (#74139)

This PR adds the `-fno-fortran-main` command line option to remove
`Fortran_main.a` from the link and to allow for linking Fortran code w/o
program unit with C/C++ translation units that provide the `main()`
entrypoint.

When linking Fortran code with C/C++ code (Fortran calling into C/C++),
PR #73124 introduced a proper error message that would prevent
successful linkage, if there was a program unit from Fortran *and*
`main()` function coming from C/C++. Alas, this caused some breakage of
code that would call Fortran code from C/C++ and rightfully provided the
`main()` entrypoint. Classic Flang had the command-line option
`-fno-fortran-main` to then remove the entrypoints for the Fortran
program unit from the linker stage.

This PR is related to PR #74120 and (merged) PR #73124.

---------

Co-authored-by: Andrzej Warzyński <andrzej.warzynski@gmail.com>
@tblah
Copy link
Contributor Author

tblah commented Dec 21, 2023

Closing because this was superseded by #74139

@tblah tblah closed this Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang Clang issues not falling into any other category flang:driver flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants