Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6041444rwp; Mon, 17 Jul 2023 13:54:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlHTrUW1xBVeFWE5gKvzp/mAsG5nGfSaSAOFYDYNY7n0Qb6oX6t9V1/b5Q58WX2evRwQILJ1 X-Received: by 2002:a17:902:ea11:b0:1b9:d38d:efb1 with SMTP id s17-20020a170902ea1100b001b9d38defb1mr14225445plg.8.1689627264471; Mon, 17 Jul 2023 13:54:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689627264; cv=none; d=google.com; s=arc-20160816; b=IHZJx5t6pExG+XrInPS3vT4UNiMKWFFqGC1gPTUEQ+a+dUR9dmKpu7CuKZTWMrfGkh mEdB5/D5wIdbC8XtC55QI0OXT9t+Dj/bt3SYAhWTYQ9DEwcpln2+vxAsQLo3SLg8Glvv fuicXINmw60rX35LBk/wNnM0EDu4HuV2uFsGluLWVPQVvAPVst9JncWv7eUmbxf5gUgy kpysoajt+ujl5pF7Oj5yIs0iNGXxXEYxYKDyogbwYQHNw1Fet3pZf7VFWlLCqTB892BQ RdlX6mI65iwjNdgrNy5XyMy1oiQC/IjimUjoiuNf6oMOyj/Z6nYPRDqc7U/9hg/rZ6Wr rkuw== 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=t3aT+ZPr7MG/9q0gWGDFi+jP2MQR744t9+HKGVormRo=; fh=8kNp/ad9JOWmvKXVKmduEyEWXMEvitAX6odxSTMbmQU=; b=fvU+SQZEYlbbtC4YhUP61w5Nvl1uU/IVPw/SM6rpQ8wdNXKX+MqOoTnXPFQkPfRnJf BTylr76ODlYLMOoctkcYRrz8pcDMEXctOPb+bIiipihIkqG6u2AeqyoSLTj+of83gVfk BX4BJCzlDkh/UM7Nb42qVvccPGGyGohMUP0Edsn6Sy0pOy6OySF4M76V/TgJ2N+4F298 Hr1ocQtfEcXrd/ApRYmYLfT/ggW7V7Y7dcxgbnOHg6bW0pUQ7BJly6DYpd2EcdX0oTsL rOsEXNCzDH6kp2Ev/iya2DmD5rpbIb+r9iZ+UqH5t+X1JAA9Y9lTQfS5rPg5IGG/ryiP dC7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=il+XQKSj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jz5-20020a170903430500b001b89462881fsi386666plb.561.2023.07.17.13.54.08; Mon, 17 Jul 2023 13:54:24 -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=@kernel.org header.s=k20201202 header.b=il+XQKSj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230117AbjGQUqA (ORCPT + 99 others); Mon, 17 Jul 2023 16:46:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229471AbjGQUp6 (ORCPT ); Mon, 17 Jul 2023 16:45:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC19F10C7 for ; Mon, 17 Jul 2023 13:45:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 71CF961254 for ; Mon, 17 Jul 2023 20:45:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A1D1C433C8; Mon, 17 Jul 2023 20:45:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689626756; bh=UsXsfjVL9REDWcNWMHiUI6cTNSdXjR9CSQ/6ZyhFjy8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=il+XQKSjT3nn4U1R4HkC5syT0/BiDp0SRWQ8Vg1tWBr2j9+/O7ByTu5Fa3FkVrJxe vHfFFIPcpDVFs8K7DwSnWsJ2kYat2EvVhL7Hiv64bBEqW0bt7jHnYEB5wmIw+Ss0VO OeSrRmS3DcneJnpUQ5uksTdCiAmOtFTj//8yRCBwSlpj4yDwbKcZLmrKJ407P1DHYj QpI/31QeBYsaLe2MXCynGBQK8hTI1L6IRMnBKqYuV3Xn42aojQlZYnCkTjiz375ZRc ByfsEeW9YEIgwOTubLu5amXdeOmHpTROJeiRlsbtpLgTLdUEyeo+bLBN2az0aLAOnZ 1KVGNZrL6BbGw== Date: Mon, 17 Jul 2023 13:45:54 -0700 From: Nathan Chancellor To: Jakob Koschel Cc: Nick Desaulniers , Tom Rix , linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] arch: enable HAS_LTO_CLANG with KASAN and KCOV Message-ID: <20230717204554.GB2212488@dev-arch.thelio-3990X> References: <20230717-enable-kasan-lto1-v1-1-471e706a5c4e@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230717-enable-kasan-lto1-v1-1-471e706a5c4e@gmail.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hi Jakob, On Mon, Jul 17, 2023 at 10:09:27PM +0200, Jakob Koschel wrote: > Both KASAN and KCOV had issues with LTO_CLANG if DEBUG_INFO is enabled. > With LTO inlinable function calls are required to have debug info if > they are inlined into a function that has debug info. > > Starting with LLVM 17 this will be fixed ([1],[2]) and enabling LTO with > KASAN/KCOV and DEBUG_INFO doesn't cause linker errors anymore. > > Signed-off-by: Jakob Koschel > Link: https://github.com/llvm/llvm-project/commit/913f7e93dac67ecff47bade862ba42f27cb68ca9 > Link: https://github.com/llvm/llvm-project/commit/4a8b1249306ff11f229320abdeadf0c215a00400 Thanks for seeing this to completion, especially with the LLVM fixes in tow! One small nit below, other than that: Reviewed-by: Nathan Chancellor Normally, I would not say that comment alone is worth a v2 but I think in this case, I will say it is because neither Nick nor I pick up patches directly, so this will need to be picked up by either Kees Cook (who has generally handled clang LTO patches because he ferried in the initial LTO series to mainline) or Andrew Morton. Would you mind addressing my comment and sending a v2 to them directly (they can figure out who will take it) with us on CC in case we need to poke them? Their addresses should be in MAINTAINERS. Cheers, Nathan > --- > arch/Kconfig | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/Kconfig b/arch/Kconfig > index aff2746c8af2..61263ff92271 100644 > --- a/arch/Kconfig > +++ b/arch/Kconfig > @@ -745,7 +745,8 @@ config HAS_LTO_CLANG > depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm) > depends on ARCH_SUPPORTS_LTO_CLANG > depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT > - depends on !KASAN || KASAN_HW_TAGS Consider linking back to either your fixes in LLVM or https://github.com/ClangBuiltLinux/linux/issues/1721 so that we have a paper trail of why these version checks are here :) > + depends on (!KASAN || KASAN_HW_TAGS || CLANG_VERSION >= 170000) || !DEBUG_INFO > + depends on (!KCOV || CLANG_VERSION >= 170000) || !DEBUG_INFO > depends on !GCOV_KERNEL > help > The compiler and Kconfig options support building with Clang's > > --- > base-commit: fdf0eaf11452d72945af31804e2a1048ee1b574c > change-id: 20230717-enable-kasan-lto1-656754c76241 > > Best regards, > -- > Jakob Koschel >