From 9a8e5cca2391de2b20c4c1ca617381d7bfaa9570 Mon Sep 17 00:00:00 2001 From: Peter Goodman Date: Wed, 26 Sep 2018 11:44:04 -0700 Subject: [PATCH] Disable static builds on macOS --- CMakeLists.txt | 7 ++++--- examples/CMakeLists.txt | 9 +++++---- src/include/deepstate/Klee.h | 9 +++++++-- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d84ed65..c50e85a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,9 +65,10 @@ target_compile_options(${PROJECT_NAME} PUBLIC -mno-avx) target_compile_options(${PROJECT_NAME}32 PUBLIC -m32 -g3 -mno-avx) -target_link_libraries(${PROJECT_NAME} -static "-Wl,--allow-multiple-definition,--no-export-dynamic") - -target_link_libraries(${PROJECT_NAME}32 -static "-Wl,--allow-multiple-definition,--no-export-dynamic") +if (NOT APPLE) + target_link_libraries(${PROJECT_NAME} -static "-Wl,--allow-multiple-definition,--no-export-dynamic") + target_link_libraries(${PROJECT_NAME}32 -static "-Wl,--allow-multiple-definition,--no-export-dynamic") +endif() target_include_directories(${PROJECT_NAME} PUBLIC SYSTEM "${CMAKE_SOURCE_DIR}/src/include" diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 062cab4..f8e7a21 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. - add_executable(Crash Crash.cpp) target_link_libraries(Crash deepstate) @@ -103,9 +102,11 @@ if (BUILD_LIBFUZZER) set_target_properties(StreamingAndFormatting_LF PROPERTIES COMPILE_DEFINITIONS "LIBFUZZER") endif() -add_executable(Squares Squares.c) -target_link_libraries(Squares deepstate) -set_target_properties(Squares PROPERTIES COMPILE_DEFINITIONS "DEEPSTATE_TEST") +if (NOT APPLE) + add_executable(Squares Squares.c) + target_link_libraries(Squares deepstate) + set_target_properties(Squares PROPERTIES COMPILE_DEFINITIONS "DEEPSTATE_TEST") +endif() add_executable(TakeOver TakeOver.cpp) target_link_libraries(TakeOver deepstate) diff --git a/src/include/deepstate/Klee.h b/src/include/deepstate/Klee.h index 2c8a4c5..c91f16b 100644 --- a/src/include/deepstate/Klee.h +++ b/src/include/deepstate/Klee.h @@ -97,7 +97,12 @@ static void klee_posix_prefer_cex(void *object, uintptr_t condition) { /* static KLEE_GET_VALUE(d, double); */ static KLEE_GET_VALUE(l, long) { - DeepState_MinInt(val); + if (sizeof(long) == sizeof(int)) { + return DeepState_MinInt((int) val); + } else { + // TODO: We need a MinInt64 function. + return DeepState_MinInt(val); + } } /* Unsupported. */ @@ -105,7 +110,7 @@ static KLEE_GET_VALUE(l, long) { /* TODO(joe): Implement */ static KLEE_GET_VALUE(_i32, int32_t) { - DeepState_MinInt(val); + return DeepState_MinInt(val); } /* TODO(joe): Implement */