From e0162a6868713abd0e7816d0e2735d4c5896c316 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Fri, 18 Oct 2024 03:02:31 +0200 Subject: [PATCH] strip: Overwrite debuglink when it's already present When objcopy encounters an already-present section, adding the new debuglink will fail with a warning. Remove any existing `.gnu_debuglink` section to work around this problem. Arch Linux's `rust` package is affected by this. Apparently when LLVM's LLD links in `/usr/lib/Scrt1.o` it will also copy the `.gnu_debuglink` section. See: https://bugs.gentoo.org/787623 --- scripts/libmakepkg/tidy/strip.sh.in | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/libmakepkg/tidy/strip.sh.in b/scripts/libmakepkg/tidy/strip.sh.in index cf814323..0b2d061f 100644 --- a/scripts/libmakepkg/tidy/strip.sh.in +++ b/scripts/libmakepkg/tidy/strip.sh.in @@ -100,6 +100,7 @@ collect_debug_symbols() { return fi + safe_objcopy "$binary" --remove-section=.gnu_debuglink safe_objcopy "$binary" --add-gnu-debuglink="$dbgdir/${binary#/}.debug" # create any needed hardlinks