From ed12fa68402f58e171a6f79500f73f4781fdc9e5 Mon Sep 17 00:00:00 2001 From: Chris Packham Date: Fri, 2 Aug 2024 12:44:52 +1200 Subject: gcc: Add 14.2.0 https://gcc.gnu.org/pipermail/gcc-announce/2024/000184.html Add the new version clean up the patches. Signed-off-by: Chris Packham --- .../0000-libtool-leave-framework-alone.patch | 18 -- ...001-gcc-plugin-POSIX-include-sys-select-h.patch | 14 -- .../gcc/14.1.0/0002-arm-softfloat-libgcc.patch | 31 --- ...0003-libgcc-disable-split-stack-nothreads.patch | 17 -- ...Remove-use-of-include_next-from-c-headers.patch | 262 --------------------- ...default-libc-to-be-specified-to-configure.patch | 134 ----------- ...nd-getenv-function-to-allow-default-value.patch | 95 -------- ...and-picolibc-as-default-C-library-choices.patch | 37 --- .../gcc/14.1.0/0008-Support-picolibc-targets.patch | 33 --- ...-gcc-Allow-g-to-work-differently-from-gcc.patch | 60 ----- ...cc-Exclude-UCLIBC-from-GLIBC-thread-check.patch | 35 --- packages/gcc/14.1.0/chksum | 8 - ...d-custom-spec-file-fragments-for-using-pi.patch | 127 ---------- packages/gcc/14.1.0/version.desc | 0 .../0000-libtool-leave-framework-alone.patch | 18 ++ ...001-gcc-plugin-POSIX-include-sys-select-h.patch | 14 ++ .../gcc/14.2.0/0002-arm-softfloat-libgcc.patch | 31 +++ ...0003-libgcc-disable-split-stack-nothreads.patch | 17 ++ ...Remove-use-of-include_next-from-c-headers.patch | 262 +++++++++++++++++++++ ...default-libc-to-be-specified-to-configure.patch | 134 +++++++++++ ...nd-getenv-function-to-allow-default-value.patch | 95 ++++++++ ...and-picolibc-as-default-C-library-choices.patch | 37 +++ .../gcc/14.2.0/0008-Support-picolibc-targets.patch | 33 +++ ...-gcc-Allow-g-to-work-differently-from-gcc.patch | 60 +++++ ...cc-Exclude-UCLIBC-from-GLIBC-thread-check.patch | 30 +++ packages/gcc/14.2.0/chksum | 8 + ...d-custom-spec-file-fragments-for-using-pi.patch | 127 ++++++++++ packages/gcc/14.2.0/version.desc | 0 28 files changed, 866 insertions(+), 871 deletions(-) delete mode 100644 packages/gcc/14.1.0/0000-libtool-leave-framework-alone.patch delete mode 100644 packages/gcc/14.1.0/0001-gcc-plugin-POSIX-include-sys-select-h.patch delete mode 100644 packages/gcc/14.1.0/0002-arm-softfloat-libgcc.patch delete mode 100644 packages/gcc/14.1.0/0003-libgcc-disable-split-stack-nothreads.patch delete mode 100644 packages/gcc/14.1.0/0004-Remove-use-of-include_next-from-c-headers.patch delete mode 100644 packages/gcc/14.1.0/0005-Allow-default-libc-to-be-specified-to-configure.patch delete mode 100644 packages/gcc/14.1.0/0006-driver-Extend-getenv-function-to-allow-default-value.patch delete mode 100644 packages/gcc/14.1.0/0007-Add-newlib-and-picolibc-as-default-C-library-choices.patch delete mode 100644 packages/gcc/14.1.0/0008-Support-picolibc-targets.patch delete mode 100644 packages/gcc/14.1.0/0009-gcc-Allow-g-to-work-differently-from-gcc.patch delete mode 100644 packages/gcc/14.1.0/0013-libgcc-Exclude-UCLIBC-from-GLIBC-thread-check.patch delete mode 100644 packages/gcc/14.1.0/chksum delete mode 100644 packages/gcc/14.1.0/experimental/0001-picolibc-Add-custom-spec-file-fragments-for-using-pi.patch delete mode 100644 packages/gcc/14.1.0/version.desc create mode 100644 packages/gcc/14.2.0/0000-libtool-leave-framework-alone.patch create mode 100644 packages/gcc/14.2.0/0001-gcc-plugin-POSIX-include-sys-select-h.patch create mode 100644 packages/gcc/14.2.0/0002-arm-softfloat-libgcc.patch create mode 100644 packages/gcc/14.2.0/0003-libgcc-disable-split-stack-nothreads.patch create mode 100644 packages/gcc/14.2.0/0004-Remove-use-of-include_next-from-c-headers.patch create mode 100644 packages/gcc/14.2.0/0005-Allow-default-libc-to-be-specified-to-configure.patch create mode 100644 packages/gcc/14.2.0/0006-driver-Extend-getenv-function-to-allow-default-value.patch create mode 100644 packages/gcc/14.2.0/0007-Add-newlib-and-picolibc-as-default-C-library-choices.patch create mode 100644 packages/gcc/14.2.0/0008-Support-picolibc-targets.patch create mode 100644 packages/gcc/14.2.0/0009-gcc-Allow-g-to-work-differently-from-gcc.patch create mode 100644 packages/gcc/14.2.0/0010-libgcc-Exclude-UCLIBC-from-GLIBC-thread-check.patch create mode 100644 packages/gcc/14.2.0/chksum create mode 100644 packages/gcc/14.2.0/experimental/0001-picolibc-Add-custom-spec-file-fragments-for-using-pi.patch create mode 100644 packages/gcc/14.2.0/version.desc diff --git a/packages/gcc/14.1.0/0000-libtool-leave-framework-alone.patch b/packages/gcc/14.1.0/0000-libtool-leave-framework-alone.patch deleted file mode 100644 index 1a86e415..00000000 --- a/packages/gcc/14.1.0/0000-libtool-leave-framework-alone.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- - libtool-ldflags | 5 +++++ - 1 file changed, 5 insertions(+) - ---- a/libtool-ldflags -+++ b/libtool-ldflags -@@ -36,6 +36,11 @@ - for arg - do - case $arg in -+ -framework) -+ # libtool handles this option. It should not be prefixed with -+ # -Xcompiler, as that would split it from the argument that -+ # follows. -+ ;; - -f*|--*|-static-lib*|-shared-lib*|-B*) - # Libtool does not ascribe any special meaning options - # that begin with -f or with a double-dash. So, it will diff --git a/packages/gcc/14.1.0/0001-gcc-plugin-POSIX-include-sys-select-h.patch b/packages/gcc/14.1.0/0001-gcc-plugin-POSIX-include-sys-select-h.patch deleted file mode 100644 index 5f9a07a2..00000000 --- a/packages/gcc/14.1.0/0001-gcc-plugin-POSIX-include-sys-select-h.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- - libcc1/connection.cc | 1 + - 1 file changed, 1 insertion(+) - ---- a/libcc1/connection.cc -+++ b/libcc1/connection.cc -@@ -21,6 +21,7 @@ - #include - #include - #include -+#include - #include - #include - #include "marshall.hh" diff --git a/packages/gcc/14.1.0/0002-arm-softfloat-libgcc.patch b/packages/gcc/14.1.0/0002-arm-softfloat-libgcc.patch deleted file mode 100644 index d9800365..00000000 --- a/packages/gcc/14.1.0/0002-arm-softfloat-libgcc.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- - gcc/config/arm/linux-elf.h | 2 +- - libgcc/config/arm/t-linux | 7 ++++++- - 2 files changed, 7 insertions(+), 2 deletions(-) - ---- a/gcc/config/arm/linux-elf.h -+++ b/gcc/config/arm/linux-elf.h -@@ -58,7 +58,7 @@ - %{shared:-lc} \ - %{!shared:%{profile:-lc_p}%{!profile:-lc}}" - --#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" -+#define LIBGCC_SPEC "-lgcc" - - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" - ---- a/libgcc/config/arm/t-linux -+++ b/libgcc/config/arm/t-linux -@@ -1,6 +1,11 @@ - LIB1ASMSRC = arm/lib1funcs.S - LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ -- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 -+ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ -+ _arm_addsubdf3 _arm_addsubsf3 \ -+ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ -+ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ -+ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ -+ _arm_fixsfsi _arm_fixunssfsi - - # Just for these, we omit the frame pointer since it makes such a big - # difference. diff --git a/packages/gcc/14.1.0/0003-libgcc-disable-split-stack-nothreads.patch b/packages/gcc/14.1.0/0003-libgcc-disable-split-stack-nothreads.patch deleted file mode 100644 index df91a9ff..00000000 --- a/packages/gcc/14.1.0/0003-libgcc-disable-split-stack-nothreads.patch +++ /dev/null @@ -1,17 +0,0 @@ -disable split-stack for non-thread builds - -Signed-off-by: Waldemar Brodkorb - ---- - libgcc/config/t-stack | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/libgcc/config/t-stack -+++ b/libgcc/config/t-stack -@@ -1,4 +1,6 @@ - # Makefile fragment to provide generic support for -fsplit-stack. - # This should be used in config.host for any host which supports - # -fsplit-stack. -+ifeq ($(enable_threads),yes) - LIB2ADD_ST += $(srcdir)/generic-morestack.c $(srcdir)/generic-morestack-thread.c -+endif diff --git a/packages/gcc/14.1.0/0004-Remove-use-of-include_next-from-c-headers.patch b/packages/gcc/14.1.0/0004-Remove-use-of-include_next-from-c-headers.patch deleted file mode 100644 index 429d3bd3..00000000 --- a/packages/gcc/14.1.0/0004-Remove-use-of-include_next-from-c-headers.patch +++ /dev/null @@ -1,262 +0,0 @@ -From fc4aaba8a3b8fe7815e103cc20f2a36d5de7e8ab Mon Sep 17 00:00:00 2001 -From: Keith Packard -Date: Sun, 24 Jan 2021 14:20:33 -0800 -Subject: [PATCH] Remove use of include_next from c++ headers - -Using include_next bypasses the default header search path and lets -files later in the include path take priority over earlier files. - -This makes replacing libc impossible as the default libc headers will -occur after the libstdc++ headers, and so be picked up in place of -headers inserted at the begining of the search path or appended to the -end of the search path. - -Using include_next is a hack to work-around broken combinations of -libraries, and is not necessary in a well constructed toolchain. - -Signed-off-by: Keith Packard ---- - libstdc++-v3/include/bits/std_abs.h | 4 ++-- - libstdc++-v3/include/c/cassert | 2 +- - libstdc++-v3/include/c/cctype | 2 +- - libstdc++-v3/include/c/cerrno | 2 +- - libstdc++-v3/include/c/cfloat | 2 +- - libstdc++-v3/include/c/climits | 2 +- - libstdc++-v3/include/c/clocale | 2 +- - libstdc++-v3/include/c/cmath | 2 +- - libstdc++-v3/include/c/csetjmp | 2 +- - libstdc++-v3/include/c/csignal | 2 +- - libstdc++-v3/include/c/cstdarg | 2 +- - libstdc++-v3/include/c/cstddef | 2 +- - libstdc++-v3/include/c/cstdio | 2 +- - libstdc++-v3/include/c/cstdlib | 2 +- - libstdc++-v3/include/c/cstring | 2 +- - libstdc++-v3/include/c/ctime | 2 +- - libstdc++-v3/include/c/cuchar | 2 +- - libstdc++-v3/include/c/cwchar | 2 +- - libstdc++-v3/include/c/cwctype | 2 +- - libstdc++-v3/include/c_global/cmath | 2 +- - libstdc++-v3/include/c_global/cstdlib | 2 +- - 21 files changed, 22 insertions(+), 22 deletions(-) - ---- a/libstdc++-v3/include/bits/std_abs.h -+++ b/libstdc++-v3/include/bits/std_abs.h -@@ -35,9 +35,9 @@ - #include - - #define _GLIBCXX_INCLUDE_NEXT_C_HEADERS --#include_next -+#include - #ifdef __CORRECT_ISO_CPP_MATH_H_PROTO --# include_next -+# include - #endif - #undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS - ---- a/libstdc++-v3/include/c/cassert -+++ b/libstdc++-v3/include/c/cassert -@@ -31,4 +31,4 @@ - #pragma GCC system_header - - #include --#include_next -+#include ---- a/libstdc++-v3/include/c/cctype -+++ b/libstdc++-v3/include/c/cctype -@@ -31,6 +31,6 @@ - - #pragma GCC system_header - --#include_next -+#include - - #endif ---- a/libstdc++-v3/include/c/cerrno -+++ b/libstdc++-v3/include/c/cerrno -@@ -41,7 +41,7 @@ - #pragma GCC system_header - - #include --#include_next -+#include - - // Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998 - #ifndef errno ---- a/libstdc++-v3/include/c/cfloat -+++ b/libstdc++-v3/include/c/cfloat -@@ -32,6 +32,6 @@ - #pragma GCC system_header - - #include --#include_next -+#include - - #endif ---- a/libstdc++-v3/include/c/climits -+++ b/libstdc++-v3/include/c/climits -@@ -32,6 +32,6 @@ - #pragma GCC system_header - - #include --#include_next -+#include - - #endif ---- a/libstdc++-v3/include/c/clocale -+++ b/libstdc++-v3/include/c/clocale -@@ -31,6 +31,6 @@ - - #pragma GCC system_header - --#include_next -+#include - - #endif ---- a/libstdc++-v3/include/c/cmath -+++ b/libstdc++-v3/include/c/cmath -@@ -33,7 +33,7 @@ - - #include - --#include_next -+#include - - // Get rid of those macros defined in in lieu of real functions. - #undef abs ---- a/libstdc++-v3/include/c/csetjmp -+++ b/libstdc++-v3/include/c/csetjmp -@@ -31,7 +31,7 @@ - - #pragma GCC system_header - --#include_next -+#include - - // Get rid of those macros defined in in lieu of real functions. - #undef longjmp ---- a/libstdc++-v3/include/c/csignal -+++ b/libstdc++-v3/include/c/csignal -@@ -31,6 +31,6 @@ - - #pragma GCC system_header - --#include_next -+#include - - #endif ---- a/libstdc++-v3/include/c/cstdarg -+++ b/libstdc++-v3/include/c/cstdarg -@@ -32,6 +32,6 @@ - #pragma GCC system_header - - #undef __need___va_list --#include_next -+#include - - #endif ---- a/libstdc++-v3/include/c/cstddef -+++ b/libstdc++-v3/include/c/cstddef -@@ -35,6 +35,6 @@ - #define __need_ptrdiff_t - #define __need_NULL - #define __need_offsetof --#include_next -+#include - - #endif ---- a/libstdc++-v3/include/c/cstdio -+++ b/libstdc++-v3/include/c/cstdio -@@ -31,7 +31,7 @@ - - #pragma GCC system_header - --#include_next -+#include - - // Get rid of those macros defined in in lieu of real functions. - #undef clearerr ---- a/libstdc++-v3/include/c/cstdlib -+++ b/libstdc++-v3/include/c/cstdlib -@@ -31,6 +31,6 @@ - - #pragma GCC system_header - --#include_next -+#include - - #endif ---- a/libstdc++-v3/include/c/cstring -+++ b/libstdc++-v3/include/c/cstring -@@ -31,6 +31,6 @@ - - #pragma GCC system_header - --#include_next -+#include - - #endif ---- a/libstdc++-v3/include/c/ctime -+++ b/libstdc++-v3/include/c/ctime -@@ -31,6 +31,6 @@ - - #pragma GCC system_header - --#include_next -+#include - - #endif ---- a/libstdc++-v3/include/c/cuchar -+++ b/libstdc++-v3/include/c/cuchar -@@ -39,7 +39,7 @@ - #include - - #if _GLIBCXX_USE_C11_UCHAR_CXX11 --# include_next -+# include - #endif - - #endif // C++11 ---- a/libstdc++-v3/include/c/cwchar -+++ b/libstdc++-v3/include/c/cwchar -@@ -36,7 +36,7 @@ - #include - - #if _GLIBCXX_HAVE_WCHAR_H --#include_next -+#include - #endif - - // Need to do a bit of trickery here with mbstate_t as char_traits ---- a/libstdc++-v3/include/c/cwctype -+++ b/libstdc++-v3/include/c/cwctype -@@ -34,7 +34,7 @@ - #include - - #if _GLIBCXX_HAVE_WCTYPE_H --#include_next -+#include - #endif - - #endif ---- a/libstdc++-v3/include/c_global/cmath -+++ b/libstdc++-v3/include/c_global/cmath -@@ -44,7 +44,7 @@ - #include - #include - #define _GLIBCXX_INCLUDE_NEXT_C_HEADERS --#include_next -+#include - #undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS - #include - ---- a/libstdc++-v3/include/c_global/cstdlib -+++ b/libstdc++-v3/include/c_global/cstdlib -@@ -76,7 +76,7 @@ - // Need to ensure this finds the C library's not a libstdc++ - // wrapper that might already be installed later in the include search path. - #define _GLIBCXX_INCLUDE_NEXT_C_HEADERS --#include_next -+#include - #undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS - #include - diff --git a/packages/gcc/14.1.0/0005-Allow-default-libc-to-be-specified-to-configure.patch b/packages/gcc/14.1.0/0005-Allow-default-libc-to-be-specified-to-configure.patch deleted file mode 100644 index 47f56953..00000000 --- a/packages/gcc/14.1.0/0005-Allow-default-libc-to-be-specified-to-configure.patch +++ /dev/null @@ -1,134 +0,0 @@ -From ffb10db6fa080e4c225e16928aec052d4c0baa95 Mon Sep 17 00:00:00 2001 -From: Keith Packard -Date: Fri, 2 Sep 2022 23:07:05 -0700 -Subject: [PATCH] Allow default libc to be specified to configure - -The default C library is normally computed based on the target -triplet. However, for embedded systems, it can be useful to leave the -triplet alone while changing which C library is used by default. Other -C libraries may still be available on the system so the compiler and -can be used by specifying suitable include and library paths at build -time. - -If an unknown --with-default-libc= value is provided, emit an error -and stop. - -Signed-off-by: Keith Packard ---- - gcc/config.gcc | 48 ++++++++++++++++++++++++++++++++++++++++-------- - gcc/configure.ac | 4 ++++ - 2 files changed, 44 insertions(+), 8 deletions(-) - ---- a/gcc/config.gcc -+++ b/gcc/config.gcc -@@ -664,6 +664,8 @@ - # Common C libraries. - tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4" - -+default_libc="" -+ - # 32-bit x86 processors supported by --with-arch=. Each processor - # MUST be separated by exactly one space. - x86_archs="athlon athlon-4 athlon-fx athlon-mp athlon-tbird \ -@@ -870,16 +872,16 @@ - esac - case $target in - *-*-*android*) -- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_BIONIC" -+ default_libc=LIBC_BIONIC - ;; - *-*-*uclibc* | *-*-uclinuxfdpiceabi) -- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC" -+ default_libc=LIBC_UCLIBC - ;; - *-*-*musl*) -- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL" -+ default_libc=LIBC_MUSL - ;; - *) -- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC" -+ default_libc=LIBC_GLIBC - ;; - esac - # Assume that glibc or uClibc or Bionic are being used and so __cxa_atexit -@@ -988,7 +990,8 @@ - case ${enable_threads} in - "" | yes | posix) thread_file='posix' ;; - esac -- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC" -+ tm_defines="$tm_defines SINGLE_LIBC" -+ default_libc=LIBC_UCLIBC - ;; - *-*-rdos*) - use_gcc_stdint=wrap -@@ -1652,13 +1655,13 @@ - - case ${target} in - csky-*-linux-gnu*) -- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC" -+ default_libc=LIBC_GLIBC - # Force .init_array support. The configure script cannot always - # automatically detect that GAS supports it, yet we require it. - gcc_cv_initfini_array=yes - ;; - csky-*-linux-uclibc*) -- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC" -+ default_libc=LIBC_UCLIBC - default_use_cxa_atexit=no - ;; - *) -@@ -3038,7 +3041,7 @@ - tmake_file="${tmake_file} t-linux rs6000/t-linux64 rs6000/t-fprules rs6000/t-ppccomm" - tmake_file="${tmake_file} rs6000/t-vxworks" - -- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC" -+ default_libc=LIBC_GLIBC - extra_objs="$extra_objs linux.o rs6000-linux.o" - ;; - powerpc-wrs-vxworks*) -@@ -5879,3 +5882,32 @@ - fi - ;; - esac -+ -+case "${with_default_libc}" in -+glibc) -+ default_libc=LIBC_GLIBC -+ ;; -+uclibc) -+ default_libc=LIBC_UCLIBC -+ ;; -+bionic) -+ default_libc=LIBC_BIONIC -+ ;; -+musl) -+ default_libc=LIBC_MUSL -+ ;; -+"") -+ ;; -+*) -+ echo "Unknown libc in --with-default-libc=$with_default_libc" 1>&2 -+ exit 1 -+ ;; -+esac -+ -+case "$default_libc" in -+"") -+ ;; -+*) -+ tm_defines="$tm_defines DEFAULT_LIBC=$default_libc" -+ ;; -+esac ---- a/gcc/configure.ac -+++ b/gcc/configure.ac -@@ -2502,6 +2502,10 @@ - fi - AC_SUBST(inhibit_libc) - -+AC_ARG_WITH(default-libc, -+ [AS_HELP_STRING([--with-default-libc], -+ [Use specified default C library])]) -+ - # When building gcc with a cross-compiler, we need to adjust things so - # that the generator programs are still built with the native compiler. - # Also, we cannot run fixincludes. diff --git a/packages/gcc/14.1.0/0006-driver-Extend-getenv-function-to-allow-default-value.patch b/packages/gcc/14.1.0/0006-driver-Extend-getenv-function-to-allow-default-value.patch deleted file mode 100644 index 4c73bd6f..00000000 --- a/packages/gcc/14.1.0/0006-driver-Extend-getenv-function-to-allow-default-value.patch +++ /dev/null @@ -1,95 +0,0 @@ -From fd6aa8e67aec185b0d84ba9551fd38c90c9d6d8a Mon Sep 17 00:00:00 2001 -From: Keith Packard -Date: Fri, 26 Aug 2022 14:30:03 -0700 -Subject: [PATCH] driver: Extend 'getenv' function to allow default value - -Right now, a missing environment variable provided to the 'getenv' -function in a .specs file causes a fatal error. That makes writing a -spec file that uses the GCC_EXEC_PREFIX value difficult as that -variable is only set when the driver has been relocated, but not when -run from the defined location. This makes building a relocatable -toolchain difficult to extend to other ancilary pieces which use specs -files to locate header and library files adjacent to the toolchain. - -This patch adds an optional third argument to the getenv function that -can be used to fall back to the standard installation path when the -driver hasn't set GCC_EXEC_PREFIX in the environment. - -For example, if an alternate C library is installed in -${prefix}/extra, then this change allows the specs file to locate that -relative to the gcc directory, if gcc is located in the original -installation directory (which would leave GCC_EXEC_PREFIX unset), or -if the gcc tree has been moved to a different location (where gcc -would set GCC_EXEC_PREFIX itself): - -*cpp: --isystem %:getenv(GCC_EXEC_PREFIX ../../extra/include ${prefix}/extra/include) - -I considered changing the behavior of either the %R sequence so that -it had a defined behavior when there was no sysroot defined, or making -the driver always set the GCC_EXEC_PREFIX environment variable and -decided that the approach of adding functionality to getenv where it -was previously invalid would cause the least potential for affecting -existing usage. - -Signed-off-by: Keith Packard ---- - gcc/doc/invoke.texi | 18 +++++++++++------- - gcc/gcc.cc | 10 +++++++++- - 2 files changed, 20 insertions(+), 8 deletions(-) - ---- a/gcc/doc/invoke.texi -+++ b/gcc/doc/invoke.texi -@@ -34814,17 +34814,21 @@ - - @table @code - @item @code{getenv} --The @code{getenv} spec function takes two arguments: an environment --variable name and a string. If the environment variable is not --defined, a fatal error is issued. Otherwise, the return value is the --value of the environment variable concatenated with the string. For --example, if @env{TOPDIR} is defined as @file{/path/to/top}, then: -+ -+The @code{getenv} spec function takes two or three arguments: an -+environment variable name, a string and an optional default value. If -+the environment variable is not defined and a default value is -+provided, that is used as the return value; otherwise a fatal error is -+issued. Otherwise, the return value is the value of the environment -+variable concatenated with the string. For example, if @env{TOPDIR} -+is defined as @file{/path/to/top}, then: - - @smallexample --%:getenv(TOPDIR /include) -+%:getenv(TOPDIR /include /path/to/default/include) - @end smallexample - --expands to @file{/path/to/top/include}. -+expands to @file{/path/to/top/include}. If @env{TOPDIR} is not -+defined, then this expands to @file{/path/to/default/include}. - - @item @code{if-exists} - The @code{if-exists} spec function takes one argument, an absolute ---- a/gcc/gcc.cc -+++ b/gcc/gcc.cc -@@ -10155,12 +10155,20 @@ - char *ptr; - size_t len; - -- if (argc != 2) -+ if (argc != 2 && argc != 3) - return NULL; - - varname = argv[0]; - value = env.get (varname); - -+ if (!value && argc == 3) -+ { -+ value = argv[2]; -+ result = XNEWVAR(char, strlen(value) + 1); -+ strcpy(result, value); -+ return result; -+ } -+ - /* If the variable isn't defined and this is allowed, craft our expected - return value. Assume variable names used in specs strings don't contain - any active spec character so don't need escaping. */ diff --git a/packages/gcc/14.1.0/0007-Add-newlib-and-picolibc-as-default-C-library-choices.patch b/packages/gcc/14.1.0/0007-Add-newlib-and-picolibc-as-default-C-library-choices.patch deleted file mode 100644 index 3a36594d..00000000 --- a/packages/gcc/14.1.0/0007-Add-newlib-and-picolibc-as-default-C-library-choices.patch +++ /dev/null @@ -1,37 +0,0 @@ -From be5d482de0099012288e617af0583772fac21714 Mon Sep 17 00:00:00 2001 -From: Keith Packard -Date: Tue, 23 Aug 2022 22:12:06 -0700 -Subject: [PATCH] Add newlib and picolibc as default C library choices - -Signed-off-by: Keith Packard ---- - gcc/config.gcc | 11 ++++++++++- - 1 file changed, 10 insertions(+), 1 deletion(-) - ---- a/gcc/config.gcc -+++ b/gcc/config.gcc -@@ -662,7 +662,7 @@ - esac - - # Common C libraries. --tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4" -+tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4 LIBC_NEWLIB=5 LIBC_PICOLIBC=6" - - default_libc="" - -@@ -5896,6 +5896,15 @@ - musl) - default_libc=LIBC_MUSL - ;; -+newlib) -+ # Newlib configurations don't set the DEFAULT_LIBC variable, so -+ # avoid changing those by allowing --with-default-libc=newlib but -+ # not actually setting the DEFAULT_LIBC variable. -+ default_libc= -+ ;; -+picolibc) -+ default_libc=LIBC_PICOLIBC -+ ;; - "") - ;; - *) diff --git a/packages/gcc/14.1.0/0008-Support-picolibc-targets.patch b/packages/gcc/14.1.0/0008-Support-picolibc-targets.patch deleted file mode 100644 index 0f8cc2f9..00000000 --- a/packages/gcc/14.1.0/0008-Support-picolibc-targets.patch +++ /dev/null @@ -1,33 +0,0 @@ -From c9c22fe9ce182e48282e2bf0a8830381d3c55dd4 Mon Sep 17 00:00:00 2001 -From: Keith Packard -Date: Sun, 12 Feb 2023 14:23:32 -0800 -Subject: [PATCH] Support picolibc targets - -Match *-picolibc-* and select picolibc as the default C library, plus continuing to use -the newlib-based logic for other configuration items. - -Signed-off-by: Keith Packard ---- - gcc/config.gcc | 11 +++++++++++ - 1 file changed, 11 insertions(+) - ---- a/gcc/config.gcc -+++ b/gcc/config.gcc -@@ -1116,6 +1116,17 @@ - ;; - esac - ;; -+*-picolibc-*) -+ # __cxa_atexit is provided. -+ default_use_cxa_atexit=yes -+ use_gcc_stdint=wrap -+ default_libc=LIBC_PICOLIBC -+ case "${with_newlib}-${with_headers}" in -+ no-no) use_gcc_stdint=provide ;; -+ *) ;; -+ esac -+ ;; -+ - *-*-elf|arc*-*-elf*) - # Assume that newlib is being used and so __cxa_atexit is provided. - default_use_cxa_atexit=yes diff --git a/packages/gcc/14.1.0/0009-gcc-Allow-g-to-work-differently-from-gcc.patch b/packages/gcc/14.1.0/0009-gcc-Allow-g-to-work-differently-from-gcc.patch deleted file mode 100644 index 57a22f98..00000000 --- a/packages/gcc/14.1.0/0009-gcc-Allow-g-to-work-differently-from-gcc.patch +++ /dev/null @@ -1,60 +0,0 @@ -From ef327a7c2a36b63e8a372bef88e3700460b51c34 Mon Sep 17 00:00:00 2001 -From: Keith Packard -Date: Sat, 11 Feb 2023 23:07:08 -0800 -Subject: [PATCH] gcc: Allow g++ to work differently from gcc - -Compile gcc.cc with -DIN_GPP defined when building g++ so that the -code can respond appropriately for the default target language. This -allows the driver to customize the specs used, selecting different -linker scripts, adjusting the use of crtbegin.o/crtend.o etc. - -By default, this change has no effect; targets need to explicitly -check for IN_GPP to have alternate behavior. - -Signed-off-by: Keith Packard ---- - gcc/cp/Make-lang.in | 7 ++++++- - gcc/gpp.cc | 21 +++++++++++++++++++++ - 2 files changed, 27 insertions(+), 1 deletion(-) - create mode 100644 gcc/gpp.cc - ---- a/gcc/cp/Make-lang.in -+++ b/gcc/cp/Make-lang.in -@@ -77,7 +77,12 @@ - endif - - # Create the compiler driver for g++. --GXX_OBJS = $(GCC_OBJS) cp/g++spec.o -+GXX_OBJS = $(GCC_OBJS:gcc.o=gpp.o) cp/g++spec.o -+ -+CFLAGS-gpp.o = $(CFLAGS-gcc.o) -+gpp.o: $(BASEVER) -+gpp.o: gcc.o -+ - xg++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBDEPS) - +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \ - $(GXX_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \ ---- /dev/null -+++ b/gcc/gpp.cc -@@ -0,0 +1,21 @@ -+/* Compiler driver program that can handle many languages. -+ Copyright (C) 1987-2022 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_GPP -+#include "gcc.cc" diff --git a/packages/gcc/14.1.0/0013-libgcc-Exclude-UCLIBC-from-GLIBC-thread-check.patch b/packages/gcc/14.1.0/0013-libgcc-Exclude-UCLIBC-from-GLIBC-thread-check.patch deleted file mode 100644 index 349f280a..00000000 --- a/packages/gcc/14.1.0/0013-libgcc-Exclude-UCLIBC-from-GLIBC-thread-check.patch +++ /dev/null @@ -1,35 +0,0 @@ -From d901175d36221fbf79a0eb8305823b88243b829c Mon Sep 17 00:00:00 2001 -From: Chris Packham -Date: Thu, 7 Sep 2023 19:26:49 +1200 -Subject: [PATCH] libgcc: Exclude UCLIBC from GLIBC thread check - -UBLIBC defines __GLIBC__ but also marks __pthread_key_create() as -protected. Leading to link errors with newer binutils such as: - - ld.bfd: isl_test_cpp17.o: non-canonical reference to canonical protected function `__pthread_key_create' in x86_64-multilib-linux-uclibc/sysroot/lib64/libc.so.1 - ld.bfd: failed to set dynamic section sizes: bad value - -Add a condition on !__UCLIBC__ when selecting a symbol to detect pthread -usage so it picks the intended pthread_cancel(). - -Signed-off-by: Chris Packham ---- - libgcc/gthr-posix.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libgcc/gthr-posix.h b/libgcc/gthr-posix.h -index aebcfdd9f4ca..087a631d308d 100644 ---- a/libgcc/gthr-posix.h -+++ b/libgcc/gthr-posix.h -@@ -233,7 +233,7 @@ __gthread_active_p (void) - library does not provide pthread_cancel, so we do use pthread_create - there (and interceptor libraries lose). */ - --#ifdef __GLIBC__ -+#if defined(__GLIBC__) && !defined(__UCLIBC__) - __gthrw2(__gthrw_(__pthread_key_create), - __pthread_key_create, - pthread_key_create) --- -2.42.0 - diff --git a/packages/gcc/14.1.0/chksum b/packages/gcc/14.1.0/chksum deleted file mode 100644 index 7adcc215..00000000 --- a/packages/gcc/14.1.0/chksum +++ /dev/null @@ -1,8 +0,0 @@ -md5 gcc-14.1.0.tar.gz 195a75ef5205a75b6bee49c8fcfc564b -sha1 gcc-14.1.0.tar.gz 2796a00db55368be593f122df38499742216c9bc -sha256 gcc-14.1.0.tar.gz a0be066c02775002a0fa65ad3c65fb56a8bfd923d072a26ed148c0439ecdb68f -sha512 gcc-14.1.0.tar.gz d1ef7c8ba4134e7c64f715665f41eef5af30662352503442241a73772ce03de804ea4ca667353731b67c9fc66bdc2faec2bec3fd3d5bce1826c8ad545698345b -md5 gcc-14.1.0.tar.xz 24195dca80ded5e0551b533f46a4481d -sha1 gcc-14.1.0.tar.xz 0aec8d432b8473559942a45c12459a5db3a04618 -sha256 gcc-14.1.0.tar.xz e283c654987afe3de9d8080bc0bd79534b5ca0d681a73a11ff2b5d3767426840 -sha512 gcc-14.1.0.tar.xz e9e224f2b26646fcf038d28dfa08b94c623bc57941f99894a321d01c600f7c68aff6b8837fd25e73e540de1f8de5606e98694a62cdcdfb525ce768b3ef6879ea diff --git a/packages/gcc/14.1.0/experimental/0001-picolibc-Add-custom-spec-file-fragments-for-using-pi.patch b/packages/gcc/14.1.0/experimental/0001-picolibc-Add-custom-spec-file-fragments-for-using-pi.patch deleted file mode 100644 index 487a28c3..00000000 --- a/packages/gcc/14.1.0/experimental/0001-picolibc-Add-custom-spec-file-fragments-for-using-pi.patch +++ /dev/null @@ -1,127 +0,0 @@ -From b0f9ac365f91952f6f920c8e6aa4ddb819f47cc8 Mon Sep 17 00:00:00 2001 -From: Keith Packard -Date: Tue, 23 Aug 2022 22:13:08 -0700 -Subject: [PATCH] picolibc: Add custom spec file fragments for using - picolibc - -The '--oslib=' option allows targets to insert an OS library after the -C library in the LIB_PATH spec file fragment. This library maps a few -POSIX APIs used by picolibc to underlying system capabilities. - -The '--crt0=' option allows targets to use an alternate crt0 in place -of the usual one as provided by Picolibc. - -For example, picolibc provides 'libsemihost' and 'crt0-semihost.o' on -various targets which maps some POSIX APIs to semihosting capabilities -and signals the semihosting environment when 'main' returns. These -would be used by specifying --oslib=semihost --crt0=semihost. - -This patch also takes advantage of the IN_GPP conditional when -building g++ to elide exception handling contents from the executable -when not linking with the g++ driver. - -Signed-off-by: Keith Packard ---- - gcc/config.gcc | 7 +++++++ - gcc/config/picolibc.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ - gcc/config/picolibc.opt | 33 +++++++++++++++++++++++++++++++++ - 3 files changed, 84 insertions(+) - create mode 100644 gcc/config/picolibc.h - create mode 100644 gcc/config/picolibc.opt - ---- a/gcc/config.gcc -+++ b/gcc/config.gcc -@@ -5931,3 +5931,10 @@ - tm_defines="$tm_defines DEFAULT_LIBC=$default_libc" - ;; - esac -+ -+case "$default_libc" in -+ LIBC_PICOLIBC) -+ extra_options="${extra_options} picolibc.opt" -+ tm_file="${tm_file} picolibc.h" -+ ;; -+esac ---- /dev/null -+++ b/gcc/config/picolibc.h -@@ -0,0 +1,44 @@ -+/* Configuration common to all targets running Picolibc. -+ Copyright (C) 2023 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. -+ -+ Under Section 7 of GPL version 3, you are granted additional -+ permissions described in the GCC Runtime Library Exception, version -+ 3.1, as published by the Free Software Foundation. -+ -+ You should have received a copy of the GNU General Public License and -+ a copy of the GCC Runtime Library Exception along with this program; -+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+ . */ -+ -+#ifdef IN_GPP -+#define PICOLIBC_LD "picolibcpp.ld" -+#define PICOLIBC_BEGIN " crtbegin%O%s" -+#define PICOLIBC_END "crtend%O%s" -+#else -+#define PICOLIBC_LD "picolibc.ld" -+#define PICOLIBC_BEGIN "" -+#define PICOLIBC_END "" -+#endif -+ -+#undef LIB_SPEC -+#define LIB_SPEC "%{!T:-T" PICOLIBC_LD "} --start-group -lc %{-oslib=*:-l%*} %(libgcc) --end-group" -+ -+#undef STARTFILE_SPEC -+#define STARTFILE_SPEC "%{-crt0=*:crt0-%*%O%s; :crt0%O%s}" PICOLIBC_BEGIN -+ -+#undef ENDFILE_SPEC -+#define ENDFILE_SPEC PICOLIBC_END -+ -+#define EH_TABLES_CAN_BE_READ_ONLY 1 ---- /dev/null -+++ b/gcc/config/picolibc.opt -@@ -0,0 +1,33 @@ -+; Processor-independent options for picolibc. -+; -+; Copyright (C) 2022 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 -+; . -+ -+-oslib -+Driver Separate Alias(-oslib=) -+ -+-oslib= -+Driver Joined -+Specify an OS support library to load after libc. -+ -+-crt0 -+Driver Separate Alias(-crt0=) -+ -+-crt0= -+Driver Joined -+Specify an alternate startup file. diff --git a/packages/gcc/14.1.0/version.desc b/packages/gcc/14.1.0/version.desc deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/gcc/14.2.0/0000-libtool-leave-framework-alone.patch b/packages/gcc/14.2.0/0000-libtool-leave-framework-alone.patch new file mode 100644 index 00000000..1a86e415 --- /dev/null +++ b/packages/gcc/14.2.0/0000-libtool-leave-framework-alone.patch @@ -0,0 +1,18 @@ +--- + libtool-ldflags | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/libtool-ldflags ++++ b/libtool-ldflags +@@ -36,6 +36,11 @@ + for arg + do + case $arg in ++ -framework) ++ # libtool handles this option. It should not be prefixed with ++ # -Xcompiler, as that would split it from the argument that ++ # follows. ++ ;; + -f*|--*|-static-lib*|-shared-lib*|-B*) + # Libtool does not ascribe any special meaning options + # that begin with -f or with a double-dash. So, it will diff --git a/packages/gcc/14.2.0/0001-gcc-plugin-POSIX-include-sys-select-h.patch b/packages/gcc/14.2.0/0001-gcc-plugin-POSIX-include-sys-select-h.patch new file mode 100644 index 00000000..5f9a07a2 --- /dev/null +++ b/packages/gcc/14.2.0/0001-gcc-plugin-POSIX-include-sys-select-h.patch @@ -0,0 +1,14 @@ +--- + libcc1/connection.cc | 1 + + 1 file changed, 1 insertion(+) + +--- a/libcc1/connection.cc ++++ b/libcc1/connection.cc +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + #include + #include "marshall.hh" diff --git a/packages/gcc/14.2.0/0002-arm-softfloat-libgcc.patch b/packages/gcc/14.2.0/0002-arm-softfloat-libgcc.patch new file mode 100644 index 00000000..d9800365 --- /dev/null +++ b/packages/gcc/14.2.0/0002-arm-softfloat-libgcc.patch @@ -0,0 +1,31 @@ +--- + gcc/config/arm/linux-elf.h | 2 +- + libgcc/config/arm/t-linux | 7 ++++++- + 2 files changed, 7 insertions(+), 2 deletions(-) + +--- a/gcc/config/arm/linux-elf.h ++++ b/gcc/config/arm/linux-elf.h +@@ -58,7 +58,7 @@ + %{shared:-lc} \ + %{!shared:%{profile:-lc_p}%{!profile:-lc}}" + +-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" ++#define LIBGCC_SPEC "-lgcc" + + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" + +--- a/libgcc/config/arm/t-linux ++++ b/libgcc/config/arm/t-linux +@@ -1,6 +1,11 @@ + LIB1ASMSRC = arm/lib1funcs.S + LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ +- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 ++ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ ++ _arm_addsubdf3 _arm_addsubsf3 \ ++ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ ++ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ ++ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ ++ _arm_fixsfsi _arm_fixunssfsi + + # Just for these, we omit the frame pointer since it makes such a big + # difference. diff --git a/packages/gcc/14.2.0/0003-libgcc-disable-split-stack-nothreads.patch b/packages/gcc/14.2.0/0003-libgcc-disable-split-stack-nothreads.patch new file mode 100644 index 00000000..df91a9ff --- /dev/null +++ b/packages/gcc/14.2.0/0003-libgcc-disable-split-stack-nothreads.patch @@ -0,0 +1,17 @@ +disable split-stack for non-thread builds + +Signed-off-by: Waldemar Brodkorb + +--- + libgcc/config/t-stack | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/libgcc/config/t-stack ++++ b/libgcc/config/t-stack +@@ -1,4 +1,6 @@ + # Makefile fragment to provide generic support for -fsplit-stack. + # This should be used in config.host for any host which supports + # -fsplit-stack. ++ifeq ($(enable_threads),yes) + LIB2ADD_ST += $(srcdir)/generic-morestack.c $(srcdir)/generic-morestack-thread.c ++endif diff --git a/packages/gcc/14.2.0/0004-Remove-use-of-include_next-from-c-headers.patch b/packages/gcc/14.2.0/0004-Remove-use-of-include_next-from-c-headers.patch new file mode 100644 index 00000000..429d3bd3 --- /dev/null +++ b/packages/gcc/14.2.0/0004-Remove-use-of-include_next-from-c-headers.patch @@ -0,0 +1,262 @@ +From fc4aaba8a3b8fe7815e103cc20f2a36d5de7e8ab Mon Sep 17 00:00:00 2001 +From: Keith Packard +Date: Sun, 24 Jan 2021 14:20:33 -0800 +Subject: [PATCH] Remove use of include_next from c++ headers + +Using include_next bypasses the default header search path and lets +files later in the include path take priority over earlier files. + +This makes replacing libc impossible as the default libc headers will +occur after the libstdc++ headers, and so be picked up in place of +headers inserted at the begining of the search path or appended to the +end of the search path. + +Using include_next is a hack to work-around broken combinations of +libraries, and is not necessary in a well constructed toolchain. + +Signed-off-by: Keith Packard +--- + libstdc++-v3/include/bits/std_abs.h | 4 ++-- + libstdc++-v3/include/c/cassert | 2 +- + libstdc++-v3/include/c/cctype | 2 +- + libstdc++-v3/include/c/cerrno | 2 +- + libstdc++-v3/include/c/cfloat | 2 +- + libstdc++-v3/include/c/climits | 2 +- + libstdc++-v3/include/c/clocale | 2 +- + libstdc++-v3/include/c/cmath | 2 +- + libstdc++-v3/include/c/csetjmp | 2 +- + libstdc++-v3/include/c/csignal | 2 +- + libstdc++-v3/include/c/cstdarg | 2 +- + libstdc++-v3/include/c/cstddef | 2 +- + libstdc++-v3/include/c/cstdio | 2 +- + libstdc++-v3/include/c/cstdlib | 2 +- + libstdc++-v3/include/c/cstring | 2 +- + libstdc++-v3/include/c/ctime | 2 +- + libstdc++-v3/include/c/cuchar | 2 +- + libstdc++-v3/include/c/cwchar | 2 +- + libstdc++-v3/include/c/cwctype | 2 +- + libstdc++-v3/include/c_global/cmath | 2 +- + libstdc++-v3/include/c_global/cstdlib | 2 +- + 21 files changed, 22 insertions(+), 22 deletions(-) + +--- a/libstdc++-v3/include/bits/std_abs.h ++++ b/libstdc++-v3/include/bits/std_abs.h +@@ -35,9 +35,9 @@ + #include + + #define _GLIBCXX_INCLUDE_NEXT_C_HEADERS +-#include_next ++#include + #ifdef __CORRECT_ISO_CPP_MATH_H_PROTO +-# include_next ++# include + #endif + #undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS + +--- a/libstdc++-v3/include/c/cassert ++++ b/libstdc++-v3/include/c/cassert +@@ -31,4 +31,4 @@ + #pragma GCC system_header + + #include +-#include_next ++#include +--- a/libstdc++-v3/include/c/cctype ++++ b/libstdc++-v3/include/c/cctype +@@ -31,6 +31,6 @@ + + #pragma GCC system_header + +-#include_next ++#include + + #endif +--- a/libstdc++-v3/include/c/cerrno ++++ b/libstdc++-v3/include/c/cerrno +@@ -41,7 +41,7 @@ + #pragma GCC system_header + + #include +-#include_next ++#include + + // Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998 + #ifndef errno +--- a/libstdc++-v3/include/c/cfloat ++++ b/libstdc++-v3/include/c/cfloat +@@ -32,6 +32,6 @@ + #pragma GCC system_header + + #include +-#include_next ++#include + + #endif +--- a/libstdc++-v3/include/c/climits ++++ b/libstdc++-v3/include/c/climits +@@ -32,6 +32,6 @@ + #pragma GCC system_header + + #include +-#include_next ++#include + + #endif +--- a/libstdc++-v3/include/c/clocale ++++ b/libstdc++-v3/include/c/clocale +@@ -31,6 +31,6 @@ + + #pragma GCC system_header + +-#include_next ++#include + + #endif +--- a/libstdc++-v3/include/c/cmath ++++ b/libstdc++-v3/include/c/cmath +@@ -33,7 +33,7 @@ + + #include + +-#include_next ++#include + + // Get rid of those macros defined in in lieu of real functions. + #undef abs +--- a/libstdc++-v3/include/c/csetjmp ++++ b/libstdc++-v3/include/c/csetjmp +@@ -31,7 +31,7 @@ + + #pragma GCC system_header + +-#include_next ++#include + + // Get rid of those macros defined in in lieu of real functions. + #undef longjmp +--- a/libstdc++-v3/include/c/csignal ++++ b/libstdc++-v3/include/c/csignal +@@ -31,6 +31,6 @@ + + #pragma GCC system_header + +-#include_next ++#include + + #endif +--- a/libstdc++-v3/include/c/cstdarg ++++ b/libstdc++-v3/include/c/cstdarg +@@ -32,6 +32,6 @@ + #pragma GCC system_header + + #undef __need___va_list +-#include_next ++#include + + #endif +--- a/libstdc++-v3/include/c/cstddef ++++ b/libstdc++-v3/include/c/cstddef +@@ -35,6 +35,6 @@ + #define __need_ptrdiff_t + #define __need_NULL + #define __need_offsetof +-#include_next ++#include + + #endif +--- a/libstdc++-v3/include/c/cstdio ++++ b/libstdc++-v3/include/c/cstdio +@@ -31,7 +31,7 @@ + + #pragma GCC system_header + +-#include_next ++#include + + // Get rid of those macros defined in in lieu of real functions. + #undef clearerr +--- a/libstdc++-v3/include/c/cstdlib ++++ b/libstdc++-v3/include/c/cstdlib +@@ -31,6 +31,6 @@ + + #pragma GCC system_header + +-#include_next ++#include + + #endif +--- a/libstdc++-v3/include/c/cstring ++++ b/libstdc++-v3/include/c/cstring +@@ -31,6 +31,6 @@ + + #pragma GCC system_header + +-#include_next ++#include + + #endif +--- a/libstdc++-v3/include/c/ctime ++++ b/libstdc++-v3/include/c/ctime +@@ -31,6 +31,6 @@ + + #pragma GCC system_header + +-#include_next ++#include + + #endif +--- a/libstdc++-v3/include/c/cuchar ++++ b/libstdc++-v3/include/c/cuchar +@@ -39,7 +39,7 @@ + #include + + #if _GLIBCXX_USE_C11_UCHAR_CXX11 +-# include_next ++# include + #endif + + #endif // C++11 +--- a/libstdc++-v3/include/c/cwchar ++++ b/libstdc++-v3/include/c/cwchar +@@ -36,7 +36,7 @@ + #include + + #if _GLIBCXX_HAVE_WCHAR_H +-#include_next ++#include + #endif + + // Need to do a bit of trickery here with mbstate_t as char_traits +--- a/libstdc++-v3/include/c/cwctype ++++ b/libstdc++-v3/include/c/cwctype +@@ -34,7 +34,7 @@ + #include + + #if _GLIBCXX_HAVE_WCTYPE_H +-#include_next ++#include + #endif + + #endif +--- a/libstdc++-v3/include/c_global/cmath ++++ b/libstdc++-v3/include/c_global/cmath +@@ -44,7 +44,7 @@ + #include + #include + #define _GLIBCXX_INCLUDE_NEXT_C_HEADERS +-#include_next ++#include + #undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS + #include + +--- a/libstdc++-v3/include/c_global/cstdlib ++++ b/libstdc++-v3/include/c_global/cstdlib +@@ -76,7 +76,7 @@ + // Need to ensure this finds the C library's not a libstdc++ + // wrapper that might already be installed later in the include search path. + #define _GLIBCXX_INCLUDE_NEXT_C_HEADERS +-#include_next ++#include + #undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS + #include + diff --git a/packages/gcc/14.2.0/0005-Allow-default-libc-to-be-specified-to-configure.patch b/packages/gcc/14.2.0/0005-Allow-default-libc-to-be-specified-to-configure.patch new file mode 100644 index 00000000..9a7a2a85 --- /dev/null +++ b/packages/gcc/14.2.0/0005-Allow-default-libc-to-be-specified-to-configure.patch @@ -0,0 +1,134 @@ +From ffb10db6fa080e4c225e16928aec052d4c0baa95 Mon Sep 17 00:00:00 2001 +From: Keith Packard +Date: Fri, 2 Sep 2022 23:07:05 -0700 +Subject: [PATCH] Allow default libc to be specified to configure + +The default C library is normally computed based on the target +triplet. However, for embedded systems, it can be useful to leave the +triplet alone while changing which C library is used by default. Other +C libraries may still be available on the system so the compiler and +can be used by specifying suitable include and library paths at build +time. + +If an unknown --with-default-libc= value is provided, emit an error +and stop. + +Signed-off-by: Keith Packard +--- + gcc/config.gcc | 48 ++++++++++++++++++++++++++++++++++++++++-------- + gcc/configure.ac | 4 ++++ + 2 files changed, 44 insertions(+), 8 deletions(-) + +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -695,6 +695,8 @@ + # Common C libraries. + tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4" + ++default_libc="" ++ + # 32-bit x86 processors supported by --with-arch=. Each processor + # MUST be separated by exactly one space. + x86_archs="athlon athlon-4 athlon-fx athlon-mp athlon-tbird \ +@@ -911,16 +913,16 @@ + esac + case $target in + *-*-*android*) +- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_BIONIC" ++ default_libc=LIBC_BIONIC + ;; + *-*-*uclibc* | *-*-uclinuxfdpiceabi) +- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC" ++ default_libc=LIBC_UCLIBC + ;; + *-*-*musl*) +- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL" ++ default_libc=LIBC_MUSL + ;; + *) +- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC" ++ default_libc=LIBC_GLIBC + ;; + esac + # Assume that glibc or uClibc or Bionic are being used and so __cxa_atexit +@@ -1035,7 +1037,8 @@ + case ${enable_threads} in + "" | yes | posix) thread_file='posix' ;; + esac +- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC" ++ tm_defines="$tm_defines SINGLE_LIBC" ++ default_libc=LIBC_UCLIBC + ;; + *-*-rdos*) + use_gcc_stdint=wrap +@@ -1721,13 +1724,13 @@ + + case ${target} in + csky-*-linux-gnu*) +- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC" ++ default_libc=LIBC_GLIBC + # Force .init_array support. The configure script cannot always + # automatically detect that GAS supports it, yet we require it. + gcc_cv_initfini_array=yes + ;; + csky-*-linux-uclibc*) +- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC" ++ default_libc=LIBC_UCLIBC + default_use_cxa_atexit=no + ;; + *) +@@ -3125,7 +3128,7 @@ + tmake_file="${tmake_file} t-linux rs6000/t-linux64 rs6000/t-fprules rs6000/t-ppccomm" + tmake_file="${tmake_file} rs6000/t-vxworks" + +- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC" ++ default_libc=LIBC_GLIBC + extra_objs="$extra_objs linux.o rs6000-linux.o" + ;; + powerpc-wrs-vxworks*) +@@ -6079,3 +6082,32 @@ + fi + ;; + esac ++ ++case "${with_default_libc}" in ++glibc) ++ default_libc=LIBC_GLIBC ++ ;; ++uclibc) ++ default_libc=LIBC_UCLIBC ++ ;; ++bionic) ++ default_libc=LIBC_BIONIC ++ ;; ++musl) ++ default_libc=LIBC_MUSL ++ ;; ++"") ++ ;; ++*) ++ echo "Unknown libc in --with-default-libc=$with_default_libc" 1>&2 ++ exit 1 ++ ;; ++esac ++ ++case "$default_libc" in ++"") ++ ;; ++*) ++ tm_defines="$tm_defines DEFAULT_LIBC=$default_libc" ++ ;; ++esac +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -2546,6 +2546,10 @@ + fi + AC_SUBST(inhibit_libc) + ++AC_ARG_WITH(default-libc, ++ [AS_HELP_STRING([--with-default-libc], ++ [Use specified default C library])]) ++ + # When building gcc with a cross-compiler, we need to adjust things so + # that the generator programs are still built with the native compiler. + # Also, we cannot run fixincludes. diff --git a/packages/gcc/14.2.0/0006-driver-Extend-getenv-function-to-allow-default-value.patch b/packages/gcc/14.2.0/0006-driver-Extend-getenv-function-to-allow-default-value.patch new file mode 100644 index 00000000..955ff3ca --- /dev/null +++ b/packages/gcc/14.2.0/0006-driver-Extend-getenv-function-to-allow-default-value.patch @@ -0,0 +1,95 @@ +From fd6aa8e67aec185b0d84ba9551fd38c90c9d6d8a Mon Sep 17 00:00:00 2001 +From: Keith Packard +Date: Fri, 26 Aug 2022 14:30:03 -0700 +Subject: [PATCH] driver: Extend 'getenv' function to allow default value + +Right now, a missing environment variable provided to the 'getenv' +function in a .specs file causes a fatal error. That makes writing a +spec file that uses the GCC_EXEC_PREFIX value difficult as that +variable is only set when the driver has been relocated, but not when +run from the defined location. This makes building a relocatable +toolchain difficult to extend to other ancilary pieces which use specs +files to locate header and library files adjacent to the toolchain. + +This patch adds an optional third argument to the getenv function that +can be used to fall back to the standard installation path when the +driver hasn't set GCC_EXEC_PREFIX in the environment. + +For example, if an alternate C library is installed in +${prefix}/extra, then this change allows the specs file to locate that +relative to the gcc directory, if gcc is located in the original +installation directory (which would leave GCC_EXEC_PREFIX unset), or +if the gcc tree has been moved to a different location (where gcc +would set GCC_EXEC_PREFIX itself): + +*cpp: +-isystem %:getenv(GCC_EXEC_PREFIX ../../extra/include ${prefix}/extra/include) + +I considered changing the behavior of either the %R sequence so that +it had a defined behavior when there was no sysroot defined, or making +the driver always set the GCC_EXEC_PREFIX environment variable and +decided that the approach of adding functionality to getenv where it +was previously invalid would cause the least potential for affecting +existing usage. + +Signed-off-by: Keith Packard +--- + gcc/doc/invoke.texi | 18 +++++++++++------- + gcc/gcc.cc | 10 +++++++++- + 2 files changed, 20 insertions(+), 8 deletions(-) + +--- a/gcc/doc/invoke.texi ++++ b/gcc/doc/invoke.texi +@@ -36963,17 +36963,21 @@ + + @table @code + @item @code{getenv} +-The @code{getenv} spec function takes two arguments: an environment +-variable name and a string. If the environment variable is not +-defined, a fatal error is issued. Otherwise, the return value is the +-value of the environment variable concatenated with the string. For +-example, if @env{TOPDIR} is defined as @file{/path/to/top}, then: ++ ++The @code{getenv} spec function takes two or three arguments: an ++environment variable name, a string and an optional default value. If ++the environment variable is not defined and a default value is ++provided, that is used as the return value; otherwise a fatal error is ++issued. Otherwise, the return value is the value of the environment ++variable concatenated with the string. For example, if @env{TOPDIR} ++is defined as @file{/path/to/top}, then: + + @smallexample +-%:getenv(TOPDIR /include) ++%:getenv(TOPDIR /include /path/to/default/include) + @end smallexample + +-expands to @file{/path/to/top/include}. ++expands to @file{/path/to/top/include}. If @env{TOPDIR} is not ++defined, then this expands to @file{/path/to/default/include}. + + @item @code{if-exists} + The @code{if-exists} spec function takes one argument, an absolute +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -10300,12 +10300,20 @@ + char *ptr; + size_t len; + +- if (argc != 2) ++ if (argc != 2 && argc != 3) + return NULL; + + varname = argv[0]; + value = env.get (varname); + ++ if (!value && argc == 3) ++ { ++ value = argv[2]; ++ result = XNEWVAR(char, strlen(value) + 1); ++ strcpy(result, value); ++ return result; ++ } ++ + /* If the variable isn't defined and this is allowed, craft our expected + return value. Assume variable names used in specs strings don't contain + any active spec character so don't need escaping. */ diff --git a/packages/gcc/14.2.0/0007-Add-newlib-and-picolibc-as-default-C-library-choices.patch b/packages/gcc/14.2.0/0007-Add-newlib-and-picolibc-as-default-C-library-choices.patch new file mode 100644 index 00000000..5443630b --- /dev/null +++ b/packages/gcc/14.2.0/0007-Add-newlib-and-picolibc-as-default-C-library-choices.patch @@ -0,0 +1,37 @@ +From be5d482de0099012288e617af0583772fac21714 Mon Sep 17 00:00:00 2001 +From: Keith Packard +Date: Tue, 23 Aug 2022 22:12:06 -0700 +Subject: [PATCH] Add newlib and picolibc as default C library choices + +Signed-off-by: Keith Packard +--- + gcc/config.gcc | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -693,7 +693,7 @@ + esac + + # Common C libraries. +-tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4" ++tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4 LIBC_NEWLIB=5 LIBC_PICOLIBC=6" + + default_libc="" + +@@ -6096,6 +6096,15 @@ + musl) + default_libc=LIBC_MUSL + ;; ++newlib) ++ # Newlib configurations don't set the DEFAULT_LIBC variable, so ++ # avoid changing those by allowing --with-default-libc=newlib but ++ # not actually setting the DEFAULT_LIBC variable. ++ default_libc= ++ ;; ++picolibc) ++ default_libc=LIBC_PICOLIBC ++ ;; + "") + ;; + *) diff --git a/packages/gcc/14.2.0/0008-Support-picolibc-targets.patch b/packages/gcc/14.2.0/0008-Support-picolibc-targets.patch new file mode 100644 index 00000000..987baf39 --- /dev/null +++ b/packages/gcc/14.2.0/0008-Support-picolibc-targets.patch @@ -0,0 +1,33 @@ +From c9c22fe9ce182e48282e2bf0a8830381d3c55dd4 Mon Sep 17 00:00:00 2001 +From: Keith Packard +Date: Sun, 12 Feb 2023 14:23:32 -0800 +Subject: [PATCH] Support picolibc targets + +Match *-picolibc-* and select picolibc as the default C library, plus continuing to use +the newlib-based logic for other configuration items. + +Signed-off-by: Keith Packard +--- + gcc/config.gcc | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -1168,6 +1168,17 @@ + ;; + esac + ;; ++*-picolibc-*) ++ # __cxa_atexit is provided. ++ default_use_cxa_atexit=yes ++ use_gcc_stdint=wrap ++ default_libc=LIBC_PICOLIBC ++ case "${with_newlib}-${with_headers}" in ++ no-no) use_gcc_stdint=provide ;; ++ *) ;; ++ esac ++ ;; ++ + *-*-elf|arc*-*-elf*) + # Assume that newlib is being used and so __cxa_atexit is provided. + default_use_cxa_atexit=yes diff --git a/packages/gcc/14.2.0/0009-gcc-Allow-g-to-work-differently-from-gcc.patch b/packages/gcc/14.2.0/0009-gcc-Allow-g-to-work-differently-from-gcc.patch new file mode 100644 index 00000000..57a22f98 --- /dev/null +++ b/packages/gcc/14.2.0/0009-gcc-Allow-g-to-work-differently-from-gcc.patch @@ -0,0 +1,60 @@ +From ef327a7c2a36b63e8a372bef88e3700460b51c34 Mon Sep 17 00:00:00 2001 +From: Keith Packard +Date: Sat, 11 Feb 2023 23:07:08 -0800 +Subject: [PATCH] gcc: Allow g++ to work differently from gcc + +Compile gcc.cc with -DIN_GPP defined when building g++ so that the +code can respond appropriately for the default target language. This +allows the driver to customize the specs used, selecting different +linker scripts, adjusting the use of crtbegin.o/crtend.o etc. + +By default, this change has no effect; targets need to explicitly +check for IN_GPP to have alternate behavior. + +Signed-off-by: Keith Packard +--- + gcc/cp/Make-lang.in | 7 ++++++- + gcc/gpp.cc | 21 +++++++++++++++++++++ + 2 files changed, 27 insertions(+), 1 deletion(-) + create mode 100644 gcc/gpp.cc + +--- a/gcc/cp/Make-lang.in ++++ b/gcc/cp/Make-lang.in +@@ -77,7 +77,12 @@ + endif + + # Create the compiler driver for g++. +-GXX_OBJS = $(GCC_OBJS) cp/g++spec.o ++GXX_OBJS = $(GCC_OBJS:gcc.o=gpp.o) cp/g++spec.o ++ ++CFLAGS-gpp.o = $(CFLAGS-gcc.o) ++gpp.o: $(BASEVER) ++gpp.o: gcc.o ++ + xg++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBDEPS) + +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \ + $(GXX_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \ +--- /dev/null ++++ b/gcc/gpp.cc +@@ -0,0 +1,21 @@ ++/* Compiler driver program that can handle many languages. ++ Copyright (C) 1987-2022 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_GPP ++#include "gcc.cc" diff --git a/packages/gcc/14.2.0/0010-libgcc-Exclude-UCLIBC-from-GLIBC-thread-check.patch b/packages/gcc/14.2.0/0010-libgcc-Exclude-UCLIBC-from-GLIBC-thread-check.patch new file mode 100644 index 00000000..c0a32648 --- /dev/null +++ b/packages/gcc/14.2.0/0010-libgcc-Exclude-UCLIBC-from-GLIBC-thread-check.patch @@ -0,0 +1,30 @@ +From d901175d36221fbf79a0eb8305823b88243b829c Mon Sep 17 00:00:00 2001 +From: Chris Packham +Date: Thu, 7 Sep 2023 19:26:49 +1200 +Subject: [PATCH] libgcc: Exclude UCLIBC from GLIBC thread check + +UBLIBC defines __GLIBC__ but also marks __pthread_key_create() as +protected. Leading to link errors with newer binutils such as: + + ld.bfd: isl_test_cpp17.o: non-canonical reference to canonical protected function `__pthread_key_create' in x86_64-multilib-linux-uclibc/sysroot/lib64/libc.so.1 + ld.bfd: failed to set dynamic section sizes: bad value + +Add a condition on !__UCLIBC__ when selecting a symbol to detect pthread +usage so it picks the intended pthread_cancel(). + +Signed-off-by: Chris Packham +--- + libgcc/gthr-posix.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/libgcc/gthr-posix.h ++++ b/libgcc/gthr-posix.h +@@ -246,7 +246,7 @@ + library does not provide pthread_cancel, so we do use pthread_create + there (and interceptor libraries lose). */ + +-#ifdef __GLIBC__ ++#if defined(__GLIBC__) && !defined(__UCLIBC__) + __gthrw2(__gthrw_(__pthread_key_create), + __pthread_key_create, + pthread_key_create) diff --git a/packages/gcc/14.2.0/chksum b/packages/gcc/14.2.0/chksum new file mode 100644 index 00000000..40000f5c --- /dev/null +++ b/packages/gcc/14.2.0/chksum @@ -0,0 +1,8 @@ +md5 gcc-14.2.0.tar.xz 2268420ba02dc01821960e274711bde0 +sha1 gcc-14.2.0.tar.xz d91ecc3d20ce6298bd95f9b09cc51dc6d3c73ae3 +sha256 gcc-14.2.0.tar.xz a7b39bc69cbf9e25826c5a60ab26477001f7c08d85cec04bc0e29cabed6f3cc9 +sha512 gcc-14.2.0.tar.xz 932bdef0cda94bacedf452ab17f103c0cb511ff2cec55e9112fc0328cbf1d803b42595728ea7b200e0a057c03e85626f937012e49a7515bc5dd256b2bf4bc396 +md5 gcc-14.2.0.tar.gz b89ddcdaf5c1b6214abad40d9761a6ba +sha1 gcc-14.2.0.tar.gz d4d09500ace1dc9ab69f6c4c791de012da8607ed +sha256 gcc-14.2.0.tar.gz 7d376d445f93126dc545e2c0086d0f647c3094aae081cdb78f42ce2bc25e7293 +sha512 gcc-14.2.0.tar.gz d6828a5702ff4b667cc3e1e7e9f180191041b7efb68ffdc54248a42aa1799f41db6743acfe9ab74ea59977ba06f425fcf943a9fe3a77f9db706fc6bdbd657c1a diff --git a/packages/gcc/14.2.0/experimental/0001-picolibc-Add-custom-spec-file-fragments-for-using-pi.patch b/packages/gcc/14.2.0/experimental/0001-picolibc-Add-custom-spec-file-fragments-for-using-pi.patch new file mode 100644 index 00000000..487a28c3 --- /dev/null +++ b/packages/gcc/14.2.0/experimental/0001-picolibc-Add-custom-spec-file-fragments-for-using-pi.patch @@ -0,0 +1,127 @@ +From b0f9ac365f91952f6f920c8e6aa4ddb819f47cc8 Mon Sep 17 00:00:00 2001 +From: Keith Packard +Date: Tue, 23 Aug 2022 22:13:08 -0700 +Subject: [PATCH] picolibc: Add custom spec file fragments for using + picolibc + +The '--oslib=' option allows targets to insert an OS library after the +C library in the LIB_PATH spec file fragment. This library maps a few +POSIX APIs used by picolibc to underlying system capabilities. + +The '--crt0=' option allows targets to use an alternate crt0 in place +of the usual one as provided by Picolibc. + +For example, picolibc provides 'libsemihost' and 'crt0-semihost.o' on +various targets which maps some POSIX APIs to semihosting capabilities +and signals the semihosting environment when 'main' returns. These +would be used by specifying --oslib=semihost --crt0=semihost. + +This patch also takes advantage of the IN_GPP conditional when +building g++ to elide exception handling contents from the executable +when not linking with the g++ driver. + +Signed-off-by: Keith Packard +--- + gcc/config.gcc | 7 +++++++ + gcc/config/picolibc.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ + gcc/config/picolibc.opt | 33 +++++++++++++++++++++++++++++++++ + 3 files changed, 84 insertions(+) + create mode 100644 gcc/config/picolibc.h + create mode 100644 gcc/config/picolibc.opt + +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -5931,3 +5931,10 @@ + tm_defines="$tm_defines DEFAULT_LIBC=$default_libc" + ;; + esac ++ ++case "$default_libc" in ++ LIBC_PICOLIBC) ++ extra_options="${extra_options} picolibc.opt" ++ tm_file="${tm_file} picolibc.h" ++ ;; ++esac +--- /dev/null ++++ b/gcc/config/picolibc.h +@@ -0,0 +1,44 @@ ++/* Configuration common to all targets running Picolibc. ++ Copyright (C) 2023 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. ++ ++ Under Section 7 of GPL version 3, you are granted additional ++ permissions described in the GCC Runtime Library Exception, version ++ 3.1, as published by the Free Software Foundation. ++ ++ You should have received a copy of the GNU General Public License and ++ a copy of the GCC Runtime Library Exception along with this program; ++ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++ . */ ++ ++#ifdef IN_GPP ++#define PICOLIBC_LD "picolibcpp.ld" ++#define PICOLIBC_BEGIN " crtbegin%O%s" ++#define PICOLIBC_END "crtend%O%s" ++#else ++#define PICOLIBC_LD "picolibc.ld" ++#define PICOLIBC_BEGIN "" ++#define PICOLIBC_END "" ++#endif ++ ++#undef LIB_SPEC ++#define LIB_SPEC "%{!T:-T" PICOLIBC_LD "} --start-group -lc %{-oslib=*:-l%*} %(libgcc) --end-group" ++ ++#undef STARTFILE_SPEC ++#define STARTFILE_SPEC "%{-crt0=*:crt0-%*%O%s; :crt0%O%s}" PICOLIBC_BEGIN ++ ++#undef ENDFILE_SPEC ++#define ENDFILE_SPEC PICOLIBC_END ++ ++#define EH_TABLES_CAN_BE_READ_ONLY 1 +--- /dev/null ++++ b/gcc/config/picolibc.opt +@@ -0,0 +1,33 @@ ++; Processor-independent options for picolibc. ++; ++; Copyright (C) 2022 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 ++; . ++ ++-oslib ++Driver Separate Alias(-oslib=) ++ ++-oslib= ++Driver Joined ++Specify an OS support library to load after libc. ++ ++-crt0 ++Driver Separate Alias(-crt0=) ++ ++-crt0= ++Driver Joined ++Specify an alternate startup file. diff --git a/packages/gcc/14.2.0/version.desc b/packages/gcc/14.2.0/version.desc new file mode 100644 index 00000000..e69de29b -- cgit v1.2.3