diff mbox series

[7/8] gcc: Add a patch to avoid hardcoded paths in libgcc on powerpc

Message ID 20220816205746.1672987-7-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit a71832a14b6944da10c1916861545577f2f2de2c
Headers show
Series [1/8] package: Switch debug source handling to use prefix map | expand

Commit Message

Richard Purdie Aug. 16, 2022, 8:57 p.m. UTC
Tweak the powerpc code to just include filenames rather than full paths
to avoid build reproducibility issues.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-12.1.inc        |  1 +
 .../gcc/gcc/hardcoded-paths.patch             | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 meta/recipes-devtools/gcc/gcc/hardcoded-paths.patch

Comments

Khem Raj Aug. 16, 2022, 10:45 p.m. UTC | #1
On Tue, Aug 16, 2022 at 1:58 PM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> Tweak the powerpc code to just include filenames rather than full paths
> to avoid build reproducibility issues.
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  meta/recipes-devtools/gcc/gcc-12.1.inc        |  1 +
>  .../gcc/gcc/hardcoded-paths.patch             | 19 +++++++++++++++++++
>  2 files changed, 20 insertions(+)
>  create mode 100644 meta/recipes-devtools/gcc/gcc/hardcoded-paths.patch
>
> diff --git a/meta/recipes-devtools/gcc/gcc-12.1.inc b/meta/recipes-devtools/gcc/gcc-12.1.inc
> index c42fa3d72f0..488e0c95b18 100644
> --- a/meta/recipes-devtools/gcc/gcc-12.1.inc
> +++ b/meta/recipes-devtools/gcc/gcc-12.1.inc
> @@ -66,6 +66,7 @@ SRC_URI = "${BASEURI} \
>             file://0026-rust-recursion-limit.patch \
>             file://0001-libsanitizer-cherry-pick-9cf13067cb5088626ba7-from-u.patch \
>             file://prefix-map-realpath.patch \
> +           file://hardcoded-paths.patch \
>  "
>  SRC_URI[sha256sum] = "62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b"
>
> diff --git a/meta/recipes-devtools/gcc/gcc/hardcoded-paths.patch b/meta/recipes-devtools/gcc/gcc/hardcoded-paths.patch
> new file mode 100644
> index 00000000000..aa3d16f6000
> --- /dev/null
> +++ b/meta/recipes-devtools/gcc/gcc/hardcoded-paths.patch
> @@ -0,0 +1,19 @@
> +Avoid encoding build paths into sources used for floating point on powerpc.
> +(MACHINE=qemuppc bitbake libgcc).
> +
> +Upstream-Status: Pending
> +Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> +
> +Index: gcc-12.1.0/libgcc/config/rs6000/t-float128
> +===================================================================
> +--- gcc-12.1.0.orig/libgcc/config/rs6000/t-float128
> ++++ gcc-12.1.0/libgcc/config/rs6000/t-float128
> +@@ -103,7 +103,7 @@ $(ibm128_dec_objs) : INTERNAL_CFLAGS +=
> + $(fp128_softfp_src) : $(srcdir)/soft-fp/$(subst -sw,,$(subst kf,tf,$@)) $(fp128_dep)
> +       @src="$(srcdir)/soft-fp/$(subst -sw,,$(subst kf,tf,$@))"; \
> +       echo "Create $@"; \
> +-      (echo "/* file created from $$src */"; \
> ++      (echo "/* file created from `basename $$src` */"; \
> +        echo; \
> +        sed -f $(fp128_sed) < $$src) > $@
> +

This one looks an easily upstreamable change.

> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#169461): https://lists.openembedded.org/g/openembedded-core/message/169461
> Mute This Topic: https://lists.openembedded.org/mt/93068152/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta/recipes-devtools/gcc/gcc-12.1.inc b/meta/recipes-devtools/gcc/gcc-12.1.inc
index c42fa3d72f0..488e0c95b18 100644
--- a/meta/recipes-devtools/gcc/gcc-12.1.inc
+++ b/meta/recipes-devtools/gcc/gcc-12.1.inc
@@ -66,6 +66,7 @@  SRC_URI = "${BASEURI} \
            file://0026-rust-recursion-limit.patch \
            file://0001-libsanitizer-cherry-pick-9cf13067cb5088626ba7-from-u.patch \
            file://prefix-map-realpath.patch \
+           file://hardcoded-paths.patch \
 "
 SRC_URI[sha256sum] = "62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b"
 
diff --git a/meta/recipes-devtools/gcc/gcc/hardcoded-paths.patch b/meta/recipes-devtools/gcc/gcc/hardcoded-paths.patch
new file mode 100644
index 00000000000..aa3d16f6000
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc/hardcoded-paths.patch
@@ -0,0 +1,19 @@ 
+Avoid encoding build paths into sources used for floating point on powerpc.
+(MACHINE=qemuppc bitbake libgcc).
+
+Upstream-Status: Pending
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+
+Index: gcc-12.1.0/libgcc/config/rs6000/t-float128
+===================================================================
+--- gcc-12.1.0.orig/libgcc/config/rs6000/t-float128
++++ gcc-12.1.0/libgcc/config/rs6000/t-float128
+@@ -103,7 +103,7 @@ $(ibm128_dec_objs)	: INTERNAL_CFLAGS +=
+ $(fp128_softfp_src) : $(srcdir)/soft-fp/$(subst -sw,,$(subst kf,tf,$@)) $(fp128_dep)
+ 	@src="$(srcdir)/soft-fp/$(subst -sw,,$(subst kf,tf,$@))"; \
+ 	echo "Create $@"; \
+-	(echo "/* file created from $$src */"; \
++	(echo "/* file created from `basename $$src` */"; \
+ 	 echo; \
+ 	 sed -f $(fp128_sed) < $$src) > $@
+