All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <olsajiri@gmail.com>
To: Leo Yan <leo.yan@arm.com>
Cc: Quentin Monnet <qmo@kernel.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	Stanislav Fomichev <sdf@fomichev.me>, Hao Luo <haoluo@google.com>,
	Nick Terrell <terrelln@fb.com>, Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	"Liang, Kan" <kan.liang@linux.intel.com>,
	James Clark <james.clark@linaro.org>,
	Guilherme Amadio <amadio@gentoo.org>,
	linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v2 1/3] tools build: Add feature test for libelf with ZSTD
Date: Wed, 11 Dec 2024 16:05:14 +0100	[thread overview]
Message-ID: <Z1mqKpXBcl303IDY@krava> (raw)
In-Reply-To: <20241211093114.263742-2-leo.yan@arm.com>

On Wed, Dec 11, 2024 at 09:31:12AM +0000, Leo Yan wrote:
> Add a test for checking if libelf supports ZSTD compress algorithm.
> 
> The macro ELFCOMPRESS_ZSTD is defined for the algorithm, pass it as an
> argument to the elf_compress() function.  If the build succeeds, it
> means the feature is supported.
> 
> Signed-off-by: Leo Yan <leo.yan@arm.com>

lgtm

Acked-by: Jiri Olsa <jolsa@kernel.org>

jirka

> ---
>  tools/build/Makefile.feature           | 1 +
>  tools/build/feature/Makefile           | 4 ++++
>  tools/build/feature/test-all.c         | 4 ++++
>  tools/build/feature/test-libelf-zstd.c | 9 +++++++++
>  4 files changed, 18 insertions(+)
>  create mode 100644 tools/build/feature/test-libelf-zstd.c
> 
> diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
> index bca47d136f05..b2884bc23775 100644
> --- a/tools/build/Makefile.feature
> +++ b/tools/build/Makefile.feature
> @@ -43,6 +43,7 @@ FEATURE_TESTS_BASIC :=                  \
>          libelf-getphdrnum               \
>          libelf-gelf_getnote             \
>          libelf-getshdrstrndx            \
> +        libelf-zstd                     \
>          libnuma                         \
>          numa_num_possible_cpus          \
>          libperl                         \
> diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
> index 043dfd00fce7..f12b89103d7a 100644
> --- a/tools/build/feature/Makefile
> +++ b/tools/build/feature/Makefile
> @@ -28,6 +28,7 @@ FILES=                                          \
>           test-libelf-getphdrnum.bin             \
>           test-libelf-gelf_getnote.bin           \
>           test-libelf-getshdrstrndx.bin          \
> +         test-libelf-zstd.bin                   \
>           test-libdebuginfod.bin                 \
>           test-libnuma.bin                       \
>           test-numa_num_possible_cpus.bin        \
> @@ -196,6 +197,9 @@ $(OUTPUT)test-libelf-gelf_getnote.bin:
>  $(OUTPUT)test-libelf-getshdrstrndx.bin:
>  	$(BUILD) -lelf
>  
> +$(OUTPUT)test-libelf-zstd.bin:
> +	$(BUILD) -lelf -lz -lzstd
> +
>  $(OUTPUT)test-libdebuginfod.bin:
>  	$(BUILD) -ldebuginfod
>  
> diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
> index 80ac297f8196..67125f967860 100644
> --- a/tools/build/feature/test-all.c
> +++ b/tools/build/feature/test-all.c
> @@ -58,6 +58,10 @@
>  # include "test-libelf-getshdrstrndx.c"
>  #undef main
>  
> +#define main main_test_libelf_zstd
> +# include "test-libelf-zstd.c"
> +#undef main
> +
>  #define main main_test_libslang
>  # include "test-libslang.c"
>  #undef main
> diff --git a/tools/build/feature/test-libelf-zstd.c b/tools/build/feature/test-libelf-zstd.c
> new file mode 100644
> index 000000000000..a1324a1db3bb
> --- /dev/null
> +++ b/tools/build/feature/test-libelf-zstd.c
> @@ -0,0 +1,9 @@
> +// SPDX-License-Identifier: GPL-2.0
> +#include <stddef.h>
> +#include <libelf.h>
> +
> +int main(void)
> +{
> +	elf_compress(NULL, ELFCOMPRESS_ZSTD, 0);
> +	return 0;
> +}
> -- 
> 2.34.1
> 

  parent reply	other threads:[~2024-12-11 15:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-11  9:31 [PATCH v2 0/3] bpftool: Fix the static linkage failure Leo Yan
2024-12-11  9:31 ` [PATCH v2 1/3] tools build: Add feature test for libelf with ZSTD Leo Yan
2024-12-11 12:48   ` Quentin Monnet
2024-12-11 15:05   ` Jiri Olsa [this message]
2024-12-11  9:31 ` [PATCH v2 2/3] perf: build: Minor improvement for linking libzstd Leo Yan
2024-12-11  9:31 ` [PATCH v2 3/3] bpftool: Link zstd lib required by libelf Leo Yan
2024-12-11 12:48   ` Quentin Monnet
2024-12-11 13:18 ` [PATCH v2 0/3] bpftool: Fix the static linkage failure Arnaldo Carvalho de Melo
2024-12-11 20:26   ` Leo Yan
2024-12-12 23:53     ` Andrii Nakryiko
2024-12-11 19:44 ` Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z1mqKpXBcl303IDY@krava \
    --to=olsajiri@gmail.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=amadio@gentoo.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=haoluo@google.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=john.fastabend@gmail.com \
    --cc=kan.liang@linux.intel.com \
    --cc=kpsingh@kernel.org \
    --cc=leo.yan@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=namhyung@kernel.org \
    --cc=qmo@kernel.org \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=terrelln@fb.com \
    --cc=yonghong.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.