From patchwork Thu Feb 1 10:21:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10195229 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C4339601A0 for ; Thu, 1 Feb 2018 10:22:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1BAC2876D for ; Thu, 1 Feb 2018 10:22:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B6167289FD; Thu, 1 Feb 2018 10:22:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 425EF2876D for ; Thu, 1 Feb 2018 10:22:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752090AbeBAKWZ (ORCPT ); Thu, 1 Feb 2018 05:22:25 -0500 Received: from baptiste.telenet-ops.be ([195.130.132.51]:33008 "EHLO baptiste.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751949AbeBAKWI (ORCPT ); Thu, 1 Feb 2018 05:22:08 -0500 Received: from ayla.of.borg ([84.194.104.20]) by baptiste.telenet-ops.be with bizsmtp id 5NN31x00T0SRDqC01NN3WX; Thu, 01 Feb 2018 11:22:07 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1ehC0J-0007hD-0g; Thu, 01 Feb 2018 11:22:03 +0100 Received: from geert by ramsan with local (Exim 4.86_2) (envelope-from ) id 1ehC0I-0001An-Rn; Thu, 01 Feb 2018 11:22:02 +0100 From: Geert Uytterhoeven To: Herbert Xu , "David S . Miller" , Christopher Li , Ard Biesheuvel , Tom Lendacky Cc: Arnd Bergmann , Andrew Morton , linux-crypto@vger.kernel.org, linux-sparse@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 2/3] compiler-gcc.h: __nostackprotector needs gcc-4.4 and up Date: Thu, 1 Feb 2018 11:21:59 +0100 Message-Id: <1517480520-4465-2-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517480520-4465-1-git-send-email-geert@linux-m68k.org> References: <1517480520-4465-1-git-send-email-geert@linux-m68k.org> MIME-Version: 1.0 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Gcc versions before 4.4 do not recognize the __optimize__ compiler attribute: warning: ‘__optimize__’ attribute directive ignored Fixes: 7375ae3a0b79ea07 ("compiler-gcc.h: Introduce __nostackprotector function attribute") Signed-off-by: Geert Uytterhoeven --- Can anyone please verify this? Apparently __nostackprotector is used on x86 only, which is usually served by modern compilers. --- include/linux/compiler-gcc.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 0a278a527944ad2f..73bc63e0a1c4b664 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -167,8 +167,6 @@ #if GCC_VERSION >= 40100 # define __compiletime_object_size(obj) __builtin_object_size(obj, 0) - -#define __nostackprotector __attribute__((__optimize__("no-stack-protector"))) #endif #if GCC_VERSION >= 40300 @@ -198,6 +196,7 @@ #if GCC_VERSION >= 40400 #define __optimize(level) __attribute__((__optimize__(level))) +#define __nostackprotector __optimize("no-stack-protector") #endif /* GCC_VERSION >= 40400 */ #if GCC_VERSION >= 40500