Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2515759pxb; Mon, 11 Jan 2021 11:37:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFYJP0prQVRfYnVm1bvCjX6J0lB9bHUvnP2Gwa84bCkgNO5qMmN0RGAvMtapW5fDY/U+xB X-Received: by 2002:a17:906:234d:: with SMTP id m13mr717642eja.270.1610393866641; Mon, 11 Jan 2021 11:37:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610393866; cv=none; d=google.com; s=arc-20160816; b=XPMpUrhsRsTzpBQxl6R57fDX7cUPkLxOKihhfooK7FNpNIFmkvO+mda93iG9YUB+CM YcmBlxfv0pPHYop0Dn0KMwu9VCyPdORI3PROQBdzHdEDVe9FUmJzvXStUsPvjqSRZktx A0f89mzcBOn9HlSalDvRLc3LIAG4q6DJ4EwbF/JiVfl3nK7GSFoEN7Dnzfa/nMkFPK+A aJjdT0iHIRQD4+FNzPsJrTDbH+1U9hJDWiWWK9RMhs7poxF69WsO1G926KcobY8iRj1n Hy4R1sznWSnlc30+44W5IMvCLyeg/FchbX+dw5+P7hkdSLVRfYfttOCwjXwLFwb/egCs uiww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5n87tlf//wbzIK0eFiapoMfQ9AN1g8d2FAoAK9a2vxY=; b=BfgDLLk/wY0GB9FZJaPYCQpC4cVseTPCpeksSKi5VTgUccL69fXIMmaCsjh2yfLsSt DXWr96qilB0iV233JPO0ZBS67EfoklDdvz1AYtangXawk2vKmL+p+bXzkooV9TpV7piX HxOrExCAJAnU6WP08dFUsgxmKuz5vgrCNWzSI/WhRn45pOeoUsLdBO6lZPiirRqHIUFE zivPFnAwgjAqE+TPya+sg79gcXLumT7t2Vm3n3cGEz+inuJrCDBg503EaH4AG2eMzyNx nIGSmWJgbJ+Cnq3XACJnUvivEHrchvBqMboTOHEfnsoTepceMN+gkKgMEmZf0dVU/zI1 vhSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Rq4NY83B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c26si257079edv.182.2021.01.11.11.37.22; Mon, 11 Jan 2021 11:37:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Rq4NY83B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391225AbhAKTep (ORCPT + 99 others); Mon, 11 Jan 2021 14:34:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390813AbhAKTeo (ORCPT ); Mon, 11 Jan 2021 14:34:44 -0500 Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F4FAC061794; Mon, 11 Jan 2021 11:34:04 -0800 (PST) Received: by mail-il1-x12a.google.com with SMTP id x15so341238ilq.1; Mon, 11 Jan 2021 11:34:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=5n87tlf//wbzIK0eFiapoMfQ9AN1g8d2FAoAK9a2vxY=; b=Rq4NY83BuV9gdq7ymDniXgE3trbn7AuWPX5XYRuawZOf3jkN7iziyclvuU/QMCUHPU rmMU25jDfrKvPW4ayQTUxpimEJ9WzdPmc245vbt2wq69TSazRKSNXyLQqNADZOWd3xX/ +9IKJ92XGDBm8QOYOb84gmTJh5ufYhJHY+PNmZMmdZi4u+4naJWNhVj8pQoB2k+aDf3s wpiwxCk5b5dn7Mij0UywlCyVmBt/t71Dg90yxMnh32+PaYrcklD79sFo7axxUwaG08l/ w3X57MW4x9e5qBqVCgzbziPqgge1KEYgiMnnuYUzAlNeN/+/DyCVPfMH8pd/MYgouQja 4XYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=5n87tlf//wbzIK0eFiapoMfQ9AN1g8d2FAoAK9a2vxY=; b=SZRKpB4Ji+xtK5M3qTyanfb8moB3Z2HmD4gHaHw3Stf1lgn10htTJ94l35hSoBhrlI N/q9Usv1NA0g0nIjxWHMmU0LqlnXmMQPYDzNOWnrNMHmEcvhvKvvVUYUDefBnayIdPHe PssmUwOuEOzmv0c5NKydSRQviWEcdRBkC9OOLSABuKOMksmtvB4mRKahvg0MduJa6Eec 03kjC0OoKzHhLNDfnmxGsXMFYu8RZLd+/2iym5phXNPhCb8QFJ8uwkqtSnQsoqZsbUAD 2FtoRlsCIqWH1afSsSL9M4fmhts5X93IfljJX8eS3EUHJlu63VAwt+sFEGoBbOEW4E6B q7OQ== X-Gm-Message-State: AOAM532wQTwuF9cmXotDlXxsnVR9tj06n7XDeHK9yh+4D+exzqGeY6dz 669rQz/wc42Tsng8bgE11+M= X-Received: by 2002:a92:418d:: with SMTP id o135mr649615ila.213.1610393643713; Mon, 11 Jan 2021 11:34:03 -0800 (PST) Received: from ubuntu-m3-large-x86 ([2604:1380:45f1:1d00::1]) by smtp.gmail.com with ESMTPSA id 17sm360669ilt.15.2021.01.11.11.34.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 11:34:02 -0800 (PST) Date: Mon, 11 Jan 2021 12:34:00 -0700 From: Nathan Chancellor To: Masahiro Yamada Cc: Michal Marek , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Linux Kernel Mailing List , Linux Kbuild mailing list , Networking , bpf , Sedat Dilek Subject: Re: [PATCH] bpf: Hoise pahole version checks into Kconfig Message-ID: <20210111193400.GA1343746@ubuntu-m3-large-x86> References: <20210111180609.713998-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 12, 2021 at 04:19:01AM +0900, Masahiro Yamada wrote: > On Tue, Jan 12, 2021 at 3:06 AM Nathan Chancellor > wrote: > > > > After commit da5fb18225b4 ("bpf: Support pre-2.25-binutils objcopy for > > vmlinux BTF"), having CONFIG_DEBUG_INFO_BTF enabled but lacking a valid > > copy of pahole results in a kernel that will fully compile but fail to > > link. The user then has to either install pahole or disable > > CONFIG_DEBUG_INFO_BTF and rebuild the kernel but only after their build > > has failed, which could have been a significant amount of time depending > > on the hardware. > > > > Avoid a poor user experience and require pahole to be installed with an > > appropriate version to select and use CONFIG_DEBUG_INFO_BTF, which is > > standard for options that require a specific tools version. > > > > Suggested-by: Sedat Dilek > > Signed-off-by: Nathan Chancellor > > > > I am not sure if this is the right direction. > > > I used to believe moving any tool test to the Kconfig > was the right thing to do. > > For example, I tried to move the libelf test to Kconfig, > and make STACK_VALIDATION depend on it. > > https://patchwork.kernel.org/project/linux-kbuild/patch/1531186516-15764-1-git-send-email-yamada.masahiro@socionext.com/ > > It was rejected. > > > In my understanding, it is good to test target toolchains > in Kconfig (e.g. cc-option, ld-option, etc). > > As for host tools, in contrast, it is better to _intentionally_ > break the build in order to let users know that something needed is missing. > Then, they will install necessary tools or libraries. > It is just a one-time setup, in most cases, > just running 'apt install' or 'dnf install'. > > > > Recently, a similar thing happened to GCC_PLUGINS > https://patchwork.kernel.org/project/linux-kbuild/patch/20201203125700.161354-1-masahiroy@kernel.org/#23855673 > > > > > Following this pattern, if a new pahole is not installed, > it might be better to break the build instead of hiding > the CONFIG option. > > In my case, it is just a matter of 'apt install pahole'. > On some distributions, the bundled pahole is not new enough, > and people may end up with building pahole from the source code. This is fair enough. However, I think that parts of this patch could still be salvaged into something that fits this by making it so that if pahole is not installed (CONFIG_PAHOLE_VERSION=0) or too old, the build errors at the beginning, rather at the end. I am not sure where the best place to put that check would be though. Cheers, Nathan