[PATCH] lib: avoid potential problems with `-fno-common`

2021-08-27 Thread Saleem Abdulrasool via Elfutils-devel
This properly homes the fallback function into a translation unit rather than trying to define an inline common definition for the fallback path. The intent of the original approach was to actually simply avoid adding a new source file that is used for the fallback path. However, that may cause tr

Re: [PATCH v2] handle libc implemntations which do not provide `error.h`

2021-08-27 Thread Saleem Abdulrasool via Elfutils-devel
anges neither path should cause problems for bisection in the future for previously supported systems. I'd go with whatever is most commonly done in this project. On Fri, Aug 27, 2021 at 8:39 AM Mark Wielaard wrote: > Hi Saleem, > > On Fri, 2021-08-27 at 08:24 -0700, Saleem Abdulrasool

[PATCH v3] handle libc implemntations which do not provide `error.h`

2021-08-27 Thread Saleem Abdulrasool via Elfutils-devel
Introduce a configure time check for the presence of `error.h`. In the case that `error.h` is not available, we can fall back to `err.h`. Although `err.h` is not a C standard header (it is a BSD extension), many libc implementations provide. If there are targets which do not provide an implementa

Re: [PATCH v2] handle libc implemntations which do not provide `error.h`

2021-08-27 Thread Saleem Abdulrasool via Elfutils-devel
I think that this is not exactly ideal, as it will introduce a local error_message_count in each translation unit, rather than giving it vague linkage as I had hoped. I think it may be better to introduce a new source file here. I can move the implementation around though. A second issue is that

[PATCH] lib: remove unused `STROF` definition (NFC)

2021-08-27 Thread Saleem Abdulrasool via Elfutils-devel
This definition was in the fallback path, where `sys/cdefs.h` is not available. Now that we have a single path through here, this macro gets defined, though is unused. Remove the unused macro definition. Signed-off-by: Saleem Abdulrasool --- lib/ChangeLog | 4 lib/fixedsizehash.h |

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

2021-08-23 Thread Saleem Abdulrasool 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

[PATCH v2] handle libc implemntations which do not provide `error.h`

2021-08-20 Thread Saleem Abdulrasool via Elfutils-devel
Introduce a configure time check for the presence of `error.h`. In the case that `error.h` is not available, we can fall back to `err.h`. Although `err.h` is not a C standard header (it is a BSD extension), many libc implementations provide. If there are targets which do not provide an implementa

Re: [PATCH] handle libc implemntations which do not provide `error.h`

2021-08-20 Thread Saleem Abdulrasool via Elfutils-devel
Hi, Sorry, this change is missing a modification that I seemed to have left out accidentally. I missed the inclusion of `err.h` in the `HAVE_ERR_H` when I was staging the changes locally. I'll send out a new version of this patch. On Fri, Aug 20, 2021 at 11:23 AM Saleem Abdulrasool wrote: > >

[PATCH] handle libc implemntations which do not provide `error.h`

2021-08-20 Thread Saleem Abdulrasool via Elfutils-devel
Introduce a configure time check for the presence of `error.h`. In the case that `error.h` is not available, we can fall back to `err.h`. Although `err.h` is not a C standard header (it is a BSD extension), many libc implementations provide. If there are targets which do not provide an implementa

[PATCH] debuginfod, elfclassify: remove unnecessary header inclusion

2021-08-20 Thread Saleem Abdulrasool via Elfutils-devel
`error.h`'s inclusion was centralised into the `system.h` header. As the implementation currently includes `system.h` already, the inclusion of `error.h` is unnecessary. This prepares for a future portability change to allow elfutil to build with alternate libc implementations. Signed-off-by: Sa

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

2021-08-20 Thread Saleem Abdulrasool via Elfutils-devel
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 header. Remove the usage of the header and always use the previously fallback path.