Commit Graph

6 Commits

Author SHA1 Message Date
Michael Pratt
eb726c90be tools/gnulib: make tdestroy() fully portable
The tdestroy() function, which is a GNU extension to the standard C
library, is defined in gnulib in tsearch.c but is missing it's
corresponding declaration in search.in.h by being completely missing...

This patch is large but upstreamable, including all of the macros and
conditionals and configure checks that upstream GNU would expect for
portable support, like using the @@ placeholder/substitution method to
determine whether or not to have declarations based on whether or not
tdestroy() is already declared within the standard headers of the default
include paths.

There were also some typedefs and aliases missing, along with the warnings
and preprocessor exceptions that need to be added for consistency with the
usage of the rest of the functions in the files.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
2024-04-25 21:33:51 +02:00
Michael Pratt
5ade7ee60e tools/gnulib: add macros to skip reallocarray() functions
For modules that depend on the reallocarray module, like ialloc, xalloc,
and safe-alloc, it was not possible to skip importing the reallocarray
module as they all contained at least one function that called
reallocarray() and would cause build failure if the host system didn't
declare it.

This upstreamable patch adds macros that toggle whether to define
functions that depend on reallocarray() based on whether the reallocarray
module is being imported.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
2024-04-25 21:33:51 +02:00
Tony Ambardar
4de8c0e1d8 tools/gnulib: update to branch stable-202401
Patches refreshed automatically.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
2024-04-25 21:33:51 +02:00
Felix Fietkau
5331e85d96 elfutils: fix build and enable on non-linux systems
Use gnulib for compatibility

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-10-29 15:56:46 +01:00
Michael Pratt
e4977f614f
tools/missing-macros: prefer macros provided by gnulib source
These 7 macro files are provided by gnulib,
so we can now replace these statically stored copies
with the latest copy from GNU sources.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2023-05-04 06:07:27 +02:00
Michael Pratt
fe33d5ba13
tools: add gnulib source
By having a local copy of gnulib, we can:
import the latest macro fixes into any package,
get rid of some statically stored macros that were otherwise missing,
bootstrap GNU tools with the latest relevant source
without having to wait for a release or rely on git submodules,
and possibly more...

The patch assists in bootstrapping by ignoring
the building of po files using gettext,
and also to allow a user-defined path to a program
to include parameters.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2023-05-04 06:07:27 +02:00