lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 22 Aug 2023 13:11:56 +0300
From:   "Jarkko Sakkinen" <jarkko@...nel.org>
To:     "Jo Van Bulck" <jo.vanbulck@...kuleuven.be>, <kai.huang@...el.com>,
        <linux-sgx@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Cc:     <dave.hansen@...ux.intel.com>
Subject: Re: [PATCH v3 8/9] selftests/sgx: Separate linker options

On Sat Aug 19, 2023 at 12:43 PM EEST, Jo Van Bulck wrote:
> Fixes "'linker' input unused [-Wunused-command-line-argument]" errors when
> compiling with clang.
>
> Signed-off-by: Jo Van Bulck <jo.vanbulck@...kuleuven.be>
> ---
>  tools/testing/selftests/sgx/Makefile | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/tools/testing/selftests/sgx/Makefile b/tools/testing/selftests/sgx/Makefile
> index 1d6315a2e..2de970f72 100644
> --- a/tools/testing/selftests/sgx/Makefile
> +++ b/tools/testing/selftests/sgx/Makefile
> @@ -12,9 +12,11 @@ OBJCOPY := $(CROSS_COMPILE)objcopy
>  endif
>  
>  INCLUDES := -I$(top_srcdir)/tools/include
> -HOST_CFLAGS := -Wall -Werror -g $(INCLUDES) -fPIC -z noexecstack
> +HOST_CFLAGS := -Wall -Werror -g $(INCLUDES) -fPIC
> +HOST_LDFLAGS := -z noexecstack -lcrypto
>  ENCL_CFLAGS := -Wall -Werror -static-pie -nostdlib -nostartfiles -fPIE \
>  	       -fno-stack-protector -mrdrnd $(INCLUDES)
> +ENCL_LDFLAGS := -Wl,-T,test_encl.lds,--build-id=none
>  
>  TEST_CUSTOM_PROGS := $(OUTPUT)/test_sgx
>  TEST_FILES := $(OUTPUT)/test_encl.elf
> @@ -28,7 +30,7 @@ $(OUTPUT)/test_sgx: $(OUTPUT)/main.o \
>  		    $(OUTPUT)/sigstruct.o \
>  		    $(OUTPUT)/call.o \
>  		    $(OUTPUT)/sign_key.o
> -	$(CC) $(HOST_CFLAGS) -o $@ $^ -lcrypto
> +	$(CC) $(HOST_CFLAGS) -o $@ $^ $(HOST_LDFLAGS)
>  
>  $(OUTPUT)/main.o: main.c
>  	$(CC) $(HOST_CFLAGS) -c $< -o $@
> @@ -45,8 +47,8 @@ $(OUTPUT)/call.o: call.S
>  $(OUTPUT)/sign_key.o: sign_key.S
>  	$(CC) $(HOST_CFLAGS) -c $< -o $@
>  
> -$(OUTPUT)/test_encl.elf: test_encl.lds test_encl.c test_encl_bootstrap.S
> -	$(CC) $(ENCL_CFLAGS) -T $^ -o $@ -Wl,--build-id=none
> +$(OUTPUT)/test_encl.elf: test_encl.c test_encl_bootstrap.S
> +	$(CC) $(ENCL_CFLAGS) $^ -o $@ $(ENCL_LDFLAGS)
>  
>  EXTRA_CLEAN := \
>  	$(OUTPUT)/test_encl.elf \
> -- 
> 2.25.1

Reviewed-by: Jarkko Sakkinen <jarkko@...nel.org>

BR, Jarkko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ