svf-tools 1.0.423 → 1.0.424
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 +62 -31
- package/package.json +1 -1
package/build.sh
CHANGED
|
@@ -1,43 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# type './build.sh'
|
|
3
|
-
# type './build.sh debug'
|
|
2
|
+
# type './build.sh' for release build
|
|
3
|
+
# type './build.sh debug' for debug build
|
|
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
7
|
#
|
|
8
8
|
# Dependencies include: build-essential libncurses5 libncurses-dev cmake zlib1g-dev
|
|
9
9
|
|
|
10
|
-
|
|
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
|
|
10
|
+
jobs=4
|
|
30
11
|
|
|
31
12
|
#########
|
|
32
13
|
# VARs and Links
|
|
33
14
|
########
|
|
34
15
|
SVFHOME=$(pwd)
|
|
35
16
|
sysOS=$(uname -s)
|
|
17
|
+
arch=$(uname -m)
|
|
36
18
|
MacLLVM="https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz"
|
|
37
19
|
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
20
|
UbuntuArmLLVM="https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-aarch64-linux-gnu.tar.xz"
|
|
21
|
+
SourceLLVM="https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-13.0.0.zip"
|
|
39
22
|
MacZ3="https://github.com/Z3Prover/z3/releases/download/z3-4.8.8/z3-4.8.8-x64-osx-10.14.6.zip"
|
|
40
23
|
UbuntuZ3="https://github.com/Z3Prover/z3/releases/download/z3-4.8.8/z3-4.8.8-x64-ubuntu-16.04.zip"
|
|
24
|
+
SourceZ3="https://github.com/Z3Prover/z3/archive/refs/tags/z3-4.8.8.zip"
|
|
41
25
|
MacCTIR="https://github.com/mbarbar/ctir/releases/download/ctir-10.c3/ctir-clang-v10.c3-macos10.15.zip"
|
|
42
26
|
UbuntuCTIR="https://github.com/mbarbar/ctir/releases/download/ctir-10.c3/ctir-clang-v10.c3-ubuntu18.04.zip"
|
|
43
27
|
Z3Git="--branch z3-4.8.14 https://github.com/Z3Prover/z3.git"
|
|
@@ -116,6 +100,47 @@ function check_xz {
|
|
|
116
100
|
fi
|
|
117
101
|
}
|
|
118
102
|
|
|
103
|
+
function build_z3_from_source {
|
|
104
|
+
mkdir "$Z3Home"
|
|
105
|
+
echo "Downloading Z3 source..."
|
|
106
|
+
generic_download_file "$SourceZ3" z3.zip
|
|
107
|
+
check_zip
|
|
108
|
+
echo "Unzipping Z3 source..."
|
|
109
|
+
mkdir z3-source
|
|
110
|
+
unzip z3.zip -d z3-source
|
|
111
|
+
|
|
112
|
+
echo "Building Z3..."
|
|
113
|
+
mkdir z3-build
|
|
114
|
+
cd z3-build
|
|
115
|
+
# /* is a dirty hack to get z3-version...
|
|
116
|
+
cmake -DCMAKE_INSTALL_PREFIX="$SVFHOME/$Z3Home" -DZ3_BUILD_LIBZ3_SHARED=false ../z3-source/*
|
|
117
|
+
make -j${jobs}
|
|
118
|
+
make install
|
|
119
|
+
|
|
120
|
+
cd ..
|
|
121
|
+
rm -r z3-source z3-build z3.zip
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function build_llvm_from_source {
|
|
125
|
+
mkdir "$LLVMHome"
|
|
126
|
+
echo "Downloading LLVM source..."
|
|
127
|
+
generic_download_file "$SourceLLVM" llvm.zip
|
|
128
|
+
check_unzip
|
|
129
|
+
echo "Unzipping LLVM source..."
|
|
130
|
+
mkdir llvm-source
|
|
131
|
+
unzip llvm.zip -d llvm-source
|
|
132
|
+
|
|
133
|
+
echo "Building LLVM..."
|
|
134
|
+
mkdir llvm-build
|
|
135
|
+
cd llvm-build
|
|
136
|
+
# /*/ is a dirty hack to get llvm-project-llvmorg-version...
|
|
137
|
+
cmake -DCMAKE_INSTALL_PREFIX="$SVFHOME/$LLVMHome" ../llvm-source/*/llvm
|
|
138
|
+
make -j${jobs}
|
|
139
|
+
make install
|
|
140
|
+
|
|
141
|
+
cd ..
|
|
142
|
+
rm -r llvm-source llvm-build llvm.zip
|
|
143
|
+
}
|
|
119
144
|
|
|
120
145
|
# OS-specific values.
|
|
121
146
|
urlLLVM=""
|
|
@@ -134,7 +159,7 @@ then
|
|
|
134
159
|
OSDisplayName="macOS"
|
|
135
160
|
elif [[ $sysOS == "Linux" ]]
|
|
136
161
|
then
|
|
137
|
-
[[
|
|
162
|
+
[[ "$arch" == "aarch64" ]] && urlLLVM="$UbuntuArmLLVM" || urlLLVM="$UbuntuLLVM"
|
|
138
163
|
urlZ3="$UbuntuZ3"
|
|
139
164
|
urlCTIR="$UbuntuCTIR"
|
|
140
165
|
OSDisplayName="Ubuntu"
|
|
@@ -149,12 +174,17 @@ if [ ! -d "$LLVM_DIR" ]
|
|
|
149
174
|
then
|
|
150
175
|
if [ ! -d "$LLVMHome" ]
|
|
151
176
|
then
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
177
|
+
if [ "$sysOS" = "Darwin" ] && [ "$arch" = "arm64" ]
|
|
178
|
+
then
|
|
179
|
+
build_llvm_from_source
|
|
180
|
+
else
|
|
181
|
+
echo "Downloading LLVM binary for $OSDisplayName"
|
|
182
|
+
generic_download_file "$urlLLVM" llvm.tar.xz
|
|
183
|
+
check_xz
|
|
184
|
+
echo "Unzipping llvm package..."
|
|
185
|
+
mkdir -p "./$LLVMHome" && tar -xf llvm.tar.xz -C "./$LLVMHome" --strip-components 1
|
|
186
|
+
rm llvm.tar.xz
|
|
187
|
+
fi
|
|
158
188
|
fi
|
|
159
189
|
|
|
160
190
|
export LLVM_DIR="$SVFHOME/$LLVMHome"
|
|
@@ -167,9 +197,10 @@ if [ ! -d "$Z3_DIR" ]
|
|
|
167
197
|
then
|
|
168
198
|
if [ ! -d "$Z3Home" ]
|
|
169
199
|
then
|
|
170
|
-
|
|
200
|
+
# M1 Macs give back arm64, some Linuxes can give aarch64.
|
|
201
|
+
if [ "$arch" = "aarch64" ] || [ "$arch" = "arm64" ]
|
|
171
202
|
then
|
|
172
|
-
build_z3_from_source
|
|
203
|
+
build_z3_from_source
|
|
173
204
|
else
|
|
174
205
|
echo "Downloading Z3 binary for $OSDisplayName"
|
|
175
206
|
generic_download_file "$urlZ3" z3.zip
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svf-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.424",
|
|
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": {
|