2017-08-22 07:25:50 +08:00
|
|
|
@LIT_SITE_CFG_IN_HEADER@
|
|
|
|
|
|
|
|
config.cpp_compiler = "@LIBFUZZER_TEST_COMPILER@"
|
|
|
|
config.target_flags = "@LIBFUZZER_TEST_FLAGS@"
|
|
|
|
config.c_compiler = "@LIBFUZZER_TEST_COMPILER@"
|
2018-01-18 04:39:14 +08:00
|
|
|
config.stdlib = "@LIBFUZZER_TEST_STDLIB@"
|
2018-06-20 21:33:42 +08:00
|
|
|
config.apple_platform = "@LIBFUZZER_TEST_APPLE_PLATFORM@"
|
2020-02-15 03:35:06 +08:00
|
|
|
config.apple_platform_min_deployment_target_flag = "@LIBFUZZER_TEST_MIN_DEPLOYMENT_TARGET_FLAG@"
|
2018-06-15 04:46:07 +08:00
|
|
|
config.name_suffix = "@LIBFUZZER_TEST_CONFIG_SUFFIX@"
|
2022-02-01 18:11:02 +08:00
|
|
|
config.arm_thumb = "@COMPILER_RT_ARM_THUMB@"
|
2017-08-22 07:25:50 +08:00
|
|
|
|
[libFuzzer] Fix lit files to make running tests more straightforward on Mac OS.
Summary:
Current implementation does not work if CMAKE_OSX_SYSROOT is not specified.
It silently generates invalid command with the following flags:
`-std=c++11 -lc++ -gline-tables-only -isysroot -fsanitize=address,fuzzer`
and then fails with the following error:
```
warning: no such sysroot directory: '-fsanitize=address,fuzzer' [-Wmissing-sysroot]"
<...>/RepeatedBytesTest.cpp:5:10: fatal error: 'assert.h' file not found
#include <assert.h>
^~~~~~~~~~
1 error generated.
```
However, if you have Command Line Tools installed, you have '/usr/include' dir.
In that case, it is not necessary to specify isysroot path.
Also, with the patch, in case of '/usr/include' does not exist, the '-sysroot'
path would be resolved automatically in compiler-rt/cmake/base-config-ix.cmake.
For more context, see the comment at `compiler-rt/cmake/base-config-ix.cmake#L76`
Reviewers: kcc, george.karpenkov
Reviewed By: kcc, george.karpenkov
Differential Revision: https://reviews.llvm.org/D37721
llvm-svn: 313033
2017-09-12 23:02:10 +08:00
|
|
|
config.osx_sysroot_flag = "@OSX_SYSROOT_FLAG@"
|
2017-08-22 07:25:50 +08:00
|
|
|
config.cmake_binary_dir = "@CMAKE_BINARY_DIR@"
|
2018-01-18 04:39:14 +08:00
|
|
|
config.llvm_library_dir = "@LLVM_LIBRARY_DIR@"
|
2021-12-02 17:04:46 +08:00
|
|
|
config.target_triple = "@LLVM_TARGET_TRIPLE@"
|
2019-05-01 01:58:55 +08:00
|
|
|
config.target_arch = "@LIBFUZZER_TEST_TARGET_ARCH@"
|
2017-08-22 07:25:50 +08:00
|
|
|
|
|
|
|
# Load common config for all compiler-rt lit tests.
|
|
|
|
lit_config.load_config(config,
|
|
|
|
"@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")
|
|
|
|
|
2018-06-28 11:11:52 +08:00
|
|
|
if config.enable_per_target_runtime_dir:
|
|
|
|
config.runtime_library_dir = config.compiler_rt_libdir
|
|
|
|
else:
|
|
|
|
config.runtime_library_dir = "@LLVM_LIBRARY_DIR@"
|
|
|
|
|
2019-06-28 04:56:04 +08:00
|
|
|
lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg.py")
|