[PATCH] add supporting of the sanitizer arguments into Clang on FreeBSD platform.
Alexey Samsonov
samsonov at google.com
Thu Mar 13 08:05:53 PDT 2014
================
Comment at: test/Driver/sanitizer-ld.c:27
@@ +26,3 @@
+// CHECK-ASAN-FREEBSD-NOT: "-ldl"
+// CHECK-ASAN-FREEBSD: libclang_rt.asan-i386.a"
+// CHECK-ASAN-FREEBSD: "-lpthread"
----------------
I wonder if you can somehow match "freebsd" part of a path here.
================
Comment at: test/Driver/sanitizer-ld.c:49
@@ -33,1 +48,3 @@
+// RUN: %clangxx -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -target i386-unknown-freebsd -fsanitize=address \
----------------
This and the following test case doesn't seem to add any value. I think it's ok to drop them.
================
Comment at: test/Driver/sanitizer-ld.c:26
@@ +25,3 @@
+// CHECK-ASAN-FREEBSD-NOT: "-lc"
+// CHECK-ASAN-FREEBSD-NOT: "-ldl"
+// CHECK-ASAN-FREEBSD: libclang_rt.asan-i386.a"
----------------
Please how CHECK-NOT lines work in the FileCheck man. Most likely you'll need to add CHECK-ASAN-FREEBSD-NOT: "-ldl" between all CHECK-ASAN-FREEBSD: lines. Or just add a single separate test case that would contain a single CHECK-NOT constraint for ldl.
================
Comment at: lib/Driver/Tools.cpp:1776
@@ +1775,3 @@
+ const llvm::Triple &Triple = TC.getTriple();
+ llvm::sys::path::append(Res, "lib",
+ Triple.getOS() == llvm::Triple::FreeBSD ?
----------------
Please calculate os-specific dir in a separate variable. Also, why not just use "freebsd" constant for llvm::Triple::FreeBSD? Is it going to change?
http://llvm-reviews.chandlerc.com/D2644
More information about the cfe-commits
mailing list