Skip to content

Commit 6ca74a0

Browse files
authored
Merge pull request #166 from jkloetzke/fix-165
libs::elfutils: fix build with compat-toolchain
2 parents 0776531 + 7ac64c1 commit 6ca74a0

2 files changed

Lines changed: 56 additions & 1 deletion

File tree

recipes/libs/elfutils.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
inherit: [autotools]
1+
inherit: [autotools, patch]
22

33
metaEnvironment:
44
PKG_VERSION: "0.194"
@@ -16,6 +16,10 @@ checkoutSCM:
1616
digestSHA256: 09e2ff033d39baa8b388a2d7fbc5390bfde99ae3b7c67c7daaf7433fbcf0f01e
1717
stripComponents: 1
1818

19+
checkoutDeterministic: True
20+
checkoutScript: |
21+
patchApplySeries $<@elfutils/*.patch@>
22+
1923
buildTools: [m4]
2024
buildScript: |
2125
mkdir -p all
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
From 1bee26c4d7d787eebbebca2a2ad3c5f3d06528a5 Mon Sep 17 00:00:00 2001
2+
From: Aaron Merey <amerey@redhat.com>
3+
Date: Mon, 27 Oct 2025 21:49:31 -0400
4+
Subject: [PATCH] link_map.c: Declare name_no_sysroot only if openat2
5+
RESOLVE_IN_ROOT is supported
6+
7+
Rename variable n to name_no_sysroot. Declare name_no_sysroot only if
8+
openat2 RESOLVE_IN_ROOT is supported to avoid an unused variable warning.
9+
10+
https://sourceware.org/bugzilla/show_bug.cgi?id=33581
11+
12+
Signed-off-by: Aaron Merey <amerey@redhat.com>
13+
---
14+
libdwfl/link_map.c | 11 +++++++----
15+
1 file changed, 7 insertions(+), 4 deletions(-)
16+
17+
diff --git a/libdwfl/link_map.c b/libdwfl/link_map.c
18+
index 013a415d..5f934131 100644
19+
--- a/libdwfl/link_map.c
20+
+++ b/libdwfl/link_map.c
21+
@@ -431,12 +431,14 @@ report_r_debug (uint_fast8_t elfclass, uint_fast8_t elfdata,
22+
23+
if (sysroot && !name_in_sysroot)
24+
{
25+
- const char *n = NULL;
26+
-
27+
if (asprintf (&sysroot_name, "%s%s", sysroot, name) < 0)
28+
return release_buffer (&memory_closure, &buffer, &buffer_available, -1);
29+
30+
- n = name;
31+
+#ifdef HAVE_OPENAT2_RESOLVE_IN_ROOT
32+
+ /* The original name does not contain the sysroot as a prefix.
33+
+ Save this for use with openat2. */
34+
+ const char *name_no_sysroot = name;
35+
+#endif
36+
name = sysroot_name;
37+
38+
#ifdef HAVE_OPENAT2_RESOLVE_IN_ROOT
39+
@@ -451,7 +453,8 @@ report_r_debug (uint_fast8_t elfclass, uint_fast8_t elfdata,
40+
if (sysrootfd < 0)
41+
return -1;
42+
43+
- fd = syscall (SYS_openat2, sysrootfd, n, &how, sizeof(how));
44+
+ fd = syscall (SYS_openat2, sysrootfd, name_no_sysroot,
45+
+ &how, sizeof(how));
46+
err = fd < 0 ? -errno : 0;
47+
48+
close (sysrootfd);
49+
--
50+
2.43.7
51+

0 commit comments

Comments
 (0)