diff mbox series

[3/3] selftests/bpf: Build urandom_read with LDFLAGS and LDLIBS

Message ID 20200117165330.17015-3-daniel.diaz@linaro.org (mailing list archive)
State New
Headers show
Series [1/3] selftests/x86: Build with LDFLAGS and LDLIBS | expand

Commit Message

Daniel Díaz Jan. 17, 2020, 4:53 p.m. UTC
During cross-compilation, it was discovered that LDFLAGS and
LDLIBS were not being used while building binaries, leading
to defaults which were not necessarily correct.

OpenEmbedded reported this kind of problem:
  ERROR: QA Issue: No GNU_HASH in the ELF binary [...], didn't pass LDFLAGS?

Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
---
 tools/testing/selftests/bpf/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andrii Nakryiko Jan. 17, 2020, 7:04 p.m. UTC | #1
On Fri, Jan 17, 2020 at 8:55 AM Daniel Díaz <daniel.diaz@linaro.org> wrote:
>
> During cross-compilation, it was discovered that LDFLAGS and
> LDLIBS were not being used while building binaries, leading
> to defaults which were not necessarily correct.
>
> OpenEmbedded reported this kind of problem:
>   ERROR: QA Issue: No GNU_HASH in the ELF binary [...], didn't pass LDFLAGS?
>
> Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
> ---

Acked-by: Andrii Nakryiko <andriin@fb.com>

>  tools/testing/selftests/bpf/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> index e2fd6f8d579c..f1740113d5dc 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -88,7 +88,7 @@ $(notdir $(TEST_GEN_PROGS)                                            \
>          $(TEST_CUSTOM_PROGS)): %: $(OUTPUT)/% ;
>
>  $(OUTPUT)/urandom_read: urandom_read.c
> -       $(CC) -o $@ $< -Wl,--build-id
> +       $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS) -Wl,--build-id
>
>  $(OUTPUT)/test_stub.o: test_stub.c
>         $(CC) -c $(CFLAGS) -o $@ $<
> --
> 2.20.1
>
John Fastabend Jan. 20, 2020, 5:06 a.m. UTC | #2
Andrii Nakryiko wrote:
> On Fri, Jan 17, 2020 at 8:55 AM Daniel Díaz <daniel.diaz@linaro.org> wrote:
> >
> > During cross-compilation, it was discovered that LDFLAGS and
> > LDLIBS were not being used while building binaries, leading
> > to defaults which were not necessarily correct.
> >
> > OpenEmbedded reported this kind of problem:
> >   ERROR: QA Issue: No GNU_HASH in the ELF binary [...], didn't pass LDFLAGS?
> >
> > Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
> > ---
> 
> Acked-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Daniel Borkmann Jan. 22, 2020, 5:23 p.m. UTC | #3
On 1/17/20 5:53 PM, Daniel Díaz wrote:
> During cross-compilation, it was discovered that LDFLAGS and
> LDLIBS were not being used while building binaries, leading
> to defaults which were not necessarily correct.
> 
> OpenEmbedded reported this kind of problem:
>    ERROR: QA Issue: No GNU_HASH in the ELF binary [...], didn't pass LDFLAGS?
> 
> Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>

Applied, thanks!
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index e2fd6f8d579c..f1740113d5dc 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -88,7 +88,7 @@  $(notdir $(TEST_GEN_PROGS)						\
 	 $(TEST_CUSTOM_PROGS)): %: $(OUTPUT)/% ;
 
 $(OUTPUT)/urandom_read: urandom_read.c
-	$(CC) -o $@ $< -Wl,--build-id
+	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS) -Wl,--build-id
 
 $(OUTPUT)/test_stub.o: test_stub.c
 	$(CC) -c $(CFLAGS) -o $@ $<