summaryrefslogtreecommitdiffstats
path: root/tools/elfutils
Commit message (Collapse)AuthorAgeFilesLines
* tools/elfutils: remove dirnameRobert Marko2024-04-302-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the 0.191 update dirname was used instead of <libgen.h> to fix the poisoned basename error: /usr/include/libgen.h:35:9: error: attempt to use poisoned "basename" 35 | #define basename __xpg_basename However, doing this has lead to libelf.a pulling in xmalloc, xstrdup and friends and statically linking them thus leading to a symbol name conflict with FRR host build and anything else that links against libelf and uses xmalloc and friends. Well, it turns out that upstream has added a helper[1] for basename so it can compile with musl 1.2.5 which dropped the basename declaration, but it also means that we must NOT include <libgen.h> and that poisoned error is intentional and added to prevent duplicate basename definitions. This also means that for macOS we dont need to do any additional header inclusions as the new helper takes care of basename. So, to fix the symbol conflict we can simply drop the <dirname.h> inclusion and build from elfutils. Tested on Fedora 40 as well as macOS 14.4.1. [1] https://sourceware.org/git/?p=elfutils.git;a=commit;h=a2194f6b305bf0d0b9dd49dccd0a5c21994c8eea Fixes: #24030 Fixes: b6f025b42429 ("tools/elfutils: update to 1.91") Link: https://github.com/openwrt/openwrt/pull/15337 Signed-off-by: Robert Marko <robimarko@gmail.com>
* tools/elfutils: refresh portability patch for macOSMichael Pratt2024-04-251-29/+5
| | | | | | | | | | | | | | | | Quilt refresh combined two sets of changes to the same file. The switch from using libgen.h to dirname.h because of function poisoning from gnulib's import of basename() was added as a new patch hunk instead of an edit to the original one. The original patch hunk was to fix build errors on an earlier version of elfutils before the "dirname" module was being imported to fix further build errors with the 0.191 version. Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS Signed-off-by: Michael Pratt <mcpratt@pm.me> Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
* tools/elfutils: remove no-op copy of tdestroy()Michael Pratt2024-04-251-14/+0
| | | | | | | | | | | | A false tdestroy() function was added in order to make elfutils build on macOS again. A previous commit added declarations for a real version of tdestroy() into gnulib, which is already imported, as well as the preprocessor flags and the triggers for the Makefile.am conditional in order to include the source to be built. Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS Signed-off-by: Michael Pratt <mcpratt@pm.me> Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
* tools/elfutils: use locally declared static reallocarray()Michael Pratt2024-04-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | On macOS, stdlib.h in the standard include paths does not provide reallocarray() while both elfutils and gnulib do, however they are declared differently, leading to an error: ./system.h:101:1: error: static declaration of 'reallocarray' follows non-static declaration reallocarray (void *ptr, size_t nmemb, size_t size) A normal "configure && make" build cycle results in both declarations being enabled as a result of both elfutils and gnulib having completely separate configure checks where gnulib uses an internal placeholder symbol HAVE_REALLOCARRAY, and elfutils uses a standard autoconf macro HAVE_DECL_REALLOCARRAY. Fix this by excluding the import of the reallocarray module which causes gnulib checks in the configure stage to not even consider whether to declare reallocarray later on, so the decision is only between the standard include stdlib.h and the elfutils header. Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS Signed-off-by: Michael Pratt <mcpratt@pm.me> Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
* tools/elfutils: organize gnulib import build stageMichael Pratt2024-04-251-1/+19
| | | | | | | | | Organize the Makefile lines involved in gnulib importing and its workarounds. It improves readability and keeps git history organized. Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS Signed-off-by: Michael Pratt <mcpratt@pm.me> Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
* tools/elfutils: override SUBDIRS variable of MakefileMichael Pratt2024-04-252-17/+20
| | | | | | | | | | | | | | | | | | Instead of editing the SUBDIRS variable with a patch, it can be overriden at the end of the command line when invoking Make. This tool has a series of recursive Makefiles in each subdirectory, therefore SUBDIRS is set to a pattern of Make functions so that the result is variable depending on the current subdirectory that Make is being invoked in. It's not necessary to have gnulib-cache.m4 in EXTRA_DIST since we don't need to re-import after packaging this in the SDK, so get rid of the entire patch hunk for ./Makefile.am Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS Signed-off-by: Michael Pratt <mcpratt@pm.me> Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
* tools/elfutils: update to 1.91Tony Ambardar2024-04-252-20/+65
| | | | | | | | | | | | | | | | | | | | | Release Notes: https://sourceware.org/pipermail/elfutils-devel/2024q1/006876.html Manually refresh: - 100-portability.patch Change: - replace libgen.h with gnulib "dirname" module for compilation errors: In file included from ./../libdw/libdwP.h:38, from eblobjnote.c:42: /usr/include/libgen.h:35:9: error: attempt to use poisoned "basename" 35 | #define basename __xpg_basename | ^ Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS Co-Developed-by: Nick Hainke <vincent@systemli.org> Signed-off-by: Nick Hainke <vincent@systemli.org> Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
* tools/elfutils: fix missing _ in auxv info aliasFelix Fietkau2023-11-011-1/+1
| | | | | | Fixes dwarves compile issue Signed-off-by: Felix Fietkau <nbd@nbd.name>
* tools/elfutils: disable bzlib supportFelix Fietkau2023-11-011-0/+1
| | | | | | It is not needed Signed-off-by: Felix Fietkau <nbd@nbd.name>
* tools/elfutils: add -fPIC to fix linker errors (#13841)Felix Fietkau2023-11-011-1/+1
| | | | | | Resolves issues with building PIE binaries that link against libdw or libelf Signed-off-by: Felix Fietkau <nbd@nbd.name>
* elfutils: fix build and enable on non-linux systemsFelix Fietkau2023-10-292-2/+928
| | | | | | Use gnulib for compatibility Signed-off-by: Felix Fietkau <nbd@nbd.name>
* tools/elfutils: update to 1.89Nick Hainke2023-03-121-2/+2
| | | | | | | Release Notes: https://sourceware.org/pipermail/elfutils-devel/2023q1/006023.html Signed-off-by: Nick Hainke <vincent@systemli.org>
* tools/elfutils: update to 1.88Nick Hainke2022-11-051-2/+2
| | | | | | | Release Notes: https://sourceware.org/pipermail/elfutils-devel/2022q4/005561.html Signed-off-by: Nick Hainke <vincent@systemli.org>
* tools: add Host/Uninstall where possibleRosen Penev2022-10-201-0/+4
| | | | | | This cleans staging_dir when calling tool/x/clean. Signed-off-by: Rosen Penev <rosenp@gmail.com>
* tools: elfutils: Update to version 0.187Hauke Mehrtens2022-08-131-2/+2
| | | | | | | Update to most recent version of elfutils and sync with version from package folder. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* tools/elfutils: drop HOST_BUILD_DEPENDSStijn Tintel2022-05-191-2/+0
| | | | | | | | This is only effective for host build of normal packages, not tools. Fixes: ad79b9271949 ("elfutils: move host build to tools") Reported-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
* tools/elfutils: only build required componentsStijn Tintel2022-05-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | Building all of the components results in strip being installed in staging_dir/host/bin. This strip binary will take precedence over binutils strip that is installed in the toolchain directory. This will not work on host systems that do not have libdw installed, as we do not set HOST_LDFLAGS to override rpath to staging_dir/host/lib. However, rather than overriding rpath, we should just avoid using elfutils strip entirely. Override the SUBDIRS variable in the Makefile to only build and install the libraries we require for dwarves and frr. Fixes the following build failure in toolchain/gdb: strip: error while loading shared libraries: libdw.so.1: cannot open shared object file: No such file or directory Fixes: ad79b9271949 ("elfutils: move host build to tools") Reported-by: Dominick Grift <dominick.grift@defensec.nl> Reported-by: Lucian Cristian <lucian.cristian@gmail.com> Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
* elfutils: move host build to toolsStijn Tintel2022-05-181-0/+32
The upcoming dwarves host package requires elfutils. As dependencies for tools must exist in tools, we need to move elfutils host build there. As there is at least one package that depends on this, and there is no proper way to create such dependency in the build system, build it unconditionally when not building on macOS. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>