Skip to content
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.

Commit

Permalink
Support vcpkg build system (#717)
Browse files Browse the repository at this point in the history
First step towards transitioning away from cxx-common's `pkgman.py` dependency management system towards compatibility with and use of vcpkg (https://github.com/microsoft/vcpkg) to manage dependencies.

This commit attempts to support both the new and old build systems until we can phase out the old completely.

Please see the updated remill, anvill, and trailofbits/cxx-common repositories to learn how to fetch the required dependencies.
  • Loading branch information
ekilmer authored Dec 11, 2020
1 parent 5dec010 commit 24db01c
Show file tree
Hide file tree
Showing 6 changed files with 482 additions and 5 deletions.
113 changes: 113 additions & 0 deletions .github/workflows/vcpkg_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: VCPKG Continuous Integration
on:
push:
branches:
- master
pull_request:
schedule:
# run CI every day even if no PRs/merges occur
- cron: '0 6 * * *'

jobs:
build_linux:
strategy:
fail-fast: false
matrix:
image:
- { name: 'ubuntu', tag: '18.04' }
- { name: 'ubuntu', tag: '20.04' }
llvm: [
'9',
'10'
]

runs-on: ubuntu-20.04
container:
image: docker.pkg.github.com/trailofbits/cxx-common/vcpkg-builder-${{ matrix.image.name }}:${{ matrix.image.tag }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2
- name: Install utility tools
shell: bash
run: |
# TODO some of these should probably live in the Docker build image
apt-get update
apt-get install -y pixz xz-utils make
- name: Build and install remill
shell: bash
run: |
# Change to master after testing
git clone --depth=1 --branch master https://github.com/lifting-bits/remill.git
cd remill
./scripts/build.sh --llvm-version ${{ matrix.llvm }}
cmake --build remill-build --target install -- -j "$(nproc)"
- name: Build and install anvill
shell: bash
run: |
# Change to master after testing
git clone --depth=1 --branch master https://github.com/lifting-bits/anvill.git
mkdir -p anvill/build && cd anvill/build
cmake -DCMAKE_VERBOSE_MAKEFILE=ON ..
cmake --build . --target install -- -j "$(nproc)"
- name: Build mcsema
shell: bash
run: |
mkdir build && cd build
cmake -DCMAKE_VERBOSE_MAKEFILE=ON ..
cmake --build . --target install -- -j "$(nproc)"
- name: Smoke Test
shell: bash
run: |
# --help return non-zero and fails...
mcsema-lift-${{ matrix.llvm }}.0 --version
mcsema-disass-2 --help
build_mac:
strategy:
fail-fast: false
matrix:
os: [
'macos-10.15',
'macos-11.0'
]
llvm: [
'9',
'10'
]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Build and install remill
shell: bash
run: |
# Change to master after testing
git clone --depth=1 --branch master https://github.com/lifting-bits/remill.git
cd remill
./scripts/build.sh --llvm-version ${{ matrix.llvm }}
cmake --build remill-build --target install -- -j "$(sysctl -n hw.logicalcpu)"
- name: Build and install anvill
shell: bash
run: |
# Change to master after testing
git clone --depth=1 --branch master https://github.com/lifting-bits/anvill.git
mkdir -p anvill/build && cd anvill/build
cmake -DCMAKE_VERBOSE_MAKEFILE=ON ..
cmake --build . --target install -- -j "$(sysctl -n hw.logicalcpu)"
- name: Build mcsema
shell: bash
run: |
mkdir build && cd build
cmake -DCMAKE_VERBOSE_MAKEFILE=ON ..
cmake --build . --target install -- -j "$(sysctl -n hw.logicalcpu)"
- name: Smoke Test
shell: bash
run: |
# --help return non-zero and fails...
mcsema-lift-${{ matrix.llvm }}.0 --version
mcsema-disass-2 --help
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

if (NOT DEFINED ENV{TRAILOFBITS_LIBRARIES})
message(STATUS "Using new vcpkg build system")
include(CMakeLists_vcpkg.txt)
return()
endif()

project(mcsema)
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.14)

# remill
if("${PLATFORM_NAME}" STREQUAL "windows")
Expand Down
Loading

0 comments on commit 24db01c

Please sign in to comment.