From 1d8899af27240fcb8a020137588405810dc303d2 Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Tue, 23 Mar 2021 10:40:36 +0700 Subject: gcc: just shift numbering in patch names diff --git a/packages/gcc/10.2.0/0019-libstdcxx-pure-stdio.patch b/packages/gcc/10.2.0/0019-libstdcxx-pure-stdio.patch deleted file mode 100644 index da92ba3..0000000 --- a/packages/gcc/10.2.0/0019-libstdcxx-pure-stdio.patch +++ /dev/null @@ -1,275 +0,0 @@ -From ce06ad6901b1d24abb90d6baba5fe01c750ffb4e Mon Sep 17 00:00:00 2001 -From: Keith Packard -Date: Tue, 15 Dec 2020 17:39:24 +0000 -Subject: [PATCH] libstdc++: Support libc with stdio-only I/O in libstdc++ - -The current libstdc++ basic_file_stdio.cc code assumes a POSIX API -underneath the stdio implementation provided by the host libc. This -means that the host must provide a fairly broad POSIX file API, -including read, write, open, close, lseek and ioctl. - -This patch changes basic_file_stdio.cc to only use basic ANSI-C stdio -functions, allowing it to be used with libc implementations like -picolibc which may not have a POSIX operating system underneath. - -This is enabled by a new --enable-cstdio=stdio_pure configure option. - -Aided-by: Jonathan Wakely -Signed-off-by: Keith Packard - -libstdc++-v3/ChangeLog: - - * acinclude.m4 (GLIBCXX_ENABLE_CSTDIO): Allow "stdio_pure" - option and define _GLIBCXX_USE_PURE_STDIO when it is used. Also - add "stdio_posix" option as an alias for "stdio". - * config/io/basic_file_stdio.cc [_GLIBCXX_USE_PURE_STDIO]: Only - use defined stdio entry points for all I/O operations, without - direct calls to underlying POSIX functions. - * config.h.in: Regenerate. - * configure: Regenerate. ---- - libstdc++-v3/acinclude.m4 | 20 ++++++---- - libstdc++-v3/config.h.in | 3 ++ - libstdc++-v3/config/io/basic_file_stdio.cc | 46 +++++++++++++++++++--- - libstdc++-v3/configure | 17 +++++--- - 4 files changed, 69 insertions(+), 17 deletions(-) - -diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 -index ee5e0336f2c..9604533c306 100644 ---- a/libstdc++-v3/acinclude.m4 -+++ b/libstdc++-v3/acinclude.m4 -@@ -2826,24 +2826,30 @@ AC_DEFUN([GLIBCXX_ENABLE_PARALLEL], [ - - - dnl --dnl Check for which I/O library to use: stdio, or something specific. -+dnl Check for which I/O library to use: stdio and POSIX, or pure stdio. - dnl --dnl Default is stdio. -+dnl Default is stdio_posix. - dnl - AC_DEFUN([GLIBCXX_ENABLE_CSTDIO], [ - AC_MSG_CHECKING([for underlying I/O to use]) - GLIBCXX_ENABLE(cstdio,stdio,[[[=PACKAGE]]], -- [use target-specific I/O package], [permit stdio]) -+ [use target-specific I/O package], [permit stdio|stdio_posix|stdio_pure]) - -- # Now that libio has been removed, you can have any color you want as long -- # as it's black. This is one big no-op until other packages are added, but -- # showing the framework never hurts. -+ # The only available I/O model is based on stdio, via basic_file_stdio. -+ # The default "stdio" is actually "stdio + POSIX" because it uses fdopen(3) -+ # to get a file descriptor and then uses read(3) and write(3) with it. -+ # The "stdio_pure" model doesn't use fdopen and only uses FILE* for I/O. - case ${enable_cstdio} in -- stdio) -+ stdio*) - CSTDIO_H=config/io/c_io_stdio.h - BASIC_FILE_H=config/io/basic_file_stdio.h - BASIC_FILE_CC=config/io/basic_file_stdio.cc - AC_MSG_RESULT(stdio) -+ -+ if test "x$enable_cstdio" = "xstdio_pure" ; then -+ AC_DEFINE(_GLIBCXX_USE_STDIO_PURE, 1, -+ [Define to restrict std::__basic_file<> to stdio APIs.]) -+ fi - ;; - esac - -diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in -index 8940e0c7acd..eabcf18b52b 100644 ---- a/libstdc++-v3/config.h.in -+++ b/libstdc++-v3/config.h.in -@@ -1031,6 +1031,9 @@ - /* Define if sendfile is available in . */ - #undef _GLIBCXX_USE_SENDFILE - -+/* Define to restrict std::__basic_file<> to stdio APIs. */ -+#undef _GLIBCXX_USE_STDIO_PURE -+ - /* Define if struct stat has timespec members. */ - #undef _GLIBCXX_USE_ST_MTIM - -diff --git a/libstdc++-v3/config/io/basic_file_stdio.cc b/libstdc++-v3/config/io/basic_file_stdio.cc -index ba830fb9e97..eedffb017b6 100644 ---- a/libstdc++-v3/config/io/basic_file_stdio.cc -+++ b/libstdc++-v3/config/io/basic_file_stdio.cc -@@ -111,13 +111,21 @@ namespace - - // Wrapper handling partial write. - static std::streamsize -+#ifdef _GLIBCXX_USE_STDIO_PURE -+ xwrite(FILE *__file, const char* __s, std::streamsize __n) -+#else - xwrite(int __fd, const char* __s, std::streamsize __n) -+#endif - { - std::streamsize __nleft = __n; - - for (;;) - { -+#ifdef _GLIBCXX_USE_STDIO_PURE -+ const std::streamsize __ret = fwrite(__file, 1, __nleft, __file); -+#else - const std::streamsize __ret = write(__fd, __s, __nleft); -+#endif - if (__ret == -1L && errno == EINTR) - continue; - if (__ret == -1L) -@@ -133,7 +141,7 @@ namespace - return __n - __nleft; - } - --#ifdef _GLIBCXX_HAVE_WRITEV -+#if defined(_GLIBCXX_HAVE_WRITEV) && !defined(_GLIBCXX_USE_STDIO_PURE) - // Wrapper handling partial writev. - static std::streamsize - xwritev(int __fd, const char* __s1, std::streamsize __n1, -@@ -286,9 +294,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION - __basic_file::is_open() const throw () - { return _M_cfile != 0; } - -+#ifndef _GLIBCCXX_USE_STDIO_PURE - int - __basic_file::fd() throw () - { return fileno(_M_cfile); } -+#endif - - __c_file* - __basic_file::file() throw () -@@ -315,28 +325,46 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION - { - streamsize __ret; - do -+#ifdef _GLIBCXX_USE_STDIO_PURE -+ __ret = fread(__s, 1, __n, this->file()); -+#else - __ret = read(this->fd(), __s, __n); -+#endif - while (__ret == -1L && errno == EINTR); - return __ret; - } - - streamsize - __basic_file::xsputn(const char* __s, streamsize __n) -- { return xwrite(this->fd(), __s, __n); } -+ { -+#ifdef _GLIBCXX_USE_STDIO_PURE -+ return xwrite(this->file(), __s, __n); -+#else -+ return xwrite(this->fd(), __s, __n); -+#endif -+ } - - streamsize - __basic_file::xsputn_2(const char* __s1, streamsize __n1, - const char* __s2, streamsize __n2) - { - streamsize __ret = 0; --#ifdef _GLIBCXX_HAVE_WRITEV -+#if defined(_GLIBCXX_HAVE_WRITEV) && !defined(_GLIBCXX_USE_STDIO_PURE) - __ret = xwritev(this->fd(), __s1, __n1, __s2, __n2); - #else - if (__n1) -+#ifdef _GLIBCXX_USE_STDIO_PURE -+ __ret = xwrite(this->file(), __s1, __n1); -+#else - __ret = xwrite(this->fd(), __s1, __n1); -+#endif - - if (__ret == __n1) -+#ifdef _GLIBCXX_USE_STDIO_PURE -+ __ret += xwrite(this->file(), __s2, __n2); -+#else - __ret += xwrite(this->fd(), __s2, __n2); -+#endif - #endif - return __ret; - } -@@ -350,7 +378,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION - if (__off > numeric_limits::max() - || __off < numeric_limits::min()) - return -1L; -+#ifdef _GLIBCXX_USE_STDIO_PURE -+ return fseek(this->file(), __off, __way); -+#else - return lseek(this->fd(), __off, __way); -+#endif - #endif - } - -@@ -361,7 +393,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION - streamsize - __basic_file::showmanyc() - { --#ifndef _GLIBCXX_NO_IOCTL -+#if !defined(_GLIBCXX_NO_IOCTL) && !defined(_GLIBCXX_USE_STDIO_PURE) - #ifdef FIONREAD - // Pipes and sockets. - int __num = 0; -@@ -371,7 +403,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION - #endif - #endif - --#ifdef _GLIBCXX_HAVE_POLL -+#if defined(_GLIBCXX_HAVE_POLL) && !defined(_GLIBCXX_USE_STDIO_PURE) - // Cheap test. - struct pollfd __pfd[1]; - __pfd[0].fd = this->fd(); -@@ -395,8 +427,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION - struct stat __buffer; - const int __err = fstat(this->fd(), &__buffer); - if (!__err && _GLIBCXX_ISREG(__buffer.st_mode)) -+#ifdef _GLIBCXX_USE_STDIO_PURE -+ return __buffer.st_size - fseek(this->file(), 0, ios_base::cur); -+#else - return __buffer.st_size - lseek(this->fd(), 0, ios_base::cur); - #endif -+#endif - #endif - return 0; - } -diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure -index 9f9c5a2419a..50c8f00a41c 100755 ---- a/libstdc++-v3/configure -+++ b/libstdc++-v3/configure -@@ -16299,7 +16299,7 @@ $as_echo_n "checking for underlying I/O to use... " >&6; } - if test "${enable_cstdio+set}" = set; then : - enableval=$enable_cstdio; - case "$enableval" in -- stdio) ;; -+ stdio|stdio_posix|stdio_pure) ;; - *) as_fn_error $? "Unknown argument to enable/disable cstdio" "$LINENO" 5 ;; - esac - -@@ -16309,16 +16309,23 @@ fi - - - -- # Now that libio has been removed, you can have any color you want as long -- # as it's black. This is one big no-op until other packages are added, but -- # showing the framework never hurts. -+ # The only available I/O model is based on stdio, via basic_file_stdio. -+ # The default "stdio" is actually "stdio + POSIX" because it uses fdopen(3) -+ # to get a file descriptor and then uses read(3) and write(3) with it. -+ # The "stdio_pure" model doesn't use fdopen and only uses FILE* for I/O. - case ${enable_cstdio} in -- stdio) -+ stdio*) - CSTDIO_H=config/io/c_io_stdio.h - BASIC_FILE_H=config/io/basic_file_stdio.h - BASIC_FILE_CC=config/io/basic_file_stdio.cc - { $as_echo "$as_me:${as_lineno-$LINENO}: result: stdio" >&5 - $as_echo "stdio" >&6; } -+ -+ if test "x$enable_cstdio" = "xstdio_pure" ; then -+ -+$as_echo "#define _GLIBCXX_USE_STDIO_PURE 1" >>confdefs.h -+ -+ fi - ;; - esac - --- -2.29.2 - diff --git a/packages/gcc/10.2.0/0020-Darwin-Adjust-the-PCH-area-to-allow-for-16384byte-pa.patch b/packages/gcc/10.2.0/0020-Darwin-Adjust-the-PCH-area-to-allow-for-16384byte-pa.patch deleted file mode 100644 index 4904368..0000000 --- a/packages/gcc/10.2.0/0020-Darwin-Adjust-the-PCH-area-to-allow-for-16384byte-pa.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 22a26745add0b02a96d1b65c953529f217a52bad Mon Sep 17 00:00:00 2001 -From: Iain Sandoe -Date: Sat, 8 Aug 2020 12:15:09 +0100 -Subject: [PATCH 1/2] Darwin: Adjust the PCH area to allow for 16384byte page - size. - -Newer versions of Darwin report pagesize 20 which means that we -need to adjust the aligment of the PCH area. - -gcc/ChangeLog: - - * config/host-darwin.c: Align pch_address_space to 16384. ---- - gcc/config/host-darwin.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/gcc/config/host-darwin.c b/gcc/config/host-darwin.c -index 0face6c450f..c862935dcf3 100644 ---- a/gcc/config/host-darwin.c -+++ b/gcc/config/host-darwin.c -@@ -24,7 +24,10 @@ - #include "config/host-darwin.h" - - /* Yes, this is really supposed to work. */ --static char pch_address_space[1024*1024*1024] __attribute__((aligned (4096))); -+/* This allows for a pagesize of 16384, which we have on Darwin20, but should -+ continue to work OK for pagesize 4096 which we have on earlier versions. -+ The size is 1 (binary) Gb. */ -+static char pch_address_space[65536*16384] __attribute__((aligned (16384))); - - /* Return the address of the PCH address space, if the PCH will fit in it. */ - --- -2.28.0 - diff --git a/packages/gcc/10.2.0/0020-libstdcxx-pure-stdio.patch b/packages/gcc/10.2.0/0020-libstdcxx-pure-stdio.patch new file mode 100644 index 0000000..da92ba3 --- /dev/null +++ b/packages/gcc/10.2.0/0020-libstdcxx-pure-stdio.patch @@ -0,0 +1,275 @@ +From ce06ad6901b1d24abb90d6baba5fe01c750ffb4e Mon Sep 17 00:00:00 2001 +From: Keith Packard +Date: Tue, 15 Dec 2020 17:39:24 +0000 +Subject: [PATCH] libstdc++: Support libc with stdio-only I/O in libstdc++ + +The current libstdc++ basic_file_stdio.cc code assumes a POSIX API +underneath the stdio implementation provided by the host libc. This +means that the host must provide a fairly broad POSIX file API, +including read, write, open, close, lseek and ioctl. + +This patch changes basic_file_stdio.cc to only use basic ANSI-C stdio +functions, allowing it to be used with libc implementations like +picolibc which may not have a POSIX operating system underneath. + +This is enabled by a new --enable-cstdio=stdio_pure configure option. + +Aided-by: Jonathan Wakely +Signed-off-by: Keith Packard + +libstdc++-v3/ChangeLog: + + * acinclude.m4 (GLIBCXX_ENABLE_CSTDIO): Allow "stdio_pure" + option and define _GLIBCXX_USE_PURE_STDIO when it is used. Also + add "stdio_posix" option as an alias for "stdio". + * config/io/basic_file_stdio.cc [_GLIBCXX_USE_PURE_STDIO]: Only + use defined stdio entry points for all I/O operations, without + direct calls to underlying POSIX functions. + * config.h.in: Regenerate. + * configure: Regenerate. +--- + libstdc++-v3/acinclude.m4 | 20 ++++++---- + libstdc++-v3/config.h.in | 3 ++ + libstdc++-v3/config/io/basic_file_stdio.cc | 46 +++++++++++++++++++--- + libstdc++-v3/configure | 17 +++++--- + 4 files changed, 69 insertions(+), 17 deletions(-) + +diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 +index ee5e0336f2c..9604533c306 100644 +--- a/libstdc++-v3/acinclude.m4 ++++ b/libstdc++-v3/acinclude.m4 +@@ -2826,24 +2826,30 @@ AC_DEFUN([GLIBCXX_ENABLE_PARALLEL], [ + + + dnl +-dnl Check for which I/O library to use: stdio, or something specific. ++dnl Check for which I/O library to use: stdio and POSIX, or pure stdio. + dnl +-dnl Default is stdio. ++dnl Default is stdio_posix. + dnl + AC_DEFUN([GLIBCXX_ENABLE_CSTDIO], [ + AC_MSG_CHECKING([for underlying I/O to use]) + GLIBCXX_ENABLE(cstdio,stdio,[[[=PACKAGE]]], +- [use target-specific I/O package], [permit stdio]) ++ [use target-specific I/O package], [permit stdio|stdio_posix|stdio_pure]) + +- # Now that libio has been removed, you can have any color you want as long +- # as it's black. This is one big no-op until other packages are added, but +- # showing the framework never hurts. ++ # The only available I/O model is based on stdio, via basic_file_stdio. ++ # The default "stdio" is actually "stdio + POSIX" because it uses fdopen(3) ++ # to get a file descriptor and then uses read(3) and write(3) with it. ++ # The "stdio_pure" model doesn't use fdopen and only uses FILE* for I/O. + case ${enable_cstdio} in +- stdio) ++ stdio*) + CSTDIO_H=config/io/c_io_stdio.h + BASIC_FILE_H=config/io/basic_file_stdio.h + BASIC_FILE_CC=config/io/basic_file_stdio.cc + AC_MSG_RESULT(stdio) ++ ++ if test "x$enable_cstdio" = "xstdio_pure" ; then ++ AC_DEFINE(_GLIBCXX_USE_STDIO_PURE, 1, ++ [Define to restrict std::__basic_file<> to stdio APIs.]) ++ fi + ;; + esac + +diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in +index 8940e0c7acd..eabcf18b52b 100644 +--- a/libstdc++-v3/config.h.in ++++ b/libstdc++-v3/config.h.in +@@ -1031,6 +1031,9 @@ + /* Define if sendfile is available in . */ + #undef _GLIBCXX_USE_SENDFILE + ++/* Define to restrict std::__basic_file<> to stdio APIs. */ ++#undef _GLIBCXX_USE_STDIO_PURE ++ + /* Define if struct stat has timespec members. */ + #undef _GLIBCXX_USE_ST_MTIM + +diff --git a/libstdc++-v3/config/io/basic_file_stdio.cc b/libstdc++-v3/config/io/basic_file_stdio.cc +index ba830fb9e97..eedffb017b6 100644 +--- a/libstdc++-v3/config/io/basic_file_stdio.cc ++++ b/libstdc++-v3/config/io/basic_file_stdio.cc +@@ -111,13 +111,21 @@ namespace + + // Wrapper handling partial write. + static std::streamsize ++#ifdef _GLIBCXX_USE_STDIO_PURE ++ xwrite(FILE *__file, const char* __s, std::streamsize __n) ++#else + xwrite(int __fd, const char* __s, std::streamsize __n) ++#endif + { + std::streamsize __nleft = __n; + + for (;;) + { ++#ifdef _GLIBCXX_USE_STDIO_PURE ++ const std::streamsize __ret = fwrite(__file, 1, __nleft, __file); ++#else + const std::streamsize __ret = write(__fd, __s, __nleft); ++#endif + if (__ret == -1L && errno == EINTR) + continue; + if (__ret == -1L) +@@ -133,7 +141,7 @@ namespace + return __n - __nleft; + } + +-#ifdef _GLIBCXX_HAVE_WRITEV ++#if defined(_GLIBCXX_HAVE_WRITEV) && !defined(_GLIBCXX_USE_STDIO_PURE) + // Wrapper handling partial writev. + static std::streamsize + xwritev(int __fd, const char* __s1, std::streamsize __n1, +@@ -286,9 +294,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + __basic_file::is_open() const throw () + { return _M_cfile != 0; } + ++#ifndef _GLIBCCXX_USE_STDIO_PURE + int + __basic_file::fd() throw () + { return fileno(_M_cfile); } ++#endif + + __c_file* + __basic_file::file() throw () +@@ -315,28 +325,46 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + { + streamsize __ret; + do ++#ifdef _GLIBCXX_USE_STDIO_PURE ++ __ret = fread(__s, 1, __n, this->file()); ++#else + __ret = read(this->fd(), __s, __n); ++#endif + while (__ret == -1L && errno == EINTR); + return __ret; + } + + streamsize + __basic_file::xsputn(const char* __s, streamsize __n) +- { return xwrite(this->fd(), __s, __n); } ++ { ++#ifdef _GLIBCXX_USE_STDIO_PURE ++ return xwrite(this->file(), __s, __n); ++#else ++ return xwrite(this->fd(), __s, __n); ++#endif ++ } + + streamsize + __basic_file::xsputn_2(const char* __s1, streamsize __n1, + const char* __s2, streamsize __n2) + { + streamsize __ret = 0; +-#ifdef _GLIBCXX_HAVE_WRITEV ++#if defined(_GLIBCXX_HAVE_WRITEV) && !defined(_GLIBCXX_USE_STDIO_PURE) + __ret = xwritev(this->fd(), __s1, __n1, __s2, __n2); + #else + if (__n1) ++#ifdef _GLIBCXX_USE_STDIO_PURE ++ __ret = xwrite(this->file(), __s1, __n1); ++#else + __ret = xwrite(this->fd(), __s1, __n1); ++#endif + + if (__ret == __n1) ++#ifdef _GLIBCXX_USE_STDIO_PURE ++ __ret += xwrite(this->file(), __s2, __n2); ++#else + __ret += xwrite(this->fd(), __s2, __n2); ++#endif + #endif + return __ret; + } +@@ -350,7 +378,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + if (__off > numeric_limits::max() + || __off < numeric_limits::min()) + return -1L; ++#ifdef _GLIBCXX_USE_STDIO_PURE ++ return fseek(this->file(), __off, __way); ++#else + return lseek(this->fd(), __off, __way); ++#endif + #endif + } + +@@ -361,7 +393,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + streamsize + __basic_file::showmanyc() + { +-#ifndef _GLIBCXX_NO_IOCTL ++#if !defined(_GLIBCXX_NO_IOCTL) && !defined(_GLIBCXX_USE_STDIO_PURE) + #ifdef FIONREAD + // Pipes and sockets. + int __num = 0; +@@ -371,7 +403,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + #endif + #endif + +-#ifdef _GLIBCXX_HAVE_POLL ++#if defined(_GLIBCXX_HAVE_POLL) && !defined(_GLIBCXX_USE_STDIO_PURE) + // Cheap test. + struct pollfd __pfd[1]; + __pfd[0].fd = this->fd(); +@@ -395,8 +427,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + struct stat __buffer; + const int __err = fstat(this->fd(), &__buffer); + if (!__err && _GLIBCXX_ISREG(__buffer.st_mode)) ++#ifdef _GLIBCXX_USE_STDIO_PURE ++ return __buffer.st_size - fseek(this->file(), 0, ios_base::cur); ++#else + return __buffer.st_size - lseek(this->fd(), 0, ios_base::cur); + #endif ++#endif + #endif + return 0; + } +diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure +index 9f9c5a2419a..50c8f00a41c 100755 +--- a/libstdc++-v3/configure ++++ b/libstdc++-v3/configure +@@ -16299,7 +16299,7 @@ $as_echo_n "checking for underlying I/O to use... " >&6; } + if test "${enable_cstdio+set}" = set; then : + enableval=$enable_cstdio; + case "$enableval" in +- stdio) ;; ++ stdio|stdio_posix|stdio_pure) ;; + *) as_fn_error $? "Unknown argument to enable/disable cstdio" "$LINENO" 5 ;; + esac + +@@ -16309,16 +16309,23 @@ fi + + + +- # Now that libio has been removed, you can have any color you want as long +- # as it's black. This is one big no-op until other packages are added, but +- # showing the framework never hurts. ++ # The only available I/O model is based on stdio, via basic_file_stdio. ++ # The default "stdio" is actually "stdio + POSIX" because it uses fdopen(3) ++ # to get a file descriptor and then uses read(3) and write(3) with it. ++ # The "stdio_pure" model doesn't use fdopen and only uses FILE* for I/O. + case ${enable_cstdio} in +- stdio) ++ stdio*) + CSTDIO_H=config/io/c_io_stdio.h + BASIC_FILE_H=config/io/basic_file_stdio.h + BASIC_FILE_CC=config/io/basic_file_stdio.cc + { $as_echo "$as_me:${as_lineno-$LINENO}: result: stdio" >&5 + $as_echo "stdio" >&6; } ++ ++ if test "x$enable_cstdio" = "xstdio_pure" ; then ++ ++$as_echo "#define _GLIBCXX_USE_STDIO_PURE 1" >>confdefs.h ++ ++ fi + ;; + esac + +-- +2.29.2 + diff --git a/packages/gcc/10.2.0/0021-Darwin-Adjust-the-PCH-area-to-allow-for-16384byte-pa.patch b/packages/gcc/10.2.0/0021-Darwin-Adjust-the-PCH-area-to-allow-for-16384byte-pa.patch new file mode 100644 index 0000000..4904368 --- /dev/null +++ b/packages/gcc/10.2.0/0021-Darwin-Adjust-the-PCH-area-to-allow-for-16384byte-pa.patch @@ -0,0 +1,35 @@ +From 22a26745add0b02a96d1b65c953529f217a52bad Mon Sep 17 00:00:00 2001 +From: Iain Sandoe +Date: Sat, 8 Aug 2020 12:15:09 +0100 +Subject: [PATCH 1/2] Darwin: Adjust the PCH area to allow for 16384byte page + size. + +Newer versions of Darwin report pagesize 20 which means that we +need to adjust the aligment of the PCH area. + +gcc/ChangeLog: + + * config/host-darwin.c: Align pch_address_space to 16384. +--- + gcc/config/host-darwin.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/gcc/config/host-darwin.c b/gcc/config/host-darwin.c +index 0face6c450f..c862935dcf3 100644 +--- a/gcc/config/host-darwin.c ++++ b/gcc/config/host-darwin.c +@@ -24,7 +24,10 @@ + #include "config/host-darwin.h" + + /* Yes, this is really supposed to work. */ +-static char pch_address_space[1024*1024*1024] __attribute__((aligned (4096))); ++/* This allows for a pagesize of 16384, which we have on Darwin20, but should ++ continue to work OK for pagesize 4096 which we have on earlier versions. ++ The size is 1 (binary) Gb. */ ++static char pch_address_space[65536*16384] __attribute__((aligned (16384))); + + /* Return the address of the PCH address space, if the PCH will fit in it. */ + +-- +2.28.0 + diff --git a/packages/gcc/10.2.0/0021-Darwin-Arm64-Initial-support-for-the-self-host-drive.patch b/packages/gcc/10.2.0/0021-Darwin-Arm64-Initial-support-for-the-self-host-drive.patch deleted file mode 100644 index 12d99f8..0000000 --- a/packages/gcc/10.2.0/0021-Darwin-Arm64-Initial-support-for-the-self-host-drive.patch +++ /dev/null @@ -1,97 +0,0 @@ -From ffecb0ce72f51ec134dc33636eedcebe53e4ec9e Mon Sep 17 00:00:00 2001 -From: Iain Sandoe -Date: Tue, 18 Aug 2020 22:29:51 +0100 -Subject: [PATCH 2/2] Darwin, Arm64: Initial support for the self-host driver. - -At present, this just includes the generic Darwin stuff. - -NOTE: - -This patch is pulled from: https://github.com/iains/gcc-darwin-arm64/ - -See commit 89dc5a9d5ed3e6b2ba6a4725bd51841ee758b6cd - -Its been backported to gcc-10.2 ---- - gcc/config.host | 7 +++++- - gcc/config/aarch64/host-aarch64-darwin.c | 32 ++++++++++++++++++++++++ - gcc/config/aarch64/x-darwin | 3 +++ - 3 files changed, 41 insertions(+), 1 deletion(-) - create mode 100644 gcc/config/aarch64/host-aarch64-darwin.c - create mode 100644 gcc/config/aarch64/x-darwin - -diff --git a/gcc/config.host b/gcc/config.host -index 84f0433e2ad..8489145e1b1 100644 ---- a/gcc/config.host -+++ b/gcc/config.host -@@ -99,7 +99,8 @@ case ${host} in - esac - - case ${host} in -- aarch64*-*-freebsd* | aarch64*-*-linux* | aarch64*-*-fuchsia*) -+ aarch64*-*-freebsd* | aarch64*-*-linux* | aarch64*-*-fuchsia* |\ -+ aarch64-*-darwin* | arm64*-*-darwin*) - case ${target} in - aarch64*-*-*) - host_extra_gcc_objs="driver-aarch64.o" -@@ -251,6 +252,10 @@ case ${host} in - host_extra_gcc_objs="${host_extra_gcc_objs} driver-mingw32.o" - host_lto_plugin_soname=liblto_plugin-0.dll - ;; -+ aarch64-*-darwin* | arm64-*-darwin*) -+ out_host_hook_obj="${out_host_hook_obj} host-aarch64-darwin.o" -+ host_xmake_file="${host_xmake_file} aarch64/x-darwin" -+ ;; - i[34567]86-*-darwin* | x86_64-*-darwin*) - out_host_hook_obj="${out_host_hook_obj} host-i386-darwin.o" - host_xmake_file="${host_xmake_file} i386/x-darwin" -diff --git a/gcc/config/aarch64/host-aarch64-darwin.c b/gcc/config/aarch64/host-aarch64-darwin.c -new file mode 100644 -index 00000000000..1a2cd4c9dab ---- /dev/null -+++ b/gcc/config/aarch64/host-aarch64-darwin.c -@@ -0,0 +1,32 @@ -+/* Arm64-darwin host-specific hook definitions. -+ Copyright (C) 2020 Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify it under -+the terms of the GNU General Public License as published by the Free -+Software Foundation; either version 3, or (at your option) any later -+version. -+ -+GCC is distributed in the hope that it will be useful, but WITHOUT ANY -+WARRANTY; without even the implied warranty of MERCHANTABILITY or -+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+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 -+. */ -+ -+#define IN_TARGET_CODE 1 -+ -+#include "config.h" -+#include "system.h" -+#include "coretypes.h" -+#include "hosthooks.h" -+#include "hosthooks-def.h" -+#include "config/host-darwin.h" -+ -+/* Darwin doesn't do anything special for arm64/aarch64 hosts; this file -+ exists just to include the generic config/host-darwin.h. */ -+ -+const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER; -diff --git a/gcc/config/aarch64/x-darwin b/gcc/config/aarch64/x-darwin -new file mode 100644 -index 00000000000..6d788d5e89c ---- /dev/null -+++ b/gcc/config/aarch64/x-darwin -@@ -0,0 +1,3 @@ -+host-aarch64-darwin.o : $(srcdir)/config/aarch64/host-aarch64-darwin.c -+ $(COMPILE) $< -+ $(POSTCOMPILE) --- -2.28.0 - diff --git a/packages/gcc/10.2.0/0022-Darwin-Arm64-Initial-support-for-the-self-host-drive.patch b/packages/gcc/10.2.0/0022-Darwin-Arm64-Initial-support-for-the-self-host-drive.patch new file mode 100644 index 0000000..12d99f8 --- /dev/null +++ b/packages/gcc/10.2.0/0022-Darwin-Arm64-Initial-support-for-the-self-host-drive.patch @@ -0,0 +1,97 @@ +From ffecb0ce72f51ec134dc33636eedcebe53e4ec9e Mon Sep 17 00:00:00 2001 +From: Iain Sandoe +Date: Tue, 18 Aug 2020 22:29:51 +0100 +Subject: [PATCH 2/2] Darwin, Arm64: Initial support for the self-host driver. + +At present, this just includes the generic Darwin stuff. + +NOTE: + +This patch is pulled from: https://github.com/iains/gcc-darwin-arm64/ + +See commit 89dc5a9d5ed3e6b2ba6a4725bd51841ee758b6cd + +Its been backported to gcc-10.2 +--- + gcc/config.host | 7 +++++- + gcc/config/aarch64/host-aarch64-darwin.c | 32 ++++++++++++++++++++++++ + gcc/config/aarch64/x-darwin | 3 +++ + 3 files changed, 41 insertions(+), 1 deletion(-) + create mode 100644 gcc/config/aarch64/host-aarch64-darwin.c + create mode 100644 gcc/config/aarch64/x-darwin + +diff --git a/gcc/config.host b/gcc/config.host +index 84f0433e2ad..8489145e1b1 100644 +--- a/gcc/config.host ++++ b/gcc/config.host +@@ -99,7 +99,8 @@ case ${host} in + esac + + case ${host} in +- aarch64*-*-freebsd* | aarch64*-*-linux* | aarch64*-*-fuchsia*) ++ aarch64*-*-freebsd* | aarch64*-*-linux* | aarch64*-*-fuchsia* |\ ++ aarch64-*-darwin* | arm64*-*-darwin*) + case ${target} in + aarch64*-*-*) + host_extra_gcc_objs="driver-aarch64.o" +@@ -251,6 +252,10 @@ case ${host} in + host_extra_gcc_objs="${host_extra_gcc_objs} driver-mingw32.o" + host_lto_plugin_soname=liblto_plugin-0.dll + ;; ++ aarch64-*-darwin* | arm64-*-darwin*) ++ out_host_hook_obj="${out_host_hook_obj} host-aarch64-darwin.o" ++ host_xmake_file="${host_xmake_file} aarch64/x-darwin" ++ ;; + i[34567]86-*-darwin* | x86_64-*-darwin*) + out_host_hook_obj="${out_host_hook_obj} host-i386-darwin.o" + host_xmake_file="${host_xmake_file} i386/x-darwin" +diff --git a/gcc/config/aarch64/host-aarch64-darwin.c b/gcc/config/aarch64/host-aarch64-darwin.c +new file mode 100644 +index 00000000000..1a2cd4c9dab +--- /dev/null ++++ b/gcc/config/aarch64/host-aarch64-darwin.c +@@ -0,0 +1,32 @@ ++/* Arm64-darwin host-specific hook definitions. ++ Copyright (C) 2020 Free Software Foundation, Inc. ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify it under ++the terms of the GNU General Public License as published by the Free ++Software Foundation; either version 3, or (at your option) any later ++version. ++ ++GCC is distributed in the hope that it will be useful, but WITHOUT ANY ++WARRANTY; without even the implied warranty of MERCHANTABILITY or ++FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++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 ++. */ ++ ++#define IN_TARGET_CODE 1 ++ ++#include "config.h" ++#include "system.h" ++#include "coretypes.h" ++#include "hosthooks.h" ++#include "hosthooks-def.h" ++#include "config/host-darwin.h" ++ ++/* Darwin doesn't do anything special for arm64/aarch64 hosts; this file ++ exists just to include the generic config/host-darwin.h. */ ++ ++const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER; +diff --git a/gcc/config/aarch64/x-darwin b/gcc/config/aarch64/x-darwin +new file mode 100644 +index 00000000000..6d788d5e89c +--- /dev/null ++++ b/gcc/config/aarch64/x-darwin +@@ -0,0 +1,3 @@ ++host-aarch64-darwin.o : $(srcdir)/config/aarch64/host-aarch64-darwin.c ++ $(COMPILE) $< ++ $(POSTCOMPILE) +-- +2.28.0 + diff --git a/packages/gcc/10.2.0/0022-aarch64-fix-conflicting-declarations.patch b/packages/gcc/10.2.0/0022-aarch64-fix-conflicting-declarations.patch deleted file mode 100644 index da1d541..0000000 --- a/packages/gcc/10.2.0/0022-aarch64-fix-conflicting-declarations.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 3c1f316323f41ad02ee834278031a1cbcfdaa96b Mon Sep 17 00:00:00 2001 -From: Andreas Schwab -Date: Mon, 4 May 2020 17:29:11 +0200 -Subject: [PATCH] aarch64: fix conflicting declarations - -aarch64_get_extension_string_for_isa_flags is declared in -"aarch64-protos.h", use that instead of re-declaring it improperly. - - * config/aarch64/driver-aarch64.c: Include "aarch64-protos.h". - (aarch64_get_extension_string_for_isa_flags): Don't declare. ---- - gcc/config/aarch64/driver-aarch64.c | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - -diff --git a/gcc/config/aarch64/driver-aarch64.c b/gcc/config/aarch64/driver-aarch64.c -index 0ccd200e330..d1229e67680 100644 ---- a/gcc/config/aarch64/driver-aarch64.c -+++ b/gcc/config/aarch64/driver-aarch64.c -@@ -24,10 +24,7 @@ - #include "system.h" - #include "coretypes.h" - #include "tm.h" -- --/* Defined in common/config/aarch64/aarch64-common.c. */ --std::string aarch64_get_extension_string_for_isa_flags (unsigned long, -- unsigned long); -+#include "aarch64-protos.h" - - struct aarch64_arch_extension - { --- -2.28.0 - diff --git a/packages/gcc/10.2.0/0023-aarch64-fix-conflicting-declarations.patch b/packages/gcc/10.2.0/0023-aarch64-fix-conflicting-declarations.patch new file mode 100644 index 0000000..da1d541 --- /dev/null +++ b/packages/gcc/10.2.0/0023-aarch64-fix-conflicting-declarations.patch @@ -0,0 +1,33 @@ +From 3c1f316323f41ad02ee834278031a1cbcfdaa96b Mon Sep 17 00:00:00 2001 +From: Andreas Schwab +Date: Mon, 4 May 2020 17:29:11 +0200 +Subject: [PATCH] aarch64: fix conflicting declarations + +aarch64_get_extension_string_for_isa_flags is declared in +"aarch64-protos.h", use that instead of re-declaring it improperly. + + * config/aarch64/driver-aarch64.c: Include "aarch64-protos.h". + (aarch64_get_extension_string_for_isa_flags): Don't declare. +--- + gcc/config/aarch64/driver-aarch64.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/gcc/config/aarch64/driver-aarch64.c b/gcc/config/aarch64/driver-aarch64.c +index 0ccd200e330..d1229e67680 100644 +--- a/gcc/config/aarch64/driver-aarch64.c ++++ b/gcc/config/aarch64/driver-aarch64.c +@@ -24,10 +24,7 @@ + #include "system.h" + #include "coretypes.h" + #include "tm.h" +- +-/* Defined in common/config/aarch64/aarch64-common.c. */ +-std::string aarch64_get_extension_string_for_isa_flags (unsigned long, +- unsigned long); ++#include "aarch64-protos.h" + + struct aarch64_arch_extension + { +-- +2.28.0 + -- cgit v0.10.2-6-g49f6