Skip to content
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

buildenv: enable pointing enclave build to alternative glibc headers #1062

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

berrange
Copy link

@berrange berrange commented Oct 9, 2024

The enclaves must be built with headers from a specific glibc version for the sake of reproducibility. It does not actually link to glibc, merely requiring a few self contained definitions. In the NixOS build env the glibc system include directories get set through various wrapper scripts NixOS creates.

When attempting a reproducible build outside of NixOS though, we can't rely on the compiler having the matching glibc system include dirs. Instead there needs to be a way to inject "-isystem/some/path" args into the enclave compiler flags.

This commit adds a "ENCLAVE_SYSTEM_INCLUDES" make var can be set by the person triggering 'make', to provide a way to inject system include directories to the enclave build process.

The enclaves must be built with headers from a specific glibc version
for the sake of reproducibility. It does not actually link to glibc,
merely requiring a few self contained definitions. In the NixOS build
env the glibc system include directories get set through various
wrapper scripts NixOS creates.

When attempting a reproducible build outside of NixOS though, we can't
rely on the compiler having the matching glibc system include dirs.
Instead there needs to be a way to inject "-isystem/some/path" args
into the enclave compiler flags.

This commit adds a "ENCLAVE_SYSTEM_INCLUDES" make var can be set by
the person triggering 'make', to provide a way to inject system include
directories to the enclave build process.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
@berrange
Copy link
Author

berrange commented Oct 9, 2024

Note, while this is sufficient for most of the enclaves, qve links to sgxssl and requires a related change in DCAP intel/SGXDataCenterAttestationPrimitives#436

@haitaohuang
Copy link
Contributor

Actually I think the enclave include path should be clean and only pointed to SDK trusted libc headers. I'll defer to others to review

@berrange
Copy link
Author

Actually I think the enclave include path should be clean and only pointed to SDK trusted libc headers. I'll defer to others to review

Yeah, I was a bit surprised that the build process was seemingly relying on headers from the NixOS libc install. If it can be changed to only rely on headers from the SDK that would simplify things for OS vendors trying to reproduce the builds.

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