Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp250980pxb; Mon, 2 Nov 2020 21:00:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJyyFUgup6HWFlNfKsrIBr4yMC5NLMSBYITXBkTAv7a0yIiBirYhxmX2iY9uOzEYDlnNBBoS X-Received: by 2002:aa7:d548:: with SMTP id u8mr19670579edr.321.1604379623134; Mon, 02 Nov 2020 21:00:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604379623; cv=none; d=google.com; s=arc-20160816; b=C2+/bueM4XC1sLJcbXiwhDsH7dA7BDyQLMpzY8O47Q3W3rJ9RTpTj8iCTiG2ztaP4M 9li5J4hjCluy7RSY2C7TUaKDEC+Vy+o8gkA9r+CoTYrjLw6lHEkVIOh7BrCa7VYQUGuh cDlkpZiAcv30c4R3ft0yJ+ootLjVPZG6c+T+aAETdy0Oz5R+fXlnR8JrHZwNwtpwBhCj QQChP16PbOyqKoOmH6N5Ly+PE/qknaoVskxBDFMlkR+0EMdkBVlfnU+7aTu/LRB+8Tkg e2BTrdkK0+tcvFMiiGMsNzB4SngP7iL0B6MxbSLssyDNIflIE6WytOupU/RowFIgXAxr xPOg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=jbo9eRt6GAj1tPEWuLj9BiBAJ0tgqeasBaHuIkPxzjo=; b=cFuNegeTYU/e0YmFajfwnfqaWt2y8LXv3fReV6L1/8aM5WJDyEVmD1GqFFK9qIybp3 BZGM/+F8Mq2dXYB4BYuBhnCaFFKdr/v4pxIzRXDC2y2YW45Gi3n2IRarTnuhcPy3vWHi vBID8VLv+tiin2lRu66UZICL6yjNfs0LupHyCCts9vfV85E7qXFDMKMQoCeo9wXrzV9/ Dc7CZaIzHjhgiwdrUA/hzNC6+mlfSPv+8IMxlYGqsBkKDvdUjjE7bMqK0TpLUeC8eeb2 Fc295LkINV/d6F/2+bUL3DbAJdFVCutdNF1kt9lsaQSs+CqGUB1Q8LgmxQaUHcVTua1d bc+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gPKVNGX3; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q23si5679275ejs.570.2020.11.02.20.59.57; Mon, 02 Nov 2020 21:00:23 -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=@kernel.org header.s=default header.b=gPKVNGX3; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725982AbgKCEz3 (ORCPT + 99 others); Mon, 2 Nov 2020 23:55:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:43082 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725952AbgKCEz2 (ORCPT ); Mon, 2 Nov 2020 23:55:28 -0500 Received: from kernel.org (83-245-197-237.elisa-laajakaista.fi [83.245.197.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 08A5222243; Tue, 3 Nov 2020 04:55:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604379328; bh=+/Zb/Rd1pwj4ivtng24HgDPmrWpJWrx1iasx4QMAmCE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gPKVNGX3SHWfoC3mgv91kVID9sQ5o+RHNVJfdwSBIcDlD+nKCRFYHcldiaiw3TpGl sYrxQq4DY8FkNgCWTfuQFyuXAhpfhX284/vOkmxZzLQG/gBAGMnzDRdX/CGNi/bD8F /KxbYvjnKNJi2I/lc55H8Vm8sms7/1Vj0SKL1jCg= Date: Tue, 3 Nov 2020 06:55:21 +0200 From: Jarkko Sakkinen To: Nick Desaulniers Cc: Andrew Morton , Kees Cook , Miguel Ojeda , Nathan Chancellor , Sedat Dilek , Marco Elver , Andrey Konovalov , Masahiro Yamada , clang-built-linux@googlegroups.com, Daniel Borkmann , Alexei Starovoitov , Will Deacon , Vincenzo Frascino , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/7] compiler-clang: add build check for clang 10.0.1 Message-ID: <20201103045521.GA58906@kernel.org> References: <20200902225911.209899-1-ndesaulniers@google.com> <20200902225911.209899-2-ndesaulniers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200902225911.209899-2-ndesaulniers@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 02, 2020 at 03:59:05PM -0700, Nick Desaulniers wrote: > During Plumbers 2020, we voted to just support the latest release of > Clang for now. Add a compile time check for this. > > We plan to remove workarounds for older versions now, which will break > in subtle and not so subtle ways. > > Suggested-by: Sedat Dilek > Suggested-by: Nathan Chancellor > Suggested-by: Kees Cook > Signed-off-by: Nick Desaulniers > Tested-by: Sedat Dilek > Reviewed-by: Kees Cook > Reviewed-by: Miguel Ojeda > Reviewed-by: Sedat Dilek > Acked-by: Marco Elver > Acked-by: Nathan Chancellor > Acked-by: Sedat Dilek > Link: https://github.com/ClangBuiltLinux/linux/issues/9 > Link: https://github.com/ClangBuiltLinux/linux/issues/941 > --- > include/linux/compiler-clang.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h > index cee0c728d39a..230604e7f057 100644 > --- a/include/linux/compiler-clang.h > +++ b/include/linux/compiler-clang.h > @@ -3,6 +3,14 @@ > #error "Please don't include directly, include instead." > #endif > > +#define CLANG_VERSION (__clang_major__ * 10000 \ > + + __clang_minor__ * 100 \ > + + __clang_patchlevel__) > + > +#if CLANG_VERSION < 100001 > +# error Sorry, your version of Clang is too old - please use 10.0.1 or newer. > +#endif I'm trying to compile a BPF enabled test kernel for a live system and I get this error even though I have much newer clang: ➜ ~ (master) ✔ clang --version Ubuntu clang version 11.0.0-2 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin Tried to Google for troubleshooter tips but this patch is basically the only hit I get :-) > + > /* Compiler specific definitions for Clang compiler */ > > /* same as gcc, this was present in clang-2.6 so we can assume it works > -- > 2.28.0.402.g5ffc5be6b7-goog > /Jarkko