Skip to content

Commit

Permalink
Update sleigh to 10.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ekilmer committed Nov 16, 2022
1 parent 50c2c77 commit 5b8a674
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:

env:
LIEF_VERSION: 0.12.3
SLEIGH_VERSION: 10.2.2

jobs:
coverage:
Expand All @@ -28,7 +29,7 @@ jobs:
run: |
sudo apt-get install libgmp-dev python3-dev libz3-dev
wget -O - -c https://github.com/lief-project/LIEF/releases/download/$LIEF_VERSION/LIEF-$LIEF_VERSION-Linux-x86_64.tar.gz | sudo tar xz -C /usr/local --strip-components=1
wget -O - -c https://github.com/lifting-bits/sleigh/releases/download/v10.1.2-2/Linux-sleigh-10.1.2-2.x86_64.tar.gz | sudo tar xz -C /usr/local --strip-components=1
wget -O - -c https://github.com/lifting-bits/sleigh/releases/download/v$SLEIGH_VERSION/Linux-sleigh-$SLEIGH_VERSION-1.x86_64.tar.gz | sudo tar xz -C /usr/local --strip-components=1
- name: Install LCov
run: sudo apt-get update -q
Expand Down Expand Up @@ -69,7 +70,7 @@ jobs:
# LIEF
wget -O- https://github.com/lief-project/LIEF/releases/download/$LIEF_VERSION/LIEF-$LIEF_VERSION-Linux-x86_64.tar.gz | sudo tar xz -C /usr/local --strip-components=1
# Sleigh
wget -O- https://github.com/lifting-bits/sleigh/releases/download/v10.1.2-2/Linux-sleigh-10.1.2-2.x86_64.tar.gz | sudo tar xz -C /usr/local --strip-components=1
wget -O- https://github.com/lifting-bits/sleigh/releases/download/v$SLEIGH_VERSION/Linux-sleigh-$SLEIGH_VERSION-1.x86_64.tar.gz | sudo tar xz -C /usr/local --strip-components=1
# Z3 Ubuntu 20.04 package doesn't play nice with sanitizers
# (also remove top-level directory from zip)
wget -O z3.zip https://github.com/Z3Prover/z3/releases/download/z3-4.8.14/z3-4.8.14-x64-glibc-2.31.zip
Expand Down Expand Up @@ -131,15 +132,15 @@ jobs:
sudo apt-get install libgmp-dev python3-dev libz3-dev
python3 -m pip install pytest
wget -O - -c https://github.com/lief-project/LIEF/releases/download/$LIEF_VERSION/LIEF-$LIEF_VERSION-Linux-x86_64.tar.gz | sudo tar xz -C /usr/local --strip-components=1
wget -O - -c https://github.com/lifting-bits/sleigh/releases/download/v10.1.2-2/Linux-sleigh-10.1.2-2.x86_64.tar.gz | sudo tar xz -C /usr/local --strip-components=1
wget -O - -c https://github.com/lifting-bits/sleigh/releases/download/v$SLEIGH_VERSION/Linux-sleigh-$SLEIGH_VERSION-1.x86_64.tar.gz | sudo tar xz -C /usr/local --strip-components=1
- name: Install Dependencies
if: matrix.os == 'macos'
run: |
brew install gmp python3 z3
python3 -m pip install pytest
wget -O - -c https://github.com/lief-project/LIEF/releases/download/$LIEF_VERSION/LIEF-$LIEF_VERSION-Darwin-x86_64.tar.gz | sudo tar xz -C /usr/local --strip-components=1
wget -O - -c https://github.com/lifting-bits/sleigh/releases/download/v10.1.2-2/macOS-sleigh-10.1.2-2.x86_64.tar.gz | sudo tar xz -C /usr/local --strip-components=1
wget -O - -c https://github.com/lifting-bits/sleigh/releases/download/v$SLEIGH_VERSION/macOS-sleigh-$SLEIGH_VERSION-1.x86_64.tar.gz | sudo tar xz -C /usr/local --strip-components=1
- name: Configure
run: cmake --preset=ci-${{ matrix.os }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:

env:
LIEF_VERSION: 0.12.3
SLEIGH_VERSION: 10.2.2

jobs:

Expand Down Expand Up @@ -125,7 +126,7 @@ jobs:
cmake --build z3/build "-j$(sysctl -n hw.logicalcpu)" && cmake --install z3/build --prefix "${{ github.workspace }}/arm64-cross"
# Native sleigh for running the sleigh compiler
wget -O - -c https://github.com/lifting-bits/sleigh/releases/download/v10.1.2-2/macOS-sleigh-10.1.2-2.x86_64.tar.gz | sudo tar xz -C /usr/local --strip-components=1
wget -O - -c https://github.com/lifting-bits/sleigh/releases/download/v$SLEIGH_VERSION/macOS-sleigh-$SLEIGH_VERSION-1.x86_64.tar.gz | sudo tar xz -C /usr/local --strip-components=1
- name: Build wheels
Expand Down
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,13 @@ add_custom_command(

# Allow user to override sleigh compiler to support cross-compilation. Default
# location is the one imported when we found the sleigh package
if(CMAKE_CROSSCOMPILING)
find_program(maat_SLEIGH_COMPILER "sleigh_opt"
DOC "Sleigh compiler executable"
)
if(TARGET sleigh::sleigh AND NOT CMAKE_CROSSCOMPILING)
set(maat_SLEIGH_COMPILER "$<TARGET_FILE:sleigh::sleigh>" CACHE PATH "Sleigh compiler executable")
else()
find_program(maat_SLEIGH_COMPILER "sleigh" DOC "Sleigh compiler executable")
if(NOT maat_SLEIGH_COMPILER)
message(FATAL_ERROR "Maat needs a sleigh compiler. Specify path manually by setting 'maat_SLEIGH_COMPILER'")
endif()
else()
set(maat_SLEIGH_COMPILER "$<TARGET_FILE:sleigh::sleigh_opt>" CACHE PATH "Sleigh compiler executable")
endif()

macro(maat_sleigh_compile ARCH_DIR ARCH)
Expand Down
3 changes: 3 additions & 0 deletions src/third-party/sleigh/native/sleigh_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ class TranslationContext

TranslationContext(maat::Arch::Type a, const std::string& slafile, const std::string& pspecfile): arch(a)
{
AttributeId::initialize();
ElementId::initialize();

if (not loadSlaFile(slafile.c_str()))
{
throw runtime_exception(Fmt() << "Sleigh: failed to load slafile: " << slafile >> Fmt::to_str);
Expand Down
2 changes: 1 addition & 1 deletion src/third-party/sleigh/sleigh-cmake
Submodule sleigh-cmake updated 55 files
+98 −87 .github/workflows/main.yml
+2 −2 .github/workflows/update_head.yml
+169 −669 CMakeLists.txt
+131 −0 CMakePresets.json
+28 −30 README.md
+33 −0 cmake/coverage.cmake
+13 −0 cmake/dev-mode.cmake
+11 −0 cmake/docs.cmake
+45 −2 cmake/install-config.cmake.in
+93 −0 cmake/install-rules.cmake
+19 −0 cmake/libconfig.h.in
+1 −1 cmake/modules/sleighCompile.cmake
+30 −15 cmake/options.cmake
+30 −33 cmake/packaging.cmake
+10 −0 cmake/prelude.cmake
+6 −0 cmake/project-is-top-level.cmake
+115 −0 example/CMakeLists.txt
+9 −0 extra-tools/CMakeLists.txt
+63 −0 extra-tools/sleigh-lift/CMakeLists.txt
+21 −12 extra-tools/sleigh-lift/src/main.cpp
+0 −39 include/libsleigh.hh
+1 −1 scripts/update_ghidra_head.py
+203 −0 sleighspecs/CMakeLists.txt
+12 −0 sleighspecs/specfiles.cmake.in
+21 −21 src/README.md
+46 −0 src/compile_options.cmake
+0 −0 src/patches/HEAD/.gitkeep
+0 −0 src/patches/HEAD/0001-Small-improvements-to-C-decompiler-testing-from-CLI.patch
+137 −0 src/patches/HEAD/0002-Add-include-guards-to-decompiler-C-headers.patch
+293 −0 src/patches/HEAD/0003-Fix-UBSAN-errors-in-decompiler.patch
+37 −0 src/patches/HEAD/0004-Use-stroull-instead-of-stroul-to-parse-address-offse.patch
+1 −1 src/patches/README.md
+0 −0 src/patches/stable/.gitkeep
+4 −4 src/patches/stable/0001-Small-improvements-to-C-decompiler-testing-from-CLI.patch
+137 −0 src/patches/stable/0002-Add-include-guards-to-decompiler-C-headers.patch
+293 −0 src/patches/stable/0003-Fix-UBSAN-errors-in-decompiler.patch
+38 −0 src/patches/stable/0004-Use-stroull-instead-of-stroul-to-parse-address-offse.patch
+177 −14 src/setup-ghidra-source.cmake
+4 −0 src/spec_files_HEAD.cmake
+7 −2 src/spec_files_stable.cmake
+59 −14 support/CMakeLists.txt
+2 −2 support/GhidraVersion.cpp.in
+4 −2 support/SpecFilePaths.h.in
+4 −4 support/Support.cpp
+1 −1 support/Version.cpp.in
+0 −0 support/include/sleigh/Support.h
+0 −0 support/include/sleigh/Version.h
+126 −0 support/include/sleigh/libsleigh.hh
+53 −0 tests/CMakeLists.txt
+9 −2 tests/find_package/CMakeLists.txt
+28 −2 tools/CMakeLists.txt
+65 −0 tools/decompiler/CMakeLists.txt
+61 −0 tools/ghidra/CMakeLists.txt
+0 −51 tools/sleigh-lift/CMakeLists.txt
+51 −0 tools/spec-compiler/CMakeLists.txt

0 comments on commit 5b8a674

Please sign in to comment.