From 6b3e32fa0370d150bf5d0b4b53bc0be5c3df9569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric?= Date: Sun, 5 Jul 2020 07:10:27 +0000 Subject: [PATCH] core: gcc,glibc,m4 added --- core/gcc/build | 77 ++++++++++++ core/gcc/checksums | 5 + core/gcc/depends | 4 + core/gcc/files/c99 | 2 + core/gcc/sources | 5 + core/gcc/version | 1 + core/glibc/build | 23 ++++ core/glibc/checksums | 1 + core/glibc/depends | 0 core/glibc/sources | 1 + core/glibc/version | 1 + core/m4/build | 9 ++ core/m4/checksums | 2 + .../m4-1.4.18-glibc-change-work-around.patch | 115 ++++++++++++++++++ core/m4/sources | 2 + core/m4/version | 1 + 16 files changed, 249 insertions(+) create mode 100755 core/gcc/build create mode 100644 core/gcc/checksums create mode 100644 core/gcc/depends create mode 100644 core/gcc/files/c99 create mode 100644 core/gcc/sources create mode 100644 core/gcc/version create mode 100755 core/glibc/build create mode 100644 core/glibc/checksums create mode 100644 core/glibc/depends create mode 100644 core/glibc/sources create mode 100644 core/glibc/version create mode 100755 core/m4/build create mode 100644 core/m4/checksums create mode 100644 core/m4/patches/m4-1.4.18-glibc-change-work-around.patch create mode 100644 core/m4/sources create mode 100644 core/m4/version diff --git a/core/gcc/build b/core/gcc/build new file mode 100755 index 0000000..858656a --- /dev/null +++ b/core/gcc/build @@ -0,0 +1,77 @@ +#!/bin/sh -e + +# Make sure gmp is built with generic options. +cp gcc/gmp/configfsf.guess gcc/gmp/config.guess +cp gcc/gmp/configfsf.sub gcc/gmp/config.sub + +# Use lib not lib64 by default. +sed -i '/m64=/s/lib64/lib/' gcc/gcc/config/i386/t-linux64 +sed -i 's/lib64/lib/' gcc/gcc/config/i386/linux64.h + +# Build must happen outside of gcc source. +mkdir -p gcc-build +cd gcc-build + +# Grab the system's GCC version. +IFS=. read -r gcc_version _ 2>/dev/null \ + < "$KISS_ROOT/var/db/kiss/installed/gcc/version" || gcc_version=null + +# Skip the bootstrap process if we are able. +case $2 in "$gcc_version"*) + printf '%s\n' "Minor version difference, disabling bootstrap." + bootstrap=--disable-bootstrap +esac + +export libat_cv_have_ifunc=no + +../gcc/configure \ + --prefix=/usr \ + --libexecdir=/usr/lib \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --disable-multilib \ + --disable-symvers \ + --disable-libmpx \ + --disable-libmudflap \ + --disable-libsanitizer \ + --disable-werror \ + --disable-fixed-point \ + --disable-libstdcxx-pch \ + --disable-nls \ + --enable-checking=release \ + --enable-__cxa_atexit \ + --enable-default-pie \ + --enable-default-ssp \ + --enable-shared \ + --enable-threads \ + --enable-tls \ + --enable-languages=c,c++ \ + --without-included-gettext \ + --without-zstd \ + --with-system-zlib \ + --build=x86_64-pc-linux-gnu \ + "${bootstrap:---enable-bootstrap}" +# --build=x86_64-pc-linux-musl \ +# "${bootstrap:---enable-bootstrap}" + +make +make DESTDIR="$1" install + +# Save 35MB. +find "$1" -name libgtkpeer.a -exec rm -f {} + +find "$1" -name libgjsmalsa.a -exec rm -f {} + +find "$1" -name libgij.a -exec rm -f {} + + +# Some legacy programs will expect cc +ln -s gcc "$1/usr/bin/cc" + +# POSIX compliance. +install -Dm755 ../c99 "$1/usr/bin/c99" + +# Symlink for LTO. +{ + mkdir -p "$1/usr/lib/bfd-plugins" + + ln -s "/usr/lib/gcc/x86_64-pc-linux-musl/$2/liblto_plugin.so" \ + "$1/usr/lib/bfd-plugins/liblto_plugin.so" +} diff --git a/core/gcc/checksums b/core/gcc/checksums new file mode 100644 index 0000000..818888a --- /dev/null +++ b/core/gcc/checksums @@ -0,0 +1,5 @@ +b6898a23844b656f1b68691c5c012036c2e694ac4b53a8918d4712ad876e7ea2 gcc-10.1.0.tar.xz +87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912 gmp-6.1.2.tar.xz +1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a mpfr-4.0.2.tar.xz +6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e mpc-1.1.0.tar.gz +765614b3396d70bca3fa0ae4a813632486c6dca320e2bd13c8c39dca52be4a4c c99 diff --git a/core/gcc/depends b/core/gcc/depends new file mode 100644 index 0000000..ca8b7e5 --- /dev/null +++ b/core/gcc/depends @@ -0,0 +1,4 @@ +binutils +bison make +flex make +zlib diff --git a/core/gcc/files/c99 b/core/gcc/files/c99 new file mode 100644 index 0000000..692f092 --- /dev/null +++ b/core/gcc/files/c99 @@ -0,0 +1,2 @@ +#!/bin/sh +exec cc -std=c99 "$@" diff --git a/core/gcc/sources b/core/gcc/sources new file mode 100644 index 0000000..bf81916 --- /dev/null +++ b/core/gcc/sources @@ -0,0 +1,5 @@ +https://gcc.gnu.org/pub/gcc/releases/gcc-10.1.0/gcc-10.1.0.tar.xz gcc +https://ftp.gnu.org/gnu/gmp/gmp-6.1.2.tar.xz gcc/gmp +https://ftp.gnu.org/gnu/mpfr/mpfr-4.0.2.tar.xz gcc/mpfr +https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz gcc/mpc +files/c99 diff --git a/core/gcc/version b/core/gcc/version new file mode 100644 index 0000000..d679b63 --- /dev/null +++ b/core/gcc/version @@ -0,0 +1 @@ +10.1.0 2 diff --git a/core/glibc/build b/core/glibc/build new file mode 100755 index 0000000..29b6a31 --- /dev/null +++ b/core/glibc/build @@ -0,0 +1,23 @@ +#!/bin/sh -e + +# pwd + +# Use lib not lib64 by default. +sed -i 's/lib64/usr\/lib/' sysdeps/unix/sysv/linux/x86_64/64/configure +sed -i 's/lib64/usr\/lib/' sysdeps/unix/sysv/linux/x86_64/ldconfig.h + +mkdir -p glibc-build +cd glibc-build + +../configure \ + --prefix=/usr \ + --bindir=/usr/bin \ + --sbindir=/usr/bin \ + --libexecdir=/usr/lib \ + --libdir=/usr/lib \ + --disable-werror \ + --with-headers=/usr/include +# --with-headers="../include" + +make +make DESTDIR="$1" install diff --git a/core/glibc/checksums b/core/glibc/checksums new file mode 100644 index 0000000..9db0434 --- /dev/null +++ b/core/glibc/checksums @@ -0,0 +1 @@ +9246fe44f68feeec8c666bb87973d590ce0137cca145df014c72ec95be9ffd17 glibc-2.31.tar.xz diff --git a/core/glibc/depends b/core/glibc/depends new file mode 100644 index 0000000..e69de29 diff --git a/core/glibc/sources b/core/glibc/sources new file mode 100644 index 0000000..80c8daf --- /dev/null +++ b/core/glibc/sources @@ -0,0 +1 @@ +http://ftp.gnu.org/gnu/glibc/glibc-2.31.tar.xz diff --git a/core/glibc/version b/core/glibc/version new file mode 100644 index 0000000..8cca3b7 --- /dev/null +++ b/core/glibc/version @@ -0,0 +1 @@ +2.31 1 diff --git a/core/m4/build b/core/m4/build new file mode 100755 index 0000000..536c4d5 --- /dev/null +++ b/core/m4/build @@ -0,0 +1,9 @@ +#!/bin/sh -e + +patch -p1 < m4-1.4.18-glibc-change-work-around.patch + +./configure \ + --prefix=/usr + +make +make DESTDIR="$1" install diff --git a/core/m4/checksums b/core/m4/checksums new file mode 100644 index 0000000..14f17db --- /dev/null +++ b/core/m4/checksums @@ -0,0 +1,2 @@ +f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07 m4-1.4.18.tar.xz +fc9b61654a3ba1a8d6cd78ce087e7c96366c290bc8d2c299f09828d793b853c8 m4-1.4.18-glibc-change-work-around.patch diff --git a/core/m4/patches/m4-1.4.18-glibc-change-work-around.patch b/core/m4/patches/m4-1.4.18-glibc-change-work-around.patch new file mode 100644 index 0000000..582ae9b --- /dev/null +++ b/core/m4/patches/m4-1.4.18-glibc-change-work-around.patch @@ -0,0 +1,115 @@ +diff -up m4-1.4.18/lib/fflush.c.orig m4-1.4.18/lib/fflush.c +--- m4-1.4.18/lib/fflush.c.orig 2018-05-02 12:35:59.536851666 +0200 ++++ m4-1.4.18/lib/fflush.c 2018-05-02 12:37:02.768958606 +0200 +@@ -33,7 +33,7 @@ + #undef fflush + + +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + + /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */ + static void +@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp) + + #endif + +-#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) ++#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) + + # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ +@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream) + if (stream == NULL || ! freading (stream)) + return fflush (stream); + +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + + clear_ungetc_buffer_preserving_position (stream); + +diff -up m4-1.4.18/lib/fpending.c.orig m4-1.4.18/lib/fpending.c +--- m4-1.4.18/lib/fpending.c.orig 2018-05-02 12:35:32.305806774 +0200 ++++ m4-1.4.18/lib/fpending.c 2018-05-02 12:35:44.944827347 +0200 +@@ -32,7 +32,7 @@ __fpending (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + return fp->_IO_write_ptr - fp->_IO_write_base; + #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ +diff -up m4-1.4.18/lib/fpurge.c.orig m4-1.4.18/lib/fpurge.c +--- m4-1.4.18/lib/fpurge.c.orig 2018-05-02 12:38:13.586078669 +0200 ++++ m4-1.4.18/lib/fpurge.c 2018-05-02 12:38:38.785121867 +0200 +@@ -62,7 +62,7 @@ fpurge (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_IO_read_end = fp->_IO_read_ptr; + fp->_IO_write_ptr = fp->_IO_write_base; + /* Avoid memory leak when there is an active ungetc buffer. */ +diff -up m4-1.4.18/lib/freadahead.c.orig m4-1.4.18/lib/freadahead.c +--- m4-1.4.18/lib/freadahead.c.orig 2016-12-31 14:54:41.000000000 +0100 ++++ m4-1.4.18/lib/freadahead.c 2018-05-02 11:43:19.570336724 +0200 +@@ -25,7 +25,7 @@ + size_t + freadahead (FILE *fp) + { +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + if (fp->_IO_write_ptr > fp->_IO_write_base) + return 0; + return (fp->_IO_read_end - fp->_IO_read_ptr) +diff -up m4-1.4.18/lib/freading.c.orig m4-1.4.18/lib/freading.c +--- m4-1.4.18/lib/freading.c.orig 2018-05-02 12:37:33.970011368 +0200 ++++ m4-1.4.18/lib/freading.c 2018-05-02 12:37:59.393054359 +0200 +@@ -31,7 +31,7 @@ freading (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + return ((fp->_flags & _IO_NO_WRITES) != 0 + || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0 + && fp->_IO_read_base != NULL)); +diff -up m4-1.4.18/lib/fseeko.c.orig m4-1.4.18/lib/fseeko.c +--- m4-1.4.18/lib/fseeko.c.orig 2018-05-02 11:44:17.947460233 +0200 ++++ m4-1.4.18/lib/fseeko.c 2018-05-02 12:39:49.537216897 +0200 +@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int when + #endif + + /* These tests are based on fpurge.c. */ +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + if (fp->_IO_read_end == fp->_IO_read_ptr + && fp->_IO_write_ptr == fp->_IO_write_base + && fp->_IO_save_base == NULL) +@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int when + return -1; + } + +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_flags &= ~_IO_EOF_SEEN; + fp->_offset = pos; + #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ +diff -up m4-1.4.18/lib/stdio-impl.h.orig m4-1.4.18/lib/stdio-impl.h +--- m4-1.4.18/lib/stdio-impl.h.orig 2016-12-31 14:54:42.000000000 +0100 ++++ m4-1.4.18/lib/stdio-impl.h 2018-05-02 11:43:19.570336724 +0200 +@@ -18,6 +18,12 @@ + the same implementation of stdio extension API, except that some fields + have different naming conventions, or their access requires some casts. */ + ++/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this ++ problem by defining it ourselves. FIXME: Do not rely on glibc ++ internals. */ ++#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN ++# define _IO_IN_BACKUP 0x100 ++#endif + + /* BSD stdio derived implementations. */ + diff --git a/core/m4/sources b/core/m4/sources new file mode 100644 index 0000000..4476d0a --- /dev/null +++ b/core/m4/sources @@ -0,0 +1,2 @@ +https://ftp.gnu.org/gnu/m4/m4-1.4.18.tar.xz +patches/m4-1.4.18-glibc-change-work-around.patch diff --git a/core/m4/version b/core/m4/version new file mode 100644 index 0000000..4920469 --- /dev/null +++ b/core/m4/version @@ -0,0 +1 @@ +1.4.18 2