clang_7,clang_8,clang_9: fix compilation of HIP-code #78308
Merged
+246
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation for this change
This PR aims to fix the same problem as NixOS/nixpkgs PR #77476; enabling to compile HIP-code using the packaged clang compiler, by also searching in $PATH for required binaries.
The change is committed upstream (https://reviews.llvm.org/D72903), but will not land in the clang versions in nixpkgs (only clang 10+). As such I have created patches for the affected versions. To compile HIP-code lld is needed, so I added it to the clang-package.
Since this is the same change for all 3 versions I packed everything into one commit+PR. If wanted I could also separate it into 3 individual commits/PRs.
Things done
I did compile all 3 versions and tested clang_9 using a HIP-program. I did not explicitly test clang_7 or clang_8, because I don't have the required rocm-device-libs. I would need to package these separately and compile them using a compatible compiler. Because only the HIP compilation behavior is changed this should not break anything currently in nixpkgs.
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)