To avoid errors we need to set a weak default for DEBUG_PREFIX_MAP_EXTRA
as it is not always set by toolchain include files.

Also, bug YOCTO #15976 mixes flags to the llvm compiler in rust and
we need to avoid the canon-prefix-map option in DEBUG_PREFIX_MAP_EXTRA.
For now, just remove this until we can properly fix the rust flags handling.

Signed-off-by: Richard Purdie <[email protected]>
---
 meta/classes-recipe/rust-common.bbclass | 2 ++
 meta/conf/bitbake.conf                  | 1 +
 2 files changed, 3 insertions(+)

diff --git a/meta/classes-recipe/rust-common.bbclass 
b/meta/classes-recipe/rust-common.bbclass
index 31331c7a268..34bb2377cf4 100644
--- a/meta/classes-recipe/rust-common.bbclass
+++ b/meta/classes-recipe/rust-common.bbclass
@@ -18,6 +18,8 @@ RUST_DEBUG_REMAP = 
"--remap-path-prefix=${WORKDIR}=${TARGET_DBGSRC_DIR}"
 RUSTFLAGS += "${RUSTLIB} ${RUST_DEBUG_REMAP}"
 RUSTLIB_DEP ??= "libstd-rs"
 RUST_PANIC_STRATEGY ??= "unwind"
+# See https://bugzilla.yoctoproject.org/show_bug.cgi?id=15976
+DEBUG_PREFIX_MAP_EXTRA:toolchain-gcc = ""
 
 def target_is_armv7(d):
     '''Determine if target is armv7'''
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 600d4baffb7..729f92fcdb9 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -649,6 +649,7 @@ EXTRA_OEMAKE:prepend:task-install = "${PARALLEL_MAKEINST} "
 # Optimization flags.
 ##################################################################
 TARGET_DBGSRC_DIR ?= "/usr/src/debug/${PN}/${PV}"
+DEBUG_PREFIX_MAP_EXTRA ??= ""
 # Beware: applied last to first
 DEBUG_PREFIX_MAP ?= "${DEBUG_PREFIX_MAP_EXTRA} \
  -ffile-prefix-map=${S}=${TARGET_DBGSRC_DIR} \
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#226745): 
https://lists.openembedded.org/g/openembedded-core/message/226745
Mute This Topic: https://lists.openembedded.org/mt/116455581/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to