From 75a9e041d6b08c304d526e654d7e7a2ce715e17c Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Thu, 7 Oct 2021 21:13:22 -0400 Subject: [PATCH] Test and officially support LLVM 12 only (#548) * Test and officially support LLVM 12 only * Remove tools that are already included in Docker image --- .github/workflows/ci.yml | 34 ++++++++++++---------------------- Dockerfile | 2 +- README.md | 8 ++++---- scripts/build.sh | 31 ++++++++----------------------- 4 files changed, 25 insertions(+), 50 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83f8cb366..f35a17b6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,15 +25,12 @@ jobs: - { name: 'ubuntu', tag: '18.04' } - { name: 'ubuntu', tag: '20.04' } llvm: [ - '9', - '10', - '11', '12' ] runs-on: ubuntu-20.04 container: - image: docker.pkg.github.com/lifting-bits/cxx-common/vcpkg-builder-${{ matrix.image.name }}:${{ matrix.image.tag }} + image: ghcr.io/lifting-bits/cxx-common/vcpkg-builder-${{ matrix.image.name }}:${{ matrix.image.tag }} credentials: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} @@ -42,12 +39,6 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 - - 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 rpm - name: Build with build script shell: bash @@ -98,10 +89,9 @@ jobs: fail-fast: false matrix: os: [ - 'macos-10.15' + 'macos-11' ] llvm: [ - '11', '12' ] @@ -188,8 +178,8 @@ jobs: zip -r9 remill_ubuntu-20.04_packages.zip \ ubuntu-20.04* - zip -r9 remill_macos-10.15_packages.zip \ - macos-10.15* + zip -r9 remill_macos-11_packages.zip \ + macos-11* - name: Upload the Ubuntu 18.04 packages uses: actions/upload-release-asset@v1 @@ -215,7 +205,7 @@ jobs: asset_name: remill_ubuntu-20.04_packages.zip asset_content_type: application/gzip - - name: Upload the macOS 10.15 packages + - name: Upload the macOS 11 packages uses: actions/upload-release-asset@v1 env: @@ -223,8 +213,8 @@ jobs: with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: remill_macos-10.15_packages.zip - asset_name: remill_macos-10.15_packages.zip + asset_path: remill_macos-11_packages.zip + asset_name: remill_macos-11_packages.zip asset_content_type: application/gzip @@ -232,15 +222,15 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - llvm: ["11"] + llvm: ["12"] ubuntu: ["18.04"] steps: - uses: actions/checkout@v2 - name: Build LLVM ${{ matrix.llvm }} on ${{ matrix.ubuntu }} run: | - docker build . -t docker.pkg.github.com/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 }}-amd64:latest -f Dockerfile --build-arg UBUNTU_VERSION=${{ matrix.ubuntu }} --build-arg ARCH=amd64 --build-arg LLVM_VERSION=${{ matrix.llvm }} - name: Test Docker image run: | - docker run --rm docker.pkg.github.com/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}-amd64:latest --arch amd64 --ir_out /dev/stdout --bytes c704ba01000000 - docker run --rm docker.pkg.github.com/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 docker.pkg.github.com/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 }}-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 diff --git a/Dockerfile b/Dockerfile index 55cfb234e..42dece5f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Choose your LLVM version -ARG LLVM_VERSION=11 +ARG LLVM_VERSION=12 ARG ARCH=amd64 ARG UBUNTU_VERSION=18.04 ARG DISTRO_BASE=ubuntu${UBUNTU_VERSION} diff --git a/README.md b/README.md index c7ed94a2e..0caab6f07 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,8 @@ Most of Remill's dependencies can be provided by the [cxx-common](https://github | [Google Flags](https://github.com/google/glog) | Latest | | [Google Log](https://github.com/google/glog) | Latest | | [Google Test](https://github.com/google/googletest) | Latest | -| [LLVM](http://llvm.org/) | 3.5+ | -| [Clang](http://clang.llvm.org/) | 3.5+ | +| [LLVM](http://llvm.org/) | 12 | +| [Clang](http://clang.llvm.org/) | 12 | | [Intel XED](https://software.intel.com/en-us/articles/xed-x86-encoder-decoder-software-library) | Latest | | [Python](https://www.python.org/) | 2.7 | | Unzip | Latest | @@ -55,7 +55,7 @@ Remill now comes with a Dockerfile for easier testing. This Dockerfile reference The Dockerfile allows for quick builds of multiple supported LLVM, architecture, and Linux configurations. -Quickstart (builds Remill against LLVM 11 on Ubuntu 18.04 for AMD64): +Quickstart (builds Remill against LLVM 12 on Ubuntu 18.04 for AMD64): Clone Remill: ```shell @@ -71,7 +71,7 @@ docker build . -t remill \ -f Dockerfile \ --build-arg UBUNTU_VERSION=18.04 \ --build-arg ARCH=amd64 \ - --build-arg LLVM_VERSION=11 + --build-arg LLVM_VERSION=12 ``` Ensure remill works: diff --git a/scripts/build.sh b/scripts/build.sh index 7e0e05a7a..5054053b0 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -23,11 +23,11 @@ DOWNLOAD_DIR="$( cd "$( dirname "${SRC_DIR}" )" && pwd )/lifting-bits-downloads" CURR_DIR=$( pwd ) BUILD_DIR="${CURR_DIR}/remill-build" INSTALL_DIR=/usr/local -LLVM_VERSION=llvm-11 +LLVM_VERSION=llvm-12 OS_VERSION= ARCH_VERSION= BUILD_FLAGS= -CXX_COMMON_VERSION="v0.1.4" +CXX_COMMON_VERSION="v0.1.5" # There are pre-build versions of various libraries for specific # Ubuntu releases. @@ -172,16 +172,13 @@ function DownloadLibraries #BUILD_FLAGS="${BUILD_FLAGS} -DCMAKE_OSX_SYSROOT=${sdk_root}" # Min version supported - OS_VERSION="macos-10.15" + OS_VERSION="macos-11" # Hard-coded to match pre-built binaries in CI - XCODE_VERSION="12.4" - if [[ "$(sw_vers -productVersion)" == "10.15"* ]]; then - echo "Found MacOS Catalina" - OS_VERSION="macos-10.15" - elif [[ "$(sw_vers -productVersion)" == "11."* ]]; then + XCODE_VERSION="13.0" + if [[ "$(sw_vers -productVersion)" == "11."* ]]; then echo "Found MacOS Big Sur" # Uses 10.15 binaries - OS_VERSION="macos-10.15" + OS_VERSION="macos-11" else echo "WARNING: ****Likely unsupported MacOS Version****" echo "WARNING: ****Using ${OS_VERSION}****" @@ -289,25 +286,13 @@ function Package function GetLLVMVersion { case ${1} in - 9) - LLVM_VERSION=llvm-9 - return 0 - ;; - 10) - LLVM_VERSION=llvm-10 - return 0 - ;; - 11) - LLVM_VERSION=llvm-11 - return 0 - ;; 12) LLVM_VERSION=llvm-12 return 0 ;; *) # unknown option - echo "[x] Unknown LLVM version ${1}. You may be able to manually build it with cxx-common." + echo "[x] Unknown or unsupported LLVM version ${1}. You may be able to manually build it with cxx-common." return 1 ;; esac @@ -320,7 +305,7 @@ function Help echo "" echo "Options:" echo " --prefix Change the default (${INSTALL_DIR}) installation prefix." - echo " --llvm-version Change the default (9) LLVM version." + echo " --llvm-version Change the default (12) LLVM version." echo " --build-dir Change the default (${BUILD_DIR}) build directory." echo " --debug Build with Debug symbols." echo " --extra-cmake-args Extra CMake arguments to build with."