From patchwork Tue Nov 15 18:20:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= X-Patchwork-Id: 13044064 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7A0DC433FE for ; Tue, 15 Nov 2022 18:21:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230494AbiKOSVZ (ORCPT ); Tue, 15 Nov 2022 13:21:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230394AbiKOSVV (ORCPT ); Tue, 15 Nov 2022 13:21:21 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8ED1926127; Tue, 15 Nov 2022 10:21:20 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2A91961984; Tue, 15 Nov 2022 18:21:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 258E5C4347C; Tue, 15 Nov 2022 18:21:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668536479; bh=kVzmN1nhvJ7rXQ8CtIjwZxxIsXnCovpfzTGFioT4v9U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ma3yBe1TSehHWYD1ASpuWsoYAedQbCS84Xf7g4d9vwu4EvXET9EAEnphGu15H5K70 qKydZKkbHbfgNIFWIi8eL8SFvTG0lGFS7Ynyzqfl7jl+v8pWSbTEupW1NGTZM4nfj6 cyq70hQGLPgmd/JaHe29ZGXUphBTPqYRvMXA7Kw5k/Pmywv8mOQEffIiaWWGWxz8PY RaSC5f2rq3BnV0EzOacujI1/bx4gTUuylISxwjNhMLGIFoRn8k3XkTixoXQ3vgZ2JW 5UJaoDMGfE7gED5rGXdVY0YySZhG3DS4zeo8JhvcUVymdJNrYJS7i/IDl0lZ9Jf/S1 vnnvIuaaDepYQ== From: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= To: bpf@vger.kernel.org, Andrii Nakryiko , Alexei Starovoitov , Daniel Borkmann Cc: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , linux-riscv@lists.infradead.org, netdev@vger.kernel.org, Anders Roxell , Mykola Lysenko , linux-kselftest@vger.kernel.org Subject: [PATCH bpf 2/2] selftests/bpf: Pass target triple to get_sys_includes macro Date: Tue, 15 Nov 2022 19:20:51 +0100 Message-Id: <20221115182051.582962-2-bjorn@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221115182051.582962-1-bjorn@kernel.org> References: <20221115182051.582962-1-bjorn@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org From: Björn Töpel When cross-compiling [1], the get_sys_includes make macro should use the target system include path, and not the build hosts system include path. Make clang honor the CROSS_COMPILE triple. [1] e.g. "ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- make" Signed-off-by: Björn Töpel Tested-by: Anders Roxell --- tools/testing/selftests/bpf/Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 8f8ede30e94e..a2a1eae75820 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -309,9 +309,9 @@ $(RESOLVE_BTFIDS): $(HOST_BPFOBJ) | $(HOST_BUILD_DIR)/resolve_btfids \ # Use '-idirafter': Don't interfere with include mechanics except where the # build would have failed anyways. define get_sys_includes -$(shell $(1) -v -E - &1 \ +$(shell $(1) $(2) -v -E - &1 \ | sed -n '/<...> search starts here:/,/End of search list./{ s| \(/.*\)|-idirafter \1|p }') \ -$(shell $(1) -dM -E -