[flang-commits] [flang] 66a9607 - [flang] Avoid calling the linker when "-c" option is used

Peter Steinfeld via flang-commits flang-commits at lists.llvm.org
Mon Nov 9 10:22:30 PST 2020


Author: Peter Steinfeld
Date: 2020-11-09T10:22:13-08:00
New Revision: 66a9607557a1f804911a5b8a687128462c5e4f1a

URL: https://github.com/llvm/llvm-project/commit/66a9607557a1f804911a5b8a687128462c5e4f1a
DIFF: https://github.com/llvm/llvm-project/commit/66a9607557a1f804911a5b8a687128462c5e4f1a.diff

LOG: [flang] Avoid calling the linker when "-c" option is used

The title says it all.

Added: 
    

Modified: 
    flang/tools/f18/f18.cpp

Removed: 
    


################################################################################
diff  --git a/flang/tools/f18/f18.cpp b/flang/tools/f18/f18.cpp
index 02ebf069d428..597199a71cc3 100644
--- a/flang/tools/f18/f18.cpp
+++ b/flang/tools/f18/f18.cpp
@@ -614,7 +614,8 @@ int main(int argc, char *const argv[]) {
           << "\n"
           << "Defaults:\n"
           << "  When invoked with input files, and no options to tell\n"
-          << "  it otherwise, f18 will unparse its input and pass that on to an\n"
+          << "  it otherwise, f18 will unparse its input and pass that on to "
+             "an\n"
           << "  external compiler to continue the compilation.\n"
           << "  The external compiler is specified by the F18_FC environment\n"
           << "  variable. The default is 'gfortran'.\n"
@@ -652,7 +653,8 @@ int main(int argc, char *const argv[]) {
           << "  -fget-symbols-sources\n"
           << "  -v -c -o -I -D -U    have their usual meanings\n"
           << "  -help                print this again\n"
-          << "Unrecognised options are passed through to the external compiler\n"
+          << "Unrecognised options are passed through to the external "
+             "compiler\n"
           << "set by F18_FC (see defaults).\n";
       return exitStatus;
     } else if (arg == "-V" || arg == "--version") {
@@ -721,7 +723,7 @@ int main(int argc, char *const argv[]) {
       objlist.push_back(relo);
     }
   }
-  if (!objlist.empty()) {
+  if (!driver.compileOnly && !objlist.empty()) {
     Link(liblist, objlist, driver);
   }
   return exitStatus;


        


More information about the flang-commits mailing list