diff options
-rw-r--r-- | meta-oe/recipes-devtools/libabigail/libabigail/0001-Check-for-correct-fts-module.patch | 90 |
1 files changed, 74 insertions, 16 deletions
diff --git a/meta-oe/recipes-devtools/libabigail/libabigail/0001-Check-for-correct-fts-module.patch b/meta-oe/recipes-devtools/libabigail/libabigail/0001-Check-for-correct-fts-module.patch index 2a9388b766..7c500e0b54 100644 --- a/meta-oe/recipes-devtools/libabigail/libabigail/0001-Check-for-correct-fts-module.patch +++ b/meta-oe/recipes-devtools/libabigail/libabigail/0001-Check-for-correct-fts-module.patch | |||
@@ -1,33 +1,91 @@ | |||
1 | From b6af55e8ae120488abc83312fcd184d8352175eb Mon Sep 17 00:00:00 2001 | 1 | From 0db4af09f1bf4456527b5f6ec60fc1305e770c4c Mon Sep 17 00:00:00 2001 |
2 | From: Ross Burton <ross.burton@arm.com> | 2 | From: Ross Burton <ross.burton@arm.com> |
3 | Date: Mon, 1 Jul 2024 10:53:45 +0000 | 3 | Date: Tue, 9 Jul 2024 15:19:35 +0100 |
4 | Subject: [PATCH] Check for correct fts module | 4 | Subject: [PATCH] configure.ac: improve fts checks |
5 | 5 | ||
6 | fts-standalone is a gentoo-specific name[1], every other distribution that | 6 | The current code checks explicitly for musl and if so uses pkg-config to |
7 | uses this library has named it musl-fts. | 7 | find fts-standalone. This is suboptimal because musl may not be the only |
8 | libc to need a standalone fts implementation, and fts-standalone is an | ||
9 | old gentoo-specific name[1] so libabigail won't build on any other system | ||
10 | against musl. | ||
8 | 11 | ||
9 | [1] https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-libs/fts-standalone/fts-standalone-1.2.7.ebuild#n34 | 12 | Instead, use AC_SEARCH_LIBS to look for fts_open in libc then libfts. Do |
13 | this before the check for behaviour just in case someone has a standalone | ||
14 | and broken implementation. I assume that the standalone fts is installed | ||
15 | on the standard search path, which should be a fair assumption. | ||
10 | 16 | ||
11 | Upstream-Status: Pending [discussing with libabigail and gentoo] | 17 | As we're not using pkg-config anymore the required link flags are now in |
18 | LIBS, so remove all instances of FTS_CFLAGS and FTS_LIBS. | ||
19 | |||
20 | [1] https://gitweb.gentoo.org/repo/gentoo.git/commit/sys-libs/fts-standalone?id=a403fe6c61d1aaeecd58d521f3def2f6d3513449 | ||
21 | |||
22 | Upstream-Status: Submitted [https://sourceware.org/pipermail/libabigail/2024q3/005973.html] | ||
12 | Signed-off-by: Ross Burton <ross.burton@arm.com> | 23 | Signed-off-by: Ross Burton <ross.burton@arm.com> |
13 | --- | 24 | --- |
14 | configure.ac | 4 ++-- | 25 | configure.ac | 9 ++++----- |
15 | 1 file changed, 2 insertions(+), 2 deletions(-) | 26 | src/Makefile.am | 4 ++-- |
27 | tools/Makefile.am | 2 -- | ||
28 | 3 files changed, 6 insertions(+), 9 deletions(-) | ||
16 | 29 | ||
17 | diff --git a/configure.ac b/configure.ac | 30 | diff --git a/configure.ac b/configure.ac |
18 | index d329490..5bad2ae 100644 | 31 | index e118a9c0..0aff2ec2 100644 |
19 | --- a/configure.ac | 32 | --- a/configure.ac |
20 | +++ b/configure.ac | 33 | +++ b/configure.ac |
21 | @@ -295,10 +295,10 @@ AS_IF([test "x$ac_cv_bad_fts" = "xyes"], | 34 | @@ -281,6 +281,10 @@ fi |
35 | |||
36 | AC_SUBST(VISIBILITY_FLAGS) | ||
37 | |||
38 | +# glibc and BSD include fts into their libc, but musl does not so check if we | ||
39 | +# need to explicitly link to the standalone musl-fts. | ||
40 | +AC_SEARCH_LIBS([fts_open], [fts]) | ||
41 | + | ||
42 | dnl Older glibc had a broken fts that didn't work with Large File Systems. | ||
43 | dnl We want the version that can handler LFS, but include workaround if we | ||
44 | dnl get a bad one. Add define to CFLAGS (not AC_DEFINE it) since we need to | ||
45 | @@ -295,11 +299,6 @@ AS_IF([test "x$ac_cv_bad_fts" = "xyes"], | ||
22 | [CFLAGS="$CFLAGS -DBAD_FTS=1", | 46 | [CFLAGS="$CFLAGS -DBAD_FTS=1", |
23 | CXXFLAGS="$CXXFLAGS -DBAD_FTS=1"]) | 47 | CXXFLAGS="$CXXFLAGS -DBAD_FTS=1"]) |
24 | 48 | ||
25 | -dnl On musl, we need to find fts-standalone | 49 | -dnl On musl, we need to find fts-standalone |
26 | +dnl On musl, we need to find the standalone fts library | 50 | -AS_CASE( |
27 | AS_CASE( | 51 | - [${host_os}], [*-musl*], [ |
28 | [${host_os}], [*-musl*], [ | ||
29 | - PKG_CHECK_MODULES([FTS], [fts-standalone]) | 52 | - PKG_CHECK_MODULES([FTS], [fts-standalone]) |
30 | + PKG_CHECK_MODULES([FTS], [musl-fts]) | 53 | -]) |
31 | ]) | ||
32 | 54 | ||
33 | dnl Check for dependency: libelf, libdw, libebl (elfutils) | 55 | dnl Check for dependency: libelf, libdw, libebl (elfutils) |
56 | dnl Note that we need to use at least elfutils 0.159 but | ||
57 | diff --git a/src/Makefile.am b/src/Makefile.am | ||
58 | index 3044c136..1c98bf84 100644 | ||
59 | --- a/src/Makefile.am | ||
60 | +++ b/src/Makefile.am | ||
61 | @@ -52,12 +52,12 @@ if BTF_READER | ||
62 | libabigail_la_SOURCES += abg-btf-reader.cc | ||
63 | endif | ||
64 | |||
65 | -libabigail_la_LIBADD = $(DEPS_LIBS) $(FTS_LIBS) | ||
66 | +libabigail_la_LIBADD = $(DEPS_LIBS) | ||
67 | libabigail_la_LDFLAGS = -lpthread -Wl,--as-needed -no-undefined -version-info $(LIBABIGAIL_SO_CURRENT):$(LIBABIGAIL_SO_REVISION):$(LIBABIGAIL_SO_AGE) | ||
68 | |||
69 | CUSTOM_MACROS = -DABIGAIL_ROOT_SYSTEM_LIBDIR=\"${libdir}\" | ||
70 | |||
71 | AM_CPPFLAGS=\ | ||
72 | -$(CUSTOM_MACROS) $(DEPS_CPPFLAGS) $(FTS_CFLAGS) \ | ||
73 | +$(CUSTOM_MACROS) $(DEPS_CPPFLAGS) \ | ||
74 | -Wall -I$(abs_top_srcdir) -I$(abs_top_srcdir)/include \ | ||
75 | -I$(abs_top_builddir)/include -I$(abs_top_builddir) | ||
76 | diff --git a/tools/Makefile.am b/tools/Makefile.am | ||
77 | index cbb5ce10..ea2d300c 100644 | ||
78 | --- a/tools/Makefile.am | ||
79 | +++ b/tools/Makefile.am | ||
80 | @@ -41,8 +41,6 @@ abicompatdir = $(bindir) | ||
81 | |||
82 | abipkgdiff_SOURCES = abipkgdiff.cc | ||
83 | abipkgdiffdir = $(bindir) | ||
84 | -abipkgdiff_CPPFLAGS = $(FTS_CFLAGS) | ||
85 | -abipkgdiff_LDADD = $(FTS_LIBS) | ||
86 | abipkgdiff_LDFLAGS = $(abs_top_builddir)/src/libabigail.la -pthread | ||
87 | |||
88 | kmidiff_SOURCES = kmidiff.cc | ||
89 | -- | ||
90 | 2.34.1 | ||
91 | |||