You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we built the main Shadow binary as a Cargo project, we could reduce this to two steps: the C library and a Rust binary. This would also allow us to skip the final link step, which would save us a few seconds of build time.
One issue is that we set the runpath to the shim library directories and shadow reads this runpath to use the correct shim libraries. For example, after building Shadow, the runpath will be set to /abs-path/shadow/build/src/lib/shim:/abs-path/shadow/build/src/lib/injector_preload:/abs-path/shadow/build/src/lib/libc_preload:/abs-path/shadow/build/src/lib/openssl_preload:. After installing Shadow, the runpath will be changed to /home/user/.local/lib. We will either need to use a different mechanism for specifying the correct path of shim libraries, or use something like patchelf to manually modify the runpath as part of the build and installation steps (CMake does this for us, but we'd have to do it manually if building the binary with Cargo). And instead of the runpath, we could maybe use a different custom elf section instead.
The text was updated successfully, but these errors were encountered:
Shadow's main function is a small C wrapper around a Rust function:
shadow/src/main/main.c
Line 9 in 117bbf4
shadow/src/main/core/main.rs
Lines 234 to 238 in 117bbf4
It would be nice to remove the C main function and build the Rust version directly.
Shadow currently uses CMake to build a C library
shadow-c
, a Rust libraryshadow-rs
, and then builds the final C binary:If we built the main Shadow binary as a Cargo project, we could reduce this to two steps: the C library and a Rust binary. This would also allow us to skip the final link step, which would save us a few seconds of build time.
One issue is that we set the runpath to the shim library directories and shadow reads this runpath to use the correct shim libraries. For example, after building Shadow, the runpath will be set to
/abs-path/shadow/build/src/lib/shim:/abs-path/shadow/build/src/lib/injector_preload:/abs-path/shadow/build/src/lib/libc_preload:/abs-path/shadow/build/src/lib/openssl_preload:
. After installing Shadow, the runpath will be changed to/home/user/.local/lib
. We will either need to use a different mechanism for specifying the correct path of shim libraries, or use something like patchelf to manually modify the runpath as part of the build and installation steps (CMake does this for us, but we'd have to do it manually if building the binary with Cargo). And instead of the runpath, we could maybe use a different custom elf section instead.The text was updated successfully, but these errors were encountered: