diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2025-02-20 05:24:19 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-02-25 12:17:22 +0000 |
commit | 116070ab08021e2d7d3674d69029992ca103f0fd (patch) | |
tree | e58f76e46203d9405723fcfb9b0965fe8924e711 | |
parent | ae8fe5b896a1f6bd0740d1fa6638b9d9377a8d28 (diff) | |
download | poky-116070ab08021e2d7d3674d69029992ca103f0fd.tar.gz |
debugedit: fix build failure when enabling DEBUG_BUILD
When DEBUG_BUILD is enabled, we use "-Og" gcc options. In such
case, the xxhash functions are considered not inline, yet debugedit.c
defined XXH_INLINE_ALL to force inline, thus causing build failure.
Backport a patch which add "--disable-inlined-xxhash" option and
make debugedit use that option when DEBUG_BUILD is enabled.
The 0003-Makefile.am-do-not-update-manual.patch is moved from musl
specific patch to SRC_URI, because we now have a patch to modify debugedit.c
and this will cause manual to be generated again. This is unnecessary and
will report help2man missing.
(From OE-Core rev: 7aaf60854c6bc9c075399de7450fe63b21b2883b)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-devtools/debugedit/debugedit_5.1.bb | 6 | ||||
-rw-r--r-- | meta/recipes-devtools/debugedit/files/0001-Add-option-to-allow-disabling-inlined-xxhash.patch | 81 |
2 files changed, 84 insertions, 3 deletions
diff --git a/meta/recipes-devtools/debugedit/debugedit_5.1.bb b/meta/recipes-devtools/debugedit/debugedit_5.1.bb index 00c40473c4..384909a36f 100644 --- a/meta/recipes-devtools/debugedit/debugedit_5.1.bb +++ b/meta/recipes-devtools/debugedit/debugedit_5.1.bb | |||
@@ -10,9 +10,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \ | |||
10 | file://COPYING3;md5=d32239bcb673463ab874e80d47fae504" | 10 | file://COPYING3;md5=d32239bcb673463ab874e80d47fae504" |
11 | 11 | ||
12 | SRC_URI = "https://sourceware.org/ftp/debugedit/${PV}/debugedit-${PV}.tar.xz \ | 12 | SRC_URI = "https://sourceware.org/ftp/debugedit/${PV}/debugedit-${PV}.tar.xz \ |
13 | " | 13 | file://0001-Add-option-to-allow-disabling-inlined-xxhash.patch \ |
14 | |||
15 | SRC_URI:append:libc-musl = "\ | ||
16 | file://0003-Makefile.am-do-not-update-manual.patch \ | 14 | file://0003-Makefile.am-do-not-update-manual.patch \ |
17 | " | 15 | " |
18 | 16 | ||
@@ -25,6 +23,8 @@ inherit pkgconfig autotools multilib_script | |||
25 | 23 | ||
26 | RDEPENDS:${PN} += "bash elfutils-binutils" | 24 | RDEPENDS:${PN} += "bash elfutils-binutils" |
27 | 25 | ||
26 | EXTRA_OECONF = "${@oe.utils.vartrue('DEBUG_BUILD', '--disable-inlined-xxhash', '', d)}" | ||
27 | |||
28 | BBCLASSEXTEND = "native nativesdk" | 28 | BBCLASSEXTEND = "native nativesdk" |
29 | 29 | ||
30 | MULTILIB_SCRIPTS = "${PN}:${bindir}/find-debuginfo" | 30 | MULTILIB_SCRIPTS = "${PN}:${bindir}/find-debuginfo" |
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 | |||