* [PATCH v2] Support building when fts and obstack aren't part of libc.
@ 2020-11-02 0:48 Érico Nogueira
2020-11-03 0:13 ` Mark Wielaard
2020-11-03 22:33 ` [PATCH v2] Support building when fts and obstack aren't part of libc Dmitry V. Levin
0 siblings, 2 replies; 11+ messages in thread
From: Érico Nogueira @ 2020-11-02 0:48 UTC (permalink / raw)
To: elfutils-devel; +Cc: Érico Rolim
From: Érico Rolim <erico.erc@gmail.com>
- Make configure.ac test for fts and obstack availability;
- Add fts and obstack ldflags to all files that need them;
- Add missing argp ldflags to programs in debuginfod/.
Signed-off-by: Érico Rolim <erico.erc@gmail.com>
---
ChangeLog | 4 ++++
configure.ac | 20 ++++++++++++++++++++
debuginfod/Makefile.am | 6 +++---
libdw/Makefile.am | 2 +-
src/Makefile.am | 6 +++---
5 files changed, 31 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 128da6c6..565d021c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2020-11-01 Érico N. Rolim <erico.erc@gmail.com>
+
+ * configure.ac: Check for fts and obstack from outside libc.
+
2020-10-28 Mark Wielaard <mark@klomp.org>
* configure.ac: Set version to 0.182.
diff --git a/configure.ac b/configure.ac
index 515ac704..c1a6954d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -542,6 +542,26 @@ else
fi
AC_SUBST([argp_LDADD])
+saved_LIBS="$LIBS"
+AC_SEARCH_LIBS([fts_close], [fts])
+LIBS="$saved_LIBS"
+case "$ac_cv_search_fts_close" in
+ no) AC_MSG_FAILURE([failed to find fts_close]) ;;
+ -l*) fts_LIBS="$ac_cv_search_fts_close" ;;
+ *) fts_LIBS= ;;
+esac
+AC_SUBST([fts_LIBS])
+
+saved_LIBS="$LIBS"
+AC_SEARCH_LIBS([_obstack_free], [obstack])
+LIBS="$saved_LIBS"
+case "$ac_cv_search__obstack_free" in
+ no) AC_MSG_FAILURE([failed to find obstack_free]) ;;
+ -l*) obstack_LIBS="$ac_cv_search__obstack_free" ;;
+ *) obstack_LIBS= ;;
+esac
+AC_SUBST([obstack_LIBS])
+
dnl The directories with content.
dnl Documentation.
diff --git a/debuginfod/Makefile.am b/debuginfod/Makefile.am
index 01985600..0af3b58c 100644
--- a/debuginfod/Makefile.am
+++ b/debuginfod/Makefile.am
@@ -71,10 +71,10 @@ bin_PROGRAMS += debuginfod-find
endif
debuginfod_SOURCES = debuginfod.cxx
-debuginfod_LDADD = $(libdw) $(libelf) $(libeu) $(libdebuginfod) $(libmicrohttpd_LIBS) $(sqlite3_LIBS) $(libarchive_LIBS) -lpthread -ldl
+debuginfod_LDADD = $(libdw) $(libelf) $(libeu) $(libdebuginfod) $(argp_LDADD) $(fts_LIBS) $(libmicrohttpd_LIBS) $(sqlite3_LIBS) $(libarchive_LIBS) -lpthread -ldl
debuginfod_find_SOURCES = debuginfod-find.c
-debuginfod_find_LDADD = $(libdw) $(libelf) $(libeu) $(libdebuginfod)
+debuginfod_find_LDADD = $(libdw) $(libelf) $(libeu) $(libdebuginfod) $(argp_LDADD) $(fts_LIBS)
if LIBDEBUGINFOD
noinst_LIBRARIES = libdebuginfod.a
@@ -98,7 +98,7 @@ libdebuginfod_so_LIBS = libdebuginfod_pic.a
if DUMMY_LIBDEBUGINFOD
libdebuginfod_so_LDLIBS =
else
-libdebuginfod_so_LDLIBS = $(libcurl_LIBS)
+libdebuginfod_so_LDLIBS = $(libcurl_LIBS) $(fts_LIBS)
endif
libdebuginfod.so$(EXEEXT): $(srcdir)/libdebuginfod.map $(libdebuginfod_so_LIBS)
$(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
diff --git a/libdw/Makefile.am b/libdw/Makefile.am
index 33b5838d..1dbb3d5e 100644
--- a/libdw/Makefile.am
+++ b/libdw/Makefile.am
@@ -109,7 +109,7 @@ libdw_so_LIBS = ../libebl/libebl_pic.a ../backends/libebl_backends_pic.a \
../libcpu/libcpu_pic.a libdw_pic.a ../libdwelf/libdwelf_pic.a \
../libdwfl/libdwfl_pic.a
libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so
-libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS) -pthread
+libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(fts_LIBS) $(obstack_LIBS) $(zip_LIBS) -pthread
libdw_so_SOURCES =
libdw.so$(EXEEXT): $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS)
$(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
diff --git a/src/Makefile.am b/src/Makefile.am
index e462e7d7..88d0ac8f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -69,7 +69,7 @@ ar_no_Wstack_usage = yes
unstrip_no_Wstack_usage = yes
readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD)
-nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) \
+nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS) \
$(demanglelib)
size_LDADD = $(libelf) $(libeu) $(argp_LDADD)
strip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
@@ -78,9 +78,9 @@ findtextrel_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD)
addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(demanglelib)
elfcmp_LDADD = $(libebl) $(libdw) $(libelf) $(libeu) $(argp_LDADD)
objdump_LDADD = $(libasm) $(libebl) $(libdw) $(libelf) $(libeu) $(argp_LDADD)
-ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD)
+ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS)
strings_LDADD = $(libelf) $(libeu) $(argp_LDADD)
-ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD)
+ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS)
unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) $(demanglelib)
elfcompress_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
--
2.29.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] Support building when fts and obstack aren't part of libc.
2020-11-02 0:48 [PATCH v2] Support building when fts and obstack aren't part of libc Érico Nogueira
@ 2020-11-03 0:13 ` Mark Wielaard
2020-11-03 2:41 ` Érico Nogueira
2020-11-03 22:33 ` [PATCH v2] Support building when fts and obstack aren't part of libc Dmitry V. Levin
1 sibling, 1 reply; 11+ messages in thread
From: Mark Wielaard @ 2020-11-03 0:13 UTC (permalink / raw)
To: Érico Nogueira; +Cc: elfutils-devel, Érico Rolim
Hi Érico,
On Sun, Nov 01, 2020 at 09:48:50PM -0300, Érico Nogueira via Elfutils-devel wrote:
> From: Érico Rolim <erico.erc@gmail.com>
>
> - Make configure.ac test for fts and obstack availability;
> - Add fts and obstack ldflags to all files that need them;
> - Add missing argp ldflags to programs in debuginfod/.
This looks good.
> Signed-off-by: Érico Rolim <erico.erc@gmail.com>
> ---
> ChangeLog | 4 ++++
> configure.ac | 20 ++++++++++++++++++++
> debuginfod/Makefile.am | 6 +++---
> libdw/Makefile.am | 2 +-
> src/Makefile.am | 6 +++---
> 5 files changed, 31 insertions(+), 7 deletions(-)
>
> diff --git a/ChangeLog b/ChangeLog
> index 128da6c6..565d021c 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,7 @@
> +2020-11-01 Érico N. Rolim <erico.erc@gmail.com>
> +
> + * configure.ac: Check for fts and obstack from outside libc.
> +
> 2020-10-28 Mark Wielaard <mark@klomp.org>
>
> * configure.ac: Set version to 0.182.
> diff --git a/configure.ac b/configure.ac
> index 515ac704..c1a6954d 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -542,6 +542,26 @@ else
> fi
> AC_SUBST([argp_LDADD])
>
> +saved_LIBS="$LIBS"
> +AC_SEARCH_LIBS([fts_close], [fts])
> +LIBS="$saved_LIBS"
> +case "$ac_cv_search_fts_close" in
> + no) AC_MSG_FAILURE([failed to find fts_close]) ;;
> + -l*) fts_LIBS="$ac_cv_search_fts_close" ;;
> + *) fts_LIBS= ;;
> +esac
> +AC_SUBST([fts_LIBS])
> +
> +saved_LIBS="$LIBS"
> +AC_SEARCH_LIBS([_obstack_free], [obstack])
> +LIBS="$saved_LIBS"
> +case "$ac_cv_search__obstack_free" in
> + no) AC_MSG_FAILURE([failed to find obstack_free]) ;;
> + -l*) obstack_LIBS="$ac_cv_search__obstack_free" ;;
> + *) obstack_LIBS= ;;
> +esac
> +AC_SUBST([obstack_LIBS])
> +
> dnl The directories with content.
OK, normally this says none required which is handled by the *) case.
Shouldn't we do argp in the same way? This looks simpler than what we
have now.
> dnl Documentation.
> diff --git a/debuginfod/Makefile.am b/debuginfod/Makefile.am
> index 01985600..0af3b58c 100644
> --- a/debuginfod/Makefile.am
> +++ b/debuginfod/Makefile.am
> @@ -71,10 +71,10 @@ bin_PROGRAMS += debuginfod-find
> endif
>
> debuginfod_SOURCES = debuginfod.cxx
> -debuginfod_LDADD = $(libdw) $(libelf) $(libeu) $(libdebuginfod) $(libmicrohttpd_LIBS) $(sqlite3_LIBS) $(libarchive_LIBS) -lpthread -ldl
> +debuginfod_LDADD = $(libdw) $(libelf) $(libeu) $(libdebuginfod) $(argp_LDADD) $(fts_LIBS) $(libmicrohttpd_LIBS) $(sqlite3_LIBS) $(libarchive_LIBS) -lpthread -ldl
OK, debuginfod uses argp and fts.
> debuginfod_find_SOURCES = debuginfod-find.c
> -debuginfod_find_LDADD = $(libdw) $(libelf) $(libeu) $(libdebuginfod)
> +debuginfod_find_LDADD = $(libdw) $(libelf) $(libeu) $(libdebuginfod) $(argp_LDADD) $(fts_LIBS)
Likewise for debuginfod_find.
> if LIBDEBUGINFOD
> noinst_LIBRARIES = libdebuginfod.a
> @@ -98,7 +98,7 @@ libdebuginfod_so_LIBS = libdebuginfod_pic.a
> if DUMMY_LIBDEBUGINFOD
> libdebuginfod_so_LDLIBS =
> else
> -libdebuginfod_so_LDLIBS = $(libcurl_LIBS)
> +libdebuginfod_so_LDLIBS = $(libcurl_LIBS) $(fts_LIBS)
libdebuginfod_so uses fts.
> endif
> libdebuginfod.so$(EXEEXT): $(srcdir)/libdebuginfod.map $(libdebuginfod_so_LIBS)
> $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
> diff --git a/libdw/Makefile.am b/libdw/Makefile.am
> index 33b5838d..1dbb3d5e 100644
> --- a/libdw/Makefile.am
> +++ b/libdw/Makefile.am
> @@ -109,7 +109,7 @@ libdw_so_LIBS = ../libebl/libebl_pic.a ../backends/libebl_backends_pic.a \
> ../libcpu/libcpu_pic.a libdw_pic.a ../libdwelf/libdwelf_pic.a \
> ../libdwfl/libdwfl_pic.a
> libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so
> -libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS) -pthread
> +libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(fts_LIBS) $(obstack_LIBS) $(zip_LIBS) -pthread
OK. libdw.so uses fts and obstacks.
> libdw_so_SOURCES =
> libdw.so$(EXEEXT): $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS)
> $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
> diff --git a/src/Makefile.am b/src/Makefile.am
> index e462e7d7..88d0ac8f 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -69,7 +69,7 @@ ar_no_Wstack_usage = yes
> unstrip_no_Wstack_usage = yes
>
> readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD)
> -nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) \
> +nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS) \
> $(demanglelib)
OK, nm uses obstacks.
> size_LDADD = $(libelf) $(libeu) $(argp_LDADD)
> strip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
> @@ -78,9 +78,9 @@ findtextrel_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD)
> addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(demanglelib)
> elfcmp_LDADD = $(libebl) $(libdw) $(libelf) $(libeu) $(argp_LDADD)
> objdump_LDADD = $(libasm) $(libebl) $(libdw) $(libelf) $(libeu) $(argp_LDADD)
> -ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD)
> +ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS)
ranlib includes arlib.h which uses obstack.
> strings_LDADD = $(libelf) $(libeu) $(argp_LDADD)
> -ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD)
> +ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS)
Likewise for ar.
> unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
> stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) $(demanglelib)
> elfcompress_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
I added the missing ChangeLog entries and pushed.
Thanks,
Mark
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] Support building when fts and obstack aren't part of libc.
2020-11-03 0:13 ` Mark Wielaard
@ 2020-11-03 2:41 ` Érico Nogueira
2020-11-03 17:05 ` Mark Wielaard
0 siblings, 1 reply; 11+ messages in thread
From: Érico Nogueira @ 2020-11-03 2:41 UTC (permalink / raw)
To: Mark Wielaard; +Cc: elfutils-devel, Érico Rolim
On Mon Nov 2, 2020 at 10:13 PM -03, Mark Wielaard wrote:
> Hi Érico,
>
> On Sun, Nov 01, 2020 at 09:48:50PM -0300, Érico Nogueira via
> Elfutils-devel wrote:
> > From: Érico Rolim <erico.erc@gmail.com>
> >
> > - Make configure.ac test for fts and obstack availability;
> > - Add fts and obstack ldflags to all files that need them;
> > - Add missing argp ldflags to programs in debuginfod/.
>
> This looks good.
>
> > Signed-off-by: Érico Rolim <erico.erc@gmail.com>
> > ---
> > ChangeLog | 4 ++++
> > configure.ac | 20 ++++++++++++++++++++
> > debuginfod/Makefile.am | 6 +++---
> > libdw/Makefile.am | 2 +-
> > src/Makefile.am | 6 +++---
> > 5 files changed, 31 insertions(+), 7 deletions(-)
> >
> > diff --git a/ChangeLog b/ChangeLog
> > index 128da6c6..565d021c 100644
> > --- a/ChangeLog
> > +++ b/ChangeLog
> > @@ -1,3 +1,7 @@
> > +2020-11-01 Érico N. Rolim <erico.erc@gmail.com>
> > +
> > + * configure.ac: Check for fts and obstack from outside libc.
> > +
> > 2020-10-28 Mark Wielaard <mark@klomp.org>
> >
> > * configure.ac: Set version to 0.182.
> > diff --git a/configure.ac b/configure.ac
> > index 515ac704..c1a6954d 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -542,6 +542,26 @@ else
> > fi
> > AC_SUBST([argp_LDADD])
> >
> > +saved_LIBS="$LIBS"
> > +AC_SEARCH_LIBS([fts_close], [fts])
> > +LIBS="$saved_LIBS"
> > +case "$ac_cv_search_fts_close" in
> > + no) AC_MSG_FAILURE([failed to find fts_close]) ;;
> > + -l*) fts_LIBS="$ac_cv_search_fts_close" ;;
> > + *) fts_LIBS= ;;
> > +esac
> > +AC_SUBST([fts_LIBS])
> > +
> > +saved_LIBS="$LIBS"
> > +AC_SEARCH_LIBS([_obstack_free], [obstack])
> > +LIBS="$saved_LIBS"
> > +case "$ac_cv_search__obstack_free" in
> > + no) AC_MSG_FAILURE([failed to find obstack_free]) ;;
> > + -l*) obstack_LIBS="$ac_cv_search__obstack_free" ;;
> > + *) obstack_LIBS= ;;
> > +esac
> > +AC_SUBST([obstack_LIBS])
> > +
> > dnl The directories with content.
>
> OK, normally this says none required which is handled by the *) case.
> Shouldn't we do argp in the same way? This looks simpler than what we
> have now.
I can send a patch to change it.
>
> I added the missing ChangeLog entries and pushed.
Thank you!
>
> Thanks,
>
> Mark
Érico
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] Support building when fts and obstack aren't part of libc.
2020-11-03 2:41 ` Érico Nogueira
@ 2020-11-03 17:05 ` Mark Wielaard
2020-12-11 0:59 ` [PATCH] configure.ac: simplify argp check Dmitry V. Levin
0 siblings, 1 reply; 11+ messages in thread
From: Mark Wielaard @ 2020-11-03 17:05 UTC (permalink / raw)
To: Érico Nogueira; +Cc: Érico Rolim, elfutils-devel
Hi Érico,
On Mon, 2020-11-02 at 23:41 -0300, Érico Nogueira via Elfutils-devel
wrote:
> On Mon Nov 2, 2020 at 10:13 PM -03, Mark Wielaard wrote:
> > Shouldn't we do argp in the same way? This looks simpler than what
> > we have now.
>
> I can send a patch to change it.
That would be great. Then all three of these configure checks are
similar.
Thanks,
Mark
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] Support building when fts and obstack aren't part of libc.
2020-11-02 0:48 [PATCH v2] Support building when fts and obstack aren't part of libc Érico Nogueira
2020-11-03 0:13 ` Mark Wielaard
@ 2020-11-03 22:33 ` Dmitry V. Levin
2020-11-03 23:39 ` Érico Nogueira
2020-12-11 0:59 ` [PATCH] configure.ac: fix typo in error diagnostics Dmitry V. Levin
1 sibling, 2 replies; 11+ messages in thread
From: Dmitry V. Levin @ 2020-11-03 22:33 UTC (permalink / raw)
To: Érico Nogueira; +Cc: elfutils-devel, Érico Rolim
On Sun, Nov 01, 2020 at 09:48:50PM -0300, Érico Nogueira via Elfutils-devel wrote:
> From: Érico Rolim <erico.erc@gmail.com>
>
> - Make configure.ac test for fts and obstack availability;
> - Add fts and obstack ldflags to all files that need them;
> - Add missing argp ldflags to programs in debuginfod/.
>
> Signed-off-by: Érico Rolim <erico.erc@gmail.com>
> ---
> ChangeLog | 4 ++++
> configure.ac | 20 ++++++++++++++++++++
> debuginfod/Makefile.am | 6 +++---
> libdw/Makefile.am | 2 +-
> src/Makefile.am | 6 +++---
> 5 files changed, 31 insertions(+), 7 deletions(-)
>
> diff --git a/ChangeLog b/ChangeLog
> index 128da6c6..565d021c 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,7 @@
> +2020-11-01 Érico N. Rolim <erico.erc@gmail.com>
> +
> + * configure.ac: Check for fts and obstack from outside libc.
> +
> 2020-10-28 Mark Wielaard <mark@klomp.org>
>
> * configure.ac: Set version to 0.182.
> diff --git a/configure.ac b/configure.ac
> index 515ac704..c1a6954d 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -542,6 +542,26 @@ else
> fi
> AC_SUBST([argp_LDADD])
>
> +saved_LIBS="$LIBS"
> +AC_SEARCH_LIBS([fts_close], [fts])
> +LIBS="$saved_LIBS"
> +case "$ac_cv_search_fts_close" in
> + no) AC_MSG_FAILURE([failed to find fts_close]) ;;
> + -l*) fts_LIBS="$ac_cv_search_fts_close" ;;
> + *) fts_LIBS= ;;
> +esac
> +AC_SUBST([fts_LIBS])
> +
> +saved_LIBS="$LIBS"
> +AC_SEARCH_LIBS([_obstack_free], [obstack])
> +LIBS="$saved_LIBS"
> +case "$ac_cv_search__obstack_free" in
> + no) AC_MSG_FAILURE([failed to find obstack_free]) ;;
> + -l*) obstack_LIBS="$ac_cv_search__obstack_free" ;;
> + *) obstack_LIBS= ;;
> +esac
> +AC_SUBST([obstack_LIBS])
> +
Hmm. In [1] I suggested to check for obstack_free, but
here I see you're checking for _obstack_free instead.
Since both symbols are provided by glibc, I wonder what was
the reason for this change. Is it something to do with libobstack?
By the way, the text of AC_MSG_FAILURE is out of sync with the symbol name.
[1] https://sourceware.org/pipermail/elfutils-devel/2020q4/002970.html
--
ldv
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] Support building when fts and obstack aren't part of libc.
2020-11-03 22:33 ` [PATCH v2] Support building when fts and obstack aren't part of libc Dmitry V. Levin
@ 2020-11-03 23:39 ` Érico Nogueira
2020-11-17 13:32 ` Mark Wielaard
2020-12-11 0:59 ` [PATCH] configure.ac: fix typo in error diagnostics Dmitry V. Levin
1 sibling, 1 reply; 11+ messages in thread
From: Érico Nogueira @ 2020-11-03 23:39 UTC (permalink / raw)
To: Dmitry V. Levin; +Cc: elfutils-devel, Érico Rolim
On Tue Nov 3, 2020 at 10:33 PM -03, Dmitry V. Levin wrote:
> On Sun, Nov 01, 2020 at 09:48:50PM -0300, Érico Nogueira via
> Elfutils-devel wrote:
> > From: Érico Rolim <erico.erc@gmail.com>
> >
> > - Make configure.ac test for fts and obstack availability;
> > - Add fts and obstack ldflags to all files that need them;
> > - Add missing argp ldflags to programs in debuginfod/.
> >
> > Signed-off-by: Érico Rolim <erico.erc@gmail.com>
> > ---
> > ChangeLog | 4 ++++
> > configure.ac | 20 ++++++++++++++++++++
> > debuginfod/Makefile.am | 6 +++---
> > libdw/Makefile.am | 2 +-
> > src/Makefile.am | 6 +++---
> > 5 files changed, 31 insertions(+), 7 deletions(-)
> >
> > diff --git a/ChangeLog b/ChangeLog
> > index 128da6c6..565d021c 100644
> > --- a/ChangeLog
> > +++ b/ChangeLog
> > @@ -1,3 +1,7 @@
> > +2020-11-01 Érico N. Rolim <erico.erc@gmail.com>
> > +
> > + * configure.ac: Check for fts and obstack from outside libc.
> > +
> > 2020-10-28 Mark Wielaard <mark@klomp.org>
> >
> > * configure.ac: Set version to 0.182.
> > diff --git a/configure.ac b/configure.ac
> > index 515ac704..c1a6954d 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -542,6 +542,26 @@ else
> > fi
> > AC_SUBST([argp_LDADD])
> >
> > +saved_LIBS="$LIBS"
> > +AC_SEARCH_LIBS([fts_close], [fts])
> > +LIBS="$saved_LIBS"
> > +case "$ac_cv_search_fts_close" in
> > + no) AC_MSG_FAILURE([failed to find fts_close]) ;;
> > + -l*) fts_LIBS="$ac_cv_search_fts_close" ;;
> > + *) fts_LIBS= ;;
> > +esac
> > +AC_SUBST([fts_LIBS])
> > +
> > +saved_LIBS="$LIBS"
> > +AC_SEARCH_LIBS([_obstack_free], [obstack])
> > +LIBS="$saved_LIBS"
> > +case "$ac_cv_search__obstack_free" in
> > + no) AC_MSG_FAILURE([failed to find obstack_free]) ;;
> > + -l*) obstack_LIBS="$ac_cv_search__obstack_free" ;;
> > + *) obstack_LIBS= ;;
> > +esac
> > +AC_SUBST([obstack_LIBS])
> > +
>
> Hmm. In [1] I suggested to check for obstack_free, but
> here I see you're checking for _obstack_free instead.
> Since both symbols are provided by glibc, I wonder what was
> the reason for this change. Is it something to do with libobstack?
I'm using the version of libobstack [1] that as far as I know is used by
most musl-based distros (some of them pull directly from pullmoll's
personal repo rather than from the void-linux namespace).
As you can see in [2], obstack_free is a macro, and AC_SEARCH_LIBS
didn't seem able to find it during my testing. On the other hand,
_obstack_free was an actual function, so I switched to it.
>
> By the way, the text of AC_MSG_FAILURE is out of sync with the symbol
> name.
Indeed. I can send a fix for it together with the argp patch if that's
ok. Thanks for noticing.
>
> [1] https://sourceware.org/pipermail/elfutils-devel/2020q4/002970.html
>
>
> --
> ldv
- [1] https://github.com/void-linux/musl-obstack
- [2] https://github.com/void-linux/musl-obstack/blob/d0493f4726835a08c5a145bce42b61a65847c6a9/obstack.h#L421
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] Support building when fts and obstack aren't part of libc.
2020-11-03 23:39 ` Érico Nogueira
@ 2020-11-17 13:32 ` Mark Wielaard
0 siblings, 0 replies; 11+ messages in thread
From: Mark Wielaard @ 2020-11-17 13:32 UTC (permalink / raw)
To: Érico Nogueira, Dmitry V. Levin; +Cc: Érico Rolim, elfutils-devel
On Tue, 2020-11-03 at 20:39 -0300, Érico Nogueira via Elfutils-devel wrote:
> On Tue Nov 3, 2020 at 10:33 PM -03, Dmitry V. Levin wrote:
> > On Sun, Nov 01, 2020 at 09:48:50PM -0300, Érico Nogueira via
> > Elfutils-devel wrote:
> > >
> > > +saved_LIBS="$LIBS"
> > > +AC_SEARCH_LIBS([_obstack_free], [obstack])
> > > +LIBS="$saved_LIBS"
> > > +case "$ac_cv_search__obstack_free" in
> > > + no) AC_MSG_FAILURE([failed to find obstack_free]) ;;
> > > + -l*) obstack_LIBS="$ac_cv_search__obstack_free" ;;
> > > + *) obstack_LIBS= ;;
> > > +esac
> > > +AC_SUBST([obstack_LIBS])
> > > +
> >
> > Hmm. In [1] I suggested to check for obstack_free, but
> > here I see you're checking for _obstack_free instead.
> > Since both symbols are provided by glibc, I wonder what was
> > the reason for this change. Is it something to do with libobstack?
>
> I'm using the version of libobstack [1] that as far as I know is used by
> most musl-based distros (some of them pull directly from pullmoll's
> personal repo rather than from the void-linux namespace).
>
> As you can see in [2], obstack_free is a macro, and AC_SEARCH_LIBS
> didn't seem able to find it during my testing. On the other hand,
> _obstack_free was an actual function, so I switched to it.
>
> >
> > By the way, the text of AC_MSG_FAILURE is out of sync with the symbol
> > name.
>
> Indeed. I can send a fix for it together with the argp patch if that's
> ok. Thanks for noticing.
It does look like all (exported) obstack symbols start with _obstack
(although there also is an non-underscore alias obstack_free in glibc).
So checking for _obstack_free seems correct. If you could sent a patch
(together with the argp check cleanup) to make the failure message to
also mention the underscore that would be great.
Thanks,
Mark
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH] configure.ac: fix typo in error diagnostics
2020-11-03 22:33 ` [PATCH v2] Support building when fts and obstack aren't part of libc Dmitry V. Levin
2020-11-03 23:39 ` Érico Nogueira
@ 2020-12-11 0:59 ` Dmitry V. Levin
2020-12-11 11:29 ` Mark Wielaard
1 sibling, 1 reply; 11+ messages in thread
From: Dmitry V. Levin @ 2020-12-11 0:59 UTC (permalink / raw)
To: elfutils-devel
Fixes: da855fc9c ("Support building when fts and obstack aren't part of libc")
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
ChangeLog | 4 ++++
configure.ac | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 71e80a25..563af0d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2020-12-11 Dmitry V. Levin <ldv@altlinux.org>
+
+ * configure.ac (AC_MSG_FAILURE): Fix typo.
+
2020-11-30 Dmitry V. Levin <ldv@altlinux.org>
* configure.ac (LIBDEBUGINFOD_SONAME): New AC_SUBST variable.
diff --git a/configure.ac b/configure.ac
index 2f7316e8..6c3e05bf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -559,7 +559,7 @@ saved_LIBS="$LIBS"
AC_SEARCH_LIBS([_obstack_free], [obstack])
LIBS="$saved_LIBS"
case "$ac_cv_search__obstack_free" in
- no) AC_MSG_FAILURE([failed to find obstack_free]) ;;
+ no) AC_MSG_FAILURE([failed to find _obstack_free]) ;;
-l*) obstack_LIBS="$ac_cv_search__obstack_free" ;;
*) obstack_LIBS= ;;
esac
--
ldv
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH] configure.ac: simplify argp check
2020-11-03 17:05 ` Mark Wielaard
@ 2020-12-11 0:59 ` Dmitry V. Levin
2020-12-11 11:33 ` Mark Wielaard
0 siblings, 1 reply; 11+ messages in thread
From: Dmitry V. Levin @ 2020-12-11 0:59 UTC (permalink / raw)
To: Mark Wielaard; +Cc: Érico Nogueira, Érico Rolim, elfutils-devel
Rewrite argp check using the same AC_SEARCH_LIBS based method used
earlier in the fts check.
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
ChangeLog | 2 ++
configure.ac | 31 ++++++++-----------------------
2 files changed, 10 insertions(+), 23 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 563af0d2..def6279a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2020-12-11 Dmitry V. Levin <ldv@altlinux.org>
+ * configure.ac: Rewrite argp check.
+
* configure.ac (AC_MSG_FAILURE): Fix typo.
2020-11-30 Dmitry V. Levin <ldv@altlinux.org>
diff --git a/configure.ac b/configure.ac
index 6c3e05bf..392f9155 100644
--- a/configure.ac
+++ b/configure.ac
@@ -520,29 +520,14 @@ if test "$ac_cv_implicit_fallthrough" = "yes"; then
[Defined if __attribute__((fallthrough)) is supported])
fi
-dnl Check if we have argp available from our libc
-AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [#include <argp.h>],
- [int argc=1; char *argv[]={"test"}; argp_parse(0,argc,&argv,0,0,0); return 0;]
- )],
- [libc_has_argp="true"],
- [libc_has_argp="false"]
-)
-
-dnl If our libc doesn't provide argp, then test for libargp
-if test "$libc_has_argp" = "false" ; then
- AC_MSG_WARN("libc does not have argp")
- AC_CHECK_LIB([argp], [argp_parse], [have_argp="true"], [have_argp="false"])
-
- if test "$have_argp" = "false"; then
- AC_MSG_ERROR("no libargp found")
- else
- argp_LDADD="-largp"
- fi
-else
- argp_LDADD=""
-fi
+saved_LIBS="$LIBS"
+AC_SEARCH_LIBS([argp_parse], [argp])
+LIBS="$saved_LIBS"
+case "$ac_cv_search_argp_parse" in
+ no) AC_MSG_FAILURE([failed to find argp_parse]) ;;
+ -l*) argp_LDADD="$ac_cv_search_argp_parse" ;;
+ *) argp_LDADD= ;;
+esac
AC_SUBST([argp_LDADD])
saved_LIBS="$LIBS"
--
ldv
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] configure.ac: fix typo in error diagnostics
2020-12-11 0:59 ` [PATCH] configure.ac: fix typo in error diagnostics Dmitry V. Levin
@ 2020-12-11 11:29 ` Mark Wielaard
0 siblings, 0 replies; 11+ messages in thread
From: Mark Wielaard @ 2020-12-11 11:29 UTC (permalink / raw)
To: Dmitry V. Levin, elfutils-devel
On Fri, 2020-12-11 at 03:59 +0300, Dmitry V. Levin wrote:
> Fixes: da855fc9c ("Support building when fts and obstack aren't part
> of libc")
Thanks, pushed.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] configure.ac: simplify argp check
2020-12-11 0:59 ` [PATCH] configure.ac: simplify argp check Dmitry V. Levin
@ 2020-12-11 11:33 ` Mark Wielaard
0 siblings, 0 replies; 11+ messages in thread
From: Mark Wielaard @ 2020-12-11 11:33 UTC (permalink / raw)
To: Dmitry V. Levin; +Cc: Érico Rolim, elfutils-devel
On Fri, 2020-12-11 at 03:59 +0300, Dmitry V. Levin wrote:
> Rewrite argp check using the same AC_SEARCH_LIBS based method used
> earlier in the fts check.
Thanks, that makes things nicely consistent.
Pushed,
Mark
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2020-12-11 11:33 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02 0:48 [PATCH v2] Support building when fts and obstack aren't part of libc Érico Nogueira
2020-11-03 0:13 ` Mark Wielaard
2020-11-03 2:41 ` Érico Nogueira
2020-11-03 17:05 ` Mark Wielaard
2020-12-11 0:59 ` [PATCH] configure.ac: simplify argp check Dmitry V. Levin
2020-12-11 11:33 ` Mark Wielaard
2020-11-03 22:33 ` [PATCH v2] Support building when fts and obstack aren't part of libc Dmitry V. Levin
2020-11-03 23:39 ` Érico Nogueira
2020-11-17 13:32 ` Mark Wielaard
2020-12-11 0:59 ` [PATCH] configure.ac: fix typo in error diagnostics Dmitry V. Levin
2020-12-11 11:29 ` Mark Wielaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).