summaryrefslogtreecommitdiff
path: root/lib/dfsan/scripts
diff options
context:
space:
mode:
authorDimitry Andric <dimitry@andric.com>2015-04-12 10:54:46 +0000
committerDimitry Andric <dimitry@andric.com>2015-04-12 10:54:46 +0000
commit847d4a02f6aedddd04750a1393781246380e9ac0 (patch)
tree2c70a0259c75fb4cc0b154dca426769d70dc6a07 /lib/dfsan/scripts
parent00ea6c18e66b1abf906f983cfecd8af0ba334ef6 (diff)
Make check_custom_wrappers.sh work on FreeBSD
Summary: When running the compiler-rt testsuite on FreeBSD (it didn't matter which version), I always got the same error result: FAILED: cd /home/dim/obj/llvm-234092-trunk-freebsd10-amd64-ninja-rel-1/projects/compiler-rt/lib && LLVM_CHECKOUT=/home/dim/src/llvm/trunk SILENT=1 TMPDIR= PYTHON_EXECUTABLE=/usr/local/bin/python2.7 COMPILER_RT=/home/dim/src/llvm/trunk/projects/compiler-rt /home/dim/src/llvm/trunk/projects/compiler-rt/lib/sanitizer_common/scripts/check_lint.sh The following differences between the implemented custom wrappers and the tests have been found: --- /tmp/tmp.vPFEefvclf 2015-04-04 17:11:44.996734563 +0200 +++ /tmp/tmp.NbIuvjxKEe 2015-04-04 17:11:45.044734647 +0200 @@ -1,52 +0,0 @@ -calloc -clock_gettime -ctime_r -dfsan_set_write_callback -dl_iterate_phdr -dlopen -fgets -fstat -get_current_dir_name -getcwd -gethostname -getpwuid_r -getrlimit -getrusage -gettimeofday -inet_pton -localtime_r -memchr -memcmp -memcpy -memset -nanosleep -poll -pread -pthread_create -read -sched_getaffinity -select -sigaction -sigemptyset -snprintf -socketpair -sprintf -stat -strcasecmp -strchr -strcmp -strcpy -strdup -strlen -strncasecmp -strncmp -strncpy -strrchr -strstr -strtod -strtol -strtoll -strtoul -strtoull -time -write After some investigation, it turns out to be due to the regex used for search test_ symbols in lib/dfsan/scripts/check_customer_wrappers.sh: grep -E "^\\s*test_.*\(\);" ${DFSAN_CUSTOM_TESTS} This uses \s to search for whitespace at start of line, but support for \s was only introduced in GNU grep v2.5.4-112-gf979ca0, while both FreeBSD and OSX only have grep 2.5.1 (the last version released under GPLv2). I propose to change \s into [[:space:]], which is the more portable notation. Test Plan: Run regression tests, and see that they work now. :) Reviewers: pcc, samsonov, emaste Reviewed By: emaste Subscribers: llvm-commits, emaste Differential Revision: http://reviews.llvm.org/D8832 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@234704 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/dfsan/scripts')
-rwxr-xr-xlib/dfsan/scripts/check_custom_wrappers.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dfsan/scripts/check_custom_wrappers.sh b/lib/dfsan/scripts/check_custom_wrappers.sh
index 50bc85d4a..1880882c3 100755
--- a/lib/dfsan/scripts/check_custom_wrappers.sh
+++ b/lib/dfsan/scripts/check_custom_wrappers.sh
@@ -32,7 +32,7 @@ fi
grep -E __dfsw_ ${DFSAN_CUSTOM_WRAPPERS} \
| sed "s/.*__dfsw_\([^(]*\).*/\1/" | sort > $DIFF_A
-grep -E "^\\s*test_.*\(\);" ${DFSAN_CUSTOM_TESTS} \
+grep -E "^[[:space:]]*test_.*\(\);" ${DFSAN_CUSTOM_TESTS} \
| sed "s/.*test_\(.*\)();/\1/" | sort > $DIFF_B
diff -u $DIFF_A $DIFF_B > ${DIFFOUT}
if [ $? -ne 0 ]