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: 1662 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1115615wrs; Mon, 3 Oct 2022 13:36:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6RCLxAYOjz+BOn4aH+Sv+6mRycQqqhppC/VhQsbQX+NjRDMGSXt9q0s9NSO2nZ/36s6pTf X-Received: by 2002:a17:907:1c8a:b0:782:1a0d:3373 with SMTP id nb10-20020a1709071c8a00b007821a0d3373mr16148566ejc.135.1664829414870; Mon, 03 Oct 2022 13:36:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664829414; cv=none; d=google.com; s=arc-20160816; b=EwPq2XBKA+NcuASfVZaLDjawFx5FMJGa07yo53SD5pVH/QCn5SBJ4f8PMt2/X7AjhV f4Gzz1347GAmCscKFwL6blZcnUHvupLAUzvVKA+aROEltbvO6gJLUVtLTIjdl9/nNRkZ JgFNRa3toCir99EA7lVvojV8QB7SKCl46xng+V3vfR/cxgtSPSmwYrGK4pbrsKdnClzV P4xnHtmFhqZ61psvFEjUnLbjoZmS3YK6WFR0FQdaV5L7rEeM4+780G7tuwIusDA6+Tpl iz5LR7nyo7mam+d6m/8Ow6Tfnnk65jLaqrbJ80MhoEuZvp5yicRNxMQP0iRSXe4kx+rM ZC7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=GLIgQVs5igT4s9LNh3J93Hkog+cVp+IC97e1kccGYSg=; b=MTVnmmpi6x/dmDTiCbwBNHheohrlTVNhX4orflYvnabYle9yJskk0I+BttK70Oujp4 CfMDPL7MqnrN6Mt1RVNnwnTGrwirDi4svbPWfwQMT1yuW50DH9RdmX5WxE45kzs6rCd1 O2w2TPfK74O7+laXqCOkWvXtilFHrMG8y8wC+bRWmqXjNso53AUX//owK4GTA0dZkbfy rseEGOxdjbc+KSCvqQFb1/wEteyjXbRtGT9hJkJfA0VZe4GnRwx+nt9Bp7BD4mPiCVX7 /MHwuzcFEZjrK7cWgd1OjZAT/2e7H399TeiQFPLrjIqdtDkKgyrMnf07pMEvjsNRR+Sp fe8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ZHVLBlXf; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id dm16-20020a170907949000b00730a20dd838si8940917ejc.84.2022.10.03.13.36.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 13:36:54 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ZHVLBlXf; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C06383853545 for ; Mon, 3 Oct 2022 20:36:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C06383853545 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664829408; 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=ZHVLBlXf16xRL/PZ3GUUfab2E+yWF7qKCRb45MS9FqRg3ZREhWCD5n3DXDaerrugK ayHv0dQMxfCW74Czaz0cS0oshJ5tzrzwQedhzjmE6aIolaT4/1kYw6T6If5DseIkJr c5+EabHd2sQCHVf+BfGHozuwmipdjqgCYp3I7t3U= 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1745700168169876573?= X-GMAIL-MSGID: =?utf-8?q?1745700168169876573?= 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