Skip to content

Commit 48b580e

Browse files
committed
buildenv: enable pointing enclave build to alternative glibc headers
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>
1 parent d5a2c9c commit 48b580e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

buildenv.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ endif
285285
# When `pie' is enabled, the linker (both BFD and Gold) under Ubuntu 14.04
286286
# will hide all symbols from dynamic symbol table even if they are marked
287287
# as `global' in the LD version script.
288-
ENCLAVE_CFLAGS = -ffreestanding -nostdinc -fvisibility=hidden -fpie -fno-strict-overflow -fno-delete-null-pointer-checks
288+
ENCLAVE_CFLAGS = -ffreestanding -nostdinc -fvisibility=hidden -fpie -fno-strict-overflow -fno-delete-null-pointer-checks $(ENCLAVE_SYSTEM_INCLUDES)
289289
ENCLAVE_CXXFLAGS = $(ENCLAVE_CFLAGS) -nostdinc++
290290
ENCLAVE_LDFLAGS = $(ENC_LDFLAGS) $(COMMON_LDFLAGS) -Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
291291
-Wl,-pie,-eenclave_entry -Wl,--export-dynamic \

0 commit comments

Comments
 (0)