From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +BtSEhwWD2HtbAAAgWs5BA (envelope-from ) for ; Sun, 08 Aug 2021 01:24:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id cCi+DRwWD2GHBQAAbx9fmQ (envelope-from ) for ; Sat, 07 Aug 2021 23:24:12 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 462916731 for ; Sun, 8 Aug 2021 01:24:11 +0200 (CEST) Received: from localhost ([::1]:40904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mCVfl-0001lz-9D for larch@yhetil.org; Sat, 07 Aug 2021 19:24:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCVfe-0001ln-Nr for bug-guix@gnu.org; Sat, 07 Aug 2021 19:24:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41782) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mCVfe-0005vv-HM for bug-guix@gnu.org; Sat, 07 Aug 2021 19:24:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mCVfe-0003HM-E0 for bug-guix@gnu.org; Sat, 07 Aug 2021 19:24:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#49935: [PATCH] gnu: gcc-4.8: Fix build with GCC 6 and later References: <3505131.mCAMElSiHm@popigai> In-Reply-To: <3505131.mCAMElSiHm@popigai> Resent-From: Thiago Jung Bauermann Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 07 Aug 2021 23:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49935 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 49935@debbugs.gnu.org Cc: Thiago Jung Bauermann Received: via spool by 49935-submit@debbugs.gnu.org id=B49935.162837861012562 (code B ref 49935); Sat, 07 Aug 2021 23:24:02 +0000 Received: (at 49935) by debbugs.gnu.org; 7 Aug 2021 23:23:30 +0000 Received: from localhost ([127.0.0.1]:53328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCVf4-0003GV-F4 for submit@debbugs.gnu.org; Sat, 07 Aug 2021 19:23:29 -0400 Received: from mx.kolabnow.com ([95.128.36.40]:59828) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCVez-0003GC-QT for 49935@debbugs.gnu.org; Sat, 07 Aug 2021 19:23:25 -0400 Received: from localhost (unknown [127.0.0.1]) by ext-mx-out003.mykolab.com (Postfix) with ESMTP id 955D640AE3 for <49935@debbugs.gnu.org>; Sun, 8 Aug 2021 01:23:15 +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=1628378594; x=1630192995; bh=hLCmqWAkG6qu1zKyl9k YtHiF+dsv1OYhSm02/4Zhx2w=; b=5aKgEYGp3FgRlHl0f/jlwIXxLph8o86AUx8 dwOvztVGo288prJPkaQ+VUOFMnRvYPLfxZimLaKxFTmP3ZGqwK6/BrLkwUQAbYG8 SQdtPpdVYaUgt6B4/DrMpIjFSsDEX0G2pn5mzwKiSY9K88LNtM6RpUL2+YyKmGyS ihoe2MyGrsFdpevKIh6q/FgCMI7YSAVgjC7P2TTO5+9DOifYpdRqTGFZ6qz8T3tz Lj0i8cwycC1gH4XW27SWyjdWuBI38mv015DXneZ0Q230+nAyWXaibbXNsqF9B8k0 gUOC0lWhkYlpULKz79s1CjfVW4KaDLEqP07NrVAMyvjySQycvfP56HlAbiZunYbS IXHC/vzyL548vUAPgByilv8BoASG0umJIUIm7rZlT6fklj6ApUMg8YGq0I8iXf8S 0HkFJeouVQvGRLaDUK2aZJ/pFhGCJCHSvc34M5AVQH6VyNzzPVPUoi0rkSj5ZiDI o7lVF5vJlgceH82TdKW2LYSLT+kNqPthkrJgRGZFnXTHDEsr3lYzt8vP6c2yXz9M KGbkTqZZQoaaRHfBOTiJr9FBL3lT3+C7GpK8aMJz/rXMZELp4YBKy4ZZ6L+zbUQE mX/phImjcAjVQeni4s3VnkhXjA1sr6TjiHgZU/CY5XNZi4vLP2WJRjjVkTEjNO9r 3OGhL2as= X-Virus-Scanned: amavisd-new at mykolab.com Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out003.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G-smV5mUe8JA for <49935@debbugs.gnu.org>; Sun, 8 Aug 2021 01:23:14 +0200 (CEST) Received: from int-mx002.mykolab.com (unknown [10.9.13.2]) by ext-mx-out003.mykolab.com (Postfix) with ESMTPS id 86A0E4084C for <49935@debbugs.gnu.org>; Sun, 8 Aug 2021 01:23:14 +0200 (CEST) Received: from ext-subm003.mykolab.com (unknown [10.9.6.3]) by int-mx002.mykolab.com (Postfix) with ESMTPS id 171214951; Sun, 8 Aug 2021 01:23:14 +0200 (CEST) Date: Sat, 7 Aug 2021 20:23:00 -0300 Message-Id: <20210807232300.1074458-1-bauermann@kolabnow.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" Reply-to: Thiago Jung Bauermann From: Thiago Jung Bauermann via Bug reports for GNU Guix X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1628378651; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=jpuAqVmKFOGYZ/uDNSW6XdFG4idDm/0eUY6Xd7LsWCQ=; b=hn52+kTmOpTxRGee7pDFDhqRe8ayQvIPDrrrt7zneVWDDI2UKONOtB1xk9rqdATmvgvaZG UKibfQDnclOtiz8I7Iwgk0EutY0UtZNkSnw52WT+xoy+IUnz3QzPGt+anuCmlT6lVKjz7y IO6UXOv9AW7bdUXs2FAv84RSxjVWF2vrqkF69HkExjBL0N07O8DIJeYptTSTgkfwTgaRYC aVYqj9AZbKD73DDEBviosJqj42yaYQjed43u5LWdo1x1nVYdsGbSUwvLgDEGabwAU6MYFq b7zM4cM+h2i0UR/3WOTe9YHnuT26pvInOTW+Yr1FfmHuxoEUXqv+lDnKyrIt2g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628378651; a=rsa-sha256; cv=none; b=BtQmPqponnxNSNbzJfViPLsGTx1GsFfjedEUU4TJ3FRthxxuxHUhCZ7LSbY1UYLLC03iey mtjTMRmMB8J1nxAc6zwQ48PE+SH/SnkmFk139nkmTS8004UuFNwRJ0u8H9Oyov8vfQ6ZY4 tHucB6H3OKRChkE0z+XwxUlGFQC+/ih4yFtlyybG+RgA0yJ+wmhtFJIDfy9EFsIDZZ/BmN IrAHT85H6yaw7thtyYXIt8Um7lTjihwb2OUpAGbcGNrZiSlA5mwowyFAsDU6u1BTFQjtPZ Nwxcw9o3So+SXPhd+suipKZRURn3HgU5SEdNQTDe0Xc5Qdmo3R/P715JdRgF6w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=kolabnow.com header.s=dkim20160331 header.b=5aKgEYGp; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: 2.58 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=kolabnow.com header.s=dkim20160331 header.b=5aKgEYGp; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 462916731 X-Spam-Score: 2.58 X-Migadu-Scanner: scn0.migadu.com X-TUID: Iqk2S2l7Sveq Versions of GCC earlier than 6 need this change in order to be built by GCC 6 and later. At the time, the fix was backported to GCC 4.9 and GCC 5 but not GCC 4.8. Therefore, backport the fix from GCC 4.9 to GCC 4.8. * gnu/packages/gcc.scm (gcc-4.8)[source]: Apply gcc-4.8-fix-build-with-newer-gcc.patch. * gnu/packages/patches/gcc-4.8-fix-build-with-newer-gcc.patch: New file. * gnu/local.mk (dist_patch_DATA): Add new file. --- Hi, This is the patch I mentioned in my previous email. Despite the subject and the name of the patch file, this change is necessary but unfortunately not sufficient to make GCC 4.8 build with GCC 6 or later. This patch solves the same problem as gcc-4-compile-with-gcc-5.patch and gcc-4.6-gnu-inline.patch (which are actually the exact same patch). Regards, Thiago gnu/local.mk | 1 + gnu/packages/gcc.scm | 4 +- .../gcc-4.8-fix-build-with-newer-gcc.patch | 181 ++++++++++++++++++ 3 files changed, 185 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/gcc-4.8-fix-build-with-newer-gcc.patch diff --git a/gnu/local.mk b/gnu/local.mk index 61ac39618a73..663f48f1833c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1059,6 +1059,7 @@ dist_patch_DATA = \ %D%/packages/patches/gcc-cross-environment-variables.patch \ %D%/packages/patches/gcc-fix-texi2pod.patch \ %D%/packages/patches/gcc-4.8-libsanitizer-fix.patch \ + %D%/packages/patches/gcc-4.8-fix-build-with-newer-gcc.patch \ %D%/packages/patches/gcc-4.9-libsanitizer-fix.patch \ %D%/packages/patches/gcc-4.9-libsanitizer-ustat.patch \ %D%/packages/patches/gcc-libsanitizer-ustat.patch \ diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 2fe30b13210e..586673042a1c 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -383,7 +383,9 @@ Go. It also includes runtime support libraries for these languages.") (patches (search-patches "gcc-arm-link-spec-fix.patch" "gcc-4.8-libsanitizer-fix.patch" "gcc-asan-missing-include.patch" - "gcc-fix-texi2pod.patch")) + "gcc-fix-texi2pod.patch" + ;; See https://gcc.gnu.org/legacy-ml/gcc-patches/2016-02/msg01409.html + "gcc-4.8-fix-build-with-newer-gcc.patch")) (modules '((guix build utils))) ;; This is required for building with glibc-2.26. ;; https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81712 diff --git a/gnu/packages/patches/gcc-4.8-fix-build-with-newer-gcc.patch b/gnu/packages/patches/gcc-4.8-fix-build-with-newer-gcc.patch new file mode 100644 index 000000000000..e2fe2af03d08 --- /dev/null +++ b/gnu/packages/patches/gcc-4.8-fix-build-with-newer-gcc.patch @@ -0,0 +1,181 @@ +From 4c212bc2507fc8ab8caba7c5afc1257707572c45 Mon Sep 17 00:00:00 2001 +From: Bernd Edlinger +Date: Thu, 25 Feb 2016 15:36:41 +0000 +Subject: [PATCH] backport: Make-lang.in: Invoke gperf with -L C++. + +2016-02-25 Bernd Edlinger + + Backported from mainline + 2016-02-19 Jakub Jelinek + Bernd Edlinger + + * Make-lang.in: Invoke gperf with -L C++. + * cfns.gperf: Remove prototypes for hash and libc_name_p + inlines. + * cfns.h: Regenerated. + * except.c (nothrow_libfn_p): Adjust. + +From-SVN: r233721 +--- + +Obtained from: + +https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=4c212bc2507fc8ab8caba7c5afc1257707572c45 + +The gcc/cp/ChangeLog hunk was modified to apply on top of gcc-4.8's gcc/cp/ChangeLog. + + gcc/cp/ChangeLog | 12 ++++++++++++ + gcc/cp/Make-lang.in | 2 +- + gcc/cp/cfns.gperf | 10 ++-------- + gcc/cp/cfns.h | 41 ++++++++++++++--------------------------- + gcc/cp/except.c | 3 ++- + 5 files changed, 31 insertions(+), 37 deletions(-) + +diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog +index 02776465da7..8d014bef83c 100644 +--- a/gcc/cp/ChangeLog ++++ b/gcc/cp/ChangeLog +@@ -1,3 +1,15 @@ ++2016-02-25 Bernd Edlinger ++ ++ Backported from mainline ++ 2016-02-19 Jakub Jelinek ++ Bernd Edlinger ++ ++ * Make-lang.in: Invoke gperf with -L C++. ++ * cfns.gperf: Remove prototypes for hash and libc_name_p ++ inlines. ++ * cfns.h: Regenerated. ++ * except.c (nothrow_libfn_p): Adjust. ++ + 2015-06-23 Release Manager + + * GCC 4.8.5 released. +diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in +index bd1c1d78f88..a0ea0d48359 100644 +--- a/gcc/cp/Make-lang.in ++++ b/gcc/cp/Make-lang.in +@@ -111,7 +111,7 @@ else + # deleting the $(srcdir)/cp/cfns.h file. + $(srcdir)/cp/cfns.h: + endif +- gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \ ++ gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \ + $(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h + + # +diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf +index 05ca753927e..d9b16b800ef 100644 +--- a/gcc/cp/cfns.gperf ++++ b/gcc/cp/cfns.gperf +@@ -1,3 +1,5 @@ ++%language=C++ ++%define class-name libc_name + %{ + /* Copyright (C) 2000-2014 Free Software Foundation, Inc. + +@@ -16,14 +18,6 @@ for more details. + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ +-#ifdef __GNUC__ +-__inline +-#endif +-static unsigned int hash (const char *, unsigned int); +-#ifdef __GNUC__ +-__inline +-#endif +-const char * libc_name_p (const char *, unsigned int); + %} + %% + # The standard C library functions, for feeding to gperf; the result is used +diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h +index c845ddf08ea..65801d1ae31 100644 +--- a/gcc/cp/cfns.h ++++ b/gcc/cp/cfns.h +@@ -1,5 +1,5 @@ +-/* ANSI-C code produced by gperf version 3.0.3 */ +-/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C cfns.gperf */ ++/* C++ code produced by gperf version 3.0.4 */ ++/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ --output-file cfns.h cfns.gperf */ + + #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ +@@ -28,7 +28,7 @@ + #error "gperf generated tables don't work with this execution character set. Please report a bug to ." + #endif + +-#line 1 "cfns.gperf" ++#line 3 "cfns.gperf" + + /* Copyright (C) 2000-2014 Free Software Foundation, Inc. + +@@ -47,25 +47,18 @@ for more details. + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ +-#ifdef __GNUC__ +-__inline +-#endif +-static unsigned int hash (const char *, unsigned int); +-#ifdef __GNUC__ +-__inline +-#endif +-const char * libc_name_p (const char *, unsigned int); + /* maximum key range = 391, duplicates = 0 */ + +-#ifdef __GNUC__ +-__inline +-#else +-#ifdef __cplusplus +-inline +-#endif +-#endif +-static unsigned int +-hash (register const char *str, register unsigned int len) ++class libc_name ++{ ++private: ++ static inline unsigned int hash (const char *str, unsigned int len); ++public: ++ static const char *libc_name_p (const char *str, unsigned int len); ++}; ++ ++inline unsigned int ++libc_name::hash (register const char *str, register unsigned int len) + { + static const unsigned short asso_values[] = + { +@@ -122,14 +115,8 @@ hash (register const char *str, register unsigned int len) + return hval + asso_values[(unsigned char)str[len - 1]]; + } + +-#ifdef __GNUC__ +-__inline +-#ifdef __GNUC_STDC_INLINE__ +-__attribute__ ((__gnu_inline__)) +-#endif +-#endif + const char * +-libc_name_p (register const char *str, register unsigned int len) ++libc_name::libc_name_p (register const char *str, register unsigned int len) + { + enum + { +diff --git a/gcc/cp/except.c b/gcc/cp/except.c +index 221971ac956..32340f5ae83 100644 +--- a/gcc/cp/except.c ++++ b/gcc/cp/except.c +@@ -1030,7 +1030,8 @@ nothrow_libfn_p (const_tree fn) + unless the system headers are playing rename tricks, and if + they are, we don't want to be confused by them. */ + id = DECL_NAME (fn); +- return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id)); ++ return !!libc_name::libc_name_p (IDENTIFIER_POINTER (id), ++ IDENTIFIER_LENGTH (id)); + } + + /* Returns nonzero if an exception of type FROM will be caught by a +-- +2.27.0 +