From patchwork Thu Aug 17 18:40:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Gallager X-Patchwork-Id: 136080 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp1828664vqi; Fri, 18 Aug 2023 21:20:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG6lzRuvcYu+Xc+9UyCGDRR/kt0HGIf2XBxxIBt3Pjt6I0nkOKDMKmdeHyME4Aku/DncQZq X-Received: by 2002:a17:906:2253:b0:99c:53f:1dc7 with SMTP id 19-20020a170906225300b0099c053f1dc7mr725958ejr.54.1692418854685; Fri, 18 Aug 2023 21:20:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692418854; cv=none; d=google.com; s=arc-20160816; b=bkVfyE9fUhDClGW3bEwMIkBy8JachaVeckyWyewq8S81Qb9MUkMrOruAF1KHthhMAU EmbsTFImI1S+TWG17KXrs+RWRNmD3G9unXe+WXGdmDNoNjnMDd3fNzjasz/CNUj3zFBz YfL2a8jE90r9tIrXWjQE1CoZsRx653gLDOfPDivWn+98Yao7qGpG6Syx0AmG6i33nT7q Cry/fP9r52zDJAKx7Lr+VU+26VUCYLIX03+JLNa83zQPPbDbeOYWcyt3qi9t7akPuGUT P1PIGGkk0nk+V3WLDpQQvxPxQtdR+/uC0aTtu2d55yM7Es+M/8SbhF3nYUBkmnuvxZ6f eS9A== 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:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=GJkmBYiwA35k0BpZAa/WY49T7DRUF5VLllLNIaoU7jE=; fh=K4/NplUadreAFDuxu9vWACZdb54PgfTG9ybBNsyVaJs=; b=soD4TZabL7FYSoUr3vsrQj9t6Pq1GwpC7hsCGtVFQfoPKDCa41Z9sw6IFSIV5y53iM LVOukh2Ojq9dYVuoa/BPgxZ9CE0UgfoNXOEa8IJy1mW5CSX/XaaTVLfUPswnLb2CRR8g MFWx1wS0VWR3B9oLZGGpnXetKBL5rHd+CS5+60KJacExo4of6ZfMlgvhvF54TINeN9rW x5/S9GAcKTFYIWPEJoDEPCF9ZnU5lWMXj+GdYf2v46cLvg4SM8ZVwfupdIsOEVjbHnzf y9PSxLR+v8b/1CpxzWWCVVAZaKP/EwLcTFHdjAv/4uLlnKai3zo78b8bhPtN7QhM16q0 VyXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=kn0dUoks; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id mh9-20020a170906eb8900b0099caf73097esi2522900ejb.226.2023.08.18.21.20.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Aug 2023 21:20:54 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=kn0dUoks; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 9E4FA3839DE7 for ; Sat, 19 Aug 2023 04:20:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9E4FA3839DE7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692418837; bh=GJkmBYiwA35k0BpZAa/WY49T7DRUF5VLllLNIaoU7jE=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=kn0dUoks95DnWhq17eWXM4HpjOKEZwD67/FhG5/qhdtMXht2ENV+Rms5oXSJFg43I fzmGQ6rh5ssrq6/j6j5p2WeJXlx2bq03UHa+H4IdE8MQ6FeAn8oiX5xV5Yhu9pQF2Q Ob3ZNvKQngp4wZEXxNTvSWcDxXj5OE+y30eZOEIM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from Local-Admins-MacBook-Pro.local (unknown [72.71.230.63]) by sourceware.org (Postfix) with ESMTP id 2C134385C426; Sat, 19 Aug 2023 04:19:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2C134385C426 Received: by Local-Admins-MacBook-Pro.local (Postfix, from userid 501) id 364C02F356DC9; Thu, 17 Aug 2023 14:42:01 -0400 (EDT) To: gcc-patches@gcc.gnu.org Cc: iains@gcc.gnu.org, Eric Gallager Subject: [PATCH] improve error when /usr/include isn't found [PR90835] Date: Thu, 17 Aug 2023 14:40:32 -0400 Message-Id: <20230817184031.92165-1-egallager@gcc.gnu.org> X-Mailer: git-send-email 2.32.0 (Apple Git-132) MIME-Version: 1.0 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KHOP_HELO_FCRDNS, MAY_BE_FORGED, NO_DNS_FOR_FROM, PDS_RDNS_DYNAMIC_FP, RCVD_IN_PBL, RCVD_IN_SORBS_DUL, RDNS_DYNAMIC, SPF_HELO_NONE, SPF_NONE, 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: Eric Gallager via Gcc-patches From: Eric Gallager Reply-To: Eric Gallager Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774629792672878263 X-GMAIL-MSGID: 1774629792672878263 This is a pretty simple patch that ought to help Darwin users understand better why their build is failing when they forget to pass the --with-sysroot= flag to configure. gcc/ChangeLog: PR target/90835 * Makefile.in: improve error message when /usr/include is missing --- gcc/Makefile.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 97e5450ecb5..535c475dfab 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -55,6 +55,7 @@ MAKEOVERRIDES = # ------------------------------- build=@build@ +build_os=@build_os@ host=@host@ host_noncanonical=@host_noncanonical@ host_os=@host_os@ @@ -3240,8 +3241,13 @@ stmp-fixinc: gsyslimits.h macro_list fixinc_list \ multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \ fix_dir=include-fixed$${multi_dir}; \ if ! $(inhibit_libc) && test ! -d ${BUILD_SYSTEM_HEADER_DIR}; then \ - echo The directory that should contain system headers does not exist: >&2 ; \ + echo "The directory (BUILD_SYSTEM_HEADER_DIR) that should contain system headers does not exist:" >&2 ; \ echo " ${BUILD_SYSTEM_HEADER_DIR}" >&2 ; \ + case ${build_os} in \ + darwin*) \ + echo "(on darwin this usually means you need to pass the --with-sysroot flag to configure to point it to where the system headers are actually put)" >&2; \ + ;; \ + esac; \ tooldir_sysinc=`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`; \ if test "x${BUILD_SYSTEM_HEADER_DIR}" = "x$${tooldir_sysinc}"; \ then sleep 1; else exit 1; fi; \