Fix moving source files into debug packages
Commit 8bec63bf92
attempted to switch to
using -fdebug-prefix-map to set file locations in debug packages. It
make a few mistakes...
1) Adding debug C{,XX}FLAGS only worked if DBGSRCDIR was defined in
makepkg.conf. Fix this by falling back to the default value.
2) Using -fdebug-prefix-map altered a lot of assumptions about file
locations when copying source files into debug packages. This resulted
in lots of messages of failed cp in packaging output.
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
4d80d87f90
commit
653d2dc86d
2 changed files with 7 additions and 8 deletions
|
@ -58,9 +58,9 @@ strip_file() {
|
||||||
# copy source files to debug directory
|
# copy source files to debug directory
|
||||||
local f t
|
local f t
|
||||||
while read -r t; do
|
while read -r t; do
|
||||||
f=${t/$dbgsrc/"$srcdir"}
|
f=${t/${dbgsrcdir}/"$srcdir"}
|
||||||
mkdir -p "${t%/*}"
|
mkdir -p "${dbgsrc/"$dbgsrcdir"/}${t%/*}"
|
||||||
cp -- "$f" "$t"
|
cp -- "$f" "${dbgsrc/"$dbgsrcdir"/}$t"
|
||||||
done < <(source_files "$binary")
|
done < <(source_files "$binary")
|
||||||
|
|
||||||
# copy debug symbols to debug directory
|
# copy debug symbols to debug directory
|
||||||
|
@ -104,7 +104,8 @@ tidy_strip() {
|
||||||
if check_option "debug" "y"; then
|
if check_option "debug" "y"; then
|
||||||
|
|
||||||
dbgdir="$pkgdirbase/$pkgbase-@DEBUGSUFFIX@/usr/lib/debug"
|
dbgdir="$pkgdirbase/$pkgbase-@DEBUGSUFFIX@/usr/lib/debug"
|
||||||
dbgsrc="$pkgdirbase/$pkgbase-@DEBUGSUFFIX@${DBGSRCDIR:-/usr/src/debug}"
|
dbgsrcdir="${DBGSRCDIR:-/usr/src/debug}"
|
||||||
|
dbgsrc="$pkgdirbase/$pkgbase-@DEBUGSUFFIX@$dbgsrcdir"
|
||||||
mkdir -p "$dbgdir" "$dbgsrc"
|
mkdir -p "$dbgdir" "$dbgsrc"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -379,10 +379,8 @@ prepare_buildenv() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if check_option "debug" "y"; then
|
if check_option "debug" "y"; then
|
||||||
if [[ -v DBGSRCDIR ]]; then
|
DEBUG_CFLAGS+=" -fdebug-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}"
|
||||||
DEBUG_CFLAGS+=" -fdebug-prefix-map=$srcdir=$DBGSRCDIR"
|
DEBUG_CXXFLAGS+=" -fdebug-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}"
|
||||||
DEBUG_CXXFLAGS+=" -fdebug-prefix-map=$srcdir=$DBGSRCDIR"
|
|
||||||
fi
|
|
||||||
CFLAGS+=" $DEBUG_CFLAGS"
|
CFLAGS+=" $DEBUG_CFLAGS"
|
||||||
CXXFLAGS+=" $DEBUG_CXXFLAGS"
|
CXXFLAGS+=" $DEBUG_CXXFLAGS"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue