Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issues with using a non-default system LLVM with CHPL_LLVM_CONFIG (…
…#26428) Fixes compiler build issues when using a system LLVM that is different than the standard LLVM. For example, an LLVM installed at `/usr/` would conflict with an LLVM installed at `/home/user/llvm-install` (which was accessed by `CHPL_LLVM_CONFIG=/home/user/llvm-install`) Subsumes #26212 and #26402 Previous work had tried to take advantage of various clang/gcc flags to achieve the right behavior, however this not working in all cases. This PR does following. 1. computes the existing search paths for the compiler 2. for each LLVM include directory specified as `-I` - In a bundled LLVM build: always use '-isystem' - In a system LLVM build: use '-isystem' if its not an existing search path, otherwise use '-I' Testing - [x] `make check` with HOST_CC=clang, LLVM=system - [x] `make check` with HOST_CC=clang, LLVM=bundled - [x] `make check` with HOST_CC=clang, LLVM=system, LLVM_CONFIG=/some/path, with/without a normal system LLVM - [x] `make check` with HOST_CC=gnu, LLVM=system - [x] `make check` with HOST_CC=gnu, LLVM=bundled - [x] `make check` with HOST_CC=gnu, LLVM=system, LLVM_CONFIG=/some/path, with/without a normal system LLVM - [x] Sanity check that normal compilations on Mac are not broken [Reviewed by @mppf]
- Loading branch information