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 diff --git a/Dockerfile b/Dockerfile index aa436e530..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} @@ -13,9 +12,8 @@ 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-v2:${UBUNTU_VERSION} as deps ARG UBUNTU_VERSION -ARG ARCH ARG LLVM_VERSION ARG LIBRARIES @@ -41,9 +39,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 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