[pacman-dev] [PATCH] makepkg: Only change debug prefix if making debug package

Austin Lund austin.lund at gmail.com
Mon Jul 29 04:52:03 UTC 2019


Currently all debug builds will prefix /usr/src/build to the source
paths.  If debugging symbols are stripped into a separate package then
these sources files are indeed in this path.  But if the debug build is
not stripped then one is left with a complex path rewriting to perform
debugging.  It's much easier to perform sensible path rewriting in this
instance when the path is left untouched.

Signed-off-by: Austin Lund <austin.lund at gmail.com>
---
 scripts/libmakepkg/buildenv/debugflags.sh.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/libmakepkg/buildenv/debugflags.sh.in b/scripts/libmakepkg/buildenv/debugflags.sh.in
index ce9c1556..ff715803 100644
--- a/scripts/libmakepkg/buildenv/debugflags.sh.in
+++ b/scripts/libmakepkg/buildenv/debugflags.sh.in
@@ -30,8 +30,10 @@ buildenv_functions+=('buildenv_debugflags')
 
 buildenv_debugflags() {
 	if check_option "debug" "y"; then
-		DEBUG_CFLAGS+=" -fdebug-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}"
-		DEBUG_CXXFLAGS+=" -fdebug-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}"
+		if check_option "strip" "y"; then
+			DEBUG_CFLAGS+=" -fdebug-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}"
+			DEBUG_CXXFLAGS+=" -fdebug-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}"
+		fi
 		CFLAGS+=" $DEBUG_CFLAGS"
 		CXXFLAGS+=" $DEBUG_CXXFLAGS"
 	fi
-- 
2.22.0


More information about the pacman-dev mailing list