-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[NFC][CFI] Don't mix CFI and non-CFI flags on the same line #135890
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
vitalybuka
merged 7 commits into
main
from
users/vitalybuka/spr/nfccfi-dont-mix-cfi-and-non-cfi-flags-on-the-same-line
Apr 16, 2025
Merged
[NFC][CFI] Don't mix CFI and non-CFI flags on the same line #135890
vitalybuka
merged 7 commits into
main
from
users/vitalybuka/spr/nfccfi-dont-mix-cfi-and-non-cfi-flags-on-the-same-line
Apr 16, 2025
+11
−6
Conversation
This file contains 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
Created using spr 1.3.4 [skip ci]
Created using spr 1.3.4
@llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-driver Author: Vitaly Buka (vitalybuka) ChangesFull diff: https://github.com/llvm/llvm-project/pull/135890.diff 1 Files Affected:
diff --git a/clang/test/Driver/sanitizer-ld.c b/clang/test/Driver/sanitizer-ld.c
index f9c3506e43208..52c1f6bf96242 100644
--- a/clang/test/Driver/sanitizer-ld.c
+++ b/clang/test/Driver/sanitizer-ld.c
@@ -830,58 +830,63 @@
// CHECK-NSAN-UBSAN: "--whole-archive" "{{[^"]*}}libclang_rt.nsan.a" "--no-whole-archive"
// CFI by itself does not link runtime libraries.
-// RUN: not %clang -fsanitize=cfi -### %s 2>&1 \
+// RUN: not %clang -fsanitize=cfi \
// RUN: --target=x86_64-unknown-linux -fuse-ld=ld -rtlib=platform \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: -### %s 2>&1 \
// RUN: | %{filecheck} --check-prefix=CHECK-CFI-LINUX
// CHECK-CFI-LINUX: "{{.*}}ld{{(.exe)?}}"
// CFI with diagnostics links the UBSan runtime.
// RUN: not %clang -fsanitize=cfi -fno-sanitize-trap=cfi -fsanitize-recover=cfi \
-// RUN: -### %s 2>&1\
// RUN: --target=x86_64-unknown-linux -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: -### %s 2>&1 \
// RUN: | %{filecheck} --check-prefix=CHECK-CFI-DIAG-LINUX
// CHECK-CFI-DIAG-LINUX: "{{.*}}ld{{(.exe)?}}"
// CHECK-CFI-DIAG-LINUX: "--whole-archive" "{{[^"]*}}libclang_rt.ubsan_standalone.a" "--no-whole-archive"
// Cross-DSO CFI links the CFI runtime.
-// RUN: not %clang -fsanitize=cfi -fsanitize-cfi-cross-dso -### %s 2>&1 \
+// RUN: not %clang -fsanitize=cfi -fsanitize-cfi-cross-dso \
// RUN: --target=x86_64-unknown-linux -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: -### %s 2>&1 \
// RUN: | %{filecheck} --check-prefix=CHECK-CFI-CROSS-DSO-LINUX
// CHECK-CFI-CROSS-DSO-LINUX: "{{.*}}ld{{(.exe)?}}"
// CHECK-CFI-CROSS-DSO-LINUX: "--whole-archive" "{{[^"]*}}libclang_rt.cfi.a" "--no-whole-archive"
// CHECK-CFI-CROSS-DSO-LINUX: -export-dynamic
// Cross-DSO CFI with diagnostics links just the CFI runtime.
-// RUN: not %clang -fsanitize=cfi -fsanitize-cfi-cross-dso -### %s 2>&1 \
+// RUN: not %clang -fsanitize=cfi -fsanitize-cfi-cross-dso \
// RUN: -fno-sanitize-trap=cfi -fsanitize-recover=cfi \
// RUN: --target=x86_64-unknown-linux -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: -### %s 2>&1 \
// RUN: | %{filecheck} --check-prefix=CHECK-CFI-CROSS-DSO-DIAG-LINUX
// CHECK-CFI-CROSS-DSO-DIAG-LINUX: "{{.*}}ld{{(.exe)?}}"
// CHECK-CFI-CROSS-DSO-DIAG-LINUX: "--whole-archive" "{{[^"]*}}libclang_rt.cfi_diag.a" "--no-whole-archive"
// CHECK-CFI-CROSS-DSO-DIAG-LINUX: -export-dynamic
// Cross-DSO CFI on Android does not link runtime libraries.
-// RUN: not %clang -fsanitize=cfi -fsanitize-cfi-cross-dso -### %s 2>&1 \
+// RUN: not %clang -fsanitize=cfi -fsanitize-cfi-cross-dso \
// RUN: --target=aarch64-linux-android -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_android_tree \
+// RUN: -### %s 2>&1 \
// RUN: | %{filecheck} --check-prefix=CHECK-CFI-CROSS-DSO-ANDROID
// CHECK-CFI-CROSS-DSO-ANDROID: "{{.*}}ld{{(.exe)?}}"
// Cross-DSO CFI with diagnostics on Android links just the UBSAN runtime.
-// RUN: not %clang -fsanitize=cfi -fsanitize-cfi-cross-dso -### %s 2>&1 \
+// RUN: not %clang -fsanitize=cfi -fsanitize-cfi-cross-dso \
// RUN: -fno-sanitize-trap=cfi -fsanitize-recover=cfi \
// RUN: --target=aarch64-linux-android -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_android_tree \
+// RUN: -### %s 2>&1 \
// RUN: | %{filecheck} --check-prefix=CHECK-CFI-CROSS-DSO-DIAG-ANDROID
// CHECK-CFI-CROSS-DSO-DIAG-ANDROID: "{{.*}}ld{{(.exe)?}}"
// CHECK-CFI-CROSS-DSO-DIAG-ANDROID: "{{[^"]*}}libclang_rt.ubsan_standalone.so"
|
fmayer
approved these changes
Apr 16, 2025
Created using spr 1.3.4 [skip ci]
Created using spr 1.3.4 [skip ci]
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.
No description provided.