* [PATCH v2] tools/resolve_btfids: Fix build error with older host toolchains
@ 2021-02-24 5:27 Kun-Chuan Hsieh
2021-02-24 8:32 ` Jiri Olsa
2021-02-24 16:10 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Kun-Chuan Hsieh @ 2021-02-24 5:27 UTC (permalink / raw)
To: ast; +Cc: bpf, jolsa, andrii, Kun-Chuan Hsieh, stable
Older libelf.h and glibc elf.h might not yet define the ELF compression
types.
Checking and defining SHF_COMPRESSED fix the build error when compiling
with older toolchains. Also, the tool resolve_btfids is compiled with host
toolchain. The host toolchain is more likely to be older than the cross
compile toolchain.
Cc: stable@vger.kernel.org
Signed-off-by: Kun-Chuan Hsieh <jetswayss@gmail.com>
---
tools/bpf/resolve_btfids/main.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/bpf/resolve_btfids/main.c b/tools/bpf/resolve_btfids/main.c
index 7409d7860aa6..80d966cfcaa1 100644
--- a/tools/bpf/resolve_btfids/main.c
+++ b/tools/bpf/resolve_btfids/main.c
@@ -260,6 +260,11 @@ static struct btf_id *add_symbol(struct rb_root *root, char *name, size_t size)
return btf_id__add(root, id, false);
}
+/* Older libelf.h and glibc elf.h might not yet define the ELF compression types. */
+#ifndef SHF_COMPRESSED
+#define SHF_COMPRESSED (1 << 11) /* Section with compressed data. */
+#endif
+
/*
* The data of compressed section should be aligned to 4
* (for 32bit) or 8 (for 64 bit) bytes. The binutils ld
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] tools/resolve_btfids: Fix build error with older host toolchains
2021-02-24 5:27 [PATCH v2] tools/resolve_btfids: Fix build error with older host toolchains Kun-Chuan Hsieh
@ 2021-02-24 8:32 ` Jiri Olsa
2021-02-24 16:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Jiri Olsa @ 2021-02-24 8:32 UTC (permalink / raw)
To: Kun-Chuan Hsieh; +Cc: ast, bpf, jolsa, andrii, stable
On Wed, Feb 24, 2021 at 05:27:52AM +0000, Kun-Chuan Hsieh wrote:
> Older libelf.h and glibc elf.h might not yet define the ELF compression
> types.
>
> Checking and defining SHF_COMPRESSED fix the build error when compiling
> with older toolchains. Also, the tool resolve_btfids is compiled with host
> toolchain. The host toolchain is more likely to be older than the cross
> compile toolchain.
>
> Cc: stable@vger.kernel.org
>
> Signed-off-by: Kun-Chuan Hsieh <jetswayss@gmail.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
thanks,
jirka
> ---
> tools/bpf/resolve_btfids/main.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/tools/bpf/resolve_btfids/main.c b/tools/bpf/resolve_btfids/main.c
> index 7409d7860aa6..80d966cfcaa1 100644
> --- a/tools/bpf/resolve_btfids/main.c
> +++ b/tools/bpf/resolve_btfids/main.c
> @@ -260,6 +260,11 @@ static struct btf_id *add_symbol(struct rb_root *root, char *name, size_t size)
> return btf_id__add(root, id, false);
> }
>
> +/* Older libelf.h and glibc elf.h might not yet define the ELF compression types. */
> +#ifndef SHF_COMPRESSED
> +#define SHF_COMPRESSED (1 << 11) /* Section with compressed data. */
> +#endif
> +
> /*
> * The data of compressed section should be aligned to 4
> * (for 32bit) or 8 (for 64 bit) bytes. The binutils ld
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] tools/resolve_btfids: Fix build error with older host toolchains
2021-02-24 5:27 [PATCH v2] tools/resolve_btfids: Fix build error with older host toolchains Kun-Chuan Hsieh
2021-02-24 8:32 ` Jiri Olsa
@ 2021-02-24 16:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-02-24 16:10 UTC (permalink / raw)
To: Kun-Chuan Hsieh; +Cc: ast, bpf, jolsa, andrii, stable
Hello:
This patch was applied to bpf/bpf.git (refs/heads/master):
On Wed, 24 Feb 2021 05:27:52 +0000 you wrote:
> Older libelf.h and glibc elf.h might not yet define the ELF compression
> types.
>
> Checking and defining SHF_COMPRESSED fix the build error when compiling
> with older toolchains. Also, the tool resolve_btfids is compiled with host
> toolchain. The host toolchain is more likely to be older than the cross
> compile toolchain.
>
> [...]
Here is the summary with links:
- [v2] tools/resolve_btfids: Fix build error with older host toolchains
https://git.kernel.org/bpf/bpf/c/b8592e231fb8
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-02-24 16:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-24 5:27 [PATCH v2] tools/resolve_btfids: Fix build error with older host toolchains Kun-Chuan Hsieh
2021-02-24 8:32 ` Jiri Olsa
2021-02-24 16:10 ` patchwork-bot+netdevbpf
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.