From cbf39d56d4dc8f2efc207967277ccbde8be41b7c Mon Sep 17 00:00:00 2001 From: peter klausler Date: Thu, 15 Mar 2018 12:22:41 -0700 Subject: [PATCH] [flang] Do not forget to run the linker even if there was nothing to compile. Original-commit: flang-compiler/f18@4f4f853e5b6a75f0f0f0340266c9a0b8fdc1190a Reviewed-on: https://github.com/flang-compiler/f18/pull/25 --- flang/tools/f18/f18.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/flang/tools/f18/f18.cc b/flang/tools/f18/f18.cc index 4ccd6bee0f37..e817f3fdb701 100644 --- a/flang/tools/f18/f18.cc +++ b/flang/tools/f18/f18.cc @@ -231,12 +231,14 @@ int main(int argc, char *const argv[]) { Fortran::parser::Options options; std::vector sources, relocatables; + bool anyFiles{false}; while (!args.empty()) { std::string arg{std::move(args.front())}; args.pop_front(); if (arg.empty()) { } else if (arg.at(0) != '-') { + anyFiles = true; auto dot = arg.rfind("."); if (dot == std::string::npos) { driver.pgf90Args.push_back(arg); @@ -247,6 +249,8 @@ int main(int argc, char *const argv[]) { suffix == "cuf" || suffix == "CUF" || suffix == "f18" || suffix == "F18") { sources.push_back(arg); + } else if (suffix == "o" || suffix == "a") { + relocatables.push_back(arg); } else { driver.pgf90Args.push_back(arg); } @@ -296,7 +300,7 @@ int main(int argc, char *const argv[]) { << " -Mextend 132-column fixed form\n" << " -M[no]backslash disable[enable] \\escapes in literals\n" << " -Mstandard enable conformance warnings\n" - << " -Mx,125,4 set bit 2 in xflag[125] (Kanji)\n" + << " -Mx,125,4 set bit 2 in xflag[125] (all Kanji mode)\n" << " -ed enable fixed form D lines\n" << " -E prescan & preprocess only\n" << " -fparse-only parse only, no output except messages\n" @@ -324,7 +328,7 @@ int main(int argc, char *const argv[]) { } driver.encoding = options.encoding; - if (sources.empty()) { + if (!anyFiles) { driver.measureTree = true; driver.dumpUnparse = true; Compile("-", options, driver);