Skip to contentSkip to conversation

selftests/sgx: add test_encl.elf to TEST_GEN_FILES

PATCH Superseded Jarkko Sakkinen 1 participant 2 messages May 18, 2022

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jarkko Sakkinen

author maintainer
#0 lore raw

PATCH 1/1 selftests/sgx: add test_encl.elf to TEST_GEN_FILES

TEST_GEN_FILES contains files that are generated during compilation and are required to be included together with the test binaries, e.g. when performing:

make -C tools/testing/selftests install INSTALL_PATH=/some/other/path [*]

Add test_encl.elf to TEST_GEN_FILES because otherwise the installed test binary will fail to run.

[*] https://docs.kernel.org/dev-tools/kselftest.html

Fixes 2adcba79e69d ("selftests/x86: Add a selftest for SGX")
---
 tools/testing/selftests/sgx/Makefile | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/sgx/Makefile +1 -0
index 75af864e07b6..f3f312904bcc 100644
@@ -17,6 +17,7 @@ ENCL_CFLAGS := -Wall -Werror -static -nostdlib -nostartfiles -fPIC \
 	       -fno-stack-protector -mrdrnd $(INCLUDES)
 
 TEST_CUSTOM_PROGS := $(OUTPUT)/test_sgx
+TEST_GEN_FILES := $(OUTPUT)/test_encl.elf
 
 ifeq ($(CAN_BUILD_X86_64), 1)
 all: $(TEST_CUSTOM_PROGS) $(OUTPUT)/test_encl.elf
Signature · 1 line
2.36.1
author maintainer
#1 lore raw
Quoted 6 lines · Jarkko Sakkinen

TEST_GEN_FILES contains files that are generated during compilation and are required to be included together with the test binaries, e.g. when performing:

make -C tools/testing/selftests install INSTALL_PATH=/some/other/path [*]

Quoted 8 lines

Add test_encl.elf to TEST_GEN_FILES because otherwise the installed test binary will fail to run.

[*] https://docs.kernel.org/dev-tools/kselftest.html

Fixes 2adcba79e69d ("selftests/x86: Add a selftest for SGX")

I found this while trying to create an image with BuldRoot containing the self-tests:

https://github.com/jarkkojs/buildroot-sgx

On SGX capable machine can be built and run in QEMU as

make sgx_x86_64_defconfig && make && output/image/run.sh

BR, Jarkko