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] [day] [month] [year] [list]
Message-ID: <CAEf4Bzbt2pWCdKX2quszFDxm9yYXvP+yPfMyVN_Gm87xi7yzrQ@mail.gmail.com>
Date:   Thu, 17 Nov 2022 15:06:06 -0800
From:   Andrii Nakryiko <andrii.nakryiko@...il.com>
To:     Andrea Righi <andrea.righi@...onical.com>
Cc:     Shuah Khan <shuah@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
        Coleman Dietsch <dietschc@....edu>,
        Lina Wang <lina.wang@...iatek.com>,
        Kamal Mostafa <kamal@...onical.com>,
        linux-kselftest@...r.kernel.org, netdev@...r.kernel.org,
        bpf@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] selftests net: additional fix for kselftest net build error

On Mon, Nov 14, 2022 at 12:39 PM Andrea Righi
<andrea.righi@...onical.com> wrote:
>
> We need to make sure that bpf_helpers.h is properly generated when
> building the net kselftest, otherwise we get this build error:
>
>  $ make -C tools/testing/selftests/net
>  ...
>  bpf/nat6to4.c:43:10: fatal error: 'bpf/bpf_helpers.h' file not found
>           ^~~~~~~~~~~~~~~~~~~
>  1 error generated.
>
> Fix by adding a make dependency on tools/lib/bpf/bpf_helper_defs.h.
>
> Moreover, re-add the include that was initially added by commit
> cf67838c4422 ("selftests net: fix bpf build error"), otherwise we won't
> be able to properly include bpf_helpers.h.
>
> Fixes: 7b92aa9e6135 ("selftests net: fix kselftest net fatal error")
> Signed-off-by: Andrea Righi <andrea.righi@...onical.com>
> ---
>  tools/testing/selftests/net/bpf/Makefile | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/net/bpf/Makefile b/tools/testing/selftests/net/bpf/Makefile
> index 8ccaf8732eb2..cc6579e154eb 100644
> --- a/tools/testing/selftests/net/bpf/Makefile
> +++ b/tools/testing/selftests/net/bpf/Makefile
> @@ -2,11 +2,15 @@
>
>  CLANG ?= clang
>  CCINCLUDE += -I../../bpf
> +CCINCLUDE += -I../../../lib
>  CCINCLUDE += -I../../../../lib
>  CCINCLUDE += -I../../../../../usr/include/
>
> +bpf_helper_defs.h:
> +       @make OUTPUT=./ -C $(OUTPUT)/../../../../tools/lib/bpf bpf_helper_defs.h
> +
>  TEST_CUSTOM_PROGS = $(OUTPUT)/bpf/nat6to4.o
> -all: $(TEST_CUSTOM_PROGS)
> +all: bpf_helper_defs.h $(TEST_CUSTOM_PROGS)

it would be better to call libbpf's install_headers target instead to
generate and install API headers only

>
>  $(OUTPUT)/%.o: %.c
>         $(CLANG) -O2 -target bpf -c $< $(CCINCLUDE) -o $@
> --
> 2.37.2
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ