[PATCH v2] libdwfl: use GNU strerror_r only when available.

Mark Wielaard mark@klomp.org
Fri Feb 5 14:46:42 GMT 2021


On Tue, 2021-02-02 at 05:56 +0300, Dmitry V. Levin wrote:
> On Mon, Feb 01, 2021 at 09:16:56PM -0300, Érico Nogueira via Elfutils-devel wrote:
> [...]
> > I'm not sure if it's a bug in this configure.ac or this macro, but
> > _GNU_SOURCE wasn't defined and lead to XSI strerror_r being used on
> > glibc until I added the trick with CFLAGS and old_CFLAGS. It's still way
> > slimmer than the previous version :)
> > 
> > I see that -D_GNU_SOURCE is passed to the build via config/eu.am, maybe
> > it could somehow be plugged into configure.ac earlier? I'm not entirely
> > sure what's best.
> 
> I wonder why don't we just use AC_USE_SYSTEM_EXTENSIONS
> instead of all these dances with -D_GNU_SOURCE.

Probably because it was only introduced in autoconf 2.60 and we didn't
require that till 2009. We could now use it. But we'll have to be
careful to keep supporting BAD_FTS:

dnl Older glibc had a broken fts that didn't work with Large File Systems.
dnl We want the version that can handler LFS, but include workaround if we
dnl get a bad one. Add define to CFLAGS (not AC_DEFINE it) since we need to
dnl check it before including config.h (which might define _FILE_OFFSET_BITS).

I am not sure how AC_USE_SYSTEM_EXTENSIONS would interact with this and
config.h inclusion.

Lets think about updating configure.ac after the release (and maybe
update our automake and autoconf version dependencies too?).

For now I'll integrate Érico's patch as is.

Thanks,

Mark


More information about the Elfutils-devel mailing list