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

Message ID 7fa04bf66973de28961edeef470266caeaa348fc.1675579641.git.keithp@keithp.com
State New
Headers
Series picolibc: Add picolibc linking help (v3) |

Commit Message

Keith Packard Feb. 5, 2023, 7:10 a.m. UTC
  Signed-off-by: Keith Packard <keithp@keithp.com>
---
 gcc/config.gcc | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
  

Patch

diff --git a/gcc/config.gcc b/gcc/config.gcc
index 0679a76bebb..84bca8df615 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -661,7 +661,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=""
 
@@ -5879,6 +5879,15 @@  bionic)
 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
+    ;;
 "")
     ;;
 *)