From 63f323b211f5856a160a9b168e314fafd37777a3 Mon Sep 17 00:00:00 2001 From: fruffy Date: Wed, 30 Oct 2024 11:56:35 -0400 Subject: [PATCH] Review comments. Signed-off-by: fruffy asdsa Signed-off-by: fruffy --- cmake/Z3.cmake | 6 +++--- cmake/z3.patch | 34 ++++++++++++---------------------- 2 files changed, 15 insertions(+), 25 deletions(-) diff --git a/cmake/Z3.cmake b/cmake/Z3.cmake index d7546b5086b..d41f6e129d1 100644 --- a/cmake/Z3.cmake +++ b/cmake/Z3.cmake @@ -50,9 +50,9 @@ macro(obtain_z3) fetchcontent_declare( z3 GIT_REPOSITORY https://github.com/Z3Prover/z3.git - GIT_TAG 51fcb10b2ff0e4496a3c0c2ed7c32f0876c9ee49 # 4.13.0 + GIT_TAG z3-4.13.3 # 4.13.0 GIT_PROGRESS TRUE - # GIT_SHALLOW TRUE + GIT_SHALLOW TRUE # We need to patch because the Z3 CMakeLists.txt also adds an uinstall target. # This leads to a namespace clash. PATCH_COMMAND @@ -67,7 +67,7 @@ macro(obtain_z3) foreach(target ${Z3_BUILD_TARGETS}) # Do not suppress warnings for Z3 library targets that are aliased. get_target_property(target_type ${target} TYPE) - if (NOT ${target_type} STREQUAL "INTERFACE_LIBRARY") + if (NOT ${target_type} STREQUAL "INTERFACE_LIBRARY" AND NOT ${target_type} STREQUAL "UTILITY") target_compile_options(${target} PRIVATE "-Wno-error" "-w") # Z3 does not add its own include directories for compilation, which can lead to conflicts. target_include_directories(${target} BEFORE PRIVATE ${z3_SOURCE_DIR}/src) diff --git a/cmake/z3.patch b/cmake/z3.patch index b51f7f57f16..956a4068f5f 100644 --- a/cmake/z3.patch +++ b/cmake/z3.patch @@ -1,36 +1,26 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index ba3ec7bce..7ca1894fd 100644 +index 79708764..18af2183 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -446,13 +446,13 @@ configure_file( +@@ -446,7 +446,7 @@ configure_file( # Target needs to be declared before the components so that they can add # dependencies to this target so they can run their own custom uninstall rules. -add_custom_target(uninstall -- COMMAND -- "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" -- COMMENT "Uninstalling..." -- USES_TERMINAL -- VERBATIM --) -+# add_custom_target(uninstall -+# COMMAND -+# "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" -+# COMMENT "Uninstalling..." -+# USES_TERMINAL -+# VERBATIM -+# ) - - ################################################################################ - # CMake build file locations ++add_custom_target(z3_uninstall + COMMAND + "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + COMMENT "Uninstalling..." diff --git a/src/util/memory_manager.cpp b/src/util/memory_manager.cpp -index 290881ba5..a3db94d7a 100644 +index 8c6bfc7e..fb3226b8 100644 --- a/src/util/memory_manager.cpp +++ b/src/util/memory_manager.cpp -@@ -29,6 +29,8 @@ Copyright (c) 2015 Microsoft Corporation - # define malloc_usable_size _msize - #endif +@@ -31,6 +31,10 @@ Copyright (c) 2015 Microsoft Corporation + + #define SIZE_T_ALIGN 2 ++// malloc_usable_size() currently does not work with BDWGC which is used by P4C. We disable it. ++// FIXME: Find a way to patch BDWGC to allow malloc_usable_size() to work. +#undef HAS_MALLOC_USABLE_SIZE + // The following two function are automatically generated by the mk_make.py script.