Add GCC 10.4.0

Last version of GCC that can be compiled with GCC 4.7.
This commit is contained in:
fosslinux 2023-01-27 17:01:52 +11:00
parent d854915ad3
commit dd8bf0921f
10 changed files with 346 additions and 0 deletions

115
sysc/gcc-10.4.0/gcc-10.4.0.sh Executable file
View file

@ -0,0 +1,115 @@
# SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
default
# Remove vendored zlib
rm -r zlib/
# Regen gperf file (because GCC's make rules suck)
rm gcc/cp/cfns.h
# (taken directly from gcc/cp/Make-lang.in)
gperf -o -C -E -k '1-6,$' -j1 -D -N 'libc_name_p' -L C++ \
gcc/cp/cfns.gperf --output-file gcc/cp/cfns.h
# Regenerate autogen stuff
autogen Makefile.def
pushd fixincludes
./genfixes
popd
# Regenerate autotools
# configure
find . -name configure | sed 's:/configure::' | while read d; do
pushd "${d}"
AUTOMAKE=automake-1.15 ACLOCAL=aclocal-1.15 autoreconf-2.69 -fiv
popd
done
# Because GCC is stupid, copy depcomp back in
cp "${PREFIX}/share/automake-1.15/depcomp" .
# Makefile.in only
BACK="${PWD}"
find . -type d \
-exec test -e "{}/Makefile.am" -a ! -e "{}/configure" \; \
-print | while read d; do
d="$(readlink -f "${d}")"
cd "${d}"
# Find the appropriate configure script for automake
while [ ! -e configure ]; do
cd ..
done
automake-1.15 -fai "${d}/Makefile"
cd "${BACK}"
done
# Remove bison generated files
rm intl/plural.c
# Remove flex generated files
rm gcc/gengtype-lex.c
# Remove unused generated files
rm -r libgfortran/generated
# intl/ Makefile is a bit broken because of new gettext
sed -i 's/@USE_INCLUDED_LIBINTL@/no/' intl/Makefile.in
# Regenerate crc table in libiberty/crc32.c
pushd libiberty
sed -n -e '38,65p' crc32.c > crcgen.c
gcc -o crcgen crcgen.c
head -n 69 crc32.c > crc32.c.new
./crcgen >> crc32.c.new
tail -n +138 crc32.c >> crc32.c.new
mv crc32.c.new crc32.c
popd
# Remove docs/translation
find . -name "*.gmo" -delete
find . -name "*.info" -delete
}
src_configure() {
mkdir build
cd build
# std=gnu11 is the default for GCC10, so that is what it makes most
# sense to build with. (default, std=gnu90 is too outdated).
# For this GCC, we only build one stage, as extra is superfluous,
# since we build GCC 12 straight after.
CFLAGS="-std=gnu11" \
LDFLAGS="-static" \
../configure \
--prefix="${PREFIX}" \
--libdir="${LIBDIR}" \
--build=i386-unknown-linux-musl \
--target=i386-unknown-linux-musl \
--host=i386-unknown-linux-musl \
--disable-bootstrap \
--enable-static \
--program-transform-name= \
--enable-languages=c,c++ \
--with-system-zlib \
--disable-sjlj-exceptions \
--disable-multilib \
--enable-threads=posix \
--disable-libsanitizer
}
src_install() {
default
# Reduce final size of GCC 10.
find "${DESTDIR}" -type f | while read f; do
case "$(file -bi "${f}")" in
application/x-executable*|\
application/x-sharedlib*|\
application/x-pie-executable*|\
application/x-archive*)
strip "${f}"
;;
esac
done
}

View file

@ -0,0 +1,37 @@
SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
SPDX-FileCopyrightText: 2022 Thomas Schwinge <thomas@codesourcery.com>
SPDX-License-Identifier: GPL-3.0-or-later
Backport of commit 25861cf3a88a07c8dca3fb32d098c0ad756bbe38
====
[PATCH] Make 'autoreconf' work for 'gcc', 'libobjc'
With that, we may then run plain 'autoreconf' for all of GCC's subpackages,
instead of for some of those (that don't use Automake) manually having to run
the applicable combination of 'aclocal', 'autoconf', 'autoheader'.
See also 'AC_CONFIG_MACRO_DIRS'/'AC_CONFIG_MACRO_DIR' usage elsewhere.
--- gcc/configure.ac 2023-01-22 16:22:57.833166450 +1100
+++ gcc/configure.ac 2023-01-22 16:23:08.971274603 +1100
@@ -25,6 +25,7 @@
AC_INIT
AC_CONFIG_SRCDIR(tree.c)
+AC_CONFIG_MACRO_DIRS([../config] [..])
AC_CONFIG_HEADER(auto-host.h:config.in)
gcc_version=`cat $srcdir/BASE-VER`
--- libobjc/configure.ac 2023-01-22 16:23:42.648601085 +1100
+++ libobjc/configure.ac 2023-01-22 16:23:28.937468262 +1100
@@ -20,6 +20,7 @@
AC_INIT(package-unused, version-unused,, libobjc)
AC_CONFIG_SRCDIR([objc/objc.h])
+AC_CONFIG_MACRO_DIRS([../config] [..])
GCC_TOPLEV_SUBDIRS
# We need the following definitions because AC_PROG_LIBTOOL relies on them

View file

@ -0,0 +1,25 @@
SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: GPL-3.0-or-later
Two fold issue.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63966
Pre-5.0 GCC does not have a cpuid.h header installed on the system, so
we use the one from this source tree.
https://stackoverflow.com/questions/22160093/inconsistent-operand-constraints-in-an-asm
Pre-5.0 GCC does not support PIC inline ASM that touches ebx (as
presumably the cpuid call does); so we must disable PIC.
--- libgcc/Makefile.in 2023-01-25 16:03:45.928059755 +1100
+++ libgcc/Makefile.in 2023-01-25 16:04:06.711464255 +1100
@@ -282,7 +282,7 @@
# subdirectory rather than in the source directory.
# -I$(@D) and -I$(srcdir)/$(@D) cause the subdirectory of the file
# currently being compiled, in both source trees, to be examined as well.
-INCLUDES = -I. -I$(@D) -I$(gcc_objdir) \
+INCLUDES = -I. -I$(@D) -I$(gcc_objdir) -I../../gcc/include -fno-pic \
-I$(srcdir) -I$(srcdir)/$(@D) -I$(srcdir)/../gcc \
-I$(srcdir)/../include $(DECNUMINC)

View file

@ -0,0 +1,120 @@
SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
SPDX-FileCopyrightText: 2022 Christophe Lyon <christophe.lyon@arm.com>
SPDX-License-Identifier: GPL-3.0-or-later
In our context, some construct has decided that we don't support
XF mode (which is not true for the architecture, in general, as
this patch supports, but is sufficient for our strange environment).
Backport of commit 43ccb7e445329dd9557b42e7289a87a8071ab0f7.
[PATCH] libgcc: Enable XF mode conversions to/from DFP modes only if
supported
Some targets do not support XF mode (eg AArch64), so don't build the
corresponding to/from DFP modes convertion routines if
__LIBGCC_HAS_XF_MODE__ is not defined.
diff --git libgcc/config/libbid/_dd_to_xf.c libgcc/config/libbid/_dd_to_xf.c
index 5a2abbbb1f4..e4b12e8ac4f 100644
--- libgcc/config/libbid/_dd_to_xf.c
+++ libgcc/config/libbid/_dd_to_xf.c
@@ -25,6 +25,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bid_functions.h"
#include "bid_gcc_intrinsics.h"
+#ifdef __LIBGCC_HAS_XF_MODE__
XFtype
__bid_extendddxf (_Decimal64 x) {
XFtype res;
@@ -34,3 +35,4 @@ __bid_extendddxf (_Decimal64 x) {
res = __bid64_to_binary80 (ux.i);
return (res);
}
+#endif
diff --git libgcc/config/libbid/_sd_to_xf.c libgcc/config/libbid/_sd_to_xf.c
index 9af09913684..288ccb25075 100644
--- libgcc/config/libbid/_sd_to_xf.c
+++ libgcc/config/libbid/_sd_to_xf.c
@@ -25,6 +25,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bid_functions.h"
#include "bid_gcc_intrinsics.h"
+#ifdef __LIBGCC_HAS_XF_MODE__
XFtype
__bid_extendsdxf (_Decimal32 x) {
XFtype res;
@@ -34,3 +35,4 @@ __bid_extendsdxf (_Decimal32 x) {
res = __bid32_to_binary80 (ux.i);
return (res);
}
+#endif
diff --git libgcc/config/libbid/_td_to_xf.c libgcc/config/libbid/_td_to_xf.c
index b0c76a71497..e990282162d 100644
--- libgcc/config/libbid/_td_to_xf.c
+++ libgcc/config/libbid/_td_to_xf.c
@@ -25,6 +25,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bid_functions.h"
#include "bid_gcc_intrinsics.h"
+#ifdef __LIBGCC_HAS_XF_MODE__
XFtype
__bid_trunctdxf (_Decimal128 x) {
XFtype res;
@@ -34,3 +35,4 @@ __bid_trunctdxf (_Decimal128 x) {
res = __bid128_to_binary80 (ux.i);
return (res);
}
+#endif
diff --git libgcc/config/libbid/_xf_to_dd.c libgcc/config/libbid/_xf_to_dd.c
index 9feb0f2c3d6..e3246a1c2e1 100644
--- libgcc/config/libbid/_xf_to_dd.c
+++ libgcc/config/libbid/_xf_to_dd.c
@@ -25,9 +25,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bid_functions.h"
#include "bid_gcc_intrinsics.h"
+#ifdef __LIBGCC_HAS_XF_MODE__
_Decimal64
__bid_truncxfdd (XFtype x) {
union decimal64 res;
res.i = __binary80_to_bid64 (x);
return (res.d);
}
+#endif
diff --git libgcc/config/libbid/_xf_to_sd.c libgcc/config/libbid/_xf_to_sd.c
index 7d46548af6c..9147e979182 100644
--- libgcc/config/libbid/_xf_to_sd.c
+++ libgcc/config/libbid/_xf_to_sd.c
@@ -25,9 +25,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bid_functions.h"
#include "bid_gcc_intrinsics.h"
+#ifdef __LIBGCC_HAS_XF_MODE__
_Decimal32
__bid_truncxfsd (XFtype x) {
union decimal32 res;
res.i = __binary80_to_bid32 (x);
return (res.d);
}
+#endif
diff --git libgcc/config/libbid/_xf_to_td.c libgcc/config/libbid/_xf_to_td.c
index 07987fdcc3a..c8d102b0b7f 100644
--- libgcc/config/libbid/_xf_to_td.c
+++ libgcc/config/libbid/_xf_to_td.c
@@ -25,9 +25,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bid_functions.h"
#include "bid_gcc_intrinsics.h"
+#ifdef __LIBGCC_HAS_XF_MODE__
_Decimal128
__bid_extendxftd (XFtype x) {
union decimal128 res;
res.i = __binary80_to_bid128 (x);
return (res.d);
}
+#endif
--
2.31.1

View file

@ -0,0 +1,17 @@
SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: GPL-3.0-or-later
In new gettext external is required for AM_GNU_GETTEXT.
--- intl/configure.ac 2023-02-07 18:43:58.989786230 +1100
+++ intl/configure.ac 2023-02-07 18:43:02.182632631 +1100
@@ -4,7 +4,7 @@
AC_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIR(../config)
AM_GNU_GETTEXT_VERSION(0.12.1)
-AM_GNU_GETTEXT([], [need-ngettext])
+AM_GNU_GETTEXT([external], [need-ngettext])
# This replaces the extensive use of DEFS in the original Makefile.in.
AC_DEFINE(IN_LIBINTL, 1, [Define because this is libintl.])

View file

@ -0,0 +1,18 @@
SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: GPL-3.0-or-later
GCC 4.7 doesn't have fisolate-erroneous-paths-dereference. Hence
this line does nothing.
--- libgcc/generic-morestack.c 2023-01-25 16:52:35.382471998 +1100
+++ libgcc/generic-morestack.c 2023-01-25 16:52:40.773585043 +1100
@@ -23,8 +23,6 @@
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
-#pragma GCC optimize ("no-isolate-erroneous-paths-dereference")
-
/* powerpc 32-bit not supported. */
#if !defined __powerpc__ || defined __powerpc64__

1
sysc/gcc-10.4.0/sources Normal file
View file

@ -0,0 +1 @@
http://ftp.gnu.org/gnu/gcc/gcc-10.4.0/gcc-10.4.0.tar.xz c9297d5bcd7cb43f3dfc2fed5389e948c9312fd962ef6a4ce455cff963ebe4f1

View file

@ -130,6 +130,8 @@ build python-3.8.16
build python-3.11.1
build gcc-10.4.0
if [ "$FORCE_TIMESTAMPS" = True ] ; then
echo 'Forcing all files timestamps to be 0 unix time.'
canonicalise_all_files_timestamp