-
Notifications
You must be signed in to change notification settings - Fork 14.5k
[NFC][CFI] Avoid clang error in CFI tests #135981
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
[NFC][CFI] Avoid clang error in CFI tests #135981
Conversation
Created using spr 1.3.4 [skip ci]
Created using spr 1.3.4
@llvm/pr-subscribers-clang-driver @llvm/pr-subscribers-clang Author: Vitaly Buka (vitalybuka) ChangesIn these tests we test correct linking flags set, Full diff: https://github.com/llvm/llvm-project/pull/135981.diff 1 Files Affected:
diff --git a/clang/test/Driver/sanitizer-ld.c b/clang/test/Driver/sanitizer-ld.c
index 67ca33d676d20..a00ec029d3d46 100644
--- a/clang/test/Driver/sanitizer-ld.c
+++ b/clang/test/Driver/sanitizer-ld.c
@@ -840,7 +840,8 @@
// CHECK-CFI-PREREQ-LINUX: '-fsanitize=cfi' only allowed with '-fvisibility='
// CFI by itself does not link runtime libraries.
-// RUN: not %clang -fsanitize=cfi \
+// RUN: %clang -fsanitize=cfi \
+// RUN: -flto -fvisibility=hidden \
// 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 \
@@ -849,7 +850,8 @@
// 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: %clang -fsanitize=cfi -fno-sanitize-trap=cfi -fsanitize-recover=cfi \
+// RUN: -flto -fvisibility=hidden \
// RUN: --target=x86_64-unknown-linux -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
@@ -859,7 +861,8 @@
// 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 \
+// RUN: %clang -fsanitize=cfi -fsanitize-cfi-cross-dso \
+// RUN: -flto -fvisibility=hidden \
// RUN: --target=x86_64-unknown-linux -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
@@ -870,7 +873,8 @@
// 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 \
+// RUN: %clang -fsanitize=cfi -fsanitize-cfi-cross-dso \
+// RUN: -flto -fvisibility=hidden \
// RUN: -fno-sanitize-trap=cfi -fsanitize-recover=cfi \
// RUN: --target=x86_64-unknown-linux -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
@@ -882,7 +886,8 @@
// 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 \
+// RUN: %clang -fsanitize=cfi -fsanitize-cfi-cross-dso \
+// RUN: -flto -fvisibility=hidden \
// RUN: --target=aarch64-linux-android -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_android_tree \
@@ -891,7 +896,8 @@
// 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 \
+// RUN: %clang -fsanitize=cfi -fsanitize-cfi-cross-dso \
+// RUN: -flto -fvisibility=hidden \
// RUN: -fno-sanitize-trap=cfi -fsanitize-recover=cfi \
// RUN: --target=aarch64-linux-android -fuse-ld=ld \
// RUN: -resource-dir=%S/Inputs/resource_dir \
|
This is causing a test failure in our clang CI bots: https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-host-linux-x64/b8717414717471782065/overview It doesn't seem that any error output is produced for the test though; do you have an intuition for what's happening? This is the only change in the blamelist, so it's definitely a result of this PR. |
#136002 to get output if it gives no clue, I'll revert both |
This reverts commit 726a5c2.
Reverts #135981 Fails with 'clang: error: --rtlib=libgcc requires --unwindlib=libgcc' on some bots.
Reverts llvm/llvm-project#135981 Fails with 'clang: error: --rtlib=libgcc requires --unwindlib=libgcc' on some bots.
Should allow to reland #135981
…#136032) Should allow to reland llvm/llvm-project#135981
In these tests we test correct linking flags set, and it's confusing that command fails because of other missing required flags. Clang diagnostics opportunistically proceed after error report on required flags, but there is no guaranty that processing of tested flags are the same in supported and erroneous flag sets.
Reverts llvm#135981 Fails with 'clang: error: --rtlib=libgcc requires --unwindlib=libgcc' on some bots.
Should allow to reland llvm#135981
In these tests we test correct linking flags set,
and it's confusing that command fails because of
other missing required flags.
Clang diagnostics opportunistically proceed after
error report on required flags, but there is no
guaranty that processing of tested flags are the same
in supported and erroneous flag sets.