aboutsummaryrefslogtreecommitdiff
path: root/packages/gcc/14.3.0/0005-Allow-default-libc-to-be-specified-to-configure.patch
diff options
context:
space:
mode:
authorChris Packham <judge.packham@gmail.com>2025-05-25 10:28:35 +1200
committerChris Packham <judge.packham@gmail.com>2025-05-27 09:08:17 +1200
commit9a4a376bfb34e542003ca87008fc13f92fd9ead8 (patch)
tree30e6d5fc33125a724a2a37490100f0c9c23232b9 /packages/gcc/14.3.0/0005-Allow-default-libc-to-be-specified-to-configure.patch
parentd46ae2bc929fe8da2c26f8444c5f8aeb4f466e62 (diff)
downloadcrosstool-ng-9a4a376bfb34e542003ca87008fc13f92fd9ead8.tar.gz
crosstool-ng-9a4a376bfb34e542003ca87008fc13f92fd9ead8.tar.bz2
crosstool-ng-9a4a376bfb34e542003ca87008fc13f92fd9ead8.zip
gcc: Update GCC 14.2.0 -> 14.3.0
https://gcc.gnu.org/pipermail/gcc-announce/2025/000186.html Add the new version. Drop the patches that have been added upstream and regenerate the rest. Signed-off-by: Chris Packham <judge.packham@gmail.com>
Diffstat (limited to 'packages/gcc/14.3.0/0005-Allow-default-libc-to-be-specified-to-configure.patch')
-rw-r--r--packages/gcc/14.3.0/0005-Allow-default-libc-to-be-specified-to-configure.patch141
1 files changed, 141 insertions, 0 deletions
diff --git a/packages/gcc/14.3.0/0005-Allow-default-libc-to-be-specified-to-configure.patch b/packages/gcc/14.3.0/0005-Allow-default-libc-to-be-specified-to-configure.patch
new file mode 100644
index 00000000..b55b8a1b
--- /dev/null
+++ b/packages/gcc/14.3.0/0005-Allow-default-libc-to-be-specified-to-configure.patch
@@ -0,0 +1,141 @@
+From d87c4fb35576c61b75c0a003f9bbccea8321b3a3 Mon Sep 17 00:00:00 2001
+From: Keith Packard <keithp@keithp.com>
+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 <keithp@keithp.com>
+---
+ gcc/config.gcc | 48 ++++++++++++++++++++++++++++++++++++++++--------
+ gcc/configure.ac | 4 ++++
+ 2 files changed, 44 insertions(+), 8 deletions(-)
+
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index a3566f5c77da..f993b4b26c4c 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -695,6 +695,8 @@ esac
+ # 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 @@ case ${target} in
+ 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 ${target} in
+ 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 @@ csky-*-*)
+
+ 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 @@ powerpc*-wrs-vxworks7r*)
+ 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 @@ i[34567]86-*-* | x86_64-*-*)
+ 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
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index cb743b5a875a..5213bf64a6d4 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -2561,6 +2561,10 @@ if { { test x$host != x$target && test "x$with_sysroot" = x ; } ||
+ 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.
+--
+2.49.0
+