Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow building of shared libraries #1229

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,11 @@ BUILD_DIR="./${BUILD_TYPE}-build"

rm -rf "${BUILD_DIR}"
mkdir "${BUILD_DIR}"
# If you need shared libs, turn BUILD_SHARED_LIBS on
cmake -D CMAKE_BUILD_TYPE:STRING="${BUILD_TYPE}" \
-DSVF_ENABLE_ASSERTIONS:BOOL=true \
-DSVF_SANITIZE="${SVF_SANITIZER}" \
-DBUILD_SHARED_LIBS=off \
-S "${SVFHOME}" -B "${BUILD_DIR}"
cmake --build "${BUILD_DIR}" -j ${jobs}

Expand Down
4 changes: 2 additions & 2 deletions svf-llvm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ endif()
# SVF-LLVM contains LLVM Libs
file(GLOB SVFLLVM_SOURCES lib/*.cpp)

add_llvm_library(SvfLLVM STATIC ${SVFLLVM_SOURCES})
add_llvm_library(SvfLLVM ${SVFLLVM_SOURCES})
target_include_directories(SvfLLVM SYSTEM PUBLIC ${LLVM_INCLUDE_DIRS})
target_include_directories(SvfLLVM PUBLIC include)
target_link_libraries(SvfLLVM PUBLIC ${Z3_LIBRARIES} SvfCoreObj)
target_link_libraries(SvfLLVM PUBLIC ${Z3_LIBRARIES} SvfCore)

if(DEFINED IN_SOURCE_BUILD)
add_dependencies(SvfLLVM intrinsics_gen)
Expand Down
7 changes: 2 additions & 5 deletions svf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,5 @@ file(
lib/Util/*.cpp
lib/WPA/*.cpp)

# Refer to this link for detail:
# https://stackoverflow.com/questions/68864536/cmake-linking-static-libraries-in-different-subdirectories-into-one-single-stati
add_library(SvfCoreObj OBJECT ${SVF_CORE_SOURCES})
add_library(SvfCore STATIC)
target_link_libraries(SvfCore PUBLIC ${Z3_LIBRARIES} SvfCoreObj)
add_library(SvfCore ${SVF_CORE_SOURCES})
target_link_libraries(SvfCore PUBLIC ${Z3_LIBRARIES})
3 changes: 3 additions & 0 deletions svf/lib/AbstractExecution/SVFIR2ItvExeState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
using namespace SVF;
using namespace SVFUtil;

SVF::SVFIR2ItvExeState::VAddrs SVF::SVFIR2ItvExeState::globalNullVaddrs =
AddressValue();

void SVFIR2ItvExeState::applySummary(IntervalExeState &es)
{
for (const auto &item: es._varToItvVal)
Expand Down