llvm-project/compiler-rt
Dimitry Andric 66749021d4 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

llvm-svn: 234704
2015-04-12 10:54:46 +00:00
..
cmake [sanitizer][MIPS] Fix warnings on MIPS 2015-04-10 09:45:22 +00:00
include [sanitizer/coverage] Add AFL-style coverage counters (search heuristic for fuzzing). 2015-03-03 23:27:02 +00:00
lib Make check_custom_wrappers.sh work on FreeBSD 2015-04-12 10:54:46 +00:00
make [UBSan] Embed UBSan into ASan runtime (compiler-rt part). 2015-04-01 22:42:36 +00:00
test Extend s{,n}printf custom wrappers to support '*' in the format specifiers 2015-04-10 20:58:28 +00:00
unittests Use the newer python syntax for exceptions 2014-12-13 02:46:56 +00:00
www Rewrite compiler-rt.llvm.org to make it relevant 2014-02-27 14:39:48 +00:00
.arcconfig Update arc config to new domain. 2014-04-07 10:22:41 +00:00
.gitignore Add vim swap files to .gitignore 2014-03-20 19:44:33 +00:00
CMakeLists.txt [sanitizer][MIPS] Fix warnings on MIPS 2015-04-10 09:45:22 +00:00
CODE_OWNERS.TXT Add myself as a c-rt owner of ASan/Win 2014-02-27 12:07:43 +00:00
CREDITS.TXT Add Guan-Hong Liu. 2014-06-16 08:38:19 +00:00
LICENSE.TXT Update copyright year to 2015. 2015-03-12 19:53:06 +00:00
Makefile Revert r196490 and fix include paths in makefile-based build 2013-12-05 10:40:11 +00:00
README.txt Moved the builtins documentation to lib/builtins/ 2014-05-28 23:09:45 +00:00

README.txt

Compiler-RT
================================

This directory and its subdirectories contain source code for the compiler
support routines.

Compiler-RT is open source software. You may freely distribute it under the
terms of the license agreement found in LICENSE.txt.

================================