wok-current rev 25605

Fix gcc49 to be build with new toolchain
author Stanislas Leduc <shann@slitaz.org>
date Fri Sep 01 21:10:48 2023 +0000 (16 months ago)
parents e7303f20381c
children 8ce450c92191
files gcc49/receipt gcc49/stuff/build_with_gcc6.patch
line diff
     1.1 --- a/gcc49/receipt	Fri Sep 01 20:31:42 2023 +0000
     1.2 +++ b/gcc49/receipt	Fri Sep 01 21:10:48 2023 +0000
     1.3 @@ -37,6 +37,9 @@
     1.4  
     1.5  	sed -i 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in
     1.6  
     1.7 +	# Patch to build with gcc >= 6
     1.8 +	patch -p1 < $stuff/build_with_gcc6.patch
     1.9 +
    1.10  	mkdir -p ../gcc-build && cd ../gcc-build
    1.11  
    1.12  	$src/configure \
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/gcc49/stuff/build_with_gcc6.patch	Fri Sep 01 21:10:48 2023 +0000
     2.3 @@ -0,0 +1,141 @@
     2.4 +From 1e5f1089dec3af328fd03125d6778f666d0bd4e4 Mon Sep 17 00:00:00 2001
     2.5 +From: edlinger <edlinger@138bc75d-0d04-0410-961f-82ee72b054a4>
     2.6 +Date: Thu, 25 Feb 2016 15:33:50 +0000
     2.7 +Subject: [PATCH 1/1] 2016-02-25  Bernd Edlinger  <bernd.edlinger@hotmail.de>
     2.8 +
     2.9 +        Backported from mainline
    2.10 +        2016-02-19  Jakub Jelinek  <jakub@redhat.com>
    2.11 +                    Bernd Edlinger  <bernd.edlinger@hotmail.de>
    2.12 +
    2.13 +        * Make-lang.in: Invoke gperf with -L C++.
    2.14 +        * cfns.gperf: Remove prototypes for hash and libc_name_p
    2.15 +        inlines.
    2.16 +        * cfns.h: Regenerated.
    2.17 +        * except.c (nothrow_libfn_p): Adjust.
    2.18 +
    2.19 +
    2.20 +diff -urp gcc-4.9.2.org/gcc/cp/cfns.gperf gcc-4.9.2/gcc/cp/cfns.gperf
    2.21 +--- gcc-4.9.2.org/gcc/cp/cfns.gperf	2014-01-02 14:23:26.000000000 -0800
    2.22 ++++ gcc-4.9.2/gcc/cp/cfns.gperf	2017-05-16 15:36:40.148468967 -0700
    2.23 +@@ -1,3 +1,5 @@
    2.24 ++%language=C++
    2.25 ++%define class-name libc_name
    2.26 + %{
    2.27 + /* Copyright (C) 2000-2014 Free Software Foundation, Inc.
    2.28 + 
    2.29 +@@ -16,14 +18,6 @@ for more details.
    2.30 + You should have received a copy of the GNU General Public License
    2.31 + along with GCC; see the file COPYING3.  If not see
    2.32 + <http://www.gnu.org/licenses/>.  */
    2.33 +-#ifdef __GNUC__
    2.34 +-__inline
    2.35 +-#endif
    2.36 +-static unsigned int hash (const char *, unsigned int);
    2.37 +-#ifdef __GNUC__
    2.38 +-__inline
    2.39 +-#endif
    2.40 +-const char * libc_name_p (const char *, unsigned int);
    2.41 + %}
    2.42 + %%
    2.43 + # The standard C library functions, for feeding to gperf; the result is used
    2.44 +Only in gcc-4.9.2/gcc/cp: cfns.gperf.orig
    2.45 +diff -urp gcc-4.9.2.org/gcc/cp/cfns.h gcc-4.9.2/gcc/cp/cfns.h
    2.46 +--- gcc-4.9.2.org/gcc/cp/cfns.h	2014-01-02 14:23:26.000000000 -0800
    2.47 ++++ gcc-4.9.2/gcc/cp/cfns.h	2017-05-16 15:36:40.152469452 -0700
    2.48 +@@ -1,5 +1,5 @@
    2.49 +-/* ANSI-C code produced by gperf version 3.0.3 */
    2.50 +-/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C cfns.gperf  */
    2.51 ++/* C++ code produced by gperf version 3.0.4 */
    2.52 ++/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ --output-file cfns.h cfns.gperf  */
    2.53 + 
    2.54 + #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
    2.55 +       && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
    2.56 +@@ -28,7 +28,7 @@
    2.57 + #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
    2.58 + #endif
    2.59 + 
    2.60 +-#line 1 "cfns.gperf"
    2.61 ++#line 3 "cfns.gperf"
    2.62 + 
    2.63 + /* Copyright (C) 2000-2014 Free Software Foundation, Inc.
    2.64 + 
    2.65 +@@ -47,25 +47,18 @@ for more details.
    2.66 + You should have received a copy of the GNU General Public License
    2.67 + along with GCC; see the file COPYING3.  If not see
    2.68 + <http://www.gnu.org/licenses/>.  */
    2.69 +-#ifdef __GNUC__
    2.70 +-__inline
    2.71 +-#endif
    2.72 +-static unsigned int hash (const char *, unsigned int);
    2.73 +-#ifdef __GNUC__
    2.74 +-__inline
    2.75 +-#endif
    2.76 +-const char * libc_name_p (const char *, unsigned int);
    2.77 + /* maximum key range = 391, duplicates = 0 */
    2.78 + 
    2.79 +-#ifdef __GNUC__
    2.80 +-__inline
    2.81 +-#else
    2.82 +-#ifdef __cplusplus
    2.83 +-inline
    2.84 +-#endif
    2.85 +-#endif
    2.86 +-static unsigned int
    2.87 +-hash (register const char *str, register unsigned int len)
    2.88 ++class libc_name
    2.89 ++{
    2.90 ++private:
    2.91 ++  static inline unsigned int hash (const char *str, unsigned int len);
    2.92 ++public:
    2.93 ++  static const char *libc_name_p (const char *str, unsigned int len);
    2.94 ++};
    2.95 ++
    2.96 ++inline unsigned int
    2.97 ++libc_name::hash (register const char *str, register unsigned int len)
    2.98 + {
    2.99 +   static const unsigned short asso_values[] =
   2.100 +     {
   2.101 +@@ -122,14 +115,8 @@ hash (register const char *str, register
   2.102 +   return hval + asso_values[(unsigned char)str[len - 1]];
   2.103 + }
   2.104 + 
   2.105 +-#ifdef __GNUC__
   2.106 +-__inline
   2.107 +-#ifdef __GNUC_STDC_INLINE__
   2.108 +-__attribute__ ((__gnu_inline__))
   2.109 +-#endif
   2.110 +-#endif
   2.111 + const char *
   2.112 +-libc_name_p (register const char *str, register unsigned int len)
   2.113 ++libc_name::libc_name_p (register const char *str, register unsigned int len)
   2.114 + {
   2.115 +   enum
   2.116 +     {
   2.117 +Only in gcc-4.9.2/gcc/cp: cfns.h.orig
   2.118 +diff -urp gcc-4.9.2.org/gcc/cp/except.c gcc-4.9.2/gcc/cp/except.c
   2.119 +--- gcc-4.9.2.org/gcc/cp/except.c	2014-01-02 14:23:26.000000000 -0800
   2.120 ++++ gcc-4.9.2/gcc/cp/except.c	2017-05-16 15:36:40.152469452 -0700
   2.121 +@@ -1030,7 +1030,8 @@ nothrow_libfn_p (const_tree fn)
   2.122 +      unless the system headers are playing rename tricks, and if
   2.123 +      they are, we don't want to be confused by them.  */
   2.124 +   id = DECL_NAME (fn);
   2.125 +-  return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id));
   2.126 ++  return !!libc_name::libc_name_p (IDENTIFIER_POINTER (id),
   2.127 ++				   IDENTIFIER_LENGTH (id));
   2.128 + }
   2.129 + 
   2.130 + /* Returns nonzero if an exception of type FROM will be caught by a
   2.131 +Only in gcc-4.9.2/gcc/cp: except.c.orig
   2.132 +diff -urp gcc-4.9.2.org/gcc/cp/Make-lang.in gcc-4.9.2/gcc/cp/Make-lang.in
   2.133 +--- gcc-4.9.2.org/gcc/cp/Make-lang.in	2014-04-15 01:04:17.000000000 -0700
   2.134 ++++ gcc-4.9.2/gcc/cp/Make-lang.in	2017-05-16 15:36:40.152469452 -0700
   2.135 +@@ -111,7 +111,7 @@ else
   2.136 + # deleting the $(srcdir)/cp/cfns.h file.
   2.137 + $(srcdir)/cp/cfns.h:
   2.138 + endif
   2.139 +-	gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \
   2.140 ++	gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \
   2.141 + 		$(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h
   2.142 + 
   2.143 + #
   2.144 +Only in gcc-4.9.2/gcc/cp: Make-lang.in.orig