Skip to content

Commit 6a1af76

Browse files
authored
1 parent ac8246f commit 6a1af76

File tree

4 files changed

+217
-26
lines changed

4 files changed

+217
-26
lines changed

deps/checksums/unwind

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
LibUnwind.v1.7.2+1.aarch64-linux-gnu.tar.gz/md5/5c73031895f590a08b52200259b7bdf3
2-
LibUnwind.v1.7.2+1.aarch64-linux-gnu.tar.gz/sha512/f0b4cb946bab283c3a2dbd1278c556e7c41226ee3672a83dfd66a75f38ca6487a17a43d7e2a90720abd5468c4fb7fdee5f5ffa6d18fc15c85fa76a61a9e7135a
3-
LibUnwind.v1.7.2+1.aarch64-linux-musl.tar.gz/md5/beadb9e35c0713759482952273444135
4-
LibUnwind.v1.7.2+1.aarch64-linux-musl.tar.gz/sha512/cd37803ea219eddfc0b792bb54b2d5002479485efc30052cd1e5397dbbc2a3d666d57daab983dd2bb236db6eecfc3ccb2fe9726dfa464dcc2b5c0549c9a3b520
5-
LibUnwind.v1.7.2+1.armv6l-linux-gnueabihf.tar.gz/md5/615030f6c33a37308f72c2c9a976eda8
6-
LibUnwind.v1.7.2+1.armv6l-linux-gnueabihf.tar.gz/sha512/8d417fef3dfbac4c380ed6585e408c6c2958a1dff211812754c5198f82c699b0b40672b0acb1cff3e8bdbb7d2ff4a51ebac209b4d6d5922359e0d3221daf4521
7-
LibUnwind.v1.7.2+1.armv6l-linux-musleabihf.tar.gz/md5/20889d57eb365a7a318710d424a57163
8-
LibUnwind.v1.7.2+1.armv6l-linux-musleabihf.tar.gz/sha512/9e335a6eaeac08a7476dc1ee87952b7202c0bee073cbe96e71690b7e179c3d739c628bb8b511747330a519b3e99b7590e5b235106e8d788be93e156a6040e845
9-
LibUnwind.v1.7.2+1.armv7l-linux-gnueabihf.tar.gz/md5/3383684c3d47f3707786df48b7ac9668
10-
LibUnwind.v1.7.2+1.armv7l-linux-gnueabihf.tar.gz/sha512/be4828b347a7324c06bef3c3f457e9a1f28c1f37ed9a2de9c2888d73ee55f207b56be485131cc26b393311697c22dae66084d0496dc77ce61ad2bf24e2a0b9cb
11-
LibUnwind.v1.7.2+1.armv7l-linux-musleabihf.tar.gz/md5/be6fe35176f002c636f3b009fc8e3e53
12-
LibUnwind.v1.7.2+1.armv7l-linux-musleabihf.tar.gz/sha512/13746270bf6a4c34a6e15964c5035b2f2b4d361a40f75294c5be2c37b5f39a94375ac832e4ebacd33a1d52d0ef4220e76c4e666420bd2ebef238e950e0a00258
13-
LibUnwind.v1.7.2+1.i686-linux-gnu.tar.gz/md5/33f3514cdb3d039137f543599a98f3ca
14-
LibUnwind.v1.7.2+1.i686-linux-gnu.tar.gz/sha512/2aea691a1d0dfabefbe12b15ee1203ca037284c18733fb56a8feb0e79e352fd4f8ce55fb585748d936b513226cd21b9545cf1092f0b4e87e67397acf544c8926
15-
LibUnwind.v1.7.2+1.i686-linux-musl.tar.gz/md5/4aed5e07fbf7e4860ff184e106cf27c4
16-
LibUnwind.v1.7.2+1.i686-linux-musl.tar.gz/sha512/cf0ecace4b888e77153bc9697bf1cbd7834fe592d7012f7b5d9d700a0f39cb95fd0870437e3ba3c3fe0816d29f119bf3282c230dfaa2af10fcb9006d69141dac
17-
LibUnwind.v1.7.2+1.powerpc64le-linux-gnu.tar.gz/md5/60f8567a63b5e9562a18591be16dcf8a
18-
LibUnwind.v1.7.2+1.powerpc64le-linux-gnu.tar.gz/sha512/82cf61e3775f575f19a607618d345a0bb393b48099f835227c000f632bfb9bd851fc00b9fa80b79898d1309d7dcc4e4c2c3cd3239d66381693bda95db9673907
19-
LibUnwind.v1.7.2+1.x86_64-linux-gnu.tar.gz/md5/5b0cdaab2a0dc470d3926227f2cc67f9
20-
LibUnwind.v1.7.2+1.x86_64-linux-gnu.tar.gz/sha512/ae8f9b85a83208601c067b2c8d6c69b87d78b940dd7d8bce08da61df0d440191cc0490c0958a1c1cf027b333965659bccfd122fed91ef5f04163f4c0abf6ab35
21-
LibUnwind.v1.7.2+1.x86_64-linux-musl.tar.gz/md5/606580e0a666939a5cd6e5454f5f0062
22-
LibUnwind.v1.7.2+1.x86_64-linux-musl.tar.gz/sha512/95ecae2208ea957f79d21f2e3229c7b4e14f012c961502dc67892629555fb867ccbe0e1169bbfd6cd2c8386e2dd939e76a4c0853dc602441332f2d7bcd98f637
23-
LibUnwind.v1.7.2+1.x86_64-unknown-freebsd.tar.gz/md5/d043be8787b39d5e9a467bd8ff90be1d
24-
LibUnwind.v1.7.2+1.x86_64-unknown-freebsd.tar.gz/sha512/44fda1ffe4a3f4d442dcccb414efe6c0d6ab895f619d74f4aa8cdcef26d9388d7b6975cb43fc18b207df1f2e61faf3555d65db8597f85e3ab4b053be5ce72e66
1+
LibUnwind.v1.7.2+2.aarch64-linux-gnu.tar.gz/md5/2c8bdfc891b817cdcebad5cec3fe03ba
2+
LibUnwind.v1.7.2+2.aarch64-linux-gnu.tar.gz/sha512/c06eb08411c9759b7d0043258e239620eebac36b573c58d91f5cd3c6b801a33fb42833c21e0badcd958085adb1eddcf3d37386143b7584fd2c0631efa225acce
3+
LibUnwind.v1.7.2+2.aarch64-linux-musl.tar.gz/md5/3233eec783f73a9723f5c9c06a4085e9
4+
LibUnwind.v1.7.2+2.aarch64-linux-musl.tar.gz/sha512/91b5f6eba193b6c2abaac30ad805003142dd48b8bbda36c9d50e7802a17abf04f95b5d21c3d842697653834ee2c21c222f0b96d8f142a99f3819a58493817474
5+
LibUnwind.v1.7.2+2.armv6l-linux-gnueabihf.tar.gz/md5/75dc5ea25f5055959d348523ed6f1bdb
6+
LibUnwind.v1.7.2+2.armv6l-linux-gnueabihf.tar.gz/sha512/315e3e05caec95a81fef570aee3328f4f8b617a9567249b7e535a3b4246f9a39c6bc45dc0f3c061e6a796b94d839c308f0bba083a06093df4a9932328e1c6dee
7+
LibUnwind.v1.7.2+2.armv6l-linux-musleabihf.tar.gz/md5/99b02885777f3954cb9569849304f6fc
8+
LibUnwind.v1.7.2+2.armv6l-linux-musleabihf.tar.gz/sha512/b73ab8472cf60fb9e88d391543e5349246d05b90fa6b0ea793fca0e1a67ce91cc8f12a09c9e4594add5264c0363b157b879b89ce881ae33f0f7e3315b56aec5e
9+
LibUnwind.v1.7.2+2.armv7l-linux-gnueabihf.tar.gz/md5/ce447b3e3a9e8f990f914faa6cb37db0
10+
LibUnwind.v1.7.2+2.armv7l-linux-gnueabihf.tar.gz/sha512/efb8aff3a23dbbc8b65414f7f39af4a664311120f2da61b7b70dd8c7da30230582d8256c2b5421e00b2d70062e767694e358dafbbae83a69f550a5d0ac6a62b9
11+
LibUnwind.v1.7.2+2.armv7l-linux-musleabihf.tar.gz/md5/535b71f32d85b18208b911a13a9a0672
12+
LibUnwind.v1.7.2+2.armv7l-linux-musleabihf.tar.gz/sha512/267b72cdb3fe1fc63031fe76fd3ffc3afc97775a541dc2357df4f849d585064c0492b82ef3c16efce0f0573778ee56ed7886e97c6591f7a8cda27f705b0b65e4
13+
LibUnwind.v1.7.2+2.i686-linux-gnu.tar.gz/md5/97b6867d8d20abef8b96f5fc17e932b9
14+
LibUnwind.v1.7.2+2.i686-linux-gnu.tar.gz/sha512/ff48995503447288945dab6f32f85801b81be98ec9f5bcc933305230befb51a9c0aeb588e722ebde3694cc9e73ee6b443ae5eedec352c5c166603dca8c23c559
15+
LibUnwind.v1.7.2+2.i686-linux-musl.tar.gz/md5/3864ac880d38adb276e353904bf2b18d
16+
LibUnwind.v1.7.2+2.i686-linux-musl.tar.gz/sha512/36198cf175d6db1dfbb43ed498ad25eab2392958f21fc8a83aafdb4f54aacf8c3a473d313b117a835c81e56b7a20ff2bf152dee8f4280cdf7ef0e751d736a362
17+
LibUnwind.v1.7.2+2.powerpc64le-linux-gnu.tar.gz/md5/b4e6b56f160be18abbaac5f36d161753
18+
LibUnwind.v1.7.2+2.powerpc64le-linux-gnu.tar.gz/sha512/354f92c8658b465545b2ae77826f0ae4580084ec3e7723900e064245bdb0c38bc8dc9dc04bc505e83879d8bb3d2291493c091e83929aba23d42c99dc622a2bf0
19+
LibUnwind.v1.7.2+2.x86_64-linux-gnu.tar.gz/md5/1d82791f522deadb3bc3232997d094be
20+
LibUnwind.v1.7.2+2.x86_64-linux-gnu.tar.gz/sha512/9603731e4f40c89b6a157c754c1e89ca7c38349e2099e072957123967e6d9c8bd7df1725afc9ffe1c9137ada6e364deb19b4b91fc19d099d7acf1bced3caf2e0
21+
LibUnwind.v1.7.2+2.x86_64-linux-musl.tar.gz/md5/278dd4a9d36169b3c7719ac83f3d3fed
22+
LibUnwind.v1.7.2+2.x86_64-linux-musl.tar.gz/sha512/68952cbc9ac3e379412bc8482379621809bdd1d77095a44f18b96ff5f58bc338e502305941db0cfae0b68d4ee3719d7db898b64ccd815f1b71110cbc49a4b11f
23+
LibUnwind.v1.7.2+2.x86_64-unknown-freebsd.tar.gz/md5/d043be8787b39d5e9a467bd8ff90be1d
24+
LibUnwind.v1.7.2+2.x86_64-unknown-freebsd.tar.gz/sha512/44fda1ffe4a3f4d442dcccb414efe6c0d6ab895f619d74f4aa8cdcef26d9388d7b6975cb43fc18b207df1f2e61faf3555d65db8597f85e3ab4b053be5ce72e66
2525
libunwind-1.7.2.tar.gz/md5/35799cd8e475d3e157230ad2590c10f1
2626
libunwind-1.7.2.tar.gz/sha512/903f7e26c7d4c22e6ef4fe8954ca0f153fdf346cec40e1e8f7ab966d251110f4deb0a84d1fd150aee194ed966b5c1e01ee27c821cd043859852da33a94faae1f
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
From 7ae19a08467254f0b3d7a513ef82651b283f38a9 Mon Sep 17 00:00:00 2001
2+
From: Tim Besard <tim.besard@gmail.com>
3+
Date: Wed, 27 Sep 2023 12:51:59 +0000
4+
Subject: [PATCH] Revert "Fix unwinding of pre-linked libraries"
5+
6+
This reverts commit a4014f33775321b4106a1134b89020a7774902dd,
7+
which regresses unwinding on FreeBSD (JuliaLang/julia#51467).
8+
---
9+
include/dwarf.h | 2 --
10+
include/libunwind-dynamic.h | 1 -
11+
src/dwarf/Gfind_proc_info-lsb.c | 42 +++++++--------------------------
12+
src/dwarf/Gfind_unwind_table.c | 1 -
13+
4 files changed, 8 insertions(+), 38 deletions(-)
14+
15+
diff --git a/include/dwarf.h b/include/dwarf.h
16+
index dd9014b7..312166cd 100644
17+
--- a/include/dwarf.h
18+
+++ b/include/dwarf.h
19+
@@ -371,8 +371,6 @@ struct unw_debug_frame_list
20+
/* The start (inclusive) and end (exclusive) of the described region. */
21+
unw_word_t start;
22+
unw_word_t end;
23+
- /* ELF load offset */
24+
- unw_word_t load_offset;
25+
/* The debug frame itself. */
26+
char *debug_frame;
27+
size_t debug_frame_size;
28+
diff --git a/include/libunwind-dynamic.h b/include/libunwind-dynamic.h
29+
index a26f2c99..c902ccd9 100644
30+
--- a/include/libunwind-dynamic.h
31+
+++ b/include/libunwind-dynamic.h
32+
@@ -141,7 +141,6 @@ typedef struct unw_dyn_info
33+
unw_word_t gp; /* global-pointer in effect for this entry */
34+
int32_t format; /* real type: unw_dyn_info_format_t */
35+
int32_t pad;
36+
- unw_word_t load_offset; /* ELF load offset */
37+
union
38+
{
39+
unw_dyn_proc_info_t pi;
40+
diff --git a/src/dwarf/Gfind_proc_info-lsb.c b/src/dwarf/Gfind_proc_info-lsb.c
41+
index 8ead48f0..154e9b5a 100644
42+
--- a/src/dwarf/Gfind_proc_info-lsb.c
43+
+++ b/src/dwarf/Gfind_proc_info-lsb.c
44+
@@ -108,17 +108,13 @@ linear_search (unw_addr_space_t as, unw_word_t ip,
45+
46+
static int
47+
load_debug_frame (const char *file, char **buf, size_t *bufsize, int is_local,
48+
- unw_word_t segbase, unw_word_t *load_offset)
49+
+ unw_word_t segbase)
50+
{
51+
struct elf_image ei;
52+
- Elf_W (Ehdr) *ehdr;
53+
- Elf_W (Phdr) *phdr;
54+
Elf_W (Shdr) *shdr;
55+
- int i;
56+
int ret;
57+
58+
ei.image = NULL;
59+
- *load_offset = 0;
60+
61+
ret = elf_w (load_debuglink) (file, &ei, is_local);
62+
if (ret != 0)
63+
@@ -193,20 +189,6 @@ load_debug_frame (const char *file, char **buf, size_t *bufsize, int is_local,
64+
#if defined(SHF_COMPRESSED)
65+
}
66+
#endif
67+
-
68+
- ehdr = ei.image;
69+
- phdr = (Elf_W (Phdr) *) ((char *) ei.image + ehdr->e_phoff);
70+
-
71+
- for (i = 0; i < ehdr->e_phnum; ++i)
72+
- if (phdr[i].p_type == PT_LOAD)
73+
- {
74+
- *load_offset = segbase - phdr[i].p_vaddr;
75+
-
76+
- Debug (4, "%s load offset is 0x%zx\n", file, *load_offset);
77+
-
78+
- break;
79+
- }
80+
-
81+
munmap(ei.image, ei.size);
82+
return 0;
83+
}
84+
@@ -259,7 +241,6 @@ locate_debug_info (unw_addr_space_t as, unw_word_t addr, unw_word_t segbase,
85+
int err;
86+
char *buf;
87+
size_t bufsize;
88+
- unw_word_t load_offset;
89+
90+
/* First, see if we loaded this frame already. */
91+
92+
@@ -287,7 +268,7 @@ locate_debug_info (unw_addr_space_t as, unw_word_t addr, unw_word_t segbase,
93+
name = (char*) dlname;
94+
95+
err = load_debug_frame (name, &buf, &bufsize, as == unw_local_addr_space,
96+
- segbase, &load_offset);
97+
+ segbase);
98+
99+
if (!err)
100+
{
101+
@@ -300,7 +281,6 @@ locate_debug_info (unw_addr_space_t as, unw_word_t addr, unw_word_t segbase,
102+
103+
fdesc->start = start;
104+
fdesc->end = end;
105+
- fdesc->load_offset = load_offset;
106+
fdesc->debug_frame = buf;
107+
fdesc->debug_frame_size = bufsize;
108+
fdesc->index = NULL;
109+
@@ -497,7 +477,6 @@ dwarf_find_debug_frame (int found, unw_dyn_info_t *di_debug, unw_word_t ip,
110+
di->format = UNW_INFO_FORMAT_TABLE;
111+
di->start_ip = fdesc->start;
112+
di->end_ip = fdesc->end;
113+
- di->load_offset = fdesc->load_offset;
114+
di->u.ti.name_ptr = (unw_word_t) (uintptr_t) obj_name;
115+
di->u.ti.table_data = (unw_word_t *) fdesc;
116+
di->u.ti.table_len = sizeof (*fdesc) / sizeof (unw_word_t);
117+
@@ -960,14 +939,12 @@ dwarf_search_unwind_table (unw_addr_space_t as, unw_word_t ip,
118+
ip_base = segbase;
119+
}
120+
121+
- Debug (6, "lookup IP 0x%lx\n", (long) (ip - ip_base - di->load_offset));
122+
-
123+
#ifndef UNW_REMOTE_ONLY
124+
if (as == unw_local_addr_space)
125+
{
126+
- e = lookup (table, table_len, ip - ip_base - di->load_offset);
127+
+ e = lookup (table, table_len, ip - ip_base);
128+
if (e && &e[1] < &table[table_len / sizeof (unw_word_t)])
129+
- last_ip = e[1].start_ip_offset + ip_base + di->load_offset;
130+
+ last_ip = e[1].start_ip_offset + ip_base;
131+
else
132+
last_ip = di->end_ip;
133+
}
134+
@@ -975,7 +952,7 @@ dwarf_search_unwind_table (unw_addr_space_t as, unw_word_t ip,
135+
#endif
136+
{
137+
#ifndef UNW_LOCAL_ONLY
138+
- int32_t last_ip_offset = di->end_ip - ip_base - di->load_offset;
139+
+ int32_t last_ip_offset = di->end_ip - ip_base;
140+
segbase = di->u.rti.segbase;
141+
if ((ret = remote_lookup (as, (uintptr_t) table, table_len,
142+
ip - ip_base, &ent, &last_ip_offset, arg)) < 0)
143+
@@ -983,7 +960,7 @@ dwarf_search_unwind_table (unw_addr_space_t as, unw_word_t ip,
144+
if (ret)
145+
{
146+
e = &ent;
147+
- last_ip = last_ip_offset + ip_base + di->load_offset;
148+
+ last_ip = last_ip_offset + ip_base;
149+
}
150+
else
151+
e = NULL; /* no info found */
152+
@@ -997,8 +974,8 @@ dwarf_search_unwind_table (unw_addr_space_t as, unw_word_t ip,
153+
unwind info. */
154+
return -UNW_ENOINFO;
155+
}
156+
- Debug (15, "ip=0x%lx, load_offset=0x%lx, start_ip=0x%lx\n",
157+
- (long) ip, (long) di->load_offset, (long) (e->start_ip_offset));
158+
+ Debug (15, "ip=0x%lx, start_ip=0x%lx\n",
159+
+ (long) ip, (long) (e->start_ip_offset));
160+
if (debug_frame_base)
161+
fde_addr = e->fde_offset + debug_frame_base;
162+
else
163+
@@ -1022,9 +999,6 @@ dwarf_search_unwind_table (unw_addr_space_t as, unw_word_t ip,
164+
pi->flags = UNW_PI_FLAG_DEBUG_FRAME;
165+
}
166+
167+
- pi->start_ip += di->load_offset;
168+
- pi->end_ip += di->load_offset;
169+
-
170+
#if defined(NEED_LAST_IP)
171+
pi->last_ip = last_ip;
172+
#else
173+
diff --git a/src/dwarf/Gfind_unwind_table.c b/src/dwarf/Gfind_unwind_table.c
174+
index fb20fea0..62feb26c 100644
175+
--- a/src/dwarf/Gfind_unwind_table.c
176+
+++ b/src/dwarf/Gfind_unwind_table.c
177+
@@ -193,7 +193,6 @@ dwarf_find_unwind_table (struct elf_dyn_info *edi, unw_addr_space_t as,
178+
179+
edi->di_cache.start_ip = start_ip;
180+
edi->di_cache.end_ip = end_ip;
181+
- edi->di_cache.load_offset = 0;
182+
edi->di_cache.format = UNW_INFO_FORMAT_REMOTE_TABLE;
183+
edi->di_cache.u.rti.name_ptr = 0;
184+
/* two 32-bit values (ip_offset/fde_offset) per table-entry: */
185+
--
186+
2.41.0
187+

deps/unwind.mk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@ $(SRCCACHE)/libunwind-$(UNWIND_VER)/source-extracted: $(SRCCACHE)/libunwind-$(UN
2626
checksum-unwind: $(SRCCACHE)/libunwind-$(UNWIND_VER).tar.gz
2727
$(JLCHECKSUM) $<
2828

29+
$(SRCCACHE)/libunwind-$(UNWIND_VER)/libunwind-revert_prelink_unwind.patch-applied: $(SRCCACHE)/libunwind-$(UNWIND_VER)/source-extracted
30+
cd $(SRCCACHE)/libunwind-$(UNWIND_VER) && patch -p1 -f -u -l < $(SRCDIR)/patches/libunwind-revert_prelink_unwind.patch
31+
echo 1 > $@
32+
2933
# note minidebuginfo requires liblzma, which we do not have a source build for
3034
# (it will be enabled in BinaryBuilder-based downloads however)
3135
# since https://github.com/JuliaPackaging/Yggdrasil/commit/0149e021be9badcb331007c62442a4f554f3003c
32-
$(BUILDDIR)/libunwind-$(UNWIND_VER)/build-configured: $(SRCCACHE)/libunwind-$(UNWIND_VER)/source-extracted
36+
$(BUILDDIR)/libunwind-$(UNWIND_VER)/build-configured: $(SRCCACHE)/libunwind-$(UNWIND_VER)/source-extracted $(SRCCACHE)/libunwind-$(UNWIND_VER)/libunwind-revert_prelink_unwind.patch-applied
3337
mkdir -p $(dir $@)
3438
cd $(dir $@) && \
3539
$(dir $<)/configure $(CONFIGURE_COMMON) CPPFLAGS="$(CPPFLAGS) $(LIBUNWIND_CPPFLAGS)" CFLAGS="$(CFLAGS) $(LIBUNWIND_CFLAGS)" --enable-shared --disable-minidebuginfo --disable-tests --enable-zlibdebuginfo --disable-conservative-checks

stdlib/LibUnwind_jll/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "LibUnwind_jll"
22
uuid = "745a5e78-f969-53e9-954f-d19f2f74f4e3"
3-
version = "1.7.2+1"
3+
version = "1.7.2+2"
44

55
[deps]
66
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

0 commit comments

Comments
 (0)