Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp17664784rwd; Tue, 27 Jun 2023 06:13:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5JSr0FRVdr5UgLIpKHl2kKtp6IPGKatnVjsYutMWMqAaUkWHkqiuqXnlHimLP3NfeuLZNm X-Received: by 2002:a17:903:244e:b0:1b7:f24c:3ba1 with SMTP id l14-20020a170903244e00b001b7f24c3ba1mr5217921pls.68.1687871625044; Tue, 27 Jun 2023 06:13:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687871625; cv=none; d=google.com; s=arc-20160816; b=LidMoGrKzFX5XKbBI14nuQzH561L4WJAL5nwtNpwn8OhpFOeXcXfSEOdadpSnzYAgk LK0hXieKEZ6d5RT+QFNxhwbnpdBif+Z9/Nc/YlysJothghVeYFwU6WonawXqXSJQzPy6 xakWFjyog2E7GGxBnSit4g1RvITkBwqKRnKvsYsif6f+gHcWI4z8KGwFMuqa0sjRPKi5 7o8b+dkT8YxK42Aubc7fjuZd2EaUYBZ61mhAuL7sWpiu4RZuZTv36AI7zy7q+qjZ8oit lb2/vWaJBaTs/GzPPLrDu0Mq1x/br4HlMppb5rITtAuKKARGpzZVEaUUKGvW57BDEqpt kWPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ugwfr31oRWz/lHQAl32dTGxCe1vvjZq9KZWzyGVfjck=; fh=LXvh4ZKpO2BrukjxFmrF34mf+AP7C4p0jztOvURxOLg=; b=qFarMvPreAosRRyW2ROb0XJrc3VISkkM7BvZJt4LQ48TduBQc51ozUcHJPX/w9Yu0C yQpmUaAeqirOb3AUyD3TWzYMPOCQRXyB163QI2h4QixngdERdIZ0Z2JDiBSdI+x5Vy0D oB1T7FIeajy9im5r6XYD4/QJHnPPFOAQ2ORnDX407aKtNLD0DEcXD7TV9J6Dv2dVfNJ1 9JoyIKkoz68XwCSmEH6kXFSUMXkqsCzr+HrUCq2vssxBmk4M+fLUFfJ2DXpFVohsWpGC SZ91JyqMRET/6718vUElaLmDL3Rjgmpq2PFOMrpM8NQVCUgHJsgZ8cLMQi4fXPsqH+T6 QFnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=LzOF1JD3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id je4-20020a170903264400b001a99b9d767csi6779476plb.166.2023.06.27.06.13.17; Tue, 27 Jun 2023 06:13:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=LzOF1JD3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230475AbjF0NBo (ORCPT + 99 others); Tue, 27 Jun 2023 09:01:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230193AbjF0NBi (ORCPT ); Tue, 27 Jun 2023 09:01:38 -0400 Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3455A26BA; Tue, 27 Jun 2023 06:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1687870895; bh=Gds07JdhXbkbt8/Vhe4lS60dTh4hWxzow1iLVsGOiF8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LzOF1JD38e5ptOv8EY2oRvZo6rAOenwsat1S8yfICrnQ8sowG1UxSDKRnZpJPSV9S jgqesWHPdoZTMdIarcEOYlBhufEP9yzxBfrbLwhltOsxKr5oMBw8aOOtmIqo8B/wC8 Tm6SKa83zjepp0egjCSwm4XBQGtEleJt1fqBnYBc= Received: from ld50.lan (unknown [101.88.25.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id 4DF19605CA; Tue, 27 Jun 2023 21:01:35 +0800 (CST) From: WANG Xuerui To: Huacai Chen Cc: WANG Rui , Nathan Chancellor , Xi Ruoyao , loongarch@lists.linux.dev, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, linux-kernel@vger.kernel.org, WANG Xuerui Subject: [PATCH 2/2] LoongArch: Include KBUILD_CPPFLAGS in CHECKFLAGS invocation Date: Tue, 27 Jun 2023 21:01:22 +0800 Message-Id: <20230627130122.1491765-3-kernel@xen0n.name> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230627130122.1491765-1-kernel@xen0n.name> References: <20230627130122.1491765-1-kernel@xen0n.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: WANG Xuerui This is a port of commit 08f6554ff90e ("mips: Include KBUILD_CPPFLAGS in CHECKFLAGS invocation") to arch/loongarch, for fixing cross-compilation of Linux/LoongArch with Clang, where previously the `--target` flag would no longer be present for the CHECKFLAGS cc invocation leading to build failure. Reported-by: Nathan Chancellor Link: https://github.com/ClangBuiltLinux/linux/issues/1787#issuecomment-1608306002 Signed-off-by: WANG Xuerui --- arch/loongarch/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile index a63683da3bcf..09ba338a64de 100644 --- a/arch/loongarch/Makefile +++ b/arch/loongarch/Makefile @@ -112,7 +112,7 @@ KBUILD_CFLAGS += -isystem $(shell $(CC) -print-file-name=include) KBUILD_LDFLAGS += -m $(ld-emul) ifdef CONFIG_LOONGARCH -CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \ +CHECKFLAGS += $(shell $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \ grep -E -vw '__GNUC_(MINOR_|PATCHLEVEL_)?_' | \ sed -e "s/^\#define /-D'/" -e "s/ /'='/" -e "s/$$/'/" -e 's/\$$/&&/g') endif -- 2.40.0