GNU bug report logs - #49896
[PATCH core-updates-frozen] gnu: gcc-5: Fix powerpc64le-linux build

Previous Next

Package: guix-patches;

Reported by: Thiago Jung Bauermann <bauermann <at> kolabnow.com>

Date: Thu, 5 Aug 2021 16:21:02 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 49896 in the body.
You can then email your comments to 49896 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#49896; Package guix-patches. (Thu, 05 Aug 2021 16:21:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thiago Jung Bauermann <bauermann <at> kolabnow.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 05 Aug 2021 16:21:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Thiago Jung Bauermann <bauermann <at> kolabnow.com>
To: guix-patches <at> gnu.org
Cc: Thiago Jung Bauermann <bauermann <at> kolabnow.com>
Subject: [PATCH core-updates-frozen] gnu: gcc-5: Fix powerpc64le-linux build
Date: Thu,  5 Aug 2021 13:19:43 -0300
GCC 5 has a misaligned access to a vector pointer which causes a build
failure when using GCC 8 and later. Backport upstream fix that was applied
on the GCC 6 branch.

* gnu/packages/gcc.scm (gcc-5)[source]: Apply
gcc-5-fix-powerpc64le-build.patch.
* gnu/packages/patches/gcc-5-fix-powerpc64le-build.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add new file.
---

Hi,

Even though gcc-5-fix-powerpc64le-build.patch modifies a file which is
used by all architectures, it only affects powerpc64le because the code
it touches is guarded by:

  #elif defined(_ARCH_PWR8) && defined(__ALTIVEC__)

Also, this problem doesn't affect the master branch because GCC 7.5 is
able to build GCC 5.

Thanks,
Thiago


 gnu/local.mk                                  |  1 +
 gnu/packages/gcc.scm                          |  4 +-
 .../patches/gcc-5-fix-powerpc64le-build.patch | 64 +++++++++++++++++++
 3 files changed, 68 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/gcc-5-fix-powerpc64le-build.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 5e5dd0bad3ec..7562b54d14e4 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1068,6 +1068,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gcc-4.9.3-mingw-gthr-default.patch	\
   %D%/packages/patches/gcc-5-hurd.patch				\
   %D%/packages/patches/gcc-5.0-libvtv-runpath.patch		\
+  %D%/packages/patches/gcc-5-fix-powerpc64le-build.patch	\
   %D%/packages/patches/gcc-5-source-date-epoch-1.patch		\
   %D%/packages/patches/gcc-5-source-date-epoch-2.patch		\
   %D%/packages/patches/gcc-6-arm-none-eabi-multilib.patch	\
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 79994cc19116..ddc5af3cedf9 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -490,7 +490,9 @@ Go.  It also includes runtime support libraries for these languages.")
                                        "gcc-5-source-date-epoch-2.patch"
                                        "gcc-6-libsanitizer-mode-size.patch"
                                        "gcc-fix-texi2pod.patch"
-                                       "gcc-5-hurd.patch"))
+                                       "gcc-5-hurd.patch"
+                                       ;; See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86162
+                                       "gcc-5-fix-powerpc64le-build.patch"))
               (modules '((guix build utils)))
               (snippet gcc-canadian-cross-objdump-snippet)))
     (inputs
diff --git a/gnu/packages/patches/gcc-5-fix-powerpc64le-build.patch b/gnu/packages/patches/gcc-5-fix-powerpc64le-build.patch
new file mode 100644
index 000000000000..289d64887539
--- /dev/null
+++ b/gnu/packages/patches/gcc-5-fix-powerpc64le-build.patch
@@ -0,0 +1,64 @@
+From ee6c0081c03330045b3d4cde8421cd1d3a459609 Mon Sep 17 00:00:00 2001
+From: Martin Liska <mliska <at> suse.cz>
+Date: Fri, 15 Jun 2018 10:51:28 +0200
+Subject: [PATCH] Partial backport r256656
+
+2018-06-15  Martin Liska  <mliska <at> suse.cz>
+
+	Backport from mainline
+	2018-01-10  Kelvin Nilsen  <kelvin <at> gcc.gnu.org>
+
+	* lex.c (search_line_fast): Remove illegal coercion of an
+	unaligned pointer value to vector pointer type and replace with
+	use of __builtin_vec_vsx_ld () built-in function, which operates
+	on unaligned pointer values.
+
+From-SVN: r261621
+---
+
+Obtained from:
+
+https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=ee6c0081c03330045b3d4cde8421cd1d3a459609
+
+The libcpp/ChangeLog hunk was modified to apply on top of gcc-5's libcpp/ChangeLog.
+
+ libcpp/ChangeLog | 12 ++++++++++++
+ libcpp/lex.c     |  2 +-
+ 2 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
+index c920a05d438..a63abb04f5e 100644
+--- a/libcpp/ChangeLog
++++ b/libcpp/ChangeLog
+@@ -1,3 +1,15 @@
++2018-06-15  Martin Liska  <mliska <at> suse.cz>
++
++	PR bootstrap/86162
++
++	Backport from mainline
++	2018-01-10  Kelvin Nilsen  <kelvin <at> gcc.gnu.org>
++
++	* lex.c (search_line_fast): Remove illegal coercion of an
++	unaligned pointer value to vector pointer type and replace with
++	use of __builtin_vec_vsx_ld () built-in function, which operates
++	on unaligned pointer values.
++
+ 2017-10-10  Release Manager
+ 
+ 	* GCC 5.5.0 released.
+diff --git a/libcpp/lex.c b/libcpp/lex.c
+index e5a0397f309..b789686f1c4 100644
+--- a/libcpp/lex.c
++++ b/libcpp/lex.c
+@@ -568,7 +568,7 @@ search_line_fast (const uchar *s, const uchar *end ATTRIBUTE_UNUSED)
+     {
+       vc m_nl, m_cr, m_bs, m_qm;
+ 
+-      data = *((const vc *)s);
++      data = __builtin_vec_vsx_ld (0, s);
+       s += 16;
+ 
+       m_nl = (vc) __builtin_vec_cmpeq(data, repl_nl);
+-- 
+2.27.0
+




Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Fri, 12 Nov 2021 06:05:01 GMT) Full text and rfc822 format available.

Notification sent to Thiago Jung Bauermann <bauermann <at> kolabnow.com>:
bug acknowledged by developer. (Fri, 12 Nov 2021 06:05:02 GMT) Full text and rfc822 format available.

Message #10 received at 49896-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Thiago Jung Bauermann <bauermann <at> kolabnow.com>
Cc: 49896-done <at> debbugs.gnu.org
Subject: Re: bug#49896: [PATCH core-updates-frozen] gnu: gcc-5: Fix
 powerpc64le-linux build
Date: Fri, 12 Nov 2021 01:03:55 -0500
Hello,

Thiago Jung Bauermann <bauermann <at> kolabnow.com> writes:

> GCC 5 has a misaligned access to a vector pointer which causes a build
> failure when using GCC 8 and later. Backport upstream fix that was applied
> on the GCC 6 branch.
>
> * gnu/packages/gcc.scm (gcc-5)[source]: Apply
> gcc-5-fix-powerpc64le-build.patch.
> * gnu/packages/patches/gcc-5-fix-powerpc64le-build.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Add new file.

Applied with commit b04a20f77fe3863931de273490d75371561d4e51 on the
core-updates-frozen branch.

Closing.

Thanks!

Maxim




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 10 Dec 2021 12:24:14 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 99 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.