From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by sourceware.org (Postfix) with ESMTPS id 21A793858D20 for ; Mon, 7 Feb 2022 14:13:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 21A793858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=seketeli.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=seketeli.org Received: (Authenticated sender: dodji@seketeli.org) by mail.gandi.net (Postfix) with ESMTPSA id BD918FF809; Mon, 7 Feb 2022 14:13:30 +0000 (UTC) Received: by localhost (Postfix, from userid 1000) id C9B255802B4; Mon, 7 Feb 2022 15:13:29 +0100 (CET) From: Dodji Seketeli To: David Seifert via Libabigail Cc: David Seifert Subject: Re: [PATCH] Find fts-standalone on musl Organization: Me, myself and I References: <20220129193107.2706650-1-soap@gentoo.org> X-Operating-System: Fedora 36 X-URL: http://www.seketeli.net/~dodji Date: Mon, 07 Feb 2022 15:13:29 +0100 In-Reply-To: <20220129193107.2706650-1-soap@gentoo.org> (David Seifert via Libabigail's message of "Sat, 29 Jan 2022 20:31:07 +0100") Message-ID: <87iltqn4s6.fsf@seketeli.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Feb 2022 14:13:40 -0000 Hello David, David Seifert via Libabigail a =C3=A9crit: > Bug: https://bugs.gentoo.org/831571 > --- > configure.ac | 7 +++++++ > src/Makefile.am | 4 ++-- > tools/Makefile.am | 3 ++- > tools/abisym.cc | 1 + > tools/kmidiff.cc | 1 - > 5 files changed, 12 insertions(+), 4 deletions(-) Thank you for this patch! I have amended it a little to make its commit log part comply with the project's standard described at in the COMMIT-LOG-GUIDELINES file in the source tree, which can be browsed online at https://sourceware.org/git/?p=3Dlibabigail.git;a=3Dblob_plain;f=3DCOMMIT-LO= G-GUIDELINES. You'll find the patch attached bellow. Also, as described at line 284 of the CONTRIBUTING file in the source tree, which can be browsed online at https://sourceware.org/git/?p=3Dlibabigail.git;a=3Dblob;f=3DCONTRIBUTING;hb= =3DHEAD#l284, I need you to write a signed-off-by Daved Seifert In reply to the patch below so that I can add it to the git repository. So here is the patch from you (modulo the signed-off-by that I still need from you) that I propose to apply to the git repository. Is that OK? Thanks. >From f685aedb92e7b6a31ccf26791f61304f26f2dab1 Mon Sep 17 00:00:00 2001 From: David Seifert Date: Sat, 29 Jan 2022 20:31:07 +0100 Subject: [PATCH] Find fts-standalone on musl When using the musl C library fts is optional. So we need to detect its presence by looking at the fts-standalone pkgconfig module. This patch does that. This comes from Gentoo bug https://bugs.gentoo.org/831571 * configure.ac: Invoke AC_CANONICAL_HOST to compute the host_cpu, host_vendor, host_os parts of the 'host" variable. Then if the host_os ends up with "musl" then, check for the fts-standalone pkgconfig module and record the fts library into FTS_{LIBS,CFLAGS}. * src/Makefile.am: Link to $FTS_LIBS and use $FTS_CFLAGS for compilation. * tools/Makefile.am: Likewise. * tools/abisym.cc: Include libgen.h * tools/kmidiff.cc: Remove useless fts.h header file. Signed-off-by: Dodji Seketeli --- configure.ac | 7 +++++++ src/Makefile.am | 4 ++-- tools/Makefile.am | 3 ++- tools/kmidiff.cc | 1 - 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 29130175..019bdbac 100644 --- a/configure.ac +++ b/configure.ac @@ -161,6 +161,7 @@ dnl check for dependencies dnl ************************************************* =20 AC_PROG_CXX +AC_CANONICAL_HOST AC_USE_SYSTEM_EXTENSIONS AC_PROG_INSTALL =20 @@ -219,6 +220,12 @@ AS_IF([test "x$ac_cv_bad_fts" =3D "xyes"], [CFLAGS=3D"$CFLAGS -DBAD_FTS=3D1", CXXFLAGS=3D"$CXXFLAGS -DBAD_FTS=3D1"]) =20 +dnl On musl, we need to find fts-standalone +AS_CASE( + [${host_os}], [*-musl*], [ + PKG_CHECK_MODULES([FTS], [fts-standalone]) +]) + dnl Check for dependency: libelf, libdw, libebl (elfutils) dnl Note that we need to use at least elfutils 0.159 but dnl at that time elfutils didnt have pkgconfig capabilities diff --git a/src/Makefile.am b/src/Makefile.am index 29da1ecf..1591224f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -46,12 +46,12 @@ if CTF_READER libabigail_la_SOURCES +=3D abg-ctf-reader.cc endif =20 -libabigail_la_LIBADD =3D $(DEPS_LIBS) +libabigail_la_LIBADD =3D $(DEPS_LIBS) $(FTS_LIBS) libabigail_la_LDFLAGS =3D -lpthread -Wl,--as-needed -no-undefined =20 CUSTOM_MACROS =3D -DABIGAIL_ROOT_SYSTEM_LIBDIR=3D\"${libdir}\" =20 AM_CPPFLAGS=3D\ -$(CUSTOM_MACROS) $(DEPS_CPPFLAGS) \ +$(CUSTOM_MACROS) $(DEPS_CPPFLAGS) $(FTS_CFLAGS) \ -Wall -I$(abs_top_srcdir) -I$(abs_top_srcdir)/include \ -I$(abs_top_builddir)/include -I$(abs_top_builddir) diff --git a/tools/Makefile.am b/tools/Makefile.am index 648a71b5..f7592b60 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -37,7 +37,8 @@ abicompat_LDADD =3D $(abs_top_builddir)/src/libabigail.la =20 abipkgdiff_SOURCES =3D abipkgdiff.cc abipkgdiffdir =3D $(bindir) -abipkgdiff_LDADD =3D $(abs_top_builddir)/src/libabigail.la +abipkgdiff_CPPFLAGS =3D $(FTS_CFLAGS) +abipkgdiff_LDADD =3D $(abs_top_builddir)/src/libabigail.la $(FTS_LIBS) abipkgdiff_LDFLAGS =3D -pthread =20 kmidiff_SOURCES =3D kmidiff.cc diff --git a/tools/kmidiff.cc b/tools/kmidiff.cc index b802348f..2e88baa7 100644 --- a/tools/kmidiff.cc +++ b/tools/kmidiff.cc @@ -11,7 +11,6 @@ =20 #include #include -#include #include #include #include --=20 2.35.0.rc2 --=20 Dodji