Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp339557pxm; Wed, 2 Mar 2022 16:47:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJwVAA0Q4bpl4TQrL/FZrogkLba0AJFNbPTQI3f7RCM+B1lA5bN/0BS33yf/l3/i5DWDTfE4 X-Received: by 2002:a17:902:bd88:b0:14f:8ddf:e373 with SMTP id q8-20020a170902bd8800b0014f8ddfe373mr32679330pls.89.1646268471772; Wed, 02 Mar 2022 16:47:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646268471; cv=none; d=google.com; s=arc-20160816; b=AqK2dLdYoF8Fb1ksMVNiSNdEZHoyAJa8+0RgMrWenJdzywONKcahqBUwWRKm+Dfkge bcXWDLyPc1V/gheJNnrBDnYFFkR9bYaE8VlXIbJQE+Xies7va/v3OnkB6tGbooiyiQp9 DXRvjA4ETTwmS8hrU3K/Knbz5dSB59OdMeNtWs+J98d9BXbBtTJP3Sqpn/21hhgETIvW iaCtnif0c6TKRVBWgcw6zB3eH58Ynj8Ez5qLqDUKz8GAk84Y25QJDzQ+o24bn+jYwYDU kIP0InydsuLmgidNTYp4v0Y+Ge7PQyL9NtU0tzy3VbIf8gv9dUiq5MCrJMHzT/ol2stm qEfg== 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=jiVdJeDoLwQpICgbJfPUxKiHkSDi4LNXBrJ/L+vsKOw=; b=hekJ89RRaBSPfG/u371uAvGoMgCH8BB/emsJlhPCYpoUJyk2OUI24G9+bF3TBb7pfX UgFritVGrRP5oNrZ9Km0sHxtu3SRR71Xme2hAPsVtDgARvAnHLr2VN+NaFUU0zYVNg2X pFwX2Nb2i3AiY/0cbRe5oi9m094dZLgPT7dDJh5V6Y6Ihjku02+fB8gsiRA573iTkZg1 LxlXJvsp3tYGk+ndL4xPVlQJN5+mGBm9U/V7qjv4ASV9EKx3QMmoEHS6z36KGAQKIlaX dWC+EFgGy6MXnJJvToDTAmZq5Iwth7TXSMRsnDg5aOWJ7ZywacP03pVngJnRtcyPM5mx hLJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SSZjuQHC; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id j15-20020a17090a840f00b001bc4437df2asi6498043pjn.106.2022.03.02.16.47.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 16:47:51 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SSZjuQHC; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4551FC5D8F; Wed, 2 Mar 2022 16:08:40 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230005AbiCCAJG (ORCPT + 99 others); Wed, 2 Mar 2022 19:09:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230011AbiCCAJD (ORCPT ); Wed, 2 Mar 2022 19:09:03 -0500 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5B4D33E33 for ; Wed, 2 Mar 2022 16:08:18 -0800 (PST) Received: by mail-il1-x12b.google.com with SMTP id b5so84953ilj.9 for ; Wed, 02 Mar 2022 16:08:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=jiVdJeDoLwQpICgbJfPUxKiHkSDi4LNXBrJ/L+vsKOw=; b=SSZjuQHCwyqlk9e6Fm/9hketAWCO5Am0rg1ge/DMoNXYSFjsC2IJ5GWXs8qQyjpN+R ndZ+np9KbbpyYhUvKTeqHahIUuF30OUpsqa2LNF/+NTgaillMi+7v/rjr0oviRv0q3Br uIXjMWADlr6xgzsKI7sBYja1dFSuzfCel0dEA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jiVdJeDoLwQpICgbJfPUxKiHkSDi4LNXBrJ/L+vsKOw=; b=Gh5zdDPIzdbKzcsoCA0sYbv6iwPNilxy89097Y+lIIPs1I5fAY4bUtE6im69bGBSX5 hLskqqDyeJFgHnPeTwOqvElkxGk9fFfcLMia3ZYMh9w5zJ1PExeWDQpsiL5ffZqGt4W0 05tRFTnr6oDl8Azi3FeFo5QD/myw4yfCmVa+xaO9dGZSv0QZLsXRY/b2GFzo+iLy7xjy lAZk6zbQZoHYzNMzV+Eb44Q+lUhTLVx/hDjywGS9oFsA9cx9U585wiSA9CCxWrfubptt r0llcdWD7u/EYsqETZfgWc1jU3FIzXgZ9NaXBASc0HwU4FQKnAth3XVY2sLaFe2jpn8T 1HlQ== X-Gm-Message-State: AOAM533M4LAZL6gfoHDJSmwWOo8GEEPQhpSeZL1CZv9zvJ0BXW5x1DSJ oiSpDwq/lnwW3Y9QFPipdvfIidMcmQQtyQ== X-Received: by 2002:a65:41c3:0:b0:363:5711:e234 with SMTP id b3-20020a6541c3000000b003635711e234mr27821213pgq.386.1646262046040; Wed, 02 Mar 2022 15:00:46 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id lk9-20020a17090b33c900b001bc7c2dfcdbsm112754pjb.37.2022.03.02.15.00.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 15:00:45 -0800 (PST) Date: Wed, 2 Mar 2022 15:00:44 -0800 From: Kees Cook To: Nathan Chancellor Cc: Nick Desaulniers , Peter Zijlstra , x86@kernel.org, joao@overdrivepizza.com, hjl.tools@gmail.com, jpoimboe@redhat.com, andrew.cooper3@citrix.com, linux-kernel@vger.kernel.org, samitolvanen@google.com, mark.rutland@arm.com, alyssa.milburn@intel.com, mbenes@suse.cz, rostedt@goodmis.org, mhiramat@kernel.org, alexei.starovoitov@gmail.com, Masahiro Yamada , Linux Kbuild mailing list , llvm@lists.linux.dev Subject: Re: [PATCH v2 01/39] kbuild: Fix clang build Message-ID: <202203021459.55F4992@keescook> References: <20220224145138.952963315@infradead.org> <20220224151322.072632223@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On Wed, Mar 02, 2022 at 02:15:45PM -0700, Nathan Chancellor wrote: > Sounds good, tentative patch attached, it passes all of my testing. > There is an instance of $(LLVM) in tools/testing/selftests/lib.mk that I > did not touch, as that will presumably have to go through the selftests > tree. I can send a separate patch for that later. I think it's fine to include that here, just to keep the logic together. > Peter, is this approach okay with you? If so, would you like to be > co-author or should I use a suggested-by tag? > > Cheers, > Nathan > From 83219caafbb7dbc2e41e3888ba5079d342aff633 Mon Sep 17 00:00:00 2001 > From: Nathan Chancellor > Date: Wed, 2 Mar 2022 13:28:14 -0700 > Subject: [PATCH] kbuild: Allow a suffix with $(LLVM) > > The LLVM variable allows a developer to quickly switch between the GNU > and LLVM tools. However, it does not handle versioned binaries, such as > the ones shipped by Debian, as LLVM=1 just defines the build variables > with the unversioned binaries. > > There was some discussion during the review of the patch that introduces > LLVM=1 around this, ultimately coming to the conclusion that developers > can just add the folder that contains the unversioned binaries to their > PATH, as Debian's versioned suffixed binaries are really just symlinks > to the unversioned binaries in /usr/lib/llvm-#/bin: > > $ realpath /usr/bin/clang-14 > /usr/lib/llvm-14/bin/clang > > $ PATH=/usr/lib/llvm-14/bin:$PATH make ... LLVM=1 > > However, it is simple enough to support this scheme directly in the > Kbuild system by allowing the developer to specify the version suffix > with LLVM=, which is shorter than the above suggestion: > > $ make ... LLVM=-14 > > It does not change the meaning of LLVM=1 (which will continue to use > unversioned binaries) and it does not add too much additional complexity > to the existing $(LLVM) code, while allowing developers to quickly test > their series with different versions of the whole LLVM suite of tools. > > Signed-off-by: Nathan Chancellor I like it! Reviewed-by: Kees Cook -- Kees Cook