Re: [PATCH] debuginfod/debuginfod-client.c: correct string format on 32bit arches with 64bit time_t

2021-11-19 Thread Érico Nogueira via Elfutils-devel
Hi! On Fri Nov 19, 2021 at 3:15 PM -03, Alexander Kanavin via Elfutils-devel wrote: > From: Alexander Kanavin > > Use intmax_t to print time_t > > time_t is platform dependent and some of architectures e.g. > x32, riscv32, arc use 64bit time_t even while they are 32bit > architectures, therefore

[PATCH] debuginfod: fix compilation on platforms without

2021-11-10 Thread Érico Nogueira via Elfutils-devel
From: Érico Nogueira "system.h" only declares the error() function, so it needs to be in an 'extern "C"' block, otherwise linking fails. Since we are here, use quotes for "system.h" header, since it's a local header, not a system one. Signed-off-by: Érico Nogueira --- debuginfod/ChangeLog

[PATCH] debuginfod: fix compilation on platforms without

2021-11-10 Thread Érico Nogueira via Elfutils-devel
From: Érico Nogueira "system.h" only declares the error() function, so it needs to be in an 'extern "C"' block, otherwise linking fails. Since we are here, use quotes for "system.h" header, since it's a local header, not a system one. Signed-off-by: Érico Nogueira --- debuginfod/ChangeLog

Re: [PATCH] lib: remove usage of `sys/cdefs.h`

2021-08-23 Thread Érico Nogueira via Elfutils-devel
On Fri Aug 20, 2021 at 3:20 PM -03, Saleem Abdulrasool via Elfutils-devel wrote: > This header is a BSD header that is also available in glibc. However, > this is a not a standard C header and was used for `__CONCAT`. Because > this is not a standard header, not all libc implementations provide the

Re: [PATCH] libdwfl: fix crash when reading link map

2021-06-09 Thread Érico Nogueira via Elfutils-devel
Hope you don't mind my nit, then :) On Wed Jun 9, 2021 at 9:51 PM -03, Omar Sandoval wrote: > On Wed, Jun 09, 2021 at 05:45:57PM -0700, Omar Sandoval wrote: > > From: Omar Sandoval > > > > When read_addrs() was converted was converted from a nested function to

Re: [PATCH 1/1] support cross compilation

2021-05-26 Thread Érico Nogueira via Elfutils-devel
On Wed May 26, 2021 at 10:58 AM -03, Petr Ovtchenkov wrote: > On Wed, 26 May 2021 10:09:31 -0300 > Érico Nogueira wrote: > > > Hi! Are you sure this is necessary? In Void Linux, we cross compile > > elfutils for arm and aarch64 without any issue, and I have built it a > > few times for powerpc as

Re: [PATCH 1/1] support cross compilation

2021-05-26 Thread Érico Nogueira via Elfutils-devel
Hi! Are you sure this is necessary? In Void Linux, we cross compile elfutils for arm and aarch64 without any issue, and I have built it a few times for powerpc as well. On Wed May 26, 2021 at 4:32 AM -03, Petr Ovtchenkov wrote: > Possible problem with out-of-tree build expected > --- > Makefile.am

Re: [PATCH] RFC: come up with startswith function.

2021-04-20 Thread Érico Nogueira via Elfutils-devel
Em 20/04/2021 08:43, Mark Wielaard escreveu: Hi Martin, On Mon, 2021-04-19 at 15:18 +0200, Martin Liška wrote: I made similar changes to binutils some time ago and I would like to come up with the same function for elfutils. Note that current construct is quite error prone, I found for insta

Re: Remove misleading XOR

2021-02-17 Thread Érico Nogueira via Elfutils-devel
Em 17/02/2021 13:49, Mark Wielaard escreveu: On Wed, 2021-02-17 at 11:12 +0100, Timm Bäder via Elfutils-devel wrote: Hi, I'm mainly leaving this patch here to discuss what to do about it. Clang complains because of -Wxor-used-as-pow. So of course one possibility is to use -Wno-xor-used-as-po

[PATCH - RFC] WIP: fix backtrace test to work on musl

2021-02-08 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim --- Currently, the run-backtrace-native.sh test fails on musl systems. As seen here in the test suite log, this appears to happen because elfutils expects raise() to be the last function in the stack trace, which it isn't, because unlike glibc, which uses inline functions for s

[PATCH] tests/run-debuginfod-find.sh: skip test if cpio isn't available.

2021-02-08 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim Signed-off-by: Érico Rolim --- tests/ChangeLog | 4 tests/run-debuginfod-find.sh | 1 + 2 files changed, 5 insertions(+) diff --git a/tests/ChangeLog b/tests/ChangeLog index 907b6351..e22fa455 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @

[PATCH v3] backends/ppc_initreg.c: include .

2021-02-05 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim Necessary on musl for struct pt_regs definition, doesn't affect the build on glibc, since includes the same header. Signed-off-by: Érico Rolim --- backends/ChangeLog | 4 backends/ppc_initreg.c | 1 + 2 files changed, 5 insertions(+) diff --git a/backends/ChangeLog

Re: [PATCH v2] backends/ppc_initreg.c: include .

2021-02-05 Thread Érico Nogueira via Elfutils-devel
Em 05/02/2021 12:06, Mark Wielaard escreveu: Hi, On Tue, 2021-02-02 at 06:22 +0300, Dmitry V. Levin wrote: Said that, I think it's safe to include right before on powerpc since in glibc the latter includes the former. So that would move the include after the include. Érico, would that

[PATCH v2] backends/ppc_initreg.c: include .

2021-02-01 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim Necessary on musl for struct pt_regs definition, doesn't affect the build on glibc. Signed-off-by: Érico Rolim --- Sending a v2 with the main difference being a slightly different commit message and signed-off-by line. I'm a bit hesitant on this being the correct patch, so I

[PATCH] backends/ppc_initreg.c: include .

2021-02-01 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim Necessary on musl, doesn't affect the build on glibc. --- backends/ChangeLog | 4 backends/ppc_initreg.c | 1 + 2 files changed, 5 insertions(+) diff --git a/backends/ChangeLog b/backends/ChangeLog index f22cd57f..eb15c81d 100644 --- a/backends/ChangeLog +++ b/backend

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

2021-02-01 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim Some C libraries don't provide the GNU version of strerror_r, only the XSI-compliant one. We use the GNU version when available, since it fits the code better, and otherwise use the XSI-compliant one. https://sourceware.org/bugzilla/show_bug.cgi?id=21010 Signed-off-by: Érico R

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

2021-02-01 Thread Érico Nogueira via Elfutils-devel
Em 01/02/2021 18:35, Mark Wielaard escreveu: Hi Érico, On Mon, Feb 01, 2021 at 03:56:26PM -0300, Érico Nogueira via Elfutils-devel wrote: Some C libraries don't provide the GNU version of strerror_r, only the XSI-compliant one. We use the GNU version when available, since it fits the

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

2021-02-01 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim Some C libraries don't provide the GNU version of strerror_r, only the XSI-compliant one. We use the GNU version when available, since it fits the code better, and otherwise use the XSI-compliant one. Signed-off-by: Érico Rolim --- If possible, I'd like to get this patch in b

Re: [PATCH v2 1/2] libdwfl: use XSI-compliant strerror_r.

2020-12-16 Thread Érico Nogueira via Elfutils-devel
On Wed Dec 16, 2020 at 9:08 PM -03, Dmitry V. Levin wrote: > On Wed, Dec 16, 2020 at 07:30:11PM -0300, Érico Nogueira via > Elfutils-devel wrote: > > From: Érico Rolim > > > > The Linux man pages recommend this version of the function for portable > > applications.

[PATCH v2 2/2] src/readelf: use qsort instead of qsort_r.

2020-12-16 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim This program is single threaded, so using qsort with a global variable isn't a danger. The interface for qsort_r isn't standardized (and diverges between glibc and FreeBSD, for example), which makes usage of qsort, where possible, preferrable. Signed-off-by: Érico Rolim --- O

[PATCH v2 1/2] libdwfl: use XSI-compliant strerror_r.

2020-12-16 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim The Linux man pages recommend this version of the function for portable applications. Signed-off-by: Érico Rolim --- Only difference from the initial patch is that this includes the Signed-off-by line. libdwfl/ChangeLog| 4 libdwfl/dwfl_error.c | 11 ++- 2

Re: [PATCH] libcpu: linking i386_gendis requires obstack.

2020-12-16 Thread Érico Nogueira via Elfutils-devel
On Wed Dec 16, 2020 at 6:48 PM -03, Mark Wielaard wrote: > On Wed, Dec 16, 2020 at 03:56:14PM -0300, Érico Nogueira via > Elfutils-devel wrote: > > Noticed while building from master today. > > Yes, you are right. i386_parse.y uses obstacks. Thanks for the > ChangeLog entry

[PATCH] src/readelf: use qsort instead of qsort_r.

2020-12-16 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim This program is single threaded, so using qsort with a global variable isn't a danger. The interface for qsort_r isn't standardized (and diverges between glibc and FreeBSD, for example), which makes usage of qsort, where possible, preferrable. --- FreeBSD's qsort_r can be seen

[PATCH] libdwfl: use XSI-compliant strerror_r.

2020-12-16 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim The Linux man pages recommend this version of the function for portable applications. --- This change could be made into its own tiny compat source file, if we want to keep _GNU_SOURCE undefined for the smallest piece of code. I'm okay with either approach. I ran the testsuite

[PATCH] libcpu: linking i386_gendis requires obstack.

2020-12-16 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim --- Noticed while building from master today. libcpu/ChangeLog | 4 libcpu/Makefile.am | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libcpu/ChangeLog b/libcpu/ChangeLog index 781c8f41..af7ea96c 100644 --- a/libcpu/ChangeLog +++ b/libcpu/ChangeLo

[announce] Void Linux debuginfod server

2020-11-23 Thread Érico Nogueira via Elfutils-devel
Hi! I am happy to announce that Void Linux is now hosting a debuginfod server in https://debuginfod.s.voidlinux.org ! It includes all packages for which we have debug packages (some packages, like chromium, have debug package generation disabled), for all of official architectures and libcs which

Re: [PATCH v2] Support building when fts and obstack aren't part of libc.

2020-11-03 Thread Érico Nogueira via Elfutils-devel
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 > > > > - Make configure.ac test for fts and obstack availability; > > - Add fts and obstack ldfla

Re: [PATCH v2] debuginfod.cxx: include libintl.h.

2020-11-02 Thread Érico Nogueira via Elfutils-devel
On Mon Nov 2, 2020 at 10:17 PM -03, Mark Wielaard wrote: > On Sun, Nov 01, 2020 at 09:58:04PM -0300, Érico Nogueira via > Elfutils-devel wrote: > > From: Érico Rolim > > > > Uncomment the include, since textdomain() and > > bindtextdomain() functions

Re: [PATCH v2] Support building when fts and obstack aren't part of libc.

2020-11-02 Thread Érico Nogueira via Elfutils-devel
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 > > > > - Make configure.ac test for fts and obstack availability; > > - Add

[PATCH] Switch from numerical to defined constants for permissions.

2020-11-01 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim Use defined constants for permission values. Also add fallback definitions for them in system.h, to allow for compatibility with systems that don't provide these macros. Include system.h in all tests/ files that required it. Signed-off-by: Érico Rolim --- I'm a bit unsure ab

[PATCH v2] debuginfod.cxx: include libintl.h.

2020-11-01 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim Uncomment the include, since textdomain() and bindtextdomain() functions provided by it are being used. Signed-off-by: Érico Rolim --- This is a follow up to the patch that went the opposite way and removed the calls to bindtextdomain() and textdomain(); it was decided that

[PATCH v2] Support building when fts and obstack aren't part of libc.

2020-11-01 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim - 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 --- ChangeLog | 4 configure.ac | 20 ++

Re: [PATCH v2] Stop depending on strndupa.

2020-10-27 Thread Érico Nogueira via Elfutils-devel
On Tue Oct 27, 2020 at 1:01 PM -03, Mark Wielaard wrote: > Hi Érico, > > On Mon, 2020-10-26 at 15:33 -0300, Érico Nogueira via Elfutils-devel > wrote: > > From: Érico Rolim > > > > This functon has inherent safety issues, since a long enough path can > > lead

[PATCH v3] unstrip: Stop using strndupa.

2020-10-27 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim This functon has inherent safety issues, since a long enough path can lead to memory clobbering. Due to the recursive nature of make_directories(), multiple calls could also stack overflow. Instead, the string can be allocated in the heap. As a bonus, this improves musl compati

[PATCH] Allow elf header to be used when __BEGIN_DECLS and __END_DECLS aren't defined.

2020-10-26 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim The elf/elf.h header is shared, verbatim, by the elfutils project. However, elfutils can be used on systems with libcs other than glibc, making the presence of __BEGIN_DECLS and __END_DECLS in the file something that downstream distros have to add patches for. Per https://sourc

[RFC][PATCH] * bits/confname.h: Define _CS_POSIX_V7_THREADS_CFLAGS, _CS_POSIX_V7_THREADS_LDFLAGS

2020-10-26 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim I would like to add these enums in order to conform to the POSIX specification: https://www.man7.org/linux/man-pages/man0/unistd.h.0p.html This change also helps musl-libc, since they want to have these defines with the same values as glibc. I tried to add them for the bits/co

Re: [PATCH] Don't use locale functions when libintl header isn't included.

2020-10-26 Thread Érico Nogueira via Elfutils-devel
On Mon Oct 26, 2020 at 3:22 PM -03, Frank Ch. Eigler wrote: > Hi - > > > On Mon, 2020-10-26 at 01:11 -0300, Érico Nogueira via Elfutils-devel wrote: > > > debuginfod.cxx used the bindtextdomain() and textdomain() functions > > > despite not including any translated output. These functions were als

Re: [PATCH] Don't use __BEGIN_DECLS macros from glibc.

2020-10-26 Thread Érico Nogueira via Elfutils-devel
On Mon Oct 26, 2020 at 8:58 PM -03, Dmitry V. Levin wrote: > On Mon, Oct 26, 2020 at 05:44:24PM -0300, Érico Nogueira via > Elfutils-devel wrote: > > From: Érico Rolim > > > > These macros are mostly internal to glibc and require the inclusion of > > (here included

[PATCH] Don't use __BEGIN_DECLS macros from glibc.

2020-10-26 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim These macros are mostly internal to glibc and require the inclusion of (here included indirectly via ), which isn't a standard header. Since they are only required once, replacing them with their definition is simple. Signed-off-by: Érico Rolim --- libelf/elf.h | 10 ++-

Re: [PATCH] Don't use locale functions when libintl header isn't included.

2020-10-26 Thread Érico Nogueira via Elfutils-devel
On Mon Oct 26, 2020 at 4:46 PM -03, Mark Wielaard wrote: > Hi Érico, > > On Mon, 2020-10-26 at 01:11 -0300, Érico Nogueira via Elfutils-devel > wrote: > > debuginfod.cxx used the bindtextdomain() and textdomain() functions > > despite not including any translated output. T

[PATCH v2] Stop depending on strndupa.

2020-10-26 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim This functon has inherent safety issues, since a long enough path can lead to memory clobbering. Instead, limit the path length to PATH_MAX. As a bonus, this improves musl compatibility, since musl doesn't include the strndupa macro for now. Also add braces around while loop.

Re: [QUESTION] Which fnmatch() functionality does elfutils depend on?

2020-10-26 Thread Érico Nogueira via Elfutils-devel
On Mon Oct 26, 2020 at 3:10 PM -03, Mark Wielaard wrote: > Hi Érico, > > On Mon, 2020-10-26 at 12:03 -0300, Érico Nogueira via Elfutils-devel > wrote: > > Do elfutils program actually depend on the extra functionality > > enabled by > > FNM_EXTMATCH? Is changing the

[QUESTION] Which fnmatch() functionality does elfutils depend on?

2020-10-26 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim Hi! Musl currently doesn't support the FNM_EXTMATCH extension to fnmatch(), leading most musl-based distros to patch the elfutils build to define FNM_EXTMATCH to 0. Do elfutils program actually depend on the extra functionality enabled by FNM_EXTMATCH? Is changing the flag to

Re: [PATCH] Support building when fts and obstack aren't part of libc.

2020-10-26 Thread Érico Nogueira via Elfutils-devel
On Mon Oct 26, 2020 at 9:32 AM -03, Dmitry V. Levin wrote: > On Sun, Oct 25, 2020 at 11:41:12PM -0300, Érico Nogueira via > Elfutils-devel wrote: > > diff --git a/configure.ac b/configure.ac > > index 973409f1..628e7a74 100644 > > --- a/configure.ac > > +++ b/conf

[PATCH] Stop depending on strndupa.

2020-10-26 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim This functon has inherent safety issues, since a long enough path can lead to memory clobbering. Instead, limit the path length to PATH_MAX. As a bonus, this improves musl compatibility, since musl doesn't include the strndupa macro for now. Also add braces around while loop.

[RFC] [PATCH] Use numeric permissions directly.

2020-10-25 Thread Érico Nogueira via Elfutils-devel
musl doesn't define ALLPERMS and ACESSPERMS macros, and the code already uses literals for these same values in some place. This commit applies the same style to the whole project. Signed-off-by: Érico Rolim --- This commit can go the other way as well, by adding blocks like /* musl libc doesn

[PATCH] Don't use locale functions when libintl header isn't included.

2020-10-25 Thread Érico Nogueira via Elfutils-devel
debuginfod.cxx used the bindtextdomain() and textdomain() functions despite not including any translated output. These functions were also used without including the libintl.h header. Signed-off-by: Érico Rolim --- debuginfod/debuginfod.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/de

[PATCH] Support building when fts and obstack aren't part of libc.

2020-10-25 Thread Érico Nogueira via Elfutils-devel
- 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 --- This is the start of a series of patches that can enable elfutils to be built on musl-based