summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/debugedit/files
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/debugedit/files')
-rw-r--r--meta/recipes-devtools/debugedit/files/0001-Add-option-to-allow-disabling-inlined-xxhash.patch81
-rw-r--r--meta/recipes-devtools/debugedit/files/0002-sepdebugcrcfix.c-do-not-use-64bit-variants.patch56
-rw-r--r--meta/recipes-devtools/debugedit/files/0003-Makefile.am-do-not-update-manual.patch13
3 files changed, 86 insertions, 64 deletions
diff --git a/meta/recipes-devtools/debugedit/files/0001-Add-option-to-allow-disabling-inlined-xxhash.patch b/meta/recipes-devtools/debugedit/files/0001-Add-option-to-allow-disabling-inlined-xxhash.patch
new file mode 100644
index 0000000000..3aac43628b
--- /dev/null
+++ b/meta/recipes-devtools/debugedit/files/0001-Add-option-to-allow-disabling-inlined-xxhash.patch
@@ -0,0 +1,81 @@
1From 820498e881401a6f4b1715dc6831da965f6e1d69 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Tue, 18 Feb 2025 18:50:46 -0800
4Subject: [PATCH] Add option to allow disabling inlined xxhash
5
6xxhash cannot always inline. For example, when using gcc14 and
7'-Og' option, xxhash cannot inline. See links below:
8https://github.com/Cyan4973/xxHash/commit/574aabad87b2ab9440403e92e1075ef48554eb87
9https://github.com/Cyan4973/xxHash/issues/943#issuecomment-2563205130
10
11To allow users successfully build debugedit with gcc14 and "-Og" option,
12add an option to allow disabling inlined xxhash.
13
14This patch refers to a similar patch for libabigail:
15https://sourceware.org/cgit/libabigail/commit/?id=50497911e2590c21270e0763d277457cf7752c3f
16
17Note that the default remains using inlined xxhash.
18
19Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
20
21Upstream-Status: Backport [https://sourceware.org/cgit/debugedit/commit/?id=820498e881401a6f4b1715dc6831da965f6e1d69]
22
23Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
24---
25 Makefile.am | 4 ++--
26 configure.ac | 11 +++++++++++
27 tools/debugedit.c | 1 -
28 3 files changed, 13 insertions(+), 3 deletions(-)
29
30diff --git a/Makefile.am b/Makefile.am
31index c590edf..35fd947 100644
32--- a/Makefile.am
33+++ b/Makefile.am
34@@ -42,8 +42,8 @@ find-debuginfo: $(top_srcdir)/scripts/find-debuginfo.in Makefile
35
36 debugedit_SOURCES = tools/debugedit.c \
37 tools/hashtab.c
38-debugedit_CFLAGS = @LIBELF_CFLAGS@ @LIBDW_CFLAGS@ $(AM_CFLAGS)
39-debugedit_LDADD = @LIBELF_LIBS@ @LIBDW_LIBS@
40+debugedit_CFLAGS = @LIBELF_CFLAGS@ @LIBDW_CFLAGS@ @XXHASH_CFLAGS@ $(AM_CFLAGS)
41+debugedit_LDADD = @LIBELF_LIBS@ @LIBDW_LIBS@ @XXHASH_LIBS@
42
43 sepdebugcrcfix_SOURCES = tools/sepdebugcrcfix.c
44 sepdebugcrcfix_CFLAGS = @LIBELF_CFLAGS@ $(AM_CFLAGS)
45diff --git a/configure.ac b/configure.ac
46index a5a6e28..32dd27d 100644
47--- a/configure.ac
48+++ b/configure.ac
49@@ -181,6 +181,17 @@ else
50 fi
51 AC_SUBST([READELF_VERSION_OK])
52
53+ENABLE_INLINED_XXHASH=yes
54+AC_ARG_ENABLE(inlined-xxhash,
55+ AS_HELP_STRING([--disable-inlined-xxhash], [disable the inlined-only version of xxhash library]),
56+ ENABLE_INLINED_XXHASH=$enableval,
57+ ENABLE_INLINED_XXHASH=yes)
58+
59+if test x$ENABLE_INLINED_XXHASH = xyes; then
60+ XXHASH_CFLAGS="$XXHASH_CFLAGS -DXXH_INLINE_ALL"
61+ XXHASH_LIBS=""
62+fi
63+
64 # And generate the output files.
65 AC_CONFIG_FILES([Makefile])
66 AC_OUTPUT
67diff --git a/tools/debugedit.c b/tools/debugedit.c
68index beefd65..43f9cee 100644
69--- a/tools/debugedit.c
70+++ b/tools/debugedit.c
71@@ -82,7 +82,6 @@ typedef struct Ebl_Strtab Strtab;
72
73 #include "tools/hashtab.h"
74
75-#define XXH_INLINE_ALL
76 #include "xxhash.h"
77
78 #define DW_TAG_partial_unit 0x3c
79--
802.25.1
81
diff --git a/meta/recipes-devtools/debugedit/files/0002-sepdebugcrcfix.c-do-not-use-64bit-variants.patch b/meta/recipes-devtools/debugedit/files/0002-sepdebugcrcfix.c-do-not-use-64bit-variants.patch
deleted file mode 100644
index 4463bd2324..0000000000
--- a/meta/recipes-devtools/debugedit/files/0002-sepdebugcrcfix.c-do-not-use-64bit-variants.patch
+++ /dev/null
@@ -1,56 +0,0 @@
1From 3e05bbc1f7909ab6f529e66f0d0f70fb1e60583a Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Thu, 23 Mar 2023 11:55:53 +0800
4Subject: [PATCH 2/2] sepdebugcrcfix.c: do not use 64bit variants
5
6configure.ac checks for largefile support via AC_SYS_LARGEFILE
7already, therefore use off_t, open and lseek instead of 64bit
8variants. Musl e.g. does not define them without _LARGEFILE64_SOURCE
9and error is not seen on glibc because _GNU_SOURCE defines
10_LARGEFILE64_SOURCE.
11
12This patch is marked as inappropriate as debugedit obviously only
13wants to support glibc or some glibc compatible libcs. We can see
14this from the error() usage. And this patch is only for musl.
15
16Upstream-Status: Inappropriate [OE Specific]
17
18Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
19---
20 tools/sepdebugcrcfix.c | 6 +++---
21 1 file changed, 3 insertions(+), 3 deletions(-)
22
23diff --git a/tools/sepdebugcrcfix.c b/tools/sepdebugcrcfix.c
24index c4a9d56..882e5f5 100644
25--- a/tools/sepdebugcrcfix.c
26+++ b/tools/sepdebugcrcfix.c
27@@ -144,7 +144,7 @@ crc32 (const char *fname, const char *base_fname, uint32_t *crcp)
28 error (0, errno, _("cannot open \"%s\""), debugname);
29 return false;
30 }
31- off64_t size = lseek64 (fd, 0, SEEK_END);
32+ off_t size = lseek (fd, 0, SEEK_END);
33 if (size == -1)
34 {
35 error (0, errno, _("cannot get size of \"%s\""), debugname);
36@@ -289,7 +289,7 @@ process (Elf *elf, int fd, const char *fname)
37 return true;
38 }
39 updated_count++;
40- off64_t seekto = (shdr->sh_offset + data->d_off
41+ off_t seekto = (shdr->sh_offset + data->d_off
42 + (crcp - (const uint8_t *) data->d_buf));
43 uint32_t crc_targetendian = (ehdr->e_ident[EI_DATA] == ELFDATA2LSB
44 ? htole32 (crc) : htobe32 (crc));
45@@ -361,7 +361,7 @@ main (int argc, char **argv)
46 error (0, errno, _("cannot chmod \"%s\" to make sure we can read and write"), fname);
47
48 bool failed = false;
49- int fd = open64 (fname, O_RDWR);
50+ int fd = open (fname, O_RDWR);
51 if (fd == -1)
52 {
53 error (0, errno, _("cannot open \"%s\""), fname);
54--
552.17.1
56
diff --git a/meta/recipes-devtools/debugedit/files/0003-Makefile.am-do-not-update-manual.patch b/meta/recipes-devtools/debugedit/files/0003-Makefile.am-do-not-update-manual.patch
index de467f5365..d0414f739a 100644
--- a/meta/recipes-devtools/debugedit/files/0003-Makefile.am-do-not-update-manual.patch
+++ b/meta/recipes-devtools/debugedit/files/0003-Makefile.am-do-not-update-manual.patch
@@ -1,7 +1,7 @@
1From 4f0d7d2f4900ce8555e09854dc681278b7a3d9a9 Mon Sep 17 00:00:00 2001 1From b2715c3f4d28fab1c238086d9b5435e269b06301 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Thu, 23 Mar 2023 13:09:23 +0800 3Date: Thu, 23 Mar 2023 13:09:23 +0800
4Subject: [PATCH 3/3] Makefile.am: do not update manual 4Subject: [PATCH] Makefile.am: do not update manual
5 5
6The tarball ships these manuals, no need to re-generate them. 6The tarball ships these manuals, no need to re-generate them.
7We have local patches for debugedit.c and sepdebugcrcfix.c, 7We have local patches for debugedit.c and sepdebugcrcfix.c,
@@ -20,7 +20,7 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
20 1 file changed, 30 deletions(-) 20 1 file changed, 30 deletions(-)
21 21
22diff --git a/Makefile.am b/Makefile.am 22diff --git a/Makefile.am b/Makefile.am
23index 98b2f20..f91deea 100644 23index c590edf..692e016 100644
24--- a/Makefile.am 24--- a/Makefile.am
25+++ b/Makefile.am 25+++ b/Makefile.am
26@@ -52,36 +52,6 @@ sepdebugcrcfix_LDADD = @LIBELF_LIBS@ 26@@ -52,36 +52,6 @@ sepdebugcrcfix_LDADD = @LIBELF_LIBS@
@@ -58,8 +58,5 @@ index 98b2f20..f91deea 100644
58- esac 58- esac
59- 59-
60 noinst_HEADERS= tools/ansidecl.h \ 60 noinst_HEADERS= tools/ansidecl.h \
61 tools/hashtab.h \ 61 tools/hashtab.h
62 tools/md5.h \ 62
63--
642.17.1
65