-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Reland "[HIP] Use original file path for CUID" (#108771) #111885
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@llvm/pr-subscribers-clang-driver @llvm/pr-subscribers-clang Author: Yaxun (Sam) Liu (yxsamliu) ChangesThis patch fixes the buildbots failure of lit tests on MacOS. Since clang driver options depend on toolchain, we cannot hardcode CUID hash. On MacOS there is an extra -mlinker-version= option. Full diff: https://github.com/llvm/llvm-project/pull/111885.diff 2 Files Affected:
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index ba850cf3803e9b..0d0b8d68159297 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -3060,10 +3060,7 @@ class OffloadingActionBuilder final {
else if (UseCUID == CUID_Hash) {
llvm::MD5 Hasher;
llvm::MD5::MD5Result Hash;
- SmallString<256> RealPath;
- llvm::sys::fs::real_path(IA->getInputArg().getValue(), RealPath,
- /*expand_tilde=*/true);
- Hasher.update(RealPath);
+ Hasher.update(IA->getInputArg().getValue());
for (auto *A : Args) {
if (A->getOption().matches(options::OPT_INPUT))
continue;
diff --git a/clang/test/Driver/hip-cuid-hash.hip b/clang/test/Driver/hip-cuid-hash.hip
index 103a1cbf26d50a..28efd6197b2303 100644
--- a/clang/test/Driver/hip-cuid-hash.hip
+++ b/clang/test/Driver/hip-cuid-hash.hip
@@ -1,13 +1,15 @@
// Check CUID generated by hash.
// The same CUID is generated for the same file with the same options.
+// RUN: cd %S
+
// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
// RUN: --offload-arch=gfx906 -c -nogpuinc -nogpulib -fuse-cuid=hash \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu >%t.out 2>&1
+// RUN: Inputs/hip_multiple_inputs/a.cu >%t.out 2>&1
// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
// RUN: --offload-arch=gfx906 -c -nogpuinc -nogpulib -fuse-cuid=hash \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu >>%t.out 2>&1
+// RUN: Inputs/hip_multiple_inputs/a.cu >>%t.out 2>&1
// RUN: FileCheck %s -check-prefixes=SAME -input-file %t.out
@@ -16,11 +18,11 @@
// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu -DX=1 --no-offload-new-driver \
// RUN: --offload-arch=gfx906 -c -nogpuinc -nogpulib -fuse-cuid=hash \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu >%t.out 2>&1
+// RUN: Inputs/hip_multiple_inputs/a.cu >%t.out 2>&1
// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu -DX=2 --no-offload-new-driver \
// RUN: --offload-arch=gfx906 -c -nogpuinc -nogpulib -fuse-cuid=hash \
-// RUN: %S/Inputs/../Inputs/hip_multiple_inputs/a.cu >>%t.out 2>&1
+// RUN: Inputs/../Inputs/hip_multiple_inputs/a.cu >>%t.out 2>&1
// RUN: FileCheck %s -check-prefixes=DIFF -input-file %t.out
|
Artem-B
reviewed
Oct 10, 2024
5fe838d
to
6a3a200
Compare
ping |
This patch fixes the buildbots failure of lit tests on MacOS. Since clang driver options depend on toolchain, we cannot hardcode CUID hash. On MacOS there is an extra -mlinker-version= option.
ping |
Artem-B
approved these changes
Mar 6, 2025
jph-13
pushed a commit
to jph-13/llvm-project
that referenced
this pull request
Mar 21, 2025
This patch fixes the buildbots failure of lit tests on MacOS. Since clang driver options depend on toolchain, we cannot hardcode CUID hash. On MacOS there is an extra -mlinker-version= option.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
clang:driver
'clang' and 'clang++' user-facing binaries. Not 'clang-cl'
clang
Clang issues not falling into any other category
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.
This patch fixes the buildbots failure of lit tests on MacOS. Since clang driver options depend on toolchain, we cannot hardcode CUID hash. On MacOS there is an extra -mlinker-version= option.