Skip to content

Commit

Permalink
Add 'build-scripts/' from commit '02ab036a5bc9ec5981470998b68ceef1a47…
Browse files Browse the repository at this point in the history
…6b320'

git-subtree-dir: build-scripts
git-subtree-mainline: 7fcb45c
git-subtree-split: 02ab036
  • Loading branch information
vitaly-cyberhaven committed Jan 7, 2020
2 parents 7fcb45c + 02ab036 commit baee4d9
Show file tree
Hide file tree
Showing 19 changed files with 2,916 additions and 0 deletions.
94 changes: 94 additions & 0 deletions build-scripts/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, foreach2, Q_FOREACH, BOOST_FOREACH, QLIST_FOREACH, QTAILQ_FOREACH ]
IncludeCategories:
- Regex: '^(<|"s2e/)'
Priority: 1
- Regex: '^(<|"(llvm|klee)/)'
Priority: 2
- Regex: '.*'
Priority: 3
IncludeIsMainRegex: '$'
IndentCaseLabels: true
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never
...
3 changes: 3 additions & 0 deletions build-scripts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
s2e
s2e-env
*.pyc
71 changes: 71 additions & 0 deletions build-scripts/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Copyright (C) 2017-2019, Cyberhaven
# All rights reserved.
#
# Licensed under the Cyberhaven Research License Agreement.

# Installs S2E and its associated libraries and tools to /opt/s2e

FROM ubuntu:18.04

# Use local mirrors if possible
RUN sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt xenial main restricted' /etc/apt/sources.list && \
sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt xenial-updates main restricted' /etc/apt/sources.list && \
sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt xenial-security main restricted' /etc/apt/sources.list

# Install build dependencies
RUN dpkg --add-architecture i386 && apt-get update && \
apt-get -y install build-essential cmake wget texinfo flex bison \
python-dev mingw-w64 lsb-release

# Install S2E dependencies
RUN apt-get update && apt-get -y install libdwarf-dev libelf-dev libelf-dev:i386 \
libboost-dev zlib1g-dev libjemalloc-dev nasm pkg-config \
libmemcached-dev libpq-dev libc6-dev-i386 binutils-dev \
libboost-system-dev libboost-serialization-dev libboost-regex-dev \
libbsd-dev libpixman-1-dev \
libglib2.0-dev libglib2.0-dev:i386 python-docutils libpng12-dev gcc-multilib g++-multilib

# Install S2E git
RUN apt-get -y install git

# Build LLVM first (to avoid rebuilding it for every change)
RUN mkdir s2e
RUN mkdir s2e-build
COPY build-scripts/Makefile s2e/
COPY build-scripts/determine_clang_binary_suffix.py s2e/
RUN cd s2e-build && \
make -f ../s2e/Makefile S2E_PREFIX=/opt/s2e stamps/clang-binary

RUN cd s2e-build && \
make -f ../s2e/Makefile S2E_PREFIX=/opt/s2e stamps/llvm-release-make

# Build S2E dependencies
RUN cd s2e-build && \
make -f ../s2e/Makefile S2E_PREFIX=/opt/s2e stamps/soci-make

RUN cd s2e-build && \
make -f ../s2e/Makefile S2E_PREFIX=/opt/s2e stamps/z3-make

RUN cd s2e-build && \
make -f ../s2e/Makefile S2E_PREFIX=/opt/s2e stamps/protobuf-make

RUN cd s2e-build && \
make -f ../s2e/Makefile S2E_PREFIX=/opt/s2e stamps/libdwarf-make

RUN cd s2e-build && \
make -f ../s2e/Makefile S2E_PREFIX=/opt/s2e stamps/rapidjson-make

# Make the S2E codebase available in the container
COPY . s2e/

# Build and install everything else
RUN cd s2e-build && \
make -f ../s2e/Makefile S2E_PREFIX=/opt/s2e install

# Install s2e-env
RUN apt-get -y install python-pip && \
cd s2e/s2e-env && \
pip install --process-dependency-links .

# Don't keep sources and build files
RUN rm -rf s2e-build s2e
39 changes: 39 additions & 0 deletions build-scripts/Dockerfile.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright (C) 2017-2019, Cyberhaven
# All rights reserved.
#
# Licensed under the Cyberhaven Research License Agreement.

FROM ubuntu:18.04
MAINTAINER Vitaly Chipounov <vitaly@cyberhaven.io>

RUN sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt xenial main restricted' /etc/apt/sources.list && \
sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt xenial-updates main restricted' /etc/apt/sources.list && \
sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt xenial-security main restricted' /etc/apt/sources.list

# i386 packages are required by IDA Pro, they are included here for convenience.
# You must provide your own copy of IDA Pro.
RUN dpkg --add-architecture i386 && apt-get update

RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
git netcat nano apport psmisc vim p7zip-full unzip \
python python-dev python-pip python-virtualenv \
wget libsvn1 libcurl3 gdb python2.7-dbg libssl-dev \
libstdc++6:i386 libpython2.7:i386 lib32ncurses5 lib32ncurses5-dev \
libncurses5-dev libx32ncurses5-dev libncurses5-dev:i386 \
libxml2-dev libicu-dev libxslt1-dev libffi-dev \
lsof psmisc libboost-system1.65.1 libboost-serialization1.65.1 libboost-regex1.65.1 \
libmemcached11 libgettextpo0 libelf1 libelf1:i386 libjemalloc1 \
libpcre3 libpcre3-dev libpcre3:i386 \
liblua5.1-0 liblua5.2-0 libsigc++-2.0-dev jq libpng12-0 \
python-yaml python-matplotlib python-lxml python-pip sudo && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
libc6-dev-i386 lib32stdc++-4.8-dev time \
$(apt-cache depends qemu-system-x86 | grep Depends | \
sed "s/.*ends:\ //" | grep -v '<' | tr '\n' ' ')

# Copy pre-compiled S2E files
COPY s2e /opt/s2e

# Install s2e-env
COPY s2e-env /s2e-env
RUN cd /s2e-env && pip install --process-dependency-links .
Loading

0 comments on commit baee4d9

Please sign in to comment.