From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oo1-xc35.google.com (mail-oo1-xc35.google.com [IPv6:2607:f8b0:4864:20::c35]) by sourceware.org (Postfix) with ESMTPS id 04D0B3857685 for ; Wed, 2 Nov 2022 14:56:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 04D0B3857685 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oo1-xc35.google.com with SMTP id g15-20020a4a894f000000b0047f8e899623so2518579ooi.5 for ; Wed, 02 Nov 2022 07:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=MfgIp9Ztn0PSLry+pajECV5hJ48xvQTvIW1IGFgFSVE=; b=v5+Mztfn7YUnboZfw5gzAE83FGcTbfDR+YF9GtbeP1kSEGhtA6+iRqUfEEv6tkOLtB rxJcB7N3gqJaOTZCiKHrDqikQ/wYoRu2nDb28kqcAqCoFpuZE76TOLRjbNDUS7CeoaJ9 zH+Yz4m665+N6o/nX9hX3WnuJ03v2WRLJwnM+e3YdwOnGG5rnRch2hFxfsIkGbOXmWLH CautUj+jg2z3r7e8PHrZ2v3X34tLimj3jnKgRYgyYQD27k4wCW6gnSP3xyA4GFVKWp8N hlM/u5qXva1E0Y/k2MTnQiUNjfP1Ls29NQuDUgFgzQhPGOF2KPg4b1CGxNogJv1uQNwY jriA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MfgIp9Ztn0PSLry+pajECV5hJ48xvQTvIW1IGFgFSVE=; b=pHxNYUkRbyuPc352DtRsxELKT2pkVFpcrG8sY490TBUPcidCW4TGb77laXukcCvEVB yALts6qROE+ywRNztDm4MaHfeCuDt1nYBdZingUWjqG+kZ5BZoitZi9WewEO043u0+/J /BDQY/IdoGrLsV9sUzk7HEaeW+ruZMRB4t//RM8pHWWADej9z8Z7x9moFMXSrvBMivST 7BNqh+AeoC7v6a+33wutxl0eyTmgURY6eFmDOVuTwmNYNv7eddgqFHEBeI2GBtLo63td To6E28LDeHW5x3CEad0FuYqPPJ4voR9EOjn4aE005HEj3kWHm2hjKED2DIU+2w7GIa7N E8Dw== X-Gm-Message-State: ACrzQf0XWWochmnK0yzBuZqmBOmgz3apQlp/lfgg+HqbFTqEVbTJDMIE Jr0DZ1WvtJI3FSdoANEi+bBNwzl4wxhFf8SQ X-Google-Smtp-Source: AMsMyM6Gbr+irE43RSs/Oy5D8UEsVlCotXhjsslSERubgOCshKwSQcqTQUpcIgX4PIQ5cfJVGmHCHw== X-Received: by 2002:a05:6820:381:b0:49b:dee1:2677 with SMTP id r1-20020a056820038100b0049bdee12677mr5679320ooj.70.1667400974067; Wed, 02 Nov 2022 07:56:14 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c0:a9f4:967f:f7c:c187:85d7]) by smtp.gmail.com with ESMTPSA id 37-20020a9d0328000000b00661af2f9a1asm5205767otv.49.2022.11.02.07.56.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 07:56:13 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org, Fangrui Song Subject: [PATCH v2 2/4] Rewrite find_cxx_header config configure.ac Date: Wed, 2 Nov 2022 11:55:57 -0300 Message-Id: <20221102145559.1962008-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221102145559.1962008-1-adhemerval.zanella@linaro.org> References: <20221102145559.1962008-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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 List-Id: With clang If the main file is , the first non-main-file dependency is not listed in the -MP output. Although it was fixed on clang-16 [1], this change adds portability for older version. [1] https://github.com/llvm/llvm-project/commit/ff9576f74514b836e1ba0268409a2ecb919d7118 --- configure | 4 ++-- configure.ac | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure b/configure index fc3d7842de..e23ea95a49 100755 --- a/configure +++ b/configure @@ -5669,8 +5669,8 @@ fi # copy of those headers in Makerules. if test -n "$CXX"; then find_cxx_header () { - echo "#include <$1>" | $CXX -M -MP -x c++ - 2>/dev/null \ - | sed -n "\,$1:,{s/:\$//;p}" + echo "#include <$1>" | $CXX -H -fsyntax-only -x c++ - 2>&1 \ + | awk '$1 == "."{print $2}' } CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)" CXX_CMATH_HEADER="$(find_cxx_header cmath)" diff --git a/configure.ac b/configure.ac index 9fc1fb1c1c..7275b53345 100644 --- a/configure.ac +++ b/configure.ac @@ -1137,8 +1137,8 @@ AC_SUBST(CXX_SYSINCLUDES) # copy of those headers in Makerules. if test -n "$CXX"; then find_cxx_header () { - echo "#include <$1>" | $CXX -M -MP -x c++ - 2>/dev/null \ - | sed -n "\,$1:,{s/:\$//;p}" + echo "#include <$1>" | $CXX -H -fsyntax-only -x c++ - 2>&1 \ + | awk '$1 == "."{print $2}' } CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)" CXX_CMATH_HEADER="$(find_cxx_header cmath)" -- 2.34.1