]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake.conf: Handle S and B separately for debug mapping
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 20 Jul 2022 12:28:03 +0000 (13:28 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 17 Aug 2022 18:55:32 +0000 (19:55 +0100)
We don't really need to keep S and B separate for debug source purposes
and there shouldn't be source references in WORKDIR that isn't S and B
either.

Separating these out simplifies the shared-work directory handling for
gcc and should also help fix external source usage. Therefore handle
S and B in DEBUG_PREFIX_MAP separately and clean up other code.

Indentation is reduced here as it is introduced on every compiler
commandline so minimising it is helpful.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/conf/bitbake.conf
meta/recipes-devtools/gcc/gcc-runtime.inc
meta/recipes-devtools/gcc/libgcc-common.inc

index bdfb678437184009993349ca41b79b071059eb82..dd2df8a5520cdb2d928af2ccdc1244e3a8dcd996 100644 (file)
@@ -645,10 +645,13 @@ EXTRA_OEMAKE:prepend:task-install = "${PARALLEL_MAKEINST} "
 # Optimization flags.
 ##################################################################
 # Beware: applied last to first
-DEBUG_PREFIX_MAP ?= "-fmacro-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
-                     -fdebug-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
-                     -fdebug-prefix-map=${STAGING_DIR_HOST}= \
-                     -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
+DEBUG_PREFIX_MAP ?= "-fmacro-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
+ -fdebug-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
+ -fmacro-prefix-map=${B}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
+ -fdebug-prefix-map=${B}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
+ -fdebug-prefix-map=${STAGING_DIR_HOST}= \
+ -fmacro-prefix-map=${STAGING_DIR_HOST}= \
+ -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
 "
 DEBUG_FLAGS ?= "-g -feliminate-unused-debug-types ${DEBUG_PREFIX_MAP}"
 
index 35a3077a4a7ce1c4a4049e3ee6b1f12de85968ec..fa5b048dab70e1bed0cf76013d7a45930635d294 100644 (file)
@@ -50,19 +50,6 @@ RUNTIMETARGET:libc-newlib = "libstdc++-v3"
 # libiberty
 # libgfortran needs separate recipe due to libquadmath dependency
 
-# Relative path to be repaced into debug info
-DEBUGSOURCE = "/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}"
-
-DEBUG_PREFIX_MAP = " \
-   -ffile-prefix-map=${WORKDIR}/${MLPREFIX}recipe-sysroot= \
-   -ffile-prefix-map=${WORKDIR}/recipe-sysroot-native= \
-   -ffile-prefix-map=${B}=${DEBUGSOURCE} \
-   -ffile-prefix-map=${S}=${DEBUGSOURCE} \
-   -fdebug-prefix-map=${B}=${DEBUGSOURCE} \
-   -fdebug-prefix-map=${S}=${DEBUGSOURCE} \
-   -ffile-prefix-map=${B}/${HOST_SYS}/libstdc++-v3/include=${includedir}/c++/${BINV} \
-   "
-
 do_configure () {
        export CXX="${CXX} -nostdinc++ -L${WORKDIR}/dummylib"
        # libstdc++ isn't built yet so CXX would error not able to find it which breaks stdc++'s configure
index e8139263132429149ede21debfad55b87ebb0b26..d9084af51ad72107bdd899911f30e3bb6c2c8d31 100644 (file)
@@ -4,14 +4,6 @@ require gcc-configure-common.inc
 
 INHIBIT_DEFAULT_DEPS = "1"
 
-DEBUGSOURCE = "/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}"
-DEBUG_PREFIX_MAP = " \
-   -fdebug-prefix-map=${WORKDIR}/${MLPREFIX}recipe-sysroot= \
-   -fdebug-prefix-map=${WORKDIR}/recipe-sysroot-native= \
-   -fdebug-prefix-map=${B}=${DEBUGSOURCE} \
-   -fdebug-prefix-map=${S}=${DEBUGSOURCE} \
-   "
-
 do_configure () {
        install -d ${D}${base_libdir} ${D}${libdir}
        mkdir -p ${B}/${BPN}