From dd595d3b06a355f58efcc547ff1f001dd55c99c6 Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Fri, 1 Mar 2024 22:37:22 +0100 Subject: [PATCH] package/tcf-agent: fix x86 build Fix the following x86 build failure raised since bump to version 1.8.0 in commit 81802e263a12e173e0e1028449d1e1e11b2e5974 and https://gitlab.eclipse.org/eclipse/tcf/tcf.agent/-/commit/8df5540c53b862d516ac25f908c2fff4a547b4a6: /home/buildroot/autobuild/run/instance-1/output-1/build/tcf-agent-1.8.0/agent/tcf/services/tcf_elf.c: In function 'unpack_elf_symbol_info': /home/buildroot/autobuild/run/instance-1/output-1/build/tcf-agent-1.8.0/agent/tcf/services/tcf_elf.c:2079:27: error: 'STT_ARM_16BIT' undeclared (first use in this function) 2079 | if (info->type == STT_ARM_16BIT) { | ^~~~~~~~~~~~~ /home/buildroot/autobuild/run/instance-1/output-1/build/tcf-agent-1.8.0/agent/tcf/services/tcf_elf.c:2079:27: note: each undeclared identifier is reported only once for each function it appears in /home/buildroot/autobuild/run/instance-1/output-1/build/tcf-agent-1.8.0/agent/tcf/services/tcf_elf.c: In function 'create_symbol_addr_search_index': /home/buildroot/autobuild/run/instance-1/output-1/build/tcf-agent-1.8.0/agent/tcf/services/tcf_elf.c:2228:78: error: 'STT_ARM_16BIT' undeclared (first use in this function) 2228 | if (type == STT_FUNC || type == STT_ARM_TFUNC || type == STT_ARM_16BIT) { | ^~~~~~~~~~~~~ Fixes: 81802e263a12e173e0e1028449d1e1e11b2e5974 - http://autobuild.buildroot.org/results/8388acf59689ed7e621bdf158483e3df1cf9bef7 Signed-off-by: Fabrice Fontaine Signed-off-by: Arnout Vandecappelle --- ...tcf-services-tcf_elf.c-fix-x86-build.patch | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 package/tcf-agent/0001-agent-tcf-services-tcf_elf.c-fix-x86-build.patch diff --git a/package/tcf-agent/0001-agent-tcf-services-tcf_elf.c-fix-x86-build.patch b/package/tcf-agent/0001-agent-tcf-services-tcf_elf.c-fix-x86-build.patch new file mode 100644 index 0000000000..5f08fa485e --- /dev/null +++ b/package/tcf-agent/0001-agent-tcf-services-tcf_elf.c-fix-x86-build.patch @@ -0,0 +1,60 @@ +From 0a847ca035113540ee44d17f364bf4701fe78355 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Fri, 1 Mar 2024 22:31:05 +0100 +Subject: [PATCH] agent/tcf/services/tcf_elf.c: fix x86 build + +Fix the following x86 build failure raised since version 1.8.0 and +https://gitlab.eclipse.org/eclipse/tcf/tcf.agent/-/commit/8df5540c53b862d516ac25f908c2fff4a547b4a6: + +/home/buildroot/autobuild/run/instance-1/output-1/build/tcf-agent-1.8.0/agent/tcf/services/tcf_elf.c: In function 'unpack_elf_symbol_info': +/home/buildroot/autobuild/run/instance-1/output-1/build/tcf-agent-1.8.0/agent/tcf/services/tcf_elf.c:2079:27: error: 'STT_ARM_16BIT' undeclared (first use in this function) + 2079 | if (info->type == STT_ARM_16BIT) { + | ^~~~~~~~~~~~~ +/home/buildroot/autobuild/run/instance-1/output-1/build/tcf-agent-1.8.0/agent/tcf/services/tcf_elf.c:2079:27: note: each undeclared identifier is reported only once for each function it appears in +/home/buildroot/autobuild/run/instance-1/output-1/build/tcf-agent-1.8.0/agent/tcf/services/tcf_elf.c: In function 'create_symbol_addr_search_index': +/home/buildroot/autobuild/run/instance-1/output-1/build/tcf-agent-1.8.0/agent/tcf/services/tcf_elf.c:2228:78: error: 'STT_ARM_16BIT' undeclared (first use in this function) + 2228 | if (type == STT_FUNC || type == STT_ARM_TFUNC || type == STT_ARM_16BIT) { + | ^~~~~~~~~~~~~ + +Fixes: + - http://autobuild.buildroot.org/results/8388acf59689ed7e621bdf158483e3df1cf9bef7 + +Signed-off-by: Fabrice Fontaine +Upstream: https://gitlab.eclipse.org/eclipse/tcf/tcf.agent/-/merge_requests/1 +--- + agent/tcf/services/tcf_elf.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/agent/tcf/services/tcf_elf.c b/agent/tcf/services/tcf_elf.c +index 1b3900ec..b0b948e4 100644 +--- a/agent/tcf/services/tcf_elf.c ++++ b/agent/tcf/services/tcf_elf.c +@@ -2076,10 +2076,12 @@ void unpack_elf_symbol_info(ELF_Section * sym_sec, U4_T index, ELF_SymbolInfo * + } + + if (file->machine == EM_ARM) { ++#ifdef STT_ARM_16BIT + if (info->type == STT_ARM_16BIT) { + info->type = STT_OBJECT; + info->type16bit = 1; + } ++#endif + if (info->type == STT_ARM_TFUNC) { + info->type = STT_FUNC; + info->type16bit = 1; +@@ -2225,7 +2227,11 @@ static void create_symbol_addr_search_index(ELF_Section * sec) { + } + add = add && type != STT_GNU_IFUNC; + if (add && file->machine == EM_ARM) { +- if (type == STT_FUNC || type == STT_ARM_TFUNC || type == STT_ARM_16BIT) { ++ if (type == STT_FUNC || type == STT_ARM_TFUNC ++#ifdef STT_ARM_16BIT ++ || type == STT_ARM_16BIT ++#endif ++ ) { + addr = addr & ~(U8_T)1; + } + } +-- +2.43.0 +