* [PATCH] Makefile: Honour LDFLAGS for binary targets
@ 2022-09-06 16:03 Stefano Brivio
2022-09-07 0:39 ` David Gibson
0 siblings, 1 reply; 2+ messages in thread
From: Stefano Brivio @ 2022-09-06 16:03 UTC (permalink / raw)
To: passt-dev
[-- Attachment #1: Type: text/plain, Size: 1466 bytes --]
We don't set any, but we should use them if they are passed in the
environment. On a Fedora Rawhide package build, annocheck
(https://sourceware.org/annobin/) reports:
Hardened: /usr/bin/passt: FAIL: bind-now test because not linked with -Wl,-z,now
...despite the build system exporting -Wl,-z,now in LDFLAGS.
Signed-off-by: Stefano Brivio <sbrivio(a)redhat.com>
---
Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 26e64d5..644a541 100644
--- a/Makefile
+++ b/Makefile
@@ -105,11 +105,11 @@ seccomp.h: $(PASST_SRCS) $(PASST_HEADERS)
@ EXTRA_SYSCALLS=$(EXTRA_SYSCALLS) ./seccomp.sh $^
passt: $(PASST_SRCS) $(PASST_HEADERS) seccomp.h
- $(CC) $(CFLAGS) $(PASST_SRCS) -o passt
+ $(CC) $(CFLAGS) $(PASST_SRCS) -o passt $(LDFLAGS)
passt.avx2: CFLAGS += -Ofast -mavx2 -ftree-vectorize -funroll-loops
passt.avx2: $(PASST_SRCS) $(PASST_HEADERS) seccomp.h
- $(CC) $(filter-out -O2,$(CFLAGS)) $(PASST_SRCS) -o passt.avx2
+ $(CC) $(filter-out -O2,$(CFLAGS)) $(PASST_SRCS) -o passt.avx2 $(LDFLAGS)
passt.avx2: passt
@@ -117,7 +117,7 @@ pasta.avx2 pasta.1 pasta: pasta%: passt%
ln -s $< $@
qrap: $(QRAP_SRCS) passt.h
- $(CC) $(CFLAGS) $(QRAP_SRCS) -o qrap
+ $(CC) $(CFLAGS) $(QRAP_SRCS) -o qrap $(LDFLAGS)
valgrind: EXTRA_SYSCALLS="rt_sigprocmask rt_sigtimedwait rt_sigaction \
getpid gettid kill clock_gettime mmap munmap open \
--
@@ -105,11 +105,11 @@ seccomp.h: $(PASST_SRCS) $(PASST_HEADERS)
@ EXTRA_SYSCALLS=$(EXTRA_SYSCALLS) ./seccomp.sh $^
passt: $(PASST_SRCS) $(PASST_HEADERS) seccomp.h
- $(CC) $(CFLAGS) $(PASST_SRCS) -o passt
+ $(CC) $(CFLAGS) $(PASST_SRCS) -o passt $(LDFLAGS)
passt.avx2: CFLAGS += -Ofast -mavx2 -ftree-vectorize -funroll-loops
passt.avx2: $(PASST_SRCS) $(PASST_HEADERS) seccomp.h
- $(CC) $(filter-out -O2,$(CFLAGS)) $(PASST_SRCS) -o passt.avx2
+ $(CC) $(filter-out -O2,$(CFLAGS)) $(PASST_SRCS) -o passt.avx2 $(LDFLAGS)
passt.avx2: passt
@@ -117,7 +117,7 @@ pasta.avx2 pasta.1 pasta: pasta%: passt%
ln -s $< $@
qrap: $(QRAP_SRCS) passt.h
- $(CC) $(CFLAGS) $(QRAP_SRCS) -o qrap
+ $(CC) $(CFLAGS) $(QRAP_SRCS) -o qrap $(LDFLAGS)
valgrind: EXTRA_SYSCALLS="rt_sigprocmask rt_sigtimedwait rt_sigaction \
getpid gettid kill clock_gettime mmap munmap open \
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Makefile: Honour LDFLAGS for binary targets
2022-09-06 16:03 [PATCH] Makefile: Honour LDFLAGS for binary targets Stefano Brivio
@ 2022-09-07 0:39 ` David Gibson
0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2022-09-07 0:39 UTC (permalink / raw)
To: passt-dev
[-- Attachment #1: Type: text/plain, Size: 1855 bytes --]
On Tue, Sep 06, 2022 at 06:03:21PM +0200, Stefano Brivio wrote:
> We don't set any, but we should use them if they are passed in the
> environment. On a Fedora Rawhide package build, annocheck
> (https://sourceware.org/annobin/) reports:
>
> Hardened: /usr/bin/passt: FAIL: bind-now test because not linked with -Wl,-z,now
>
> ...despite the build system exporting -Wl,-z,now in LDFLAGS.
>
> Signed-off-by: Stefano Brivio <sbrivio(a)redhat.com>
Reviewed-by: David Gibson <david(a)gibson.dropbear.id.au>
> ---
> Makefile | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 26e64d5..644a541 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -105,11 +105,11 @@ seccomp.h: $(PASST_SRCS) $(PASST_HEADERS)
> @ EXTRA_SYSCALLS=$(EXTRA_SYSCALLS) ./seccomp.sh $^
>
> passt: $(PASST_SRCS) $(PASST_HEADERS) seccomp.h
> - $(CC) $(CFLAGS) $(PASST_SRCS) -o passt
> + $(CC) $(CFLAGS) $(PASST_SRCS) -o passt $(LDFLAGS)
>
> passt.avx2: CFLAGS += -Ofast -mavx2 -ftree-vectorize -funroll-loops
> passt.avx2: $(PASST_SRCS) $(PASST_HEADERS) seccomp.h
> - $(CC) $(filter-out -O2,$(CFLAGS)) $(PASST_SRCS) -o passt.avx2
> + $(CC) $(filter-out -O2,$(CFLAGS)) $(PASST_SRCS) -o passt.avx2 $(LDFLAGS)
>
> passt.avx2: passt
>
> @@ -117,7 +117,7 @@ pasta.avx2 pasta.1 pasta: pasta%: passt%
> ln -s $< $@
>
> qrap: $(QRAP_SRCS) passt.h
> - $(CC) $(CFLAGS) $(QRAP_SRCS) -o qrap
> + $(CC) $(CFLAGS) $(QRAP_SRCS) -o qrap $(LDFLAGS)
>
> valgrind: EXTRA_SYSCALLS="rt_sigprocmask rt_sigtimedwait rt_sigaction \
> getpid gettid kill clock_gettime mmap munmap open \
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-07 0:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-06 16:03 [PATCH] Makefile: Honour LDFLAGS for binary targets Stefano Brivio
2022-09-07 0:39 ` David Gibson
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).