-
Notifications
You must be signed in to change notification settings - Fork 15
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 roothide support #40
base: master
Are you sure you want to change the base?
Conversation
This questions spawns from my ignorance of Xcode -- is there a reason the search path list isn't just:
considering that |
yes @loader_path/.jbroot is a valid rpath on rh. ❤️ |
Tuan and I discussed this briefly and wonder if it may be worthwhile to pass the rootless rpath flags to Xcode as well (see https://github.com/theos/theos/blob/master/vendor/mod/rootless/instance/rules.mk) which would allow, among other things, us to use |
Have you tested this? This doesn't seem valid to me, as the |
It looks to me (via testing) that dyld does detect the cycle, and stops.
int someFunc(void) {
return 2;
}
extern int someFunc(void);
int main(void) {
return someFunc();
} test: clang '-Wl,-dylib,-install_name,@rpath/libnum.dylib' num.c -o libnum.dylib
clang numctl.c -lnum -L. -o numctl -rpath '@rpath/.'
./numctl
# dyld[79285]: Library not loaded: @rpath/libnum.dylib
# Referenced from: ./numctl
# Reason: tried: '@rpath/./libnum.dylib' (no such file), '@rpath/./libnum.dylib' (no such file)
uname -v
# Darwin Kernel Version 24.1.0: Thu Oct 10 21:03:15 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6000 Another test that more closely matches what I understand as the use-case here. clang '-Wl,-dylib,-install_name,@rpath/libaux.dylib' aux.c -o extra/libaux.dylib
clang '-Wl,-dylib,-install_name,@rpath/libnum.dylib' -rpath '@rpath/extra' -laux -Lextra num.c -o libnum.dylib
clang -rpath '@executable_path' -lnum -L. numctl.c -o numctl
./numctl
Based on this, I do not believe using |
dyld has never supported @rpath in rpath, dyld only supports @loader_path/@executable_path in rpath: |
Thanks for confirming @roothider 👍 This PR looks good to me in terms of the change working. |
What does this implement/fix? Explain your changes.
add roothide support
Does this close any currently open issues?
no
Any relevant logs, error output, etc?
Any other comments?
no
Where has this been tested?
Operating System: macos
Platform: arm64
Target Platform: ios15/16/17
Toolchain Version: clang-1400.0.29.202
SDK Version: 15.4