Skip to content

Commit baee4d9

Browse files
Add 'build-scripts/' from commit '02ab036a5bc9ec5981470998b68ceef1a476b320'
git-subtree-dir: build-scripts git-subtree-mainline: 7fcb45c git-subtree-split: 02ab036
2 parents 7fcb45c + 02ab036 commit baee4d9

19 files changed

+2916
-0
lines changed

build-scripts/.clang-format

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
Language: Cpp
3+
# BasedOnStyle: LLVM
4+
AccessModifierOffset: -4
5+
AlignAfterOpenBracket: Align
6+
AlignConsecutiveAssignments: false
7+
AlignConsecutiveDeclarations: false
8+
AlignEscapedNewlinesLeft: true
9+
AlignOperands: true
10+
AlignTrailingComments: true
11+
AllowAllParametersOfDeclarationOnNextLine: true
12+
AllowShortBlocksOnASingleLine: false
13+
AllowShortCaseLabelsOnASingleLine: false
14+
AllowShortFunctionsOnASingleLine: false
15+
AllowShortIfStatementsOnASingleLine: false
16+
AllowShortLoopsOnASingleLine: false
17+
AlwaysBreakAfterDefinitionReturnType: None
18+
AlwaysBreakAfterReturnType: None
19+
AlwaysBreakBeforeMultilineStrings: false
20+
AlwaysBreakTemplateDeclarations: false
21+
BinPackArguments: true
22+
BinPackParameters: true
23+
BraceWrapping:
24+
AfterClass: false
25+
AfterControlStatement: false
26+
AfterEnum: false
27+
AfterFunction: false
28+
AfterNamespace: false
29+
AfterObjCDeclaration: false
30+
AfterStruct: false
31+
AfterUnion: false
32+
BeforeCatch: false
33+
BeforeElse: false
34+
IndentBraces: false
35+
BreakBeforeBinaryOperators: None
36+
BreakBeforeBraces: Custom
37+
BreakBeforeTernaryOperators: true
38+
BreakConstructorInitializersBeforeComma: false
39+
BreakAfterJavaFieldAnnotations: false
40+
BreakStringLiterals: true
41+
ColumnLimit: 120
42+
CommentPragmas: '^ IWYU pragma:'
43+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
44+
ConstructorInitializerIndentWidth: 4
45+
ContinuationIndentWidth: 4
46+
Cpp11BracedListStyle: true
47+
DerivePointerAlignment: false
48+
DisableFormat: false
49+
ExperimentalAutoDetectBinPacking: false
50+
ForEachMacros: [ foreach, foreach2, Q_FOREACH, BOOST_FOREACH, QLIST_FOREACH, QTAILQ_FOREACH ]
51+
IncludeCategories:
52+
- Regex: '^(<|"s2e/)'
53+
Priority: 1
54+
- Regex: '^(<|"(llvm|klee)/)'
55+
Priority: 2
56+
- Regex: '.*'
57+
Priority: 3
58+
IncludeIsMainRegex: '$'
59+
IndentCaseLabels: true
60+
IndentWidth: 4
61+
IndentWrappedFunctionNames: false
62+
JavaScriptQuotes: Leave
63+
JavaScriptWrapImports: true
64+
KeepEmptyLinesAtTheStartOfBlocks: true
65+
MacroBlockBegin: ''
66+
MacroBlockEnd: ''
67+
MaxEmptyLinesToKeep: 1
68+
NamespaceIndentation: None
69+
ObjCBlockIndentWidth: 4
70+
ObjCSpaceAfterProperty: false
71+
ObjCSpaceBeforeProtocolList: true
72+
PenaltyBreakBeforeFirstCallParameter: 19
73+
PenaltyBreakComment: 300
74+
PenaltyBreakFirstLessLess: 120
75+
PenaltyBreakString: 1000
76+
PenaltyExcessCharacter: 1000000
77+
PenaltyReturnTypeOnItsOwnLine: 60
78+
PointerAlignment: Right
79+
ReflowComments: true
80+
SortIncludes: true
81+
SpaceAfterCStyleCast: true
82+
SpaceBeforeAssignmentOperators: true
83+
SpaceBeforeParens: ControlStatements
84+
SpaceInEmptyParentheses: false
85+
SpacesBeforeTrailingComments: 1
86+
SpacesInAngles: false
87+
SpacesInContainerLiterals: true
88+
SpacesInCStyleCastParentheses: false
89+
SpacesInParentheses: false
90+
SpacesInSquareBrackets: false
91+
Standard: Cpp11
92+
TabWidth: 8
93+
UseTab: Never
94+
...

build-scripts/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
s2e
2+
s2e-env
3+
*.pyc

build-scripts/Dockerfile

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Copyright (C) 2017-2019, Cyberhaven
2+
# All rights reserved.
3+
#
4+
# Licensed under the Cyberhaven Research License Agreement.
5+
6+
# Installs S2E and its associated libraries and tools to /opt/s2e
7+
8+
FROM ubuntu:18.04
9+
10+
# Use local mirrors if possible
11+
RUN sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt xenial main restricted' /etc/apt/sources.list && \
12+
sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt xenial-updates main restricted' /etc/apt/sources.list && \
13+
sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt xenial-security main restricted' /etc/apt/sources.list
14+
15+
# Install build dependencies
16+
RUN dpkg --add-architecture i386 && apt-get update && \
17+
apt-get -y install build-essential cmake wget texinfo flex bison \
18+
python-dev mingw-w64 lsb-release
19+
20+
# Install S2E dependencies
21+
RUN apt-get update && apt-get -y install libdwarf-dev libelf-dev libelf-dev:i386 \
22+
libboost-dev zlib1g-dev libjemalloc-dev nasm pkg-config \
23+
libmemcached-dev libpq-dev libc6-dev-i386 binutils-dev \
24+
libboost-system-dev libboost-serialization-dev libboost-regex-dev \
25+
libbsd-dev libpixman-1-dev \
26+
libglib2.0-dev libglib2.0-dev:i386 python-docutils libpng12-dev gcc-multilib g++-multilib
27+
28+
# Install S2E git
29+
RUN apt-get -y install git
30+
31+
# Build LLVM first (to avoid rebuilding it for every change)
32+
RUN mkdir s2e
33+
RUN mkdir s2e-build
34+
COPY build-scripts/Makefile s2e/
35+
COPY build-scripts/determine_clang_binary_suffix.py s2e/
36+
RUN cd s2e-build && \
37+
make -f ../s2e/Makefile S2E_PREFIX=/opt/s2e stamps/clang-binary
38+
39+
RUN cd s2e-build && \
40+
make -f ../s2e/Makefile S2E_PREFIX=/opt/s2e stamps/llvm-release-make
41+
42+
# Build S2E dependencies
43+
RUN cd s2e-build && \
44+
make -f ../s2e/Makefile S2E_PREFIX=/opt/s2e stamps/soci-make
45+
46+
RUN cd s2e-build && \
47+
make -f ../s2e/Makefile S2E_PREFIX=/opt/s2e stamps/z3-make
48+
49+
RUN cd s2e-build && \
50+
make -f ../s2e/Makefile S2E_PREFIX=/opt/s2e stamps/protobuf-make
51+
52+
RUN cd s2e-build && \
53+
make -f ../s2e/Makefile S2E_PREFIX=/opt/s2e stamps/libdwarf-make
54+
55+
RUN cd s2e-build && \
56+
make -f ../s2e/Makefile S2E_PREFIX=/opt/s2e stamps/rapidjson-make
57+
58+
# Make the S2E codebase available in the container
59+
COPY . s2e/
60+
61+
# Build and install everything else
62+
RUN cd s2e-build && \
63+
make -f ../s2e/Makefile S2E_PREFIX=/opt/s2e install
64+
65+
# Install s2e-env
66+
RUN apt-get -y install python-pip && \
67+
cd s2e/s2e-env && \
68+
pip install --process-dependency-links .
69+
70+
# Don't keep sources and build files
71+
RUN rm -rf s2e-build s2e

build-scripts/Dockerfile.dist

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright (C) 2017-2019, Cyberhaven
2+
# All rights reserved.
3+
#
4+
# Licensed under the Cyberhaven Research License Agreement.
5+
6+
FROM ubuntu:18.04
7+
MAINTAINER Vitaly Chipounov <[email protected]>
8+
9+
RUN sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt xenial main restricted' /etc/apt/sources.list && \
10+
sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt xenial-updates main restricted' /etc/apt/sources.list && \
11+
sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt xenial-security main restricted' /etc/apt/sources.list
12+
13+
# i386 packages are required by IDA Pro, they are included here for convenience.
14+
# You must provide your own copy of IDA Pro.
15+
RUN dpkg --add-architecture i386 && apt-get update
16+
17+
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
18+
git netcat nano apport psmisc vim p7zip-full unzip \
19+
python python-dev python-pip python-virtualenv \
20+
wget libsvn1 libcurl3 gdb python2.7-dbg libssl-dev \
21+
libstdc++6:i386 libpython2.7:i386 lib32ncurses5 lib32ncurses5-dev \
22+
libncurses5-dev libx32ncurses5-dev libncurses5-dev:i386 \
23+
libxml2-dev libicu-dev libxslt1-dev libffi-dev \
24+
lsof psmisc libboost-system1.65.1 libboost-serialization1.65.1 libboost-regex1.65.1 \
25+
libmemcached11 libgettextpo0 libelf1 libelf1:i386 libjemalloc1 \
26+
libpcre3 libpcre3-dev libpcre3:i386 \
27+
liblua5.1-0 liblua5.2-0 libsigc++-2.0-dev jq libpng12-0 \
28+
python-yaml python-matplotlib python-lxml python-pip sudo && \
29+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
30+
libc6-dev-i386 lib32stdc++-4.8-dev time \
31+
$(apt-cache depends qemu-system-x86 | grep Depends | \
32+
sed "s/.*ends:\ //" | grep -v '<' | tr '\n' ' ')
33+
34+
# Copy pre-compiled S2E files
35+
COPY s2e /opt/s2e
36+
37+
# Install s2e-env
38+
COPY s2e-env /s2e-env
39+
RUN cd /s2e-env && pip install --process-dependency-links .

0 commit comments

Comments
 (0)