Skip to content

SGX compile options #154

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

Closed
wants to merge 2 commits into from
Closed

Conversation

raoulstrackx
Copy link
Contributor

In order to compile for the SGX target, we want to be able to specify our own (e.g., clang) compiler and compile flags enabling LVI mitigations.

When the user specifies some CFLAGS (e.g., -mllvm -x86-experimental-lvi-inline-asm-hardening) these end up in a linker failure. We skip cmake checks for a working compiler in such cases
cmk.cflag(format!(
r#"-DMBEDTLS_CONFIG_FILE="\"{}\"""#,
self.config_h.to_str().expect("config.h UTF-8 error")
))
.define("ENABLE_PROGRAMS", "OFF")
.define("ENABLE_TESTING", "OFF")
.build_target("lib");
if env::var("CC").is_ok() {
cmk.define("CMAKE_C_COMPILER_FORCED", "TRUE");
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

if utils::env_have_target_cfg("env", "sgx") {
// Compile for sgx target is similar as for unix
cmk.cflag("-Dunix");
}
Copy link
Member

@jethrogb jethrogb Mar 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raoulstrackx
Copy link
Contributor Author

Superseded by #152

@Taowyoo Taowyoo deleted the raoul/sgx_compiler_options branch October 20, 2023 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants