Skip to content

Commit

Permalink
meson: Fix debug-prefix-map issues which prevent building in ${B}
Browse files Browse the repository at this point in the history
XXX: possibly want to use file-prefix-map instead, if our gcc is new
enough?

XXX: need to test debuginfo path for files which are generated in ${B}
  • Loading branch information
jon-turney committed May 6, 2019
1 parent 9bef933 commit 4175d45
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
13 changes: 10 additions & 3 deletions bin/cygport.in
Original file line number Diff line number Diff line change
Expand Up @@ -526,10 +526,17 @@ then
do
declare ${flags}+=" -fdebug-prefix-map=${map}=/usr/src/debug/${PF}"
done
declare ${flags}+=" -fdebug-prefix-map=${B}=/usr/src/debug/${PF}"
declare ${flags}+=" -fdebug-prefix-map=${S}=/usr/src/debug/${PF}"
if ! defined _CYGPORT_RELATIVE_PREFIX_MAPS
then
declare ${flags}+=" -fdebug-prefix-map=${B}=/usr/src/debug/${PF}"
declare ${flags}+=" -fdebug-prefix-map=${S}=/usr/src/debug/${PF}"
else
declare ${flags}+=" -fdebug-prefix-map==/usr/src/debug/${PF}"
relpath=$(realpath -m --relative-to ${B} ${S})
declare ${flags}+=" -fdebug-prefix-map=${relpath}=/usr/src/debug/${PF}"
fi
done
unset flags map
unset flags map relpath
fi

################################################################################
Expand Down
10 changes: 6 additions & 4 deletions cygclass/meson.cygclass
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#
################################################################################

declare -gr _CYGPORT_RELATIVE_PREFIX_MAPS=1

#****h* Cygclasses/meson.cygclass
# SYNOPSIS
# inherit meson
Expand Down Expand Up @@ -86,7 +88,7 @@ cygmeson() {
--localstatedir=$(__host_localstatedir) \
--sysconfdir=$(__host_sysconfdir) \
--buildtype=plain --wrap-mode=nodownload \
${crossargs} ${CYGMESON_ARGS} "${@}" ${CHOST} \
${crossargs} ${CYGMESON_ARGS} "${@}" ${B} . \
|| error "meson failed"
}

Expand All @@ -101,7 +103,7 @@ cygmeson() {
#****
meson_compile() {
cygmeson ${@}
cygninja -C ${CHOST}
cygninja -C ${B}
}

#****T* meson.cygclass/meson_test
Expand All @@ -113,7 +115,7 @@ meson_compile() {
# meson_test should be run in the directory containing the top-level meson.build.
#****
meson_test() {
ninja_test -C ${CHOST}
ninja_test -C ${B}
}

#****I* meson.cygclass/meson_install
Expand All @@ -125,7 +127,7 @@ meson_test() {
# meson_install should be run in the directory containing the top-level meson.build.
#****
meson_install() {
ninja_install -C ${CHOST}
ninja_install -C ${B}
}

#****o* meson.cygclass/src_compile (meson)
Expand Down

0 comments on commit 4175d45

Please sign in to comment.