From patchwork Thu Aug 17 18:59:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Gallager X-Patchwork-Id: 136081 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp1828663vqi; Fri, 18 Aug 2023 21:20:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEVb4ro6X2sfKLXSRB3RMBEoOOMIL/QCOIdKS1TfctMKilh8I1ySI/kVijC2ou/8WW4XWba X-Received: by 2002:a17:906:ef90:b0:99c:d069:d1f with SMTP id ze16-20020a170906ef9000b0099cd0690d1fmr634992ejb.66.1692418854682; 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=SOnMtTbxD8B8Zef4WqeS+X5BZjD568l9d636qv3sxBq4C3hT3zTHD2kivb6sgkLsLS q/NXyXU71gIsw7ydWj2cjp9sANqg1R1bwoxLCCr6amzUSnprV1oJu7MYQvl61pXiaKuq Ni+pfSRgkKPbshOUWollmUjQoydTHcnjDPqA0+EevYgo8J5LpQ6XIjgSUPmljSdDaUfl T1P/d9ZYGJv04q/ySh0P0MJ3CscQizo56kTztSgf/AnR8eQNIW5tnnt8UkWysfpwtrNF OKI9Z2N5GDJjBN9h8DDaTYXqzIDlJkioty4WSaXZ9B15OEe//V1aNwItwGG+CsndkU0j NUGA== 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=PRLCt1fbfWAKnRLO6PsEEmfsm8bkCV4DeWipsQq9DdzX0T8qlkX7nZsZf/oTHyai7d WV4ZdjBjOFGq5N3AV5zOOOe638QHcISbqoEUUyKyYRfodmS4uKPErZ41mznGaXZk1hjx Ya1ztezfUVpROPW1jyRq7+RpHXHqrgrWe0j6g10CX6KemTqerASqqZHti63dYQVypWHt FQolHscv0DT3CZ3MLqzGtz1AezHjJCgaMw99nSa+az0/bbxfteaHjMBS4Vt5Ffi6dJIe L3mpXR4+UFX7Hn9hmuiYHWnkFuQn4M1VqkubhLrulMMWlo+R0Hr1wRJQtMGKsAgWq1Ed 2ynw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=laE2zq4B; 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 m17-20020a170906161100b00992b6f26c0esi2468077ejd.672.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=laE2zq4B; 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 9E51D3836E9B for ; Sat, 19 Aug 2023 04:20:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9E51D3836E9B 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=laE2zq4Bg2Hpc4mUDtdRVQcsplbIcq+LTLta5+zKT++rbhohSqYtFCbWk+i7XD0Fe SWpTx1+kef8+Emxw+U96HNk77ZOVIFdxgiCIos3fY8BjopyfR15cLClbxFhWdZTWA3 5XRJcvYIV3bj9oSjNelvQB61G+ldoRent/lzCOQs= 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 293AF38582A3; Sat, 19 Aug 2023 04:19:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 293AF38582A3 Received: by Local-Admins-MacBook-Pro.local (Postfix, from userid 501) id C6F1D2F3587D4; Thu, 17 Aug 2023 15:00:04 -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:59:43 -0400 Message-Id: <20230817185942.93988-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=-1.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KHOP_HELO_FCRDNS, MAY_BE_FORGED, PDS_RDNS_DYNAMIC_FP, RCVD_IN_PBL, RCVD_IN_SORBS_DUL, RDNS_DYNAMIC, SPF_HELO_NONE, SPF_NEUTRAL, 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: 1774629793119048929 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; \