-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issues with using a non-default system LLVM with CHPL_LLVM_CONFIG #26428
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with it if you add a check for clang/gcc
@@ -1024,6 +1024,42 @@ def get_clang_prgenv_args(): | |||
|
|||
return (comp_args, link_args) | |||
|
|||
@memoize | |||
def get_system_include_directories(flag, lang): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure this code will only work for gcc
and clang
. I'd recommend limiting it to those compilers. We can add other compilers as needed.
ret.append('-isystem' + directory) | ||
else: | ||
# technically don't need to add this for | ||
# but it's harmless to use -I |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment wording got weird
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 byCHPL_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.
-I
Testing
make check
with HOST_CC=clang, LLVM=systemmake check
with HOST_CC=clang, LLVM=bundledmake check
with HOST_CC=clang, LLVM=system, LLVM_CONFIG=/some/path, with/without a normal system LLVMmake check
with HOST_CC=gnu, LLVM=systemmake check
with HOST_CC=gnu, LLVM=bundledmake check
with HOST_CC=gnu, LLVM=system, LLVM_CONFIG=/some/path, with/without a normal system LLVM