Bug 31034 - iproute2 fails to build with elfutils 0.190 with musl libc
Summary: iproute2 fails to build with elfutils 0.190 with musl libc
Status: RESOLVED MOVED
Alias: None
Product: elfutils
Classification: Unclassified
Component: libelf (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-06 11:43 UTC by ncopa
Modified: 2023-12-21 00:55 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ncopa 2023-11-06 11:43:13 UTC
After elfutils was updated to 0.190, iproute2 fails to build with this error:

In file included from bpf_legacy.c:24:
/usr/include/gelf.h:86:9: error: unknown type name 'Elf64_Relr'
   86 | typedef Elf64_Relr GElf_Relr;
      |         ^~~~~~~~~~


This appears to introduced with https://sourceware.org/git/?p=elfutils.git;a=commit;h=39f2c500542f69c2f1a13fd0ae4eaa5778d2ed8d which assumes that Elf64_Relr is typedef'ed if SHT_RELR is defined. This is not (yet) the case in musl libc.
Comment 1 ncopa 2023-11-06 11:50:14 UTC
Patch sent to musl: https://www.openwall.com/lists/musl/2023/11/06/3
Comment 2 Mark Wielaard 2023-12-21 00:55:10 UTC
This was fixed in musl with:

commit 6be76895f6863100a311d474a42abdbb6466189d
Author: Violet Purcell <vimproved@inventati.org>
Date:   Sat Nov 4 12:09:20 2023 -0400

    elf.h: add typedefs for Elf64_Relr and Elf32_Relr
    
    These were overlooked when DT_RELR was added in commit
    d32dadd60efb9d3b255351a3b532f8e4c3dd0db1, potentially breaking
    software that treats presence of the DT_RELR macro as implying they
    exist.