-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMake refactor #105
CMake refactor #105
Conversation
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
This allows for someone to specify which components they want to install if they only want or need a subset
@ekilmer This looks great. Is this ready to start reviewing? |
Library is still top-level CMakeLists.txt More options
@tetsuo-cpp This will need some testing in all the projects that currently use sleigh. I've taken a stab at integrating sleigh into vcpkg in trailofbits/maat#128 (see the files in this directory for vcpkg sleigh https://github.com/trailofbits/maat/tree/ekilmer/vcpkg-integration/ports/sleigh) so that Maat only builds what it needs--- More testing of the different option combinations (which I think can be tested with vcpkg features) are also good. Additionally, testing each tool as a top-level project to make sure I've connected everything correctly is also something to look at. |
I can try moving Ian's Remill branch over to this version of Sleigh if that's useful. Also what did you mean by "testing each tool as a top-level project"? |
Yes, please make sure remill is able to use this branch easily (they will probably only want to build certain parts of this project, so hopefully they can compile only that minimal set)
Like this: cmake -S tools/decompiler -B build-decompiler
cmake --build build-decompiler
cmake --install build-decompiler --prefix decompiler-install and also for |
* master: More complete patch for all files with missing include guard (#116) Fix wrong CMake cache variable in CI (#115) Update to Ghidra stable 10.1.5 (#114) Update CMake minimum to 3.18 Update libsleigh single-header include list Bump Ghidra HEAD commit 75ae8b3 Fix SLEIGH rebuilds (#111) Allow external patches and expose more headers (#104)
@ekilmer By the way, Ian's Sleigh branch is merged into Remill now. I'll take a stab at building it with this branch and see how I go. |
* master: Add address offset parsing patch (#119)
Hmm, Remill seems to build fine without any modifications. I was curious about what you said here:
My understanding is that by default, only the library components get built and not tools (or extra tools like |
I might have said that at one point, but now that is not true. All components of the project are built by default. To see available options, after configuring with CMake, you can run $ cmake -S . -B build
$ ccmake build which will show a terminal UI with the options and their configured values. You could also use If a project is including this project through add_subdirectory(sleigh EXCLUDE_FROM_ALL) or you could manually set the cache variables before including the project: set(sleigh_BUILD_EXTRATOOLS OFF CACHE BOOL "")
add_subdirectory(sleigh) to turn off only specific features, but I think I would recommend using the first method. |
@tetsuo-cpp Do you think this should be true before merging? I wasn't sure what would be best for user experience. Seems like the most simple way for a new person to get started is to have everything enabled and built. |
Everything under |
I think your current approach seems sensible. Just build everything to start off with and give users the tools to optimize their builds if necessary. 👍 |
I know what the issue is. I'll fix it in a bit. Thank you for checking! |
|
* 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")
@tetsuo-cpp I think this is ready for another review. Also, I changed how this project works for projects that use Let me know if you have any questions! |
Could make it easier to build just the tools
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Amazing work @ekilmer.
This is a major CMake refactor that I got carried away with. There are a couple breaking changes listed as follows:
sleigh_
to avoid potential conflicts in projects that include this project's whole directory_opt
suffix on some targets to be more consistent with export target names. The suffix_dbg
is added only for Debug targetsdecomp_opt
target executable is nowdecompiler
to avoid conflict withdecomp
library targetsleigh_settings
targetsleigh_support
targetSupport
andExtraTools
COMPONENTS
for sleigh install config file to differentiate between what Ghidra includes and what ToB includes.Specs
COMPONENTS
for sleigh install config to ensure sleigh specs are available.sleigh_DEVELOPER_MODE
option to include options to build tests and documentationinstall
if you've chosen to build documentation throughsleigh_BUILD_DOCUMENTATION
CMake option. This is a bit unergonomic but there isn't a good way to do incremental doc builds with our current setup.cmake --build build --target all --target docs
will build everything and then you cancmake --install ...
Other changes that I would consider improvements to the project:
include
directory tosupport
directory to make it clear that those includes do not come from Ghidra/sleighsupport
) is its own project that can build itself and bootstrap the necessary sleigh libraries as needed.ccache
on Windows CIsleighLift
executablecloses #95
closes #93
closes #57