svf-tools 1.0.1050 → 1.0.1051

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build.sh CHANGED
@@ -1,8 +1,14 @@
1
1
  #!/usr/bin/env bash
2
- # type './build.sh' for release build
3
- # type './build.sh debug' for debug build
4
- # type './build.sh shared' for building LLVM from source with shared libs and RTTI enabled
5
- # type './build.sh debug shared' for debug build with shared libs and RTTI enabled
2
+ # type './build.sh' for release build with dynamic libs, SVF and LLVM RTTI on
3
+ # type './build.sh debug' for debug build with dynamic libs, SVF and LLVM RTTI on
4
+ # type './build.sh dyn_lib' for release build with dynamic libs, SVF and LLVM RTTI on
5
+ # type './build.sh debug dyn_lib' for debug build with dynamic libs, SVF and LLVM RTTI on
6
+
7
+ # type './build.sh sta_lib' for release build with static libs, SVF and LLVM RTTI on
8
+ # type './build.sh debug sta_lib' for debug build with static libs, SVF and LLVM RTTI on
9
+ # type './build.sh sta_lib nortti' for release build with static libs, SVF and LLVM RTTI off
10
+ # type './build.sh debug sta_lib nortti' for debug build with static libs, SVF and LLVM RTTI off
11
+
6
12
  # If the LLVM_DIR variable is not set, LLVM will be downloaded or built from source.
7
13
  #
8
14
  # Dependencies include: build-essential libncurses5 libncurses-dev cmake zlib1g-dev
@@ -20,6 +26,7 @@ arch=$(uname -m)
20
26
  MajorLLVMVer=16
21
27
  LLVMVer=${MajorLLVMVer}.0.4
22
28
  UbuntuArmLLVM="https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVMVer}/clang+llvm-${LLVMVer}-aarch64-linux-gnu.tar.xz"
29
+ UbuntuLLVM_RTTI="https://github.com/bjjwwang/SVF-LLVM/releases/download/${MajorLLVMVer}.0.0/llvm-${MajorLLVMVer}.0.0-ubuntu24-rtti-amd64.tar.gz"
23
30
  UbuntuLLVM="https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVMVer}/clang+llvm-${LLVMVer}-x86_64-linux-gnu-ubuntu-22.04.tar.xz"
24
31
  SourceLLVM="https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-${LLVMVer}.zip"
25
32
  UbuntuZ3="https://github.com/Z3Prover/z3/releases/download/z3-4.8.8/z3-4.8.8-x64-ubuntu-16.04.zip"
@@ -34,16 +41,27 @@ Z3Home="z3.obj"
34
41
 
35
42
  # Parse arguments
36
43
  BUILD_TYPE='Release'
37
- BUILD_SHARED='OFF'
44
+ BUILD_DYN_LIB='ON'
45
+ RTTI='ON'
38
46
  for arg in "$@"; do
39
47
  if [[ $arg =~ ^[Dd]ebug$ ]]; then
40
48
  BUILD_TYPE='Debug'
41
49
  fi
42
- if [[ $arg =~ ^[Ss]hared$ ]]; then
43
- BUILD_SHARED='ON'
50
+ if [[ $arg =~ ^[Ss]ta_lib$ ]]; then
51
+ BUILD_DYN_LIB='OFF'
52
+ fi
53
+ if [[ $arg =~ ^[Dd]yn_lib$ ]]; then
54
+ BUILD_DYN_LIB='ON'
55
+ fi
56
+ if [[ $arg =~ ^[Nn]ortti$ ]]; then
57
+ RTTI='OFF'
44
58
  fi
45
59
  done
46
-
60
+ # if static is off (shared lib), rtti is always on, but print a warning if rtti is off
61
+ if [[ "$BUILD_SHARED" == "ON" && "$RTTI" == "OFF" ]]; then
62
+ echo "Warning: LLVM RTTI is always on when building shared libraries."
63
+ RTTI='ON'
64
+ fi
47
65
 
48
66
 
49
67
  # Downloads $1 (URL) to $2 (target destination) using wget or curl,
@@ -180,7 +198,16 @@ elif [[ $sysOS == "Linux" ]]; then
180
198
  urlZ3="$UbuntuZ3Arm"
181
199
  OSDisplayName="Ubuntu arm64"
182
200
  else
183
- urlLLVM="$UbuntuLLVM"
201
+ if [[ "$BUILD_SHARED" == "ON" ]]; then
202
+ urlLLVM="$UbuntuLLVM_RTTI"
203
+ else
204
+ # if RTTI is on
205
+ if [[ "$RTTI" == "ON" ]]; then
206
+ urlLLVM="$UbuntuLLVM_RTTI"
207
+ else
208
+ urlLLVM="$UbuntuLLVM"
209
+ fi
210
+ fi
184
211
  urlZ3="$UbuntuZ3"
185
212
  OSDisplayName="Ubuntu x86"
186
213
  fi
@@ -206,18 +233,13 @@ if [[ ! -d "$LLVM_DIR" ]]; then
206
233
  mkdir -p $SVFHOME/$LLVMHome
207
234
  ln -s $(brew --prefix llvm@${MajorLLVMVer})/* $SVFHOME/$LLVMHome
208
235
  else
209
- # Ubuntu if build_shared in ON,
210
- if [[ "$BUILD_SHARED" == "ON" ]]; then
211
- build_llvm_from_source
212
- else
213
236
  # everything else downloads pre-built lib includ osx "arm64"
214
- echo "Downloading LLVM binary for $OSDisplayName"
215
- generic_download_file "$urlLLVM" llvm.tar.xz
216
- check_xz
217
- echo "Unzipping llvm package..."
218
- mkdir -p "./$LLVMHome" && tar -xf llvm.tar.xz -C "./$LLVMHome" --strip-components 1
219
- rm llvm.tar.xz
220
- fi
237
+ echo "Downloading LLVM binary for $OSDisplayName"
238
+ generic_download_file "$urlLLVM" llvm.tar.xz
239
+ check_xz
240
+ echo "Unzipping llvm package..."
241
+ mkdir -p "./$LLVMHome" && tar -xf llvm.tar.xz -C "./$LLVMHome" --strip-components 1
242
+ rm llvm.tar.xz
221
243
  fi
222
244
  fi
223
245
  export LLVM_DIR="$SVFHOME/$LLVMHome"
@@ -278,7 +300,7 @@ mkdir "${BUILD_DIR}"
278
300
  cmake -D CMAKE_BUILD_TYPE:STRING="${BUILD_TYPE}" \
279
301
  -DSVF_ENABLE_ASSERTIONS:BOOL=true \
280
302
  -DSVF_SANITIZE="${SVF_SANITIZER}" \
281
- -DBUILD_SHARED_LIBS=${BUILD_SHARED} \
303
+ -DBUILD_SHARED_LIBS=${BUILD_DYN_LIB} \
282
304
  -S "${SVFHOME}" -B "${BUILD_DIR}"
283
305
  cmake --build "${BUILD_DIR}" -j ${jobs}
284
306
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-tools",
3
- "version": "1.0.1050",
3
+ "version": "1.0.1051",
4
4
  "description": "* <b>[TypeClone](https://github.com/SVF-tools/SVF/wiki/TypeClone) published in our [ECOOP paper](https://yuleisui.github.io/publications/ecoop20.pdf) is now available in SVF </b> * <b>SVF now uses a single script for its build. Just type [`source ./build.sh`](https://github.com/SVF-tools/SVF/blob/master/build.sh) in your terminal, that's it!</b> * <b>SVF now supports LLVM-10.0.0! </b> * <b>We thank [bsauce](https://github.com/bsauce) for writing a user manual of SVF ([link1](https://www.jianshu.com/p/068a08ec749c) and [link2](https://www.jianshu.com/p/777c30d4240e)) in Chinese </b> * <b>SVF now supports LLVM-9.0.0 (Thank [Byoungyoung Lee](https://github.com/SVF-tools/SVF/issues/142) for his help!). </b> * <b>SVF now supports a set of [field-sensitive pointer analyses](https://yuleisui.github.io/publications/sas2019a.pdf). </b> * <b>[Use SVF as an external lib](https://github.com/SVF-tools/SVF/wiki/Using-SVF-as-a-lib-in-your-own-tool) for your own project (Contributed by [Hongxu Chen](https://github.com/HongxuChen)). </b> * <b>SVF now supports LLVM-7.0.0. </b> * <b>SVF now supports Docker. [Try SVF in Docker](https://github.com/SVF-tools/SVF/wiki/Try-SVF-in-Docker)! </b> * <b>SVF now supports [LLVM-6.0.0](https://github.com/svf-tools/SVF/pull/38) (Contributed by [Jack Anthony](https://github.com/jackanth)). </b> * <b>SVF now supports [LLVM-4.0.0](https://github.com/svf-tools/SVF/pull/23) (Contributed by Jared Carlson. Thank [Jared](https://github.com/jcarlson23) and [Will](https://github.com/dtzWill) for their in-depth [discussions](https://github.com/svf-tools/SVF/pull/18) about updating SVF!) </b> * <b>SVF now supports analysis for C++ programs.</b> <br />",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -56,6 +56,7 @@ else()
56
56
  support
57
57
  target
58
58
  transformutils
59
+ demangle
59
60
  )
60
61
  endif()
61
62