Skip to content
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

Add helper to locate SLA files #12

Closed
tetsuo-cpp opened this issue Nov 3, 2021 · 2 comments · Fixed by #24
Closed

Add helper to locate SLA files #12

tetsuo-cpp opened this issue Nov 3, 2021 · 2 comments · Fixed by #24
Assignees

Comments

@tetsuo-cpp
Copy link
Contributor

tetsuo-cpp commented Nov 3, 2021

As per @pgoodman's comment at #9 (comment), we should look into a way of exposing a helper that finds SLA files in the SLEIGH installation that it belongs to. Ideally it should just look like this:

/*
* Returns a string containing the path to the .sla file for a given architecture.
* @param arch: The architecture for which we want to find a .sla file
* @return: An absolute path to the .sla file
* @throw std::invalid_argument: An unknown arch is provided.
*/
std::string FindSlaFile(const std::string& arch);
@ekilmer
Copy link
Contributor

ekilmer commented Nov 17, 2021

I'm curious how you are planning to do this? Ideally this function would work when the linked library (or executable being run) is in the build directory and after it is installed somewhere. The build directory path can be a hard-coded (hard-calculated) absolute path using CMake, but the install path should be relative to the executable or library so as to have a relocatable package.

I think LLVM has some machinery to do this in clang to find libcxx headers 🤔

@pgoodman
Copy link
Contributor

The way in Remill is to embed the CMAKE_INSTALL_PREFIX-related location, the build folder location, and then some random search paths. We could use configure_file to create a bunch of paths in a header file, then search down a list. There should also be the ability to pass in a list of paths to prefer as hints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants