Skip to content

Commit 4632cd2

Browse files
authored
deps: fix libunwind build with GCC < 11 (JuliaLang#58628)
Apply patch from libunwind/libunwind#853 to add missing parameter names in _UPT_ptrauth_insn_mask function to comply with ISO/IEC 9899. Prior to GCC 11, omitting parameter names in function definitions was an error. GCC 11 changed this behavior in commit https://gcc.gnu.org/pipermail/gcc-cvs/2020-October/336068.html to allow omitted parameter names as a C2x extension, making it a pedantic warning instead of an error. Since we build without -Wpedantic, the code compiles fine with GCC 11+ but fails with older GCC versions. Fixes scheduled CI failures in libunwind build: https://buildkite.com/julialang/julia-master-scheduled/builds/1160
1 parent 7cb88d6 commit 4632cd2

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From 9ebe5e12b8a0063953f9ef196b2433eca9933559 Mon Sep 17 00:00:00 2001
2+
From: Stephen Webb <swebb@qnx.com>
3+
Date: Tue, 15 Apr 2025 10:48:20 -0400
4+
Subject: [PATCH] Fix FTBFS in src/ptrace/_UPT_ptrauth_insn_mask.c
5+
6+
Added missing parameter names to make C code comply to ISO/IEC 9899.
7+
---
8+
src/ptrace/_UPT_ptrauth_insn_mask.c | 5 +++--
9+
1 file changed, 3 insertions(+), 2 deletions(-)
10+
11+
diff --git a/src/ptrace/_UPT_ptrauth_insn_mask.c b/src/ptrace/_UPT_ptrauth_insn_mask.c
12+
index dcc512370..e7b3a514b 100644
13+
--- a/src/ptrace/_UPT_ptrauth_insn_mask.c
14+
+++ b/src/ptrace/_UPT_ptrauth_insn_mask.c
15+
@@ -49,9 +49,10 @@ unw_word_t _UPT_ptrauth_insn_mask (UNUSED unw_addr_space_t as, void *arg)
16+
17+
#else
18+
19+
-unw_word_t _UPT_ptrauth_insn_mask (unw_addr_space_t, void *)
20+
+unw_word_t _UPT_ptrauth_insn_mask (UNUSED unw_addr_space_t as, UNUSED void *arg)
21+
{
22+
return 0;
23+
}
24+
25+
-#endif
26+
\ No newline at end of file
27+
+#endif
28+
+

deps/unwind.mk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,14 @@ $(SRCCACHE)/libunwind-$(UNWIND_VER)/libunwind-disable-initial-exec-tls.patch-app
3939
cd $(SRCCACHE)/libunwind-$(UNWIND_VER) && patch -p1 -f -u -l < $(SRCDIR)/patches/libunwind-disable-initial-exec-tls.patch
4040
echo 1 > $@
4141

42+
$(SRCCACHE)/libunwind-$(UNWIND_VER)/libunwind-missing-parameter-names.patch-applied: $(SRCCACHE)/libunwind-$(UNWIND_VER)/libunwind-disable-initial-exec-tls.patch-applied
43+
cd $(SRCCACHE)/libunwind-$(UNWIND_VER) && patch -p1 -f -u -l < $(SRCDIR)/patches/libunwind-missing-parameter-names.patch
44+
echo 1 > $@
45+
4246
# note minidebuginfo requires liblzma, which we do not have a source build for
4347
# (it will be enabled in BinaryBuilder-based downloads however)
4448
# since https://github.com/JuliaPackaging/Yggdrasil/commit/0149e021be9badcb331007c62442a4f554f3003c
45-
$(BUILDDIR)/libunwind-$(UNWIND_VER)/build-configured: $(SRCCACHE)/libunwind-$(UNWIND_VER)/source-extracted $(SRCCACHE)/libunwind-$(UNWIND_VER)/libunwind-disable-initial-exec-tls.patch-applied
49+
$(BUILDDIR)/libunwind-$(UNWIND_VER)/build-configured: $(SRCCACHE)/libunwind-$(UNWIND_VER)/source-extracted $(SRCCACHE)/libunwind-$(UNWIND_VER)/libunwind-missing-parameter-names.patch-applied
4650
mkdir -p $(dir $@)
4751
cd $(dir $@) && \
4852
$(dir $<)/configure $(CONFIGURE_COMMON) CPPFLAGS="$(CPPFLAGS) $(LIBUNWIND_CPPFLAGS)" CFLAGS="$(CFLAGS) $(LIBUNWIND_CFLAGS)" LDFLAGS="$(LDFLAGS) $(LIBUNWIND_LDFLAGS)" --enable-shared --disable-minidebuginfo --disable-tests --enable-zlibdebuginfo --disable-conservative-checks --enable-per-thread-cache

0 commit comments

Comments
 (0)