arwen
is a cross-platform Rust implementation of patchelf
(Linux) and install_name_tool
(macOS) in one tool.
You can install arwen
using Cargo:
cargo install arwen
The CLI looks like this:
Usage: arwen <COMMAND>
Commands:
delete-rpath Delete a run path
change-rpath Change already existing run path
add-rpath Add a run path
change-install-name Change existing dylib load name
change-install-id Change dylib id. Works only if your object is a shared library
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
To add an RPath (/usr/local/lib
) to an existing binary:
arwen add-rpath /usr/local/lib my_binary
If your binary has an RPath that needs to be changed, for example, from /old/path
to /new/path
:
arwen change-rpath /old/path /new/path my_binary
To remove an existing RPath (/unwanted/path
) from a binary:
arwen delete-rpath /unwanted/path my_binary
If a Mach-O binary depends on a shared library and you want to change the library install name:
arwen change-install-name /old/libname.dylib /new/libname.dylib my_binary
For a Mach-O shared library, changing its install ID:
arwen change-install-id /new/install/id.dylib my_library.dylib
On macOS, after modifying a binary, you need to re-sign it to ensure it runs properly. You can do this using codesign
:
codesign --force --sign - my_binary
We have integration tests that validate that arwen
maintains feature parity with install_name_tool
to ensure correctness and reliability.
arwen
is licensed under the MIT license.
Contributions are welcome! Feel free to open issues or submit pull requests.
arwen
is currently in active development and provides only install_name_tool
implementation. API
and CLI
are subject to change to accommodate a more user-friendly experience.
This project is funded through NGI0 Entrust, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program.
Learn more at the NLnet project page.