From 34eba66ea7d3540f19a1165746dc205b1e3b91ac Mon Sep 17 00:00:00 2001 From: mppf Date: Mon, 30 Mar 2015 15:50:52 -0400 Subject: [PATCH] Merge pull request #1768 from mppf/fix-extern-block-no-clang-included-runtime Bug fix for extern block w/o clang-included runtime The --llvm option to compileline changes CHPL_TARGET_PLATFORM in order to use clang-included and prevent ABI issues when linking in the runtime. However, when I originally added that flag I neglected to remember that runClang runs both as an initial step in --llvm compiles but also as a parsing step with extern { } blocks even without --llvm. When it's just parsing the extern blocks, we shouldn't be changing the CHPL_TARGET_PLATFORM at all. Now we just leave out --llvm from the compileline flags if just_parse_filename is set. By removing the --llvm option to compileline if we're only parsing extern blocks (and not compiling with the LLVM backend), we remove the check that the runtime has been built with clang-included in that case. Tested with test/extern with and without --llvm and with no clang-included runtime without --llvm. Reviewed by @thomasvandoren (cherry picked from commit e3a84a63858a493e367366cb04ec854f584e6f2b) --- compiler/util/clangUtil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/util/clangUtil.cpp b/compiler/util/clangUtil.cpp index bf20a128bc00..7879428d2b95 100644 --- a/compiler/util/clangUtil.cpp +++ b/compiler/util/clangUtil.cpp @@ -827,7 +827,7 @@ void runClang(const char* just_parse_filename) { std::string compileline = home + "/util/config/compileline"; if( debugCCode ) compileline += " DEBUG=1"; if( optimizeCCode ) compileline += " OPTIMIZE=1"; - std::string readargsfrom = compileline + " --llvm" + std::string readargsfrom = compileline + (just_parse_filename?"":" --llvm") + " --llvm-install-dir" " --clang-sysroot-arguments" " --includes-and-defines";