Skip to content

Commit

Permalink
[LibFuzzer] Disable compiling and running the LibFuzzer dataflow sani…
Browse files Browse the repository at this point in the history
…tizer tests on Apple platforms.

This fixes a broken part of the build on OSX as the dataflow sanitizer is not supported
on OSX yet.

Differential Revision: http://reviews.llvm.org/D20894

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271492 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
delcypher committed Jun 2, 2016
1 parent 8bb56cc commit e8edd31
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/Fuzzer/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,17 @@ set_target_properties(LLVMFuzzer-Unittest
###############################################################################

include_directories(..)
add_subdirectory(dfsan)

if(APPLE)
message(WARNING "Dataflow sanitizer is not supported on Apple platforms."
" Building and running LibFuzzer dataflow sanitizer tests is disabled."
)
set(HAS_DFSAN 0)
else()
set(HAS_DFSAN 1)
add_subdirectory(dfsan)
endif()

add_subdirectory(uninstrumented)
add_subdirectory(ubsan)
add_subdirectory(trace-bb)
Expand Down
1 change: 1 addition & 0 deletions lib/Fuzzer/test/fuzzer-dfsan.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
REQUIRES: dfsan
CHECK1: BINGO
CHECK2: BINGO
CHECK3: BINGO
Expand Down
6 changes: 6 additions & 0 deletions lib/Fuzzer/test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ path = os.path.pathsep.join((llvm_tools_dir, config.test_exec_root,
config.environment['PATH']))
config.environment['PATH'] = path

if config.has_dfsan:
lit_config.note('dfsan feature available')
config.available_features.add('dfsan')
else:
lit_config.note('dfsan feature unavailable')

1 change: 1 addition & 0 deletions lib/Fuzzer/test/lit.site.cfg.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.has_dfsan = True if @HAS_DFSAN@ == 1 else False
lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg")

0 comments on commit e8edd31

Please sign in to comment.