Skip to content

Commit

Permalink
Merge pull request #1229 from xudon9/sharedlib
Browse files Browse the repository at this point in the history
Allow building of shared libraries
  • Loading branch information
yuleisui authored Oct 18, 2023
2 parents 4ac3ddb + 11bf011 commit b424770
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
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

0 comments on commit b424770

Please sign in to comment.