-
Notifications
You must be signed in to change notification settings - Fork 266
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
Fix switchless sample code #260
Conversation
In order to use the switchless feature of the SGX, the app binary needs to be linked with the following flags. ``` -Wl,--whole-archive -lsgx_uswitchless -Wl,--no-whole-archive ```` Noted that there is currently no proper way to pass custom link flags to all the binaries in a cargo project. As such, the `link_args` macro need to be set for each of Rust files with `main` methods. References: * Build flags used in Intel SGX sample code: https://github.com/intel/linux-sgx/blob/ce4a18d9a0963b14f717cc7462241cfadd233f55/SampleCode/Switchless/Makefile#L104 * Rust tracking issue on `link_args`: rust-lang/rust#29596 * PR for `cargo:rustc-link-arg-bins` in cargo build script: rust-lang/cargo#8441
thanks! |
I understand this issue has been closed but I needed more clarity on this one. I tried including |
You can refer to switchless example |
Hi @volcano0dr , thank you for your response. I did refer to this switchless example. However, it still doesn't work. |
In order to use the switchless feature of the SGX, the app binary needs
to be linked with the following flags.
Noted that there is currently no proper way to pass custom link flags to
all the binaries in a cargo project. As such, the
link_args
macro needto be set for each of Rust files with
main
methods.References:
link_args
: Tracking issue forlink_args
stabilization rust-lang/rust#29596cargo:rustc-link-arg-bins
in cargo build script: Finish implementation of-Zextra-link-arg
. rust-lang/cargo#8441