From d55924dbd7648c6aea3a4e1b647fcaf24f8c6a64 Mon Sep 17 00:00:00 2001 From: Morten Linderud Date: Fri, 27 May 2022 18:44:52 +0200 Subject: [PATCH] debugflags: Ensure we have unique source paths In some cases packages are built outside of a directory which contains pkgname-pkgver, this results in source listing in debug packages having a conflicting path like `/usr/src/debug/build/` which is not ideal. This patch ensures we always include the pkgbase to ensure the paths are unique. Signed-off-by: Morten Linderud Signed-off-by: Allan McRae (cherry picked from commit 776b7c1e75f24b9cab86b797c1acf549c7da2c46) --- scripts/libmakepkg/buildenv/debugflags.sh.in | 6 +++--- scripts/libmakepkg/tidy/strip.sh.in | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/libmakepkg/buildenv/debugflags.sh.in b/scripts/libmakepkg/buildenv/debugflags.sh.in index 2ab974cd..0d9ab05a 100644 --- a/scripts/libmakepkg/buildenv/debugflags.sh.in +++ b/scripts/libmakepkg/buildenv/debugflags.sh.in @@ -30,9 +30,9 @@ buildenv_functions+=('buildenv_debugflags') buildenv_debugflags() { if check_option "debug" "y" && ! check_option "buildflags" "n"; then - DEBUG_CFLAGS+=" -ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}" - DEBUG_CXXFLAGS+=" -ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}" - DEBUG_RUSTFLAGS+=" --remap-path-prefix=$srcdir=${DBGSRCDIR:-/usr/src/debug}" + DEBUG_CFLAGS+=" -ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}" + DEBUG_CXXFLAGS+=" -ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}" + DEBUG_RUSTFLAGS+=" --remap-path-prefix=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}" CFLAGS+=" $DEBUG_CFLAGS" CXXFLAGS+=" $DEBUG_CXXFLAGS" RUSTFLAGS+=" $DEBUG_RUSTFLAGS" diff --git a/scripts/libmakepkg/tidy/strip.sh.in b/scripts/libmakepkg/tidy/strip.sh.in index 4a778a9d..e7aecd38 100644 --- a/scripts/libmakepkg/tidy/strip.sh.in +++ b/scripts/libmakepkg/tidy/strip.sh.in @@ -47,7 +47,7 @@ source_files() { LANG=C debugedit --no-recompute-build-id \ --base-dir "${srcdir}" \ - --dest-dir "${dbgsrcdir}" \ + --dest-dir "${dbgsrcdir}/${pkgbase}" \ --list-file /dev/stdout "$1" \ | sort -zu | tr '\0' '\n' }