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_argsmacro needto be set for each of Rust files with
mainmethods.References:
link_args: Tracking issue forlink_argsstabilization rust-lang/rust#29596cargo:rustc-link-arg-binsin cargo build script: Finish implementation of-Zextra-link-arg. rust-lang/cargo#8441