diff --git a/flang/tools/f18/f18.cpp b/flang/tools/f18/f18.cpp --- a/flang/tools/f18/f18.cpp +++ b/flang/tools/f18/f18.cpp @@ -614,7 +614,8 @@ << "\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 @@ << " -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 @@ objlist.push_back(relo); } } - if (!objlist.empty()) { + if (!driver.compileOnly && !objlist.empty()) { Link(liblist, objlist, driver); } return exitStatus;