31 Commits

Author SHA1 Message Date
Eric Kilmer a96b7fdcc6 Actually fix Window ccache support in CI
Add CMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded to CI line
- Needs to be before the first project call

Set required CMake Policy for MSVC ccache debug type
2025-03-12 16:51:19 -04:00
Eric Kilmer 69e080e45a Ghidra 11.1 (#268)
ZLIB is now a requirement for compressed sleigh files
2024-06-12 07:22:03 -04:00
auto-updater[bot] 24b9034914 Update Ghidra HEAD to commit 317a88148 (#245)
Upstream has added a compression mechanism for compiled sleigh files. They use Zlib to perform the compression and have added the source code to the Ghidra repo. However, this commit does not use Ghidra's Zlib source and instead searches for it on the host.

This commit also fixes a number of bugs that prevent various parts of the CI pipeline from working on supported OSes. These patches will be reported upstream.

Changed files:

```
M	Ghidra/Features/Decompiler/src/decompile/cpp/Makefile
M	Ghidra/Features/Decompiler/src/decompile/cpp/address.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/architecture.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/block.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/comment.hh
A	Ghidra/Features/Decompiler/src/decompile/cpp/compression.cc
A	Ghidra/Features/Decompiler/src/decompile/cpp/compression.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/float.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/float.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/marshal.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/op.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/options.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.y
M	Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh
A	Ghidra/Features/Decompiler/src/decompile/cpp/slaformat.cc
A	Ghidra/Features/Decompiler/src/decompile/cpp/slaformat.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/space.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/space.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc
M	Ghidra/Features/Decompiler/src/decompile/cpp/translate.hh
M	Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
M	Ghidra/Features/Decompiler/src/decompile/unittests/testfuncproto.cc
M	Ghidra/Features/Decompiler/src/decompile/unittests/testmarshal.cc
A	Ghidra/Features/Decompiler/src/decompile/zlib/README.txt
A	Ghidra/Features/Decompiler/src/decompile/zlib/adler32.c
A	Ghidra/Features/Decompiler/src/decompile/zlib/deflate.c
A	Ghidra/Features/Decompiler/src/decompile/zlib/deflate.h
A	Ghidra/Features/Decompiler/src/decompile/zlib/gzguts.h
A	Ghidra/Features/Decompiler/src/decompile/zlib/inffast.c
A	Ghidra/Features/Decompiler/src/decompile/zlib/inffast.h
A	Ghidra/Features/Decompiler/src/decompile/zlib/inffixed.h
A	Ghidra/Features/Decompiler/src/decompile/zlib/inflate.c
A	Ghidra/Features/Decompiler/src/decompile/zlib/inflate.h
A	Ghidra/Features/Decompiler/src/decompile/zlib/inftrees.c
A	Ghidra/Features/Decompiler/src/decompile/zlib/inftrees.h
A	Ghidra/Features/Decompiler/src/decompile/zlib/trees.c
A	Ghidra/Features/Decompiler/src/decompile/zlib/trees.h
A	Ghidra/Features/Decompiler/src/decompile/zlib/zconf.h
A	Ghidra/Features/Decompiler/src/decompile/zlib/zlib.h
A	Ghidra/Features/Decompiler/src/decompile/zlib/zutil.c
A	Ghidra/Features/Decompiler/src/decompile/zlib/zutil.h
M	Ghidra/Processors/68000/data/languages/68000.ldefs
M	Ghidra/Processors/AARCH64/certification.manifest
M	Ghidra/Processors/AARCH64/data/languages/AARCH64.ldefs
M	Ghidra/Processors/AARCH64/data/languages/AARCH64.opinion
A	Ghidra/Processors/AARCH64/data/languages/AARCH64_swift.cspec
M	Ghidra/Processors/AARCH64/data/languages/AppleSilicon.ldefs
M	Ghidra/Processors/ARM/data/languages/ARM.ldefs
M	Ghidra/Processors/Loongarch/data/languages/loongarch.ldefs
M	Ghidra/Processors/MIPS/data/languages/mips.ldefs
M	Ghidra/Processors/PA-RISC/data/languages/pa-risc.sinc
M	Ghidra/Processors/PowerPC/data/languages/ppc.ldefs
M	Ghidra/Processors/RISCV/data/languages/riscv.ldefs
M	Ghidra/Processors/Sparc/data/languages/SparcV9.ldefs
M	Ghidra/Processors/SuperH4/data/languages/SuperH4.ldefs
M	Ghidra/Processors/Xtensa/data/languages/xtensa.ldefs
M	Ghidra/Processors/x86/certification.manifest
A	Ghidra/Processors/x86/data/languages/x86-64-swift.cspec
M	Ghidra/Processors/x86/data/languages/x86.ldefs
M	Ghidra/Processors/x86/data/languages/x86.opinion
```
2024-04-01 09:58:27 -04:00
Eric Kilmer 74838a39ba CMake refactor (#105)
* Major CMake refactor

* CI fixes

* Fix CMake errors

* Install graphviz on Windows

* More consistent CMake build types

* Fix compiler defines for Windows

* Fix more bugs

* Add standalone tool building support

* Fix typo

* Update README

* Install sleighLift before trying to smoketest it

* Test coverage preset

The compiler option '-fkeep-inline-functions' originally included with
the coverage build type causes errors with the message "undefined
reference to 'vtable for OpAction*'" for all OpAction subclasses.

This StackOverflow answer might help in resolving this?
https://stackoverflow.com/a/57504289

* Build documentation by default with CI presets

* Use COMPONENT for install commands

This allows for someone to specify which components they want to install
if they only want or need a subset

* Support cross compiling with host system sleigh compiler

* Various fixes found during review

* Move "_WINDOWS" define to CMakeLists.txt file

* Rename ToB 'tools' directory to 'extra-tools'

* Separate projects for sleigh tools

Library is still top-level CMakeLists.txt

More options

* CMake find_package(Git)

* Fix bad merge for patch paths

* Fix missing libconfig.h header install

* Fix issues with installation of headers

* More refactoring

* Refactor sleighexample into its own project/directory

* Refactor specfiles building into separate project/directory

* Check for termios.h header and set define if found

* Update READMEs

* Better consistency with install rules

* Build sleighLift as a standalone project with added source

* More changes to CMake subprojects

* Also add "Specs" component to sleigh installation config

* Try to be better at bootstrapping subprojects (hopefully this doesn't
  bite us, but if it does, I'm happy to remove it and say "not
  supported")

* Address some code review

* Add project sleigh_tool for tool subdirectory

Could make it easier to build just the tools

* Add help text to name the tool executable name

* Add license notice to CMake files

* Fix/Remove too specific CPack packaging configuration

* Consistent capitalization of Sleigh

Co-authored-by: Alex Cameron <asc@tetsuo.sh>
2022-08-22 15:41:53 +10:00
Eric Kilmer e6cfbacd67 Update CMake minimum to 3.18
Errors with Ghidra repo FetchContent when using CMake less than this
version. FetchContent runs the patch step before update and so we lose
the patches, which can cause build errors.

CMake 3.15 can still be used if you specify your own Ghidra repo on the
command line.
2022-07-28 15:40:05 -04:00
ekilmer 70bbd6ce0b Bump Ghidra HEAD commit 75ae8b3
Add new source file marshal.cc and header marshal.hh

Big changes for supporting stable and HEAD

Conditional compilation based on whether sleigh is HEAD version

Expose CMake variable to determine if version is HEAD
2022-07-27 14:49:35 -04:00
Artem Dinaburg 5ee2f2c162 Fix SLEIGH rebuilds (#111)
* Fix additional_patches cache variable type to default to empty string

Co-authored-by: Eric Kilmer <eric.d.kilmer@gmail.com>
2022-07-21 13:20:20 -04:00
2over12 08b2fdbe4b Allow external patches and expose more headers (#104)
* fix gitwatcher for external inclusion

Co-authored-by: Alex Cameron <asc@tetsuo.sh>
2022-07-20 16:05:40 +00:00
Eric Kilmer 78c2acabdc Update to Ghidra stable 10.1.4 2022-06-03 13:58:35 -04:00
Eric Kilmer c7419e7392 Windows support (#85)
* CI: Enable Windows testing

* Fix compilation error on Windows

* Remove compiler warnings as errors

* Move tests to the last step to upload Windows binaries

* Add test for find_package testing in Windows

Makes testing it easier for multi-config generators
2022-05-17 14:49:57 -04:00
Eric Kilmer 264204577d Update to Ghidra stable 10.1.3 (#87)
https://github.com/NationalSecurityAgency/ghidra/releases/tag/Ghidra_10.1.3_build

* Synchronize spec files list with HEAD
2022-04-22 08:54:05 -04:00
Eric Kilmer 759fe7ff76 Bump package version v10.1.2-2 (#73) 2022-03-11 11:34:16 -05:00
Eric Kilmer dbc3dbd15f Let user specify path to sleigh compiler in CMake module (#69)
This allows user to specify an arbitrary sleigh compiler. Almost always
it's going to be the sleigh::sleigh_opt target, but in the case of
cross-compiling, that won't work because the host won't be able to run
it.
2022-03-11 09:27:41 -05:00
Eric Kilmer 1d3d6e29b6 Consistent CMake project variable names - project name case (#58)
* Consistent CMake project variable names - project name case

While there is not official convention, internally CMake uses the case
of the project name in auto-generated variables for the project, like
<ProjectName>_BINARY_DIR. We should follow that convention.

* README: Fix install spec directory variable name

Co-authored-by: Alex Cameron <asc@tetsuo.sh>
2022-02-08 11:14:30 +11:00
Eric Kilmer 942fe1881b CMake Module for sleigh compile (#43)
* Create sleigh_compile CMake module

Useful for other projects that want to compile slaspec files

* Expose sleigh_INSTALL_SPECDIR to reach specfiles

* Use configure_package_config_file

And adjust where the installation of the CMake config files are located

* Fix magic variable in sleighCompile module

* Use MAIN_DEPENDENCY in add_custom_command

* Move some variables around

* Revert needless change

* Cleaning sleighCompile

* Add documentation about new feature

* Docs update

* cmake: Add copyright notice to `sleighCompile` helper

Co-authored-by: Alex Cameron <asc@tetsuo.sh>
2022-02-08 10:47:43 +11:00
Eric Kilmer bad0c8978c Update to latest stable 10.1.2 release (#55)
https://github.com/NationalSecurityAgency/ghidra/releases/tag/Ghidra_10.1.2_build
2022-02-03 17:55:17 -05:00
Alex Cameron 745bcd7d35 sleigh-lift: Add a --version argument (#46)
* sleigh-lift: Create `--help` and `--version` flags

* cmake: Bring in `git_watcher.cmake`

* support: Add version module to support lib

* support: Add helpers for GHIDRA version and commit hash

* cmake: Cleanup

* cmake, support: Record `cmake-git-version-tracking` Git hash

* sleigh-lift, support: Add helper for GHIDRA release type

* doc: Fix GitHub links to include commit hashes
2022-02-03 12:20:14 +11:00
Eric Kilmer 5dde7ab3fc Expose specfile directory in installed sleighConfig (#52)
Let's users know where the currently installed set of specfiles are
located. This path shouldn't be compiled into any binaries that you want
to distribute in a relocatable manner because the path probably won't
exist on another computer.
2022-02-01 18:06:20 -05:00
Eric Kilmer 08c7619d39 Use sleighTargets for EXPORT name
Also adds a proper sleighConfig.cmake file for find_package to work
2022-02-01 16:35:02 -05:00
Eric Kilmer ee2d927807 Remove SLEIGH_ENABLE_INSTALL and use CMake variable (#44)
Create installation rules by default
2022-01-28 11:12:52 +11:00
Peter Goodman 0bc0e5192d Make documentation actually optional (#31)
* Make documentation actually optional

* doc: Fix README to reflect that building docs is optional

Co-authored-by: Alex Cameron <asc@tetsuo.sh>
2021-12-19 11:09:51 +11:00
Eric Kilmer 387f9b09b7 Update to latest stable 10.1 release (#30)
Updated from 10.0.4 release
2021-12-12 13:13:20 +11:00
Eric Kilmer 63e82daee3 Use "sleigh/" include prefix for public headers
The original source code does not set up the headers this way, but it is
best practice to use the project's name prefix to avoid polluting the
include search paths and avoid name conflicts
2021-11-24 09:27:08 -05:00
Eric Kilmer 06781f158f Fix include directory when project is added as subdirectory 2021-11-24 09:27:08 -05:00
Eric Kilmer 3e1e6a7eb9 Use CMake FetchContent to support both stable and HEAD ghidra (#15)
Quite a few changes that should be explained in the READMEs

Updates to CI actions
2021-11-17 09:12:23 -05:00
Alex Cameron b1b8d7c1a0 workflows: Add macOS to CI (#13)
* workflows: Initial attempt at running macOS builds in CI

* workflows: Remove unused Linux dependencies

* cmake: Remove BFD and Iberty references in DEB and RPM requires
2021-11-06 00:24:37 +11:00
Alessandro Gario f524fa31a7 cmake: Port all sleigh targets 2021-10-15 16:39:43 +11:00
Alex Cameron 19d40de3d8 cmake: Make a few minor fixes required to import the Sleigh package 2021-10-11 02:17:01 +11:00
Alex Cameron eb1b4d1889 cmake: Add package configuration 2021-10-11 01:25:11 +11:00
Alex Cameron 325f677591 cmake: Fix typos 2021-10-10 19:43:51 +11:00
Alex Cameron 69dde8dccf cmake: Add CMake build 2021-10-07 18:40:29 +11:00