18322, "bradcray", "Developer in field hit build error in 'cg-stmt.cpp' due to LLVM include paths", "2021-08-31T23:48:52Z"
A developer in the field, using CHPL_LLVM=bundled ran into the following compilation error when building the compiler:
cg-stmt.cpp:70:35: error: call to non-static member function without an object argument llvm::DebugLoc::get(stmt->linenum(),0 /*col*/,scope)); ~~~~~~~~~~~~~~~~^~~
where the compilation line looked like:
clang++ -c -I/usr/local/opt/llvm/include -MMD -MP -O3 -I. -I../include/darwin -I../include -I/Users/mayukh.ibm/CLionProjects/chapel/third-party/llvm/install/darwin-x86_64-clang/include -I../../build/compiler/darwin/clang/x86_64/llvm-bundled/none -I../../runtime/include/encoding -I/Users/mayukh.ibm/CLionProjects/chapel/third-party/utf8-decoder -I../next/include -I/Users/mayukh.ibm/CLionProjects/chapel/third-party/llvm/install/darwin-x86_64-clang/include -std=c++14 -fno-exceptions -fno-rtti -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DHAVE_LLVM -Wno-comment -DCOMPILER_SUBDIR=codegen -o ../../build/compiler/darwin/clang/x86_64/llvm-bundled/none/codegen/cg-stmt.o cg-stmt.cpp
using the following version of clang++:
Homebrew clang version 12.0.1 Target: x86_64-apple-darwin20.5.0 Thread model: posix InstalledDir: /usr/local/opt/llvm/bin
I don't get this error when using a similar version of clang++ in my default build environment, but am able to reproduce it if I manually add the
-I/usr/local/opt/llvm/include path to the compile line that appears in position 2 of the compiler line above. So the question is "What's causing that include path to be added to the compilation line?"
From looking at Makefiles a bit, I'm guessing it's the first thing set in COMP_CXXFLAGS, but I haven't determined how it would get there yet. If anyone has ideas or leads, I'm all ears, but in the meantime am filing this to log the behavior in case others hit it.