diff mbox series

bitbake.conf: Add relative path from B to S to DEBUG_PREFIX_MAP

Message ID 20250701112317.1204143-1-michalwsieron@gmail.com
State New
Headers show
Series bitbake.conf: Add relative path from B to S to DEBUG_PREFIX_MAP | expand

Commit Message

Michal Sieron July 1, 2025, 11:23 a.m. UTC
Basically since forever, meson uses relative paths when generating
ninja rules [1]. This breaks prefix mapping that bitbake sets up in
DEBUG_PREFIX_MAP. As a result practicaly no files are added to the -src
packages built with meson.

We could add it with :append in meson.bbclass, but then it's not really
possible to override it (DEBUG_PREFIX_MAP is defined with `?=` probably
for a reason).

[1]: https://github.com/mesonbuild/meson/commit/8d1641d6a42e0a5f6db03bc38d252d3712195929

Signed-off-by: Michal Sieron <michalwsieron@gmail.com>
---
 meta/conf/bitbake.conf | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index b1f8ac5b11..0ecbc8c71f 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -656,6 +656,7 @@  TARGET_DBGSRC_DIR ?= "/usr/src/debug/${PN}/${PV}"
 DEBUG_PREFIX_MAP ?= "\
  -ffile-prefix-map=${S}=${TARGET_DBGSRC_DIR} \
  -ffile-prefix-map=${B}=${TARGET_DBGSRC_DIR} \
+ -ffile-prefix-map=${@os.path.relpath(S, B)}=${TARGET_DBGSRC_DIR} \
  -ffile-prefix-map=${STAGING_DIR_HOST}= \
  -ffile-prefix-map=${STAGING_DIR_NATIVE}= \
 "