From patchwork Thu Aug 5 16:19:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thiago Jung Bauermann X-Patchwork-Id: 31850 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4FD5D27BC82; Thu, 5 Aug 2021 17:21:16 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 985BB27BC6B for ; Thu, 5 Aug 2021 17:21:15 +0100 (BST) Received: from localhost ([::1]:48450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBg7O-0005nz-M8 for patchwork@mira.cbaines.net; Thu, 05 Aug 2021 12:21:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBg7C-0005nI-Re for guix-patches@gnu.org; Thu, 05 Aug 2021 12:21:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36640) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mBg7C-0005zE-LM for guix-patches@gnu.org; Thu, 05 Aug 2021 12:21:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mBg7C-00021i-HP for guix-patches@gnu.org; Thu, 05 Aug 2021 12:21:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49896] [PATCH core-updates-frozen] gnu: gcc-5: Fix powerpc64le-linux build Resent-From: Thiago Jung Bauermann Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 05 Aug 2021 16:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49896 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49896@debbugs.gnu.org Cc: Thiago Jung Bauermann X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16281804117665 (code B ref -1); Thu, 05 Aug 2021 16:21:02 +0000 Received: (at submit) by debbugs.gnu.org; 5 Aug 2021 16:20:11 +0000 Received: from localhost ([127.0.0.1]:48180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBg6N-0001zZ-B1 for submit@debbugs.gnu.org; Thu, 05 Aug 2021 12:20:11 -0400 Received: from lists.gnu.org ([209.51.188.17]:34914) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBg6L-0001zN-7i for submit@debbugs.gnu.org; Thu, 05 Aug 2021 12:20:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59644) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBg6L-0004yf-0y for guix-patches@gnu.org; Thu, 05 Aug 2021 12:20:09 -0400 Received: from mx.kolabnow.com ([95.128.36.41]:13044) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBg6I-0005Am-35 for guix-patches@gnu.org; Thu, 05 Aug 2021 12:20:08 -0400 Received: from localhost (unknown [127.0.0.1]) by ext-mx-out002.mykolab.com (Postfix) with ESMTP id 26B661337 for ; Thu, 5 Aug 2021 18:20:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:mime-version:message-id:date:date :subject:subject:from:from:received:received:received; s= dkim20160331; t=1628180402; x=1629994803; bh=clKsTAxlh//x64sjUVu sSHgF1/MZlEeni9Yw4gPXe6Y=; b=lefcnMLfIaQZELVW22OoyAWsyZ9zR9vXfhG OK5HzM9b6WEQh5Cd1rxu9Qu1EW8aw58qPhygs0wdP6tnw0rRKoH3OxjtlFMlm7mV hc/jHHxDNQ5iNoyyMFrxdO6PLtcpcw0oL6BEwgd5Byq6YZnINsgJVQ9hynw+AkdB rYXrCL7vwyJ9SKiwlQcfct/ldTnDqJhLk8RElwoRauBT+bMNh3ey8wtBB0ijuxP0 Sjk8eY6oc8nJeFkUZH6IpnyuB6PzfidakKbVXm3faE0FhuSu0/ziELLsjNBo/5oK KjApn+IMTgOv4GDZ+v4Ff7fY69hKRtkfohMOXRMtBoTobmNIW9DgxoBjL4ETazB0 AqU7i3dvc+8PZyYqzm0sLtks8Eh7N3JBpBsazmCfjbasgpQfhYJRF5dr7eLOIyNc 8jG06NL3zHS/mjPvadusgadWKNUvA7r9bJNVZAS57A1osBhiMKSJfFl7Mx3iJb20 +gAtup7cj8UM3WHfm4SYLjvpjgRY4UuHYQ3FPkxg3DjxKsZHx8LfgZK/1sJpkpdY GiqX1ppLXJMbqM/G5gtbUMAkGpSt+gZjjKJy7o/C08Wwjza3N9Equ1XOu03/uz7y 8cvI7qB7g40pMXXAHkT3fB0ztBFgZKsa4NJC4cyrAAe9U0UNMjDslW1Mf3BGZ0HQ 90JStlt0= X-Virus-Scanned: amavisd-new at mykolab.com Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out002.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id seglKeXyCtDH for ; Thu, 5 Aug 2021 18:20:02 +0200 (CEST) Received: from int-mx003.mykolab.com (unknown [10.9.13.3]) by ext-mx-out002.mykolab.com (Postfix) with ESMTPS id 49527627 for ; Thu, 5 Aug 2021 18:20:01 +0200 (CEST) Received: from ext-subm002.mykolab.com (unknown [10.9.6.2]) by int-mx003.mykolab.com (Postfix) with ESMTPS id D337250D1; Thu, 5 Aug 2021 18:19:59 +0200 (CEST) Date: Thu, 5 Aug 2021 13:19:43 -0300 Message-Id: <20210805161943.246592-1-bauermann@kolabnow.com> MIME-Version: 1.0 Received-SPF: pass client-ip=95.128.36.41; envelope-from=bauermann@kolabnow.com; helo=mx.kolabnow.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Thiago Jung Bauermann X-ACL-Warn: , Thiago Jung Bauermann via Guix-patches X-Patchwork-Original-From: Thiago Jung Bauermann via Guix-patches via From: Thiago Jung Bauermann X-getmail-retrieved-from-mailbox: Patches 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 +Date: Fri, 15 Jun 2018 10:51:28 +0200 +Subject: [PATCH] Partial backport r256656 + +2018-06-15 Martin Liska + + Backport from mainline + 2018-01-10 Kelvin Nilsen + + * 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 ++ ++ PR bootstrap/86162 ++ ++ Backport from mainline ++ 2018-01-10 Kelvin Nilsen ++ ++ * 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 +