mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-11 20:03:50 -04:00
Add KHDR_INCLUDES to the CFLAGS to pull in the kselftest harness
dependencies (-D_GNU_SOURCE).
Also, remove redefinitions of _GNU_SOURCE in the source code.
Fixes: 8092162335 ("selftests/harness: remove use of LINE_MAX")
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202404301040.3bea5782-oliver.sang@intel.com
Signed-off-by: Edward Liaw <edliaw@google.com>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Tested-by: Jarkko Sakkinen <jarkko@kernel.org>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
61 lines
1.5 KiB
Makefile
61 lines
1.5 KiB
Makefile
top_srcdir = ../../../..
|
|
|
|
include ../lib.mk
|
|
|
|
.PHONY: all clean
|
|
|
|
CAN_BUILD_X86_64 := $(shell ../x86/check_cc.sh "$(CC)" \
|
|
../x86/trivial_64bit_program.c)
|
|
|
|
ifndef OBJCOPY
|
|
OBJCOPY := $(CROSS_COMPILE)objcopy
|
|
endif
|
|
|
|
INCLUDES := -I$(top_srcdir)/tools/include
|
|
HOST_CFLAGS := -Wall -Werror $(KHDR_INCLUDES) -g $(INCLUDES) -fPIC
|
|
HOST_LDFLAGS := -z noexecstack -lcrypto
|
|
ENCL_CFLAGS += -Wall -Werror -static-pie -nostdlib -ffreestanding -fPIE \
|
|
-fno-stack-protector -mrdrnd $(INCLUDES)
|
|
ENCL_LDFLAGS := -Wl,-T,test_encl.lds,--build-id=none
|
|
|
|
ifeq ($(CAN_BUILD_X86_64), 1)
|
|
TEST_CUSTOM_PROGS := $(OUTPUT)/test_sgx
|
|
TEST_FILES := $(OUTPUT)/test_encl.elf
|
|
|
|
all: $(TEST_CUSTOM_PROGS) $(OUTPUT)/test_encl.elf
|
|
endif
|
|
|
|
$(OUTPUT)/test_sgx: $(OUTPUT)/main.o \
|
|
$(OUTPUT)/load.o \
|
|
$(OUTPUT)/sigstruct.o \
|
|
$(OUTPUT)/call.o \
|
|
$(OUTPUT)/sign_key.o
|
|
$(CC) $(HOST_CFLAGS) -o $@ $^ $(HOST_LDFLAGS)
|
|
|
|
$(OUTPUT)/main.o: main.c
|
|
$(CC) $(HOST_CFLAGS) -c $< -o $@
|
|
|
|
$(OUTPUT)/load.o: load.c
|
|
$(CC) $(HOST_CFLAGS) -c $< -o $@
|
|
|
|
$(OUTPUT)/sigstruct.o: sigstruct.c
|
|
$(CC) $(HOST_CFLAGS) -c $< -o $@
|
|
|
|
$(OUTPUT)/call.o: call.S
|
|
$(CC) $(HOST_CFLAGS) -c $< -o $@
|
|
|
|
$(OUTPUT)/sign_key.o: sign_key.S
|
|
$(CC) $(HOST_CFLAGS) -c $< -o $@
|
|
|
|
$(OUTPUT)/test_encl.elf: test_encl.c test_encl_bootstrap.S
|
|
$(CC) $(ENCL_CFLAGS) $^ -o $@ $(ENCL_LDFLAGS)
|
|
|
|
EXTRA_CLEAN := \
|
|
$(OUTPUT)/test_encl.elf \
|
|
$(OUTPUT)/load.o \
|
|
$(OUTPUT)/call.o \
|
|
$(OUTPUT)/main.o \
|
|
$(OUTPUT)/sigstruct.o \
|
|
$(OUTPUT)/test_sgx \
|
|
$(OUTPUT)/test_sgx.o \
|