Skip to content

Commit

Permalink
Test and officially support LLVM 12 only (#548)
Browse files Browse the repository at this point in the history
* Test and officially support LLVM 12 only

* Remove tools that are already included in Docker image
  • Loading branch information
ekilmer authored Oct 8, 2021
1 parent f5c630a commit 75a9e04
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 50 deletions.
34 changes: 12 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand Down Expand Up @@ -98,10 +89,9 @@ jobs:
fail-fast: false
matrix:
os: [
'macos-10.15'
'macos-11'
]
llvm: [
'11',
'12'
]

Expand Down Expand Up @@ -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
Expand All @@ -215,32 +205,32 @@ 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:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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


Docker_Linux:
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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}
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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
Expand All @@ -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:
Expand Down
31 changes: 8 additions & 23 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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}****"
Expand Down Expand Up @@ -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
Expand All @@ -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."
Expand Down

0 comments on commit 75a9e04

Please sign in to comment.