From mboxrd@z Thu Jan 1 00:00:00 1970 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 0F693C64ED6 for ; Tue, 14 Feb 2023 09:44:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232011AbjBNJoj (ORCPT ); Tue, 14 Feb 2023 04:44:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231710AbjBNJoi (ORCPT ); Tue, 14 Feb 2023 04:44:38 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F48C113F7; Tue, 14 Feb 2023 01:44:36 -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 ams.source.kernel.org (Postfix) with ESMTPS id D3EB8B81BF4; Tue, 14 Feb 2023 09:44:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2965AC433D2; Tue, 14 Feb 2023 09:44:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676367873; bh=FOmsk5fnXqo2RHs4yKki8c5ZfBF1FXU8FSjoNcYsGtE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=LFPC2xCHyZEp+4VSCp/bh0BjqK/nLUOVJuP44VcN3L6g+/v7hByLQ08R6Qw1JLtiE lmWOAKkcIGrpkyOknb7ezKfSurGekGVRYptLz8LM2H+SpRKrW7pTcWWQvjH2lwTVrS i5VH1nQmrRh7+iGeMos/QYBsK8HL95Bxc/KwclK8dsRWqASBi7QXOM1bwQG4tPekUt tx01+zA4cC0ij4RJYk6qOTcPd0ZmM1t+Q3sU4P1fTVIoQUGX2X1NKDm9lkQIdRzstG hxADpk4AnrP/BziRQ/d6cavRWEZuoi+SgkEkd/eenlIKudozD4YVdbv2OaCrfjRTES Ws/yVWPpMwCeg== From: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= To: Zachary Leaf , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , bpf@vger.kernel.org, netdev@vger.kernel.org Cc: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= , Jean-Philippe Brucker , linux-kselftest@vger.kernel.org, Anders Roxell , linux-riscv@lists.infradead.org, Quentin Monnet , linux-morello@op-lists.linaro.org Subject: Re: [PATCH bpf-next] selftests/bpf: Cross-compile bpftool In-Reply-To: <9d83e21c-01c8-9729-0e2b-54d405b6b1ee@arm.com> References: <20230210084326.1802597-1-bjorn@kernel.org> <87pmad63jb.fsf@all.your.base.are.belong.to.us> <9d83e21c-01c8-9729-0e2b-54d405b6b1ee@arm.com> Date: Tue, 14 Feb 2023 10:44:30 +0100 Message-ID: <87y1p08ttt.fsf@all.your.base.are.belong.to.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Zachary Leaf writes: > On 13/02/2023 14:30, Bj=C3=B6rn T=C3=B6pel wrote: >> Bj=C3=B6rn T=C3=B6pel writes: >>=20 >>> From: Bj=C3=B6rn T=C3=B6pel >>> >>> When the BPF selftests are cross-compiled, only the a host version of >>> bpftool is built. This version of bpftool is used to generate various >>> intermediates, e.g., skeletons. >>> >>> The test runners are also using bpftool. The Makefile will symlink >>> bpftool from the selftest/bpf root, where the test runners will look >>> for the tool: >>> >>> | ... >>> | $(Q)ln -sf $(if $2,..,.)/tools/build/bpftool/bootstrap/bpftool \ >>> | $(OUTPUT)/$(if $2,$2/)bpftool >>> >>> There are two issues for cross-compilation builds: >>> >>> 1. There is no native (cross-compilation target) build of bpftool >>> 2. The bootstrap variant of bpftool is never cross-compiled (by >>> design) >>> >>> Make sure that a native/cross-compiled version of bpftool is built, >>> and if CROSS_COMPILE is set, symlink to the native/non-bootstrap >>> version. >>=20 >> ...and the grand master plan is to add BPF CI support for riscv64, where >> this patch a prerequisite to [1]. I would suspect that other platforms >> might benefit from cross-compilation builds as well. > > Similar use case. There also seems to be a lot of issues building these > tests out of tree. > > I have some potential fixes up to 6.1 but linux-next seems to have > introduced a few more issues on top. Ah, yes. FWIW, the BPF CI builds the selftests *in-tree*, so with this patch (and my PRs) the BPF CI is capable of cross-compiling. Bj=C3=B6rn