forked from JonathanSalwan/Triton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
221 lines (200 loc) · 11.2 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
language: cpp
matrix:
include:
# Linux gcc 4.8
- os: linux
dist: trusty
compiler: gcc
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.8', 'ccache', 'libboost1.55-all-dev', 'cmake', 'cmake-data', 'libpython2.7']
env: [ CXX_COMPILER=g++-4.8, C_COMPILER=gcc-4.8, Z3_PKG=z3-4.6.0-x64-ubuntu-14.04, PYTHON_VERSION=2.7, PYTHON_BINARY=/usr/bin/python2.7 ]
# Linux gcc 4.9
- os: linux
dist: trusty
compiler: gcc
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.9', 'ccache', 'libboost1.55-all-dev', 'cmake', 'cmake-data', 'libpython2.7']
env: [ CXX_COMPILER=g++-4.9, C_COMPILER=gcc-4.9, Z3_PKG=z3-4.6.0-x64-ubuntu-14.04, PYTHON_VERSION=2.7, PYTHON_BINARY=/usr/bin/python2.7 ]
# Linux gcc 5.0
- os: linux
dist: trusty
compiler: gcc
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5', 'ccache', 'libboost1.55-all-dev', 'cmake', 'cmake-data', 'libpython2.7']
env: [ CXX_COMPILER=g++-5, C_COMPILER=gcc-5, Z3_PKG=z3-4.6.0-x64-ubuntu-14.04, PYTHON_VERSION=2.7, PYTHON_BINARY=/usr/bin/python2.7 ]
# Linux gcc 5.0 with gcov
- os: linux
dist: trusty
compiler: gcc
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5', 'ccache', 'libboost1.55-all-dev', 'cmake', 'cmake-data', 'libpython2.7']
env: [ GCOV=ON, CXX_COMPILER=g++-5, C_COMPILER=gcc-5, Z3_PKG=z3-4.6.0-x64-ubuntu-14.04, PYTHON_VERSION=2.7, PYTHON_BINARY=/usr/bin/python2.7 ]
# Linux gcc 5.0 with python 3.6
- os: linux
dist: trusty
compiler: gcc
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'deadsnakes']
packages: ['g++-5', 'ccache', 'libboost1.55-all-dev', 'cmake', 'cmake-data', 'python3.6-dev']
env: [ CXX_COMPILER=g++-5, C_COMPILER=gcc-5, Z3_PKG=z3-4.6.0-x64-ubuntu-14.04, PYTHON36=on, PYTHON_VERSION=3.6, PYTHON_INCLUDE_DIR=/usr/include/python3.6m, PYTHON_LIBRARY=/usr/lib/libpython3.6m.so, PYTHON_BINARY=/usr/bin/python3.6 ]
# Linux clang 3.5
- os: linux
dist: trusty
compiler: clang
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['clang-3.5', 'ccache', 'libboost1.55-all-dev', 'cmake', 'cmake-data', 'libpython2.7']
env: [ CXX_COMPILER=clang++-3.5, C_COMPILER=clang-3.5, Z3_PKG=z3-4.6.0-x64-ubuntu-14.04, PYTHON_VERSION=2.7, PYTHON_BINARY=/usr/bin/python2.7 ]
# Linux clang 3.6
- os: linux
dist: trusty
compiler: clang
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['clang-3.6', 'ccache', 'libboost1.55-all-dev', 'cmake', 'cmake-data', 'libpython2.7']
env: [ CXX_COMPILER=clang++-3.6, C_COMPILER=clang-3.6, Z3_PKG=z3-4.6.0-x64-ubuntu-14.04, PYTHON_VERSION=2.7, PYTHON_BINARY=/usr/bin/python2.7 ]
# Linux clang 3.7
- os: linux
dist: trusty
compiler: clang
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7']
packages: ['clang-3.7', 'ccache', 'libboost1.55-all-dev', 'cmake', 'cmake-data', 'libpython2.7']
env: [ CXX_COMPILER=clang++-3.7, C_COMPILER=clang-3.7, Z3_PKG=z3-4.6.0-x64-ubuntu-14.04, PYTHON_VERSION=2.7, PYTHON_BINARY=/usr/bin/python2.7 ]
# Linux clang 3.8
- os: linux
dist: trusty
compiler: clang
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['clang-3.8', 'ccache', 'libboost1.55-all-dev', 'cmake', 'cmake-data', 'libpython2.7']
env: [ CXX_COMPILER=clang++-3.8, C_COMPILER=clang-3.8, Z3_PKG=z3-4.6.0-x64-ubuntu-14.04, PYTHON_VERSION=2.7, PYTHON_BINARY=/usr/bin/python2.7 ]
# Linux clang 3.9
- os: linux
dist: trusty
compiler: clang
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['clang-3.9', 'ccache', 'libboost1.55-all-dev', 'cmake', 'cmake-data', 'libpython2.7']
env: [ CXX_COMPILER=clang++-3.9, C_COMPILER=clang-3.9, Z3_PKG=z3-4.6.0-x64-ubuntu-14.04, PYTHON_VERSION=2.7, PYTHON_BINARY=/usr/bin/python2.7 ]
# Linux clang 4.0
- os: linux
dist: trusty
compiler: clang
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-4.0']
packages: ['clang-4.0', 'ccache', 'libboost1.55-all-dev', 'cmake', 'cmake-data', 'libpython2.7']
env: [ CXX_COMPILER=clang++-4.0, C_COMPILER=clang-4.0, Z3_PKG=z3-4.6.0-x64-ubuntu-14.04, PYTHON_VERSION=2.7, PYTHON_BINARY=/usr/bin/python2.7 ]
# Linux clang 5.0
- os: linux
dist: trusty
compiler: clang
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-5.0']
packages: ['clang-5.0', 'ccache', 'libboost1.55-all-dev', 'cmake', 'cmake-data', 'libpython2.7']
env: [ CXX_COMPILER=clang++-5.0, C_COMPILER=clang-5.0, Z3_PKG=z3-4.6.0-x64-ubuntu-14.04, PYTHON_VERSION=2.7, PYTHON_BINARY=/usr/bin/python2.7 ]
# Linux clang 5.0 with python 3.6
- os: linux
dist: trusty
compiler: clang
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-5.0', 'deadsnakes']
packages: ['clang-5.0', 'ccache', 'libboost1.55-all-dev', 'cmake', 'cmake-data', 'python3.6-dev']
env: [ CXX_COMPILER=clang++-5.0, C_COMPILER=clang-5.0, Z3_PKG=z3-4.6.0-x64-ubuntu-14.04, PYTHON36=on, PYTHON_VERSION=3.6, PYTHON_INCLUDE_DIR=/usr/include/python3.6m, PYTHON_LIBRARY=/usr/lib/libpython3.6m.so, PYTHON_BINARY=/usr/bin/python3.6 ]
# OSX xcode 10.0 (High Sierra)
- os: osx
osx_image: xcode10
compiler: clang
env: [ CXX_COMPILER=clang++, C_COMPILER=clang, PYTHON_VERSION=2.7 ]
notifications:
email: false
sudo: required
cache:
- apt
- ccache
before_install:
- export CC="$C_COMPILER"
- export CXX="$CXX_COMPILER"
# Install pip
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py ;fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo ${PYTHON_BINARY} ./get-pip.py ;fi
# Install z3 on Linux
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://github.com/Z3Prover/z3/releases/download/z3-4.6.0/${Z3_PKG}.zip; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then unzip ${Z3_PKG}.zip; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install python-setuptools; fi
# Install z3 on OSX
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PREFIX="/usr/local"; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install z3 binutils; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export DYLD_LIBRARY_PATH=/usr/local/opt/capstone/lib/:$DYLD_LIBRARY_PATH; fi
# Back to /home/travis/build/JonathanSalwan
- cd ..
# Install gcov
- if [[ "$GCOV" == "ON" ]]; then sudo ln -sf /usr/bin/gcov-5 /usr/bin/gcov; fi
- if [[ "$GCOV" == "ON" ]]; then wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.13.orig.tar.gz; fi
- if [[ "$GCOV" == "ON" ]]; then tar xf lcov_1.13.orig.tar.gz; fi
- if [[ "$GCOV" == "ON" ]]; then sudo make -C lcov-1.13/ install; fi
# Install capstone. Same command lines for OSX and Linux
- wget https://github.com/aquynh/capstone/archive/4.0.1.tar.gz
- tar -xf ./4.0.1.tar.gz
- cd ./capstone-4.0.1
- bash ./make.sh
- sudo make install
- cd ../
# Install unicorn. Only test AArch64 with Unicorn on Linux.
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then git clone https://github.com/unicorn-engine/unicorn; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd ./unicorn; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then UNICORN_ARCHS="aarch64" ./make.sh; fi # we use unicorn to only test our aarch64 semantics
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo make install; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd bindings/python; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo ${PYTHON_BINARY} ./setup.py install; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd ../../../; fi
# Install LIEF
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo ${PYTHON_BINARY} -m pip install https://github.com/lief-project/LIEF/releases/download/0.7.0/linux_lief-0.7.0_py${PYTHON_VERSION}.tar.gz; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo python -m pip install https://github.com/lief-project/LIEF/releases/download/0.7.0/osx_lief-0.7.0_py2.7.tar.gz; fi
# Download pin
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget http://software.intel.com/sites/landingpage/pintool/downloads/pin-2.14-71313-gcc.4.4.7-linux.tar.gz; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tar -xf pin-2.14-71313-gcc.4.4.7-linux.tar.gz; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then wget http://software.intel.com/sites/landingpage/pintool/downloads/pin-2.14-71313-clang.4.2-mac.tar.gz; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then tar -xf pin-2.14-71313-clang.4.2-mac.tar.gz; fi
# Move Triton into pin
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mv ./Triton ./pin-2.14-71313-gcc.4.4.7-linux/source/tools/; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd ./pin-2.14-71313-gcc.4.4.7-linux/source/tools/Triton; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mv ./Triton ./pin-2.14-71313-clang.4.2-mac/source/tools/; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cd ./pin-2.14-71313-clang.4.2-mac/source/tools/Triton; fi
install:
# Prepare build
- mkdir build
- cd build
script:
# Needs for unittests
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo sh -c "echo 0 > /proc/sys/kernel/yama/ptrace_scope"; fi
# Install
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cmake -DZ3_INCLUDE_DIRS=$PWD/../${Z3_PKG}/include -DZ3_LIBRARIES=$PWD/../${Z3_PKG}/bin/libz3.so -DCMAKE_C_COMPILER=$C_COMPILER -DCMAKE_CXX_COMPILER=$CXX_COMPILER -DGCOV=${GCOV:OFF} -DPYTHON36=${PYTHON36:OFF} -DPINTOOL=on -DKERNEL4=on ..; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cmake $(echo 'from os.path import abspath, join; from distutils.sysconfig import get_python_inc, get_python_lib; print "-DPYTHON_INCLUDE_DIR=%s -DPYTHON_LIBRARY=%s" % (get_python_inc(), abspath(join(get_python_lib(), "../../libpython2.7.dylib")))' | python) ..; fi
- make -j2
# Unittests
- travis_wait 60 make check
# Check installation succeed
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir -p /Users/travis/Library/Python/2.7/lib/python/site-packages; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/travis/Library/Python/2.7/lib/python/site-packages/homebrew.pth; fi
- sudo make install
after_success:
- if [[ "$GCOV" == "ON" ]]; then bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"; fi