Skip to content

Commit

Permalink
Review comments.
Browse files Browse the repository at this point in the history
Signed-off-by: fruffy <[email protected]>

asdsa

Signed-off-by: fruffy <[email protected]>
  • Loading branch information
fruffy committed Oct 31, 2024
1 parent 096aec1 commit 63f323b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 25 deletions.
6 changes: 3 additions & 3 deletions cmake/Z3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
34 changes: 12 additions & 22 deletions cmake/z3.patch
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit 63f323b

Please sign in to comment.