[PATCH] D44645: [test] Fix Cross-DSO CFI Android sanitizer test for -rtlib=compiler-rt

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 19 13:03:38 PDT 2018


mgorny created this revision.
mgorny added a reviewer: eugenis.
Herald added subscribers: dberris, srhines.
mgorny added inline comments.


================
Comment at: test/Driver/sanitizer-ld.c:517
 // CHECK-CFI-CROSS-DSO-ANDROID: "{{.*}}ld{{(.exe)?}}"
 // CHECK-CFI-CROSS-DSO-ANDROID-NOT: libclang_rt.
 
----------------
(an alternative would be to replace this 'NOT' clause with more specific library name — but I don't know which library could 'accidentally' appear here)


Fix the CHECK-CFI-CROSS-DSO-ANDROID test to force -rtlib=libgcc.
Otherwise, if clang is built with CLANG_DEFAULT_RTLIB=compiler-rt,
the clang_rt.builtins library gets added to the command-line and causes
the 'clang_rt.' substring to unexpectedly match.


Repository:
  rC Clang

https://reviews.llvm.org/D44645

Files:
  test/Driver/sanitizer-ld.c


Index: test/Driver/sanitizer-ld.c
===================================================================
--- test/Driver/sanitizer-ld.c
+++ test/Driver/sanitizer-ld.c
@@ -510,7 +510,7 @@
 
 // Cross-DSO CFI on Android does not link runtime libraries.
 // RUN: %clang -fsanitize=cfi -fsanitize-cfi-cross-dso %s -### -o %t.o 2>&1 \
-// RUN:     -target aarch64-linux-android -fuse-ld=ld \
+// RUN:     -target aarch64-linux-android -fuse-ld=ld -rtlib=libgcc \
 // RUN:     --sysroot=%S/Inputs/basic_android_tree \
 // RUN:   | FileCheck --check-prefix=CHECK-CFI-CROSS-DSO-ANDROID %s
 // CHECK-CFI-CROSS-DSO-ANDROID: "{{.*}}ld{{(.exe)?}}"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44645.138989.patch
Type: text/x-patch
Size: 633 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180319/98b00afe/attachment.bin>


More information about the cfe-commits mailing list