<feed xmlns='http://www.w3.org/2005/Atom'>
<title>staging/dangole/tools/elfutils, branch main</title>
<subtitle>Staging tree of Daniel Golle</subtitle>
<id>https://git.openwrt.org/openwrt/staging/dangole/atom?h=main</id>
<link rel='self' href='https://git.openwrt.org/openwrt/staging/dangole/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/dangole/'/>
<updated>2024-04-30T11:37:59Z</updated>
<entry>
<title>tools/elfutils: remove dirname</title>
<updated>2024-04-30T11:37:59Z</updated>
<author>
<name>Robert Marko</name>
</author>
<published>2024-04-30T09:08:46Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/dangole/commit/?id=00ff73ec6e815d9e82ef9164d23d445a2346579e'/>
<id>urn:sha1:00ff73ec6e815d9e82ef9164d23d445a2346579e</id>
<content type='text'>
In the 0.191 update dirname was used instead of &lt;libgen.h&gt; 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 &lt;libgen.h&gt; 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 &lt;dirname.h&gt; 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 &lt;robimarko@gmail.com&gt;
</content>
</entry>
<entry>
<title>tools/elfutils: refresh portability patch for macOS</title>
<updated>2024-04-25T19:33:51Z</updated>
<author>
<name>Michael Pratt</name>
</author>
<published>2024-04-08T19:15:31Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/dangole/commit/?id=1991bfb8143d29d619a0a389db84dcb512b9a719'/>
<id>urn:sha1:1991bfb8143d29d619a0a389db84dcb512b9a719</id>
<content type='text'>
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 &lt;gvalkov@gmail.com&gt; # MacOS
Signed-off-by: Michael Pratt &lt;mcpratt@pm.me&gt;
Signed-off-by: Tony Ambardar &lt;itugrok@yahoo.com&gt;
</content>
</entry>
<entry>
<title>tools/elfutils: remove no-op copy of tdestroy()</title>
<updated>2024-04-25T19:33:51Z</updated>
<author>
<name>Michael Pratt</name>
</author>
<published>2024-04-08T07:54:13Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/dangole/commit/?id=ddb7177c57e1515d9b170a2a35c2d2f341311a05'/>
<id>urn:sha1:ddb7177c57e1515d9b170a2a35c2d2f341311a05</id>
<content type='text'>
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 &lt;gvalkov@gmail.com&gt; # MacOS
Signed-off-by: Michael Pratt &lt;mcpratt@pm.me&gt;
Signed-off-by: Tony Ambardar &lt;itugrok@yahoo.com&gt;
</content>
</entry>
<entry>
<title>tools/elfutils: use locally declared static reallocarray()</title>
<updated>2024-04-25T19:33:51Z</updated>
<author>
<name>Michael Pratt</name>
</author>
<published>2024-04-08T03:28:51Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/dangole/commit/?id=20ed56ec8b80936132d3dd66e3a7b82dd1d2ed89'/>
<id>urn:sha1:20ed56ec8b80936132d3dd66e3a7b82dd1d2ed89</id>
<content type='text'>
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 &amp;&amp; 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 &lt;gvalkov@gmail.com&gt; # MacOS
Signed-off-by: Michael Pratt &lt;mcpratt@pm.me&gt;
Signed-off-by: Tony Ambardar &lt;itugrok@yahoo.com&gt;
</content>
</entry>
<entry>
<title>tools/elfutils: organize gnulib import build stage</title>
<updated>2024-04-25T19:33:51Z</updated>
<author>
<name>Michael Pratt</name>
</author>
<published>2024-04-05T08:42:14Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/dangole/commit/?id=43be31982366a9604ca5a980dd356d4a72a6d379'/>
<id>urn:sha1:43be31982366a9604ca5a980dd356d4a72a6d379</id>
<content type='text'>
Organize the Makefile lines involved in gnulib importing and its
workarounds. It improves readability and keeps git history organized.

Tested-by: Georgi Valkov &lt;gvalkov@gmail.com&gt; # MacOS
Signed-off-by: Michael Pratt &lt;mcpratt@pm.me&gt;
Signed-off-by: Tony Ambardar &lt;itugrok@yahoo.com&gt;
</content>
</entry>
<entry>
<title>tools/elfutils: override SUBDIRS variable of Makefile</title>
<updated>2024-04-25T19:33:51Z</updated>
<author>
<name>Michael Pratt</name>
</author>
<published>2024-04-07T19:28:03Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/dangole/commit/?id=7a4df7825eae83650c42ef9839f985f6fdc87b09'/>
<id>urn:sha1:7a4df7825eae83650c42ef9839f985f6fdc87b09</id>
<content type='text'>
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 &lt;gvalkov@gmail.com&gt; # MacOS
Signed-off-by: Michael Pratt &lt;mcpratt@pm.me&gt;
Signed-off-by: Tony Ambardar &lt;itugrok@yahoo.com&gt;
</content>
</entry>
<entry>
<title>tools/elfutils: update to 1.91</title>
<updated>2024-04-25T19:33:51Z</updated>
<author>
<name>Tony Ambardar</name>
</author>
<published>2024-03-04T05:04:36Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/dangole/commit/?id=b6f025b42429ec809afeb0956b35535c248b6c1b'/>
<id>urn:sha1:b6f025b42429ec809afeb0956b35535c248b6c1b</id>
<content type='text'>
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 &lt;gvalkov@gmail.com&gt; # MacOS
Co-Developed-by: Nick Hainke &lt;vincent@systemli.org&gt;
Signed-off-by: Nick Hainke &lt;vincent@systemli.org&gt;
Signed-off-by: Tony Ambardar &lt;itugrok@yahoo.com&gt;
</content>
</entry>
<entry>
<title>tools/elfutils: fix missing _ in auxv info alias</title>
<updated>2023-11-01T18:20:35Z</updated>
<author>
<name>Felix Fietkau</name>
</author>
<published>2023-11-01T18:20:16Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/dangole/commit/?id=f95a8f876926969b3643f43cf08674cf153e22e8'/>
<id>urn:sha1:f95a8f876926969b3643f43cf08674cf153e22e8</id>
<content type='text'>
Fixes dwarves compile issue

Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
<entry>
<title>tools/elfutils: disable bzlib support</title>
<updated>2023-11-01T17:37:50Z</updated>
<author>
<name>Felix Fietkau</name>
</author>
<published>2023-11-01T17:37:45Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/dangole/commit/?id=17a5f1c81f8b72c0f684ea05bd1acac6fa49d188'/>
<id>urn:sha1:17a5f1c81f8b72c0f684ea05bd1acac6fa49d188</id>
<content type='text'>
It is not needed

Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
<entry>
<title>tools/elfutils: add -fPIC to fix linker errors (#13841)</title>
<updated>2023-11-01T16:45:25Z</updated>
<author>
<name>Felix Fietkau</name>
</author>
<published>2023-11-01T16:44:43Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/dangole/commit/?id=5364163e774a6887c3c9e5c87203d32e2db26928'/>
<id>urn:sha1:5364163e774a6887c3c9e5c87203d32e2db26928</id>
<content type='text'>
Resolves issues with building PIE binaries that link against libdw or libelf

Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
</feed>
