diff mbox series

[2/3] Add newlib and picolibc as default C library choices

Message ID 20220903060707.1622470-3-keithp@keithp.com
State New
Headers show
Series [1/3] Allow default libc to be specified to configure | expand

Commit Message

Keith Packard Sept. 3, 2022, 6:07 a.m. UTC
Don't set the DEFAULT_LIBC variable for newlib configurations as that
is how it currently works for systems using newlib as the default.

Signed-off-by: Keith Packard <keithp@keithp.com>
---
 gcc/config.gcc | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gcc/config.gcc b/gcc/config.gcc
index bf838b1545d..6f8f13a811a 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -642,7 +642,7 @@  case ${target} in
 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=""
 
@@ -5789,6 +5789,17 @@  bionic)
 musl)
     default_libc=LIBC_MUSL
     ;;
+newlib)
+
+    # Newlib configurations don't set the DEFAULT_LIBC variable, so
+    # avoid changing those allowing --with-default-libc=newlib but
+    # don't actually set the DEFAULT_LIBC variable.
+
+    default_libc=
+    ;;
+picolibc)
+    default_libc=LIBC_PICOLIBC
+    ;;
 *)
     echo "Unknown libc in --with-default-libc=$with_default_libc" 1>&2
     exit 1