From patchwork Mon Oct 3 20:35:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Arsen_Arsenovi=C4=87?= X-Patchwork-Id: 58312 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D69AA3853827 for ; Mon, 3 Oct 2022 20:36:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D69AA3853827 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664829394; bh=GLIgQVs5igT4s9LNh3J93Hkog+cVp+IC97e1kccGYSg=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=fkpWtYz7DQO0w2r1Lxm9pdO1QS0MKXLNcZRzv+CG3SLt037/QtCWc9+LYF/ZRqBC0 7kVW/FZ1fDOZTdPPXmljRtYgGk8nyv3KdB50iip2L2BC+gy/3Eeaa0ZM8gddIC5iuX DZI7U+/C2fl9jmKABcZtO74gRixPOdgCz1TmRIK8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [IPv6:2001:67c:2050:0:465::202]) by sourceware.org (Postfix) with ESMTPS id F10A03853827 for ; Mon, 3 Oct 2022 20:36:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F10A03853827 Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4MhCK95tVLz9sWQ; Mon, 3 Oct 2022 22:35:57 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [PATCH] elf: ELF toolchain --without-{headers, newlib} should provide stdint.h Date: Mon, 3 Oct 2022 22:35:44 +0200 Message-Id: <20221003203543.154431-1-arsen@aarsen.me> MIME-Version: 1.0 X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_INFOUSMEBIZ, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Arsen_Arsenovi=C4=87_via_Gcc-patches?= From: =?utf-8?q?Arsen_Arsenovi=C4=87?= Reply-To: =?utf-8?q?Arsen_Arsenovi=C4=87?= Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" 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