svf-tools 1.0.422 → 1.0.423
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 +54 -8
- package/package.json +1 -1
package/build.sh
CHANGED
|
@@ -4,6 +4,29 @@
|
|
|
4
4
|
# set the SVF_CTIR environment variable to build and run FSTBHC tests, e.g., `. build.sh SVF_CTIR=1 `.
|
|
5
5
|
# if the CTIR_DIR variable is not set, ctir Clang will be downloaded (only if SVF_CTIR is set).
|
|
6
6
|
# if the LLVM_DIR variable is not set, LLVM will be downloaded.
|
|
7
|
+
#
|
|
8
|
+
# Dependencies include: build-essential libncurses5 libncurses-dev cmake zlib1g-dev
|
|
9
|
+
|
|
10
|
+
function usage {
|
|
11
|
+
echo "Use this by ${0} [-j <job count>]"
|
|
12
|
+
echo " * job count: value passed to make."
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
#########
|
|
16
|
+
# Parse arguments
|
|
17
|
+
#########
|
|
18
|
+
while [[ $# -gt 0 ]]; do
|
|
19
|
+
case "${1}" in
|
|
20
|
+
-h|--help) usage; exit 0 ;;
|
|
21
|
+
-j|--jobs) shift; jobs="$1" ;;
|
|
22
|
+
*) usage; exit 0 ;;
|
|
23
|
+
esac
|
|
24
|
+
shift
|
|
25
|
+
done
|
|
26
|
+
|
|
27
|
+
# "getconf _NPROCESSORS_ONLN" should be compatible on linux & mac, but just in case, default to 4
|
|
28
|
+
[[ -z ${jobs} ]] && jobs=`getconf _NPROCESSORS_ONLN`
|
|
29
|
+
[[ -z ${jobs} ]] && jobs=4
|
|
7
30
|
|
|
8
31
|
#########
|
|
9
32
|
# VARs and Links
|
|
@@ -12,10 +35,12 @@ SVFHOME=$(pwd)
|
|
|
12
35
|
sysOS=$(uname -s)
|
|
13
36
|
MacLLVM="https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz"
|
|
14
37
|
UbuntuLLVM="https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz"
|
|
38
|
+
UbuntuArmLLVM="https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-aarch64-linux-gnu.tar.xz"
|
|
15
39
|
MacZ3="https://github.com/Z3Prover/z3/releases/download/z3-4.8.8/z3-4.8.8-x64-osx-10.14.6.zip"
|
|
16
40
|
UbuntuZ3="https://github.com/Z3Prover/z3/releases/download/z3-4.8.8/z3-4.8.8-x64-ubuntu-16.04.zip"
|
|
17
41
|
MacCTIR="https://github.com/mbarbar/ctir/releases/download/ctir-10.c3/ctir-clang-v10.c3-macos10.15.zip"
|
|
18
42
|
UbuntuCTIR="https://github.com/mbarbar/ctir/releases/download/ctir-10.c3/ctir-clang-v10.c3-ubuntu18.04.zip"
|
|
43
|
+
Z3Git="--branch z3-4.8.14 https://github.com/Z3Prover/z3.git"
|
|
19
44
|
|
|
20
45
|
# Keep LLVM version suffix for version checking and better debugging
|
|
21
46
|
# keep the version consistent with LLVM_DIR in setup.sh and llvm_version in Dockerfile
|
|
@@ -23,6 +48,22 @@ LLVMHome="llvm-13.0.0.obj"
|
|
|
23
48
|
Z3Home="z3.obj"
|
|
24
49
|
CTIRHome="ctir.obj"
|
|
25
50
|
|
|
51
|
+
|
|
52
|
+
function build_z3_from_source {
|
|
53
|
+
readonly GIT_SRC="${1}"
|
|
54
|
+
readonly INSTALL_DIR="${2}"
|
|
55
|
+
|
|
56
|
+
mkdir -p z3-src
|
|
57
|
+
pushd z3-src
|
|
58
|
+
git clone ${GIT_SRC} .
|
|
59
|
+
mkdir -p build && cd build
|
|
60
|
+
# We need a static library, so set the build option
|
|
61
|
+
cmake -DZ3_BUILD_LIBZ3_SHARED=FALSE ..
|
|
62
|
+
make -j ${jobs} && cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -P cmake_install.cmake
|
|
63
|
+
echo "Z3 installed to ${INSTALL_DIR}. Temporary build dir `pwd` can be removed."
|
|
64
|
+
popd
|
|
65
|
+
}
|
|
66
|
+
|
|
26
67
|
# Downloads $1 (URL) to $2 (target destination) using wget or curl,
|
|
27
68
|
# depending on OS.
|
|
28
69
|
# E.g. generic_download_file www.url.com/my.zip loc/my.zip
|
|
@@ -93,7 +134,7 @@ then
|
|
|
93
134
|
OSDisplayName="macOS"
|
|
94
135
|
elif [[ $sysOS == "Linux" ]]
|
|
95
136
|
then
|
|
96
|
-
urlLLVM="$UbuntuLLVM"
|
|
137
|
+
[[ `uname -m` == "aarch64" ]] && urlLLVM="$UbuntuArmLLVM" || urlLLVM="$UbuntuLLVM"
|
|
97
138
|
urlZ3="$UbuntuZ3"
|
|
98
139
|
urlCTIR="$UbuntuCTIR"
|
|
99
140
|
OSDisplayName="Ubuntu"
|
|
@@ -126,12 +167,17 @@ if [ ! -d "$Z3_DIR" ]
|
|
|
126
167
|
then
|
|
127
168
|
if [ ! -d "$Z3Home" ]
|
|
128
169
|
then
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
170
|
+
if [[ `uname -m` == "aarch64" ]]
|
|
171
|
+
then
|
|
172
|
+
build_z3_from_source "$Z3Git" "$SVFHOME/$Z3Home"
|
|
173
|
+
else
|
|
174
|
+
echo "Downloading Z3 binary for $OSDisplayName"
|
|
175
|
+
generic_download_file "$urlZ3" z3.zip
|
|
176
|
+
check_unzip
|
|
177
|
+
echo "Unzipping z3 package..."
|
|
178
|
+
unzip -q "z3.zip" && mv ./z3-* ./$Z3Home
|
|
179
|
+
rm z3.zip
|
|
180
|
+
fi
|
|
135
181
|
fi
|
|
136
182
|
|
|
137
183
|
export Z3_DIR="$SVFHOME/$Z3Home"
|
|
@@ -175,7 +221,7 @@ else
|
|
|
175
221
|
cd ./'Release-build'
|
|
176
222
|
cmake ../
|
|
177
223
|
fi
|
|
178
|
-
make -j
|
|
224
|
+
make -j ${jobs}
|
|
179
225
|
|
|
180
226
|
########
|
|
181
227
|
# Set up environment variables of SVF
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svf-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.423",
|
|
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": {
|