public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Arsen Arsenović" <arsen@aarsen.me>
To: gcc-patches@gcc.gnu.org
Cc: "Arsen Arsenović" <arsen@aarsen.me>
Subject: [PATCH] elf: ELF toolchain --without-{headers,newlib} should provide stdint.h
Date: Mon,  3 Oct 2022 22:35:44 +0200	[thread overview]
Message-ID: <20221003203543.154431-1-arsen@aarsen.me> (raw)

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	other threads:[~2022-10-03 20:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-03 20:35 Arsen Arsenović [this message]
2022-10-10 18:05 ` Ping: " Arsen Arsenović
2022-10-11  6:47   ` Ping: [PATCH] elf: ELF toolchain --without-{headers, newlib} " Richard Biener
2022-10-14 19:33     ` Arsen Arsenović

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221003203543.154431-1-arsen@aarsen.me \
    --to=arsen@aarsen.me \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).