stdint.h is considered a freestanding headers by C, and a valid stdint.h
is required for certain parts of libstdc++' configuration, so we should
simply provide one when we have no other way (i.e. newlib or
user-specified sysroot) of getting one.

gcc/ChangeLog:

        * config.gcc: --target=*-elf --without-{newlib,headers} should
        provide stdint.h.
---
Evening,

Currently, freestanding *-elf toolchains without newlib will always produce
invalid stdint.h files, tripping up libstdc++ configure scripts (see PR104605).
This patch should make no-newlib no-headers always provide stdint.h.

Thanks.

 gcc/config.gcc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gcc/config.gcc b/gcc/config.gcc
index 555f257c2e7..6633910d2b7 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1079,6 +1079,11 @@ case ${target} in
   # Assume that newlib is being used and so __cxa_atexit is provided.
   default_use_cxa_atexit=yes
   use_gcc_stdint=wrap
+
+  case "${with_newlib}-${with_headers}" in
+  no-no) use_gcc_stdint=provide ;;
+  *) ;;
+  esac
   ;;
 esac
 
-- 
2.37.3

Reply via email to