diff options
Diffstat (limited to 'meta/recipes-devtools/debugedit/files/0001-Add-option-to-allow-disabling-inlined-xxhash.patch')
-rw-r--r-- | meta/recipes-devtools/debugedit/files/0001-Add-option-to-allow-disabling-inlined-xxhash.patch | 81 |
1 files changed, 81 insertions, 0 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 @@ | |||
1 | From 820498e881401a6f4b1715dc6831da965f6e1d69 Mon Sep 17 00:00:00 2001 | ||
2 | From: Chen Qi <Qi.Chen@windriver.com> | ||
3 | Date: Tue, 18 Feb 2025 18:50:46 -0800 | ||
4 | Subject: [PATCH] Add option to allow disabling inlined xxhash | ||
5 | |||
6 | xxhash cannot always inline. For example, when using gcc14 and | ||
7 | '-Og' option, xxhash cannot inline. See links below: | ||
8 | https://github.com/Cyan4973/xxHash/commit/574aabad87b2ab9440403e92e1075ef48554eb87 | ||
9 | https://github.com/Cyan4973/xxHash/issues/943#issuecomment-2563205130 | ||
10 | |||
11 | To allow users successfully build debugedit with gcc14 and "-Og" option, | ||
12 | add an option to allow disabling inlined xxhash. | ||
13 | |||
14 | This patch refers to a similar patch for libabigail: | ||
15 | https://sourceware.org/cgit/libabigail/commit/?id=50497911e2590c21270e0763d277457cf7752c3f | ||
16 | |||
17 | Note that the default remains using inlined xxhash. | ||
18 | |||
19 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> | ||
20 | |||
21 | Upstream-Status: Backport [https://sourceware.org/cgit/debugedit/commit/?id=820498e881401a6f4b1715dc6831da965f6e1d69] | ||
22 | |||
23 | Signed-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 | |||
30 | diff --git a/Makefile.am b/Makefile.am | ||
31 | index 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) | ||
45 | diff --git a/configure.ac b/configure.ac | ||
46 | index 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 | ||
67 | diff --git a/tools/debugedit.c b/tools/debugedit.c | ||
68 | index 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 | -- | ||
80 | 2.25.1 | ||
81 | |||