* [PATCH 1/2] glibc: Forward -ffile-prefix-map option to assembler flags
@ 2025-04-17 17:33 Khem Raj
2025-04-17 17:33 ` [PATCH 2/2] bitbake.conf: Switch prefix mapping to use -ffile-prefix-map Khem Raj
2025-04-18 10:24 ` [OE-core] [PATCH 1/2] glibc: Forward -ffile-prefix-map option to assembler flags Mathieu Dubois-Briand
0 siblings, 2 replies; 3+ messages in thread
From: Khem Raj @ 2025-04-17 17:33 UTC (permalink / raw)
To: openembedded-core; +Cc: Khem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
...le-prefix-map-from-CFLAGS-to-ASFLAGS.patch | 24 +++++++++++++++++++
meta/recipes-core/glibc/glibc_2.41.bb | 1 +
2 files changed, 25 insertions(+)
create mode 100644 meta/recipes-core/glibc/glibc/0001-Propagate-ffile-prefix-map-from-CFLAGS-to-ASFLAGS.patch
diff --git a/meta/recipes-core/glibc/glibc/0001-Propagate-ffile-prefix-map-from-CFLAGS-to-ASFLAGS.patch b/meta/recipes-core/glibc/glibc/0001-Propagate-ffile-prefix-map-from-CFLAGS-to-ASFLAGS.patch
new file mode 100644
index 00000000000..862c7b9086e
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0001-Propagate-ffile-prefix-map-from-CFLAGS-to-ASFLAGS.patch
@@ -0,0 +1,24 @@
+From 603e50d6b8ccadb32d59b0497f76629665c1794b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 16 Apr 2025 19:51:01 -0700
+Subject: [PATCH] Propagate -ffile-prefix-map from CFLAGS to ASFLAGS.
+
+Upstream-Status: Submitted [https://sourceware.org/pipermail/libc-alpha/2025-April/165969.html]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makeconfig | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makeconfig b/Makeconfig
+index e35c5cfe4e..7a19c731c6 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -1176,7 +1176,7 @@ endif
+
+ # The assembler can generate debug information too.
+ ifndef ASFLAGS
+-ASFLAGS := $(filter -g% -fdebug-prefix-map=%,$(CFLAGS))
++ASFLAGS := $(filter -g% -fdebug-prefix-map=% -ffile-prefix-map=%,$(CFLAGS))
+ endif
+ override ASFLAGS += -Werror=undef $(ASFLAGS-config) $(asflags-cpu)
+
diff --git a/meta/recipes-core/glibc/glibc_2.41.bb b/meta/recipes-core/glibc/glibc_2.41.bb
index d707e1a6775..82dcf08fcd0 100644
--- a/meta/recipes-core/glibc/glibc_2.41.bb
+++ b/meta/recipes-core/glibc/glibc_2.41.bb
@@ -54,6 +54,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
file://0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch \
file://0023-tests-Skip-2-qemu-tests-that-can-hang-in-oe-selftest.patch \
file://0001-stdlib-Add-single-threaded-fast-path-to-rand.patch \
+ file://0001-Propagate-ffile-prefix-map-from-CFLAGS-to-ASFLAGS.patch \
"
S = "${WORKDIR}/git"
B = "${WORKDIR}/build-${TARGET_SYS}"
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] bitbake.conf: Switch prefix mapping to use -ffile-prefix-map
2025-04-17 17:33 [PATCH 1/2] glibc: Forward -ffile-prefix-map option to assembler flags Khem Raj
@ 2025-04-17 17:33 ` Khem Raj
2025-04-18 10:24 ` [OE-core] [PATCH 1/2] glibc: Forward -ffile-prefix-map option to assembler flags Mathieu Dubois-Briand
1 sibling, 0 replies; 3+ messages in thread
From: Khem Raj @ 2025-04-17 17:33 UTC (permalink / raw)
To: openembedded-core; +Cc: Khem Raj, Jacob Kroon, Martin Jansa
-ffile-prefix map is more comprehensive when it comes to reproducible
builds and its superset of all prefix-mapping options in compilers
This makes is cleaner and workable across gcc and clang, clang does not
support -fcanon-prefix-map and it has to be explicitly omitted when using
clang.
There are lambdas generated in templates by clang which still get the
absolute paths despite -fdebug-prefix-map, this helps with that as well.
nasm is an outlier and we have fixed it by adding -fdebug-prefix-map option
luckily we do not pass DEBUG_PREFIX_MAP to nasm, in all recipes which use
nasm either pass -fdebug-prefix-map explicitly to nasm or they rewrite it
to use nasm flags syntax.
We have discussed this in past [1]
[1] https://patchwork.yoctoproject.org/project/oe-core/patch/20230428032030.2047920-1-raj.khem@gmail.com/#10281
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Jacob Kroon <jacob.kroon@gmail.com>
Cc: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/conf/bitbake.conf | 14 +++++---------
meta/recipes-devtools/go/go-cross-canadian.inc | 6 +++---
meta/recipes-devtools/go/go-runtime.inc | 4 ++--
meta/recipes-devtools/go/go-target.inc | 4 ++--
meta/recipes-devtools/rust/cargo_1.85.1.bb | 2 +-
5 files changed, 13 insertions(+), 17 deletions(-)
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 501808204e5..b1dae172678 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -652,15 +652,11 @@ EXTRA_OEMAKE:prepend:task-install = "${PARALLEL_MAKEINST} "
##################################################################
TARGET_DBGSRC_DIR ?= "/usr/src/debug/${PN}/${PV}"
# Beware: applied last to first
-DEBUG_PREFIX_MAP ?= "-fcanon-prefix-map \
- -fmacro-prefix-map=${S}=${TARGET_DBGSRC_DIR} \
- -fdebug-prefix-map=${S}=${TARGET_DBGSRC_DIR} \
- -fmacro-prefix-map=${B}=${TARGET_DBGSRC_DIR} \
- -fdebug-prefix-map=${B}=${TARGET_DBGSRC_DIR} \
- -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_PREFIX_MAP ?= "\
+ -ffile-prefix-map=${S}=${TARGET_DBGSRC_DIR} \
+ -ffile-prefix-map=${B}=${TARGET_DBGSRC_DIR} \
+ -ffile-prefix-map=${STAGING_DIR_HOST}= \
+ -ffile-prefix-map=${STAGING_DIR_NATIVE}= \
"
DEBUG_LEVELFLAG ?= "-g"
diff --git a/meta/recipes-devtools/go/go-cross-canadian.inc b/meta/recipes-devtools/go/go-cross-canadian.inc
index ff6c063d69e..f9b172f37c3 100644
--- a/meta/recipes-devtools/go/go-cross-canadian.inc
+++ b/meta/recipes-devtools/go/go-cross-canadian.inc
@@ -8,9 +8,9 @@ PN = "go-cross-canadian-${TRANSLATED_TARGET_ARCH}"
# it uses gcc on build machine during go-cross-canadian bootstrap, but
# the gcc version may be old and not support option '-fmacro-prefix-map'
# which is one of default values of DEBUG_PREFIX_MAP
-DEBUG_PREFIX_MAP = "-fdebug-prefix-map=${WORKDIR}=${TARGET_DBGSRC_DIR} \
- -fdebug-prefix-map=${STAGING_DIR_HOST}= \
- -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
+DEBUG_PREFIX_MAP = "-ffile-prefix-map=${WORKDIR}=${TARGET_DBGSRC_DIR} \
+ -ffile-prefix-map=${STAGING_DIR_HOST}= \
+ -ffile-prefix-map=${STAGING_DIR_NATIVE}= \
"
export GOTOOLDIR_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/${HOST_SYS}/go/pkg/tool/${BUILD_GOTUPLE}"
diff --git a/meta/recipes-devtools/go/go-runtime.inc b/meta/recipes-devtools/go/go-runtime.inc
index e5f17337bcb..a38c2ef9e9b 100644
--- a/meta/recipes-devtools/go/go-runtime.inc
+++ b/meta/recipes-devtools/go/go-runtime.inc
@@ -3,8 +3,8 @@ DEPENDS:class-nativesdk = "virtual/${TARGET_PREFIX}go"
PROVIDES = "virtual/${TARGET_PREFIX}go-runtime"
DEBUG_PREFIX_MAP = "\
- -fdebug-prefix-map=${STAGING_DIR_HOST}= \
- -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
+ -ffile-prefix-map=${STAGING_DIR_HOST}= \
+ -ffile-prefix-map=${STAGING_DIR_NATIVE}= \
"
export CGO_CFLAGS = "${CFLAGS}"
diff --git a/meta/recipes-devtools/go/go-target.inc b/meta/recipes-devtools/go/go-target.inc
index 981c7abd313..fe60f4d9649 100644
--- a/meta/recipes-devtools/go/go-target.inc
+++ b/meta/recipes-devtools/go/go-target.inc
@@ -2,8 +2,8 @@ DEPENDS = "virtual/${TUNE_PKGARCH}-go go-native"
DEPENDS:class-nativesdk = "virtual/${TARGET_PREFIX}go go-native"
DEBUG_PREFIX_MAP = "\
- -fdebug-prefix-map=${STAGING_DIR_HOST}= \
- -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
+ -ffile-prefix-map=${STAGING_DIR_HOST}= \
+ -ffile-prefix-map=${STAGING_DIR_NATIVE}= \
"
export CGO_CFLAGS = "${CFLAGS}"
diff --git a/meta/recipes-devtools/rust/cargo_1.85.1.bb b/meta/recipes-devtools/rust/cargo_1.85.1.bb
index db18ecfda9a..150c2d2b801 100644
--- a/meta/recipes-devtools/rust/cargo_1.85.1.bb
+++ b/meta/recipes-devtools/rust/cargo_1.85.1.bb
@@ -19,7 +19,7 @@ CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
inherit cargo pkgconfig
-DEBUG_PREFIX_MAP += "-fdebug-prefix-map=${RUSTSRC}/vendor=${TARGET_DBGSRC_DIR}"
+DEBUG_PREFIX_MAP += "-ffile-prefix-map=${RUSTSRC}/vendor=${TARGET_DBGSRC_DIR}"
do_cargo_setup_snapshot () {
${UNPACKDIR}/rust-snapshot-components/${CARGO_SNAPSHOT}/install.sh --prefix="${WORKDIR}/${CARGO_SNAPSHOT}" --disable-ldconfig
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [OE-core] [PATCH 1/2] glibc: Forward -ffile-prefix-map option to assembler flags
2025-04-17 17:33 [PATCH 1/2] glibc: Forward -ffile-prefix-map option to assembler flags Khem Raj
2025-04-17 17:33 ` [PATCH 2/2] bitbake.conf: Switch prefix mapping to use -ffile-prefix-map Khem Raj
@ 2025-04-18 10:24 ` Mathieu Dubois-Briand
1 sibling, 0 replies; 3+ messages in thread
From: Mathieu Dubois-Briand @ 2025-04-18 10:24 UTC (permalink / raw)
To: raj.khem, openembedded-core
On Thu Apr 17, 2025 at 7:33 PM CEST, Khem Raj via lists.openembedded.org wrote:
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
Hi Khem,
Thanks for your series.
I believe it is breaking go on the autobuilder:
ERROR: go-runtime-1.24.2-r0 do_package_qa: QA Issue: File /usr/lib/go/pkg/linux_arm64_dynlink/plugin.a in package go-runtime-dev contains reference to TMPDIR [buildpaths]
ERROR: go-runtime-1.24.2-r0 do_package_qa: QA Issue: File /usr/lib/go/pkg/linux_arm64_dynlink/net.a in package go-runtime-dev contains reference to TMPDIR [buildpaths]
ERROR: go-runtime-1.24.2-r0 do_package_qa: QA Issue: File /usr/lib/go/pkg/linux_arm64_dynlink/internal/testpty.a in package go-runtime-dev contains reference to TMPDIR [buildpaths]
NOTE: Setscene tasks completed
NOTE: Running task 10301 of 11005 (/srv/pokybuild/yocto-worker/genericarm64-alt/build/meta/recipes-extended/at/at_3.2.5.bb:do_package_write_ipk)
ERROR: go-runtime-1.24.2-r0 do_package_qa: QA Issue: File /usr/lib/go/pkg/linux_arm64_dynlink/os/user.a in package go-runtime-dev contains reference to TMPDIR [buildpaths]
NOTE: Running task 10303 of 11005 (/srv/pokybuild/yocto-worker/genericarm64-alt/build/meta/recipes-core/systemd/systemd-compat-units.bb:do_package_write_ipk)
NOTE: recipe sysklogd-2.7.2-r0: task do_package_write_ipk: Succeeded
NOTE: Running task 10307 of 11005 (/srv/pokybuild/yocto-worker/genericarm64-alt/build/meta/recipes-devtools/python/python3-pluggy_1.5.0.bb:do_create_package_spdx)
ERROR: go-runtime-1.24.2-r0 do_package_qa: QA Issue: File /usr/lib/go/pkg/linux_arm64_dynlink/runtime/cgo.a in package go-runtime-dev contains reference to TMPDIR [buildpaths]
NOTE: Task /srv/pokybuild/yocto-worker/genericarm64-alt/build/meta/recipes-extended/sysklogd/sysklogd_2.7.2.bb:do_package_write_ipk unihash changed to 69e6baca1186c873e5da11893803e9919551e88bbb951cc484649b725d81e7bd
NOTE: recipe python3-pluggy-1.5.0-r0: task do_create_package_spdx: Started
NOTE: recipe at-3.2.5-r0: task do_package_write_ipk: Started
ERROR: go-runtime-1.24.2-r0 do_package_qa: QA Issue: File /usr/lib/go/pkg/linux_arm64_dynlink/crypto/internal/sysrand/internal/seccomp.a in package go-runtime-dev contains reference to TMPDIR [buildpaths]
https://autobuilder.yoctoproject.org/valkyrie/#/builders/22/builds/1406
Can you have a look at this please?
--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-18 10:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-17 17:33 [PATCH 1/2] glibc: Forward -ffile-prefix-map option to assembler flags Khem Raj
2025-04-17 17:33 ` [PATCH 2/2] bitbake.conf: Switch prefix mapping to use -ffile-prefix-map Khem Raj
2025-04-18 10:24 ` [OE-core] [PATCH 1/2] glibc: Forward -ffile-prefix-map option to assembler flags Mathieu Dubois-Briand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox