Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2951528imm; Thu, 24 May 2018 19:45:35 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr+jq8B0cPDH7R3zTlRPNwOvb38YjUkl8Xwwuw5p+FgsxGwauFoBc169Hp8y4NMAC/lxwRf X-Received: by 2002:a63:203:: with SMTP id 3-v6mr468963pgc.133.1527216335421; Thu, 24 May 2018 19:45:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527216335; cv=none; d=google.com; s=arc-20160816; b=BV5oe5gkT1klJi0uTCpMNYWmZB7LNFApO07RSpOeTUEGQDUIAe4U/NQ/VQ0lEYCzKY nH9sGYf1ViasJVVoE95HwOZPneS2YO2KlX9W5FNnuYE5mCM8CobC1LutSWESXQz1xunn 5LV+IomZhH8xnU6zruZu++D74TSbTPkeUOmReoigRjLDwUffZrzmeCwezecLbDuKndFy Cw/LVnoqAGz6xBIyuvgyf1W+zC5ok9sDaeMgVqanu8sOVBHcoR6UerPcAPXEm7hid50y yOsLECYYWnPm/S08++aDKfwXNj3CpmripgGIEasRoBWZ8cNMk5LZWq+q0vTYnD4oiy9V 4zZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=KUvolR8JUa3hCaaXq3E3jOtlJ9BXq8B6cgtTRVRJgAs=; b=ymvQ0MgMPcTPCeRvlzaLFBjgV6j9B1w2GgBm1csyPg4zolkN7OVgzRv76EtSvyZqtL 2lZQuEE111dheWUGJY6qUxVlRscWRBS/JjLYknbnpa2Kwm2iLBBXiOd2aGoxEeMRyYYk fM7VC45pINoH3wTCvIuSpHU0RaVKvyzoz5FDtK+879zAVYbiFobU0L1zxqPWjK5/NroH HvahyL/482pNAJgLtTWfiKN8D8LahtGBPIIil4LTjo9u6KA/d16pZChPSo4g5hkMwF26 t8PnMzKlm4S3AQ+0L4sVmMy4d+CWd2R4rT7MbQSL83QZEBLC5SZMenCZbMnaCDS2dySK 2V4Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a185-v6si17560131pgc.586.2018.05.24.19.45.20; Thu, 24 May 2018 19:45:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161573AbeEXV4h (ORCPT + 99 others); Thu, 24 May 2018 17:56:37 -0400 Received: from terminus.zytor.com ([198.137.202.136]:55693 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969755AbeEXV4g (ORCPT ); Thu, 24 May 2018 17:56:36 -0400 Received: from hanvin-mobl2.amr.corp.intel.com ([192.55.54.40]) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id w4OLuVgV790258 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 24 May 2018 14:56:32 -0700 Subject: Re: [clang] stack protector and f1f029c7bf To: Nick Desaulniers Cc: Alistair Strachan , Manoj Gupta , Matthias Kaehlcke , Greg Hackmann , sedat.dilek@gmail.com, tstellar@redhat.com, LKML , Kees Cook References: From: "H. Peter Anvin" Message-ID: Date: Thu, 24 May 2018 14:56:31 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/24/18 14:27, Nick Desaulniers wrote: > https://godbolt.org/g/oku8ux > > Is there a more canonical way the kernel does feature detection that looks > better than: > Hm. I though we had, but it doesn't seem so. For cc we only seem to be able to detect flags. For as we have rules that can detect new instructions; something similar in Kbuild would be good. > diff --git a/arch/x86/include/asm/irqflags.h > b/arch/x86/include/asm/irqflags.h > index 89f08955fff7..90974b5d023c 100644 > --- a/arch/x86/include/asm/irqflags.h > +++ b/arch/x86/include/asm/irqflags.h > @@ -13,6 +13,8 @@ > * Interrupt control: > */ > > +#ifdef GCC_VERSION > +#if GCC_VERSION < 40900 We don't actually test if GCC_VERSION is defined anywhere in the kernel. We probably should explicitly define it to either 0 or some baseline version if it is undefined. (Clang defines __GNUC__ so it will define GCC_VERSION.) -hpa