]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake.conf, gcc toolchain: add -fcanon-prefix-map to map-prefixes
authorGyorgy Sarvari <skandigraun@gmail.com>
Thu, 20 Nov 2025 12:19:46 +0000 (13:19 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 24 Nov 2025 17:48:50 +0000 (17:48 +0000)
This patch adds -fcanon-prefix-map to the list of compile file-prefixes
list in case at least gcc 13 is used (it's a gcc-only flag).

This flag used to be part of this list in the past, but was removed with [1].

Since then the source file paths are not canonicalized, which makes
the system to miss some (and sometimes all) source files to include
in the corresponding -src packages. As an example sqlite3 and audiofile
(from meta-oe) produces empty src packages, mostly due to the pathes:
they frequently use relative paths that don't match up with the
absolute path specified in the file-preifx map:
`pwd`/../../foo.cpp and ${S}/foo.cpp might refer to the same file, but
the first one won't match the prefix-map, so it is omitted.

This patch adds this option again with gcc in the target case.

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/toolchain/gcc.bbclass
meta/conf/bitbake.conf

index a5adb5ca372786313d325a0927d3dcdc4502c07b..0ed49ba892caa913d3dce83afcde51b70c5436bb 100644 (file)
@@ -30,4 +30,6 @@ PREFERRED_PROVIDER_virtual/nativesdk-cross-cc:class-cross-canadian = "gcc-crosss
 PREFERRED_PROVIDER_virtual/nativesdk-cross-c++:class-cross-canadian = "gcc-crosssdk-${SDK_SYS}"
 PREFERRED_PROVIDER_virtual/nativesdk-compilerlibs:class-cross-canadian = "nativesdk-gcc-runtime"
 
+DEBUG_PREFIX_MAP_EXTRA = "-fcanon-prefix-map"
+
 TCOVERRIDE = "toolchain-gcc"
index 5406e542db64ddf22515e0e8e7eb1f5822ba910c..600d4baffb7220034373af84b1f840e87e6fb871 100644 (file)
@@ -650,7 +650,7 @@ EXTRA_OEMAKE:prepend:task-install = "${PARALLEL_MAKEINST} "
 ##################################################################
 TARGET_DBGSRC_DIR ?= "/usr/src/debug/${PN}/${PV}"
 # Beware: applied last to first
-DEBUG_PREFIX_MAP ?= "\
+DEBUG_PREFIX_MAP ?= "${DEBUG_PREFIX_MAP_EXTRA} \
  -ffile-prefix-map=${S}=${TARGET_DBGSRC_DIR} \
  -ffile-prefix-map=${B}=${TARGET_DBGSRC_DIR} \
  -ffile-prefix-map=${STAGING_DIR_HOST}= \