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

The title says it all.
This commit is contained in:
Peter Steinfeld 2020-11-09 07:42:12 -08:00
parent 3a71f55194
commit 66a9607557
1 changed files with 5 additions and 3 deletions

View File

@ -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;