From 90dea34cb624af744a7d5deabdd5cbfb3c10db87 Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Thu, 5 Sep 2024 11:16:17 +0200 Subject: [PATCH] bitbake.conf: DEBUG_PREFIX_MAP: add -fmacro-prefix-map for STAGING_DIR_NATIVE * the default STAGING_DIR_NATIVE starts with STAGING_DIR_HOST and the only difference is '-native' suffix at the end * this can lead into replacing STAGING_DIR_NATIVE path with just "-native" in FILE macros * I've noticed this by accident in python3-matplotlib where buildpaths QA warning was triggered only for lib32-python3-matplotlib and it was because pybind11 path to STAGING_DIR_NATIVE was mapped to only '-native/' in python3-matplotlib build (which doesn't trigger buildpaths QA and lib32-python3-matplotlib the macro path wasn't replaced at all, because of 'lib32-' prefix in: -fdebug-prefix-map=/OE/build/oe-core/tmp-glibc/work/i586-oemllib32-linux/lib32-python3-matplotlib/3.7.2/lib32-recipe-sysroot= \ -fmacro-prefix-map=/OE/build/oe-core/tmp-glibc/work/i586-oemllib32-linux/lib32-python3-matplotlib/3.7.2/lib32-recipe-sysroot= \ -fdebug-prefix-map=/OE/build/oe-core/tmp-glibc/work/i586-oemllib32-linux/lib32-python3-matplotlib/3.7.2/recipe-sysroot-native= \ * more details in meta-python fix for lib32-python3-matplotlib: https://lists.openembedded.org/g/openembedded-devel/message/112074 * the order of *-prefix-map options still seems to be that the last one matching wins and this works with gcc and clang, see: https://reviews.llvm.org/D148975?id=516863 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109591 * some components might sometimes be built with -coverage and could use -fcoverage-prefix-map: https://reviews.llvm.org/D148757 or -fprofile-prefix-map: https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#index-fprofile-prefix-map but will leave that to recipes which actually use -coverage for now Signed-off-by: Martin Jansa Signed-off-by: Richard Purdie --- meta/conf/bitbake.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index d8252c5b82a..04b288abc1c 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -656,6 +656,7 @@ DEBUG_PREFIX_MAP ?= "-fcanon-prefix-map \ -fdebug-prefix-map=${STAGING_DIR_HOST}= \ -fmacro-prefix-map=${STAGING_DIR_HOST}= \ -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \ + -fmacro-prefix-map=${STAGING_DIR_NATIVE}= \ " DEBUG_LEVELFLAG ?= "-g" -- 2.47.3