From 9e84cfb886ee64a8f941da4d0f485191e1041714 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Mon, 8 Jan 2024 13:08:00 -0500 Subject: [PATCH 1/7] Update Dockerfile base image --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index aa436e530..48cc97f56 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ FROM ${BUILD_BASE} as base # Build-time dependencies go here # See here for full list of those dependencies # https://github.com/lifting-bits/cxx-common/blob/master/docker/Dockerfile.ubuntu.vcpkg -FROM trailofbits/cxx-common-vcpkg-builder-ubuntu:${UBUNTU_VERSION} as deps +FROM ghcr.io/lifting-bits/cxx-common/vcpkg-builder-ubuntu-${UBUNTU_VERSION}:pr-1045 as deps ARG UBUNTU_VERSION ARG ARCH ARG LLVM_VERSION From 1bf17dcfc1e8dffcdbaf6dfd0b186de68641d6df Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Tue, 9 Jan 2024 15:15:33 -0500 Subject: [PATCH 2/7] Change Docker name and ignore tests on aarch64 * The Docker image name for the builder has changed again for testing purposes. * Ignore test results when building Docker image on non-x86_64 architectures --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 48cc97f56..4346e53fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ FROM ${BUILD_BASE} as base # Build-time dependencies go here # See here for full list of those dependencies # https://github.com/lifting-bits/cxx-common/blob/master/docker/Dockerfile.ubuntu.vcpkg -FROM ghcr.io/lifting-bits/cxx-common/vcpkg-builder-ubuntu-${UBUNTU_VERSION}:pr-1045 as deps +FROM ghcr.io/lifting-bits/cxx-common/vcpkg-builder-ubuntu:test-ekilmer_multi-arch-docker-base-${UBUNTU_VERSION} as deps ARG UBUNTU_VERSION ARG ARCH ARG LLVM_VERSION @@ -41,9 +41,10 @@ RUN ./scripts/build.sh \ RUN pip3 install ./scripts/diff_tester_export_insns +# NOTE: At time of writing, tests only pass on x86_64 architecture RUN cd remill-build && \ cmake --build . --target test_dependencies -- -j $(nproc) && \ - CTEST_OUTPUT_ON_FAILURE=1 cmake --build . --verbose --target test -- -j $(nproc) && \ + CTEST_OUTPUT_ON_FAILURE=1 cmake --build . --verbose --target test -- -j $(nproc) || [ "$(uname -m)" != "x86_64" ] && \ cmake --build . --target install # Small installation image From a200a88c7d2389247674098e962948d97185950c Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Tue, 9 Jan 2024 16:36:57 -0500 Subject: [PATCH 3/7] Typo: Add "-v2" --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4346e53fb..8f066f91a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ FROM ${BUILD_BASE} as base # Build-time dependencies go here # See here for full list of those dependencies # https://github.com/lifting-bits/cxx-common/blob/master/docker/Dockerfile.ubuntu.vcpkg -FROM ghcr.io/lifting-bits/cxx-common/vcpkg-builder-ubuntu:test-ekilmer_multi-arch-docker-base-${UBUNTU_VERSION} as deps +FROM ghcr.io/lifting-bits/cxx-common/vcpkg-builder-ubuntu-v2:test-ekilmer_multi-arch-docker-base-${UBUNTU_VERSION} as deps ARG UBUNTU_VERSION ARG ARCH ARG LLVM_VERSION From 04ff15e90e925e787d036baa699f71861bc9f4bd Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Wed, 10 Jan 2024 09:19:16 -0500 Subject: [PATCH 4/7] Use Dockerfile built by cxx-common 'master' branch --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8f066f91a..36a7687fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ FROM ${BUILD_BASE} as base # Build-time dependencies go here # See here for full list of those dependencies # https://github.com/lifting-bits/cxx-common/blob/master/docker/Dockerfile.ubuntu.vcpkg -FROM ghcr.io/lifting-bits/cxx-common/vcpkg-builder-ubuntu-v2:test-ekilmer_multi-arch-docker-base-${UBUNTU_VERSION} as deps +FROM ghcr.io/lifting-bits/cxx-common/vcpkg-builder-ubuntu-v2:${UBUNTU_VERSION} as deps ARG UBUNTU_VERSION ARG ARCH ARG LLVM_VERSION From 91b0f6a0bfc358c1ce60dba1b9fccb9565c7a180 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Wed, 10 Jan 2024 09:21:36 -0500 Subject: [PATCH 5/7] Remove unused ARCH arg in Dockerfile --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 36a7687fd..e58bf4153 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,5 @@ # Choose your LLVM version ARG LLVM_VERSION=17 -ARG ARCH=amd64 ARG UBUNTU_VERSION=22.04 ARG DISTRO_BASE=ubuntu${UBUNTU_VERSION} ARG BUILD_BASE=ubuntu:${UBUNTU_VERSION} @@ -15,7 +14,6 @@ FROM ${BUILD_BASE} as base # https://github.com/lifting-bits/cxx-common/blob/master/docker/Dockerfile.ubuntu.vcpkg FROM ghcr.io/lifting-bits/cxx-common/vcpkg-builder-ubuntu-v2:${UBUNTU_VERSION} as deps ARG UBUNTU_VERSION -ARG ARCH ARG LLVM_VERSION ARG LIBRARIES From 1152d770b6c6b8b4ccccb067636cc25d14de948e Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Fri, 12 Jan 2024 09:58:39 -0500 Subject: [PATCH 6/7] Update Docker image CI job We don't publish these images, but: - Remove architecture indicator - Remove ARCH build arg --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e6629621..32c09f4c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -265,9 +265,9 @@ jobs: - uses: actions/checkout@v2 - name: Build LLVM ${{ matrix.llvm }} on ${{ matrix.ubuntu }} run: | - docker build . -t ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}-amd64:latest -f Dockerfile --build-arg UBUNTU_VERSION=${{ matrix.ubuntu }} --build-arg ARCH=amd64 --build-arg LLVM_VERSION=${{ matrix.llvm }} + docker build . -t ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}:latest -f Dockerfile --build-arg UBUNTU_VERSION=${{ matrix.ubuntu }} --build-arg LLVM_VERSION=${{ matrix.llvm }} - name: Test Docker image run: | - docker run --rm ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}-amd64:latest --arch amd64 --ir_out /dev/stdout --bytes c704ba01000000 - docker run --rm ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}-amd64:latest --arch aarch64 --ir_out /dev/stdout --address 0x400544 --bytes FD7BBFA90000009000601891FD030091B7FFFF97E0031F2AFD7BC1A8C0035FD6 - docker run --rm ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}-amd64:latest --arch aarch32 -ir_out /dev/stderr --bytes 0cd04de208008de504108de500208de508309de504009de500109de5903122e0c20fa0e110109fe5001091e5002081e5040081e50cd08de21eff2fe14000000000000000 + docker run --rm ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}:latest --arch amd64 --ir_out /dev/stdout --bytes c704ba01000000 + docker run --rm ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}:latest --arch aarch64 --ir_out /dev/stdout --address 0x400544 --bytes FD7BBFA90000009000601891FD030091B7FFFF97E0031F2AFD7BC1A8C0035FD6 + docker run --rm ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}:latest --arch aarch32 -ir_out /dev/stderr --bytes 0cd04de208008de504108de500208de508309de504009de500109de5903122e0c20fa0e110109fe5001091e5002081e5040081e50cd08de21eff2fe14000000000000000 From e101b23c97f9fade98ab5bda3e53dba09b4bb492 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Fri, 12 Jan 2024 10:09:11 -0500 Subject: [PATCH 7/7] Update Docker info in README --- README.md | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c3c4b86bb..a18532643 100644 --- a/README.md +++ b/README.md @@ -56,34 +56,41 @@ Most of Remill's dependencies can be provided by the [cxx-common](https://github Remill now comes with a Dockerfile for easier testing. This Dockerfile references the [cxx-common](https://github.com/lifting-bits/cxx-common) container to have all pre-requisite libraries available. -The Dockerfile allows for quick builds of multiple supported LLVM, architecture, and Linux configurations. +The Dockerfile allows for quick builds of multiple supported LLVM, and Ubuntu configurations. -Quickstart (builds Remill against LLVM 16 on Ubuntu 22.04 for AMD64): +> [!IMPORTANT] +> Not all LLVM and Ubuntu configurations are supported---Please refer to the CI results to get an idea about configurations that are tested and supported. The Docker image should build on both x86_64 and ARM64, but we only test x86_64 in CI. ARM64 _should build_, but if it doesn't, please open an issue. + +Quickstart (builds Remill against LLVM 17 on Ubuntu 22.04). Clone Remill: + ```shell -#Clone the repository. git clone https://github.com/lifting-bits/remill.git cd remill ``` Build Remill Docker container: + ```shell -# do the build docker build . -t remill \ -f Dockerfile \ --build-arg UBUNTU_VERSION=22.04 \ - --build-arg ARCH=amd64 \ - --build-arg LLVM_VERSION=16 + --build-arg LLVM_VERSION=17 ``` Ensure remill works: + +Decode some AMD64 instructions to LLVM: + ```shell -# Decode some AMD64 instructions to LLVM docker run --rm -it remill \ --arch amd64 --ir_out /dev/stdout --bytes c704ba01000000 +``` -# Decode some AArch64 instructions to LLVM +Decode some AArch64 instructions to LLVM: + +```shell docker run --rm -it remill \ --arch aarch64 --address 0x400544 --ir_out /dev/stdout \ --bytes FD7BBFA90000009000601891FD030091B7FFFF97E0031F2AFD7BC1A8C0035FD6