Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp320500imu; Fri, 25 Jan 2019 02:59:07 -0800 (PST) X-Google-Smtp-Source: ALg8bN4WkoSKu99AnMjTxSXAEGkPtnqfeD30/RPUZYEM+9LmuYq1sIXscdgApyWsTyTLc5qM1lM+ X-Received: by 2002:a17:902:4523:: with SMTP id m32mr10445798pld.53.1548413947387; Fri, 25 Jan 2019 02:59:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548413947; cv=none; d=google.com; s=arc-20160816; b=g9xValkWH00KXAnz42ZcXRHi1gSTeU7F/eTTmW1/LC9b4/XP2JNfOQD1v7fpIFygks uA9cNX8HnebdA5IfehaNt8qC03w3cKevUjktP1oqXASPlkI8Fv2kcIeVpGcxFhUtSM6R 12J48IgYJCT2cLwcyBQZFupGXR7ZkD0bj9gaSWqRFtd73mAX2kOrpE/Jrehv4xdX6Jht V1DWL/clqI++x8dQRn9cI5uJ4ocyCRVScRjsoXR/n6d/zcUD1Ieq2pzwra7CVFZ/aso3 PK0tM+nSsbYHuswh7WLh6K0RGPZhGFHVcgNTlP+8QpMljdVAayokU9fOABmcaCRGqfEn AcJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=QhMlnLD0pk6GIylS5p9law6MXy/6JZ38l1Eb/BKJuB4=; b=zyonZZ8bM6vTyh2nKiuSFc6rrfmNbHwwFuNDWMyjbinVmPh1CNL/AGkXWjZNTr7hyo YzHqOSajRxmTgDx4eNDeUDpb0j3ZhgARusqgyoe3/v6XYh4fQrj8mLJU6TwdcVumtrgz 1hPpM2YM9T1uUoByMBD1wKt+IGeVNOaoRHhErH58CYg9cS2TYj/Nz2A9UmsGeYJhU2ZO e/ujCc7IEw9f44wPOyXC8tq6ftevhe6D7tkMGOqCkvqkTTv6cpThNsN+CQ1r0SXCUEv+ t/7dMNJQ0VP/l8GHAeHS9ZUCv/L0y7tvr2tSzG5smXlDGs6iqNGRFUJdA8cCGU3fiEw9 GjVg== 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 24si19490906pgm.167.2019.01.25.02.58.51; Fri, 25 Jan 2019 02:59:07 -0800 (PST) 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 S1726485AbfAYK6j (ORCPT + 99 others); Fri, 25 Jan 2019 05:58:39 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:43387 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726095AbfAYK6j (ORCPT ); Fri, 25 Jan 2019 05:58:39 -0500 Received: by mail-qk1-f193.google.com with SMTP id z18so5109140qkj.10 for ; Fri, 25 Jan 2019 02:58:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QhMlnLD0pk6GIylS5p9law6MXy/6JZ38l1Eb/BKJuB4=; b=gN90EvGtab6FiNCB70inhtDgZT1fTKpfflYLTkM7zkjCPHjums9LrhpJK+OJ0Pgm4e dSxj2WRJ/TLjiEmSgooj2uxCVCzguKK3/wN8SUiySN212UrB1vXLMXLYPlNczl/InibR 4+MGNTxAgMH/LSWb/ukkVmgd4ToTVvUlIVomLgnpKczsmpmUMtVTxdRRa0u7a1taUDbp TB+Xo52ibQ9tM0l8AKLOkHrTVNTSA1zrDsY/c1OcpX8WmsYc3/EAEeIuVxszenLw8vQs IFtHl9EHIkEgyQ3Ng08NUZ6tteXSn1ElNNysYkJb37lLT13VoTM/O/fyz3EFo2exdr/d nxKA== X-Gm-Message-State: AJcUukfKlbrFSc89FNX+4QLu2/A2/l7NXS0TzR0f1PvjkRJ/42AYe3IM abrTcxcJOZN+vXB1aVbYqgsLvv2OTlO8x9/njOs= X-Received: by 2002:ae9:e102:: with SMTP id g2mr8697888qkm.343.1548413917620; Fri, 25 Jan 2019 02:58:37 -0800 (PST) MIME-Version: 1.0 References: <20190125104353.2791-1-labbott@redhat.com> In-Reply-To: <20190125104353.2791-1-labbott@redhat.com> From: Arnd Bergmann Date: Fri, 25 Jan 2019 11:58:21 +0100 Message-ID: Subject: Re: [RFC][PATCH] Update -Wattribute-alias for gcc9 To: Laura Abbott Cc: Masahiro Yamada , Linux Kernel Mailing List , Bernd Edlinger , Martin Sebor , Miguel Ojeda Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 25, 2019 at 11:43 AM Laura Abbott wrote: > > Commit bee20031772a ("disable -Wattribute-alias warning for > SYSCALL_DEFINEx()") disabled -Wattribute-alias with gcc8. > gcc9 changed the format of -Wattribute-alias to take a parameter. > This doesn't quite match with the existing disabling mechanism > so update for gcc9 to match with the default (-Wattribute-alias=1). > > Signed-off-by: Laura Abbott > --- > This is RFC because it feels ugly. I went ahead and did the obvious fixup > but it's worth discussing if we're going to end up with an explosion or > if there's a better way to handle this in one macro. Bernd Edlinger has sent a patch to gcc for this: https://gcc.gnu.org/ml/gcc-patches/2019-01/msg01120.html and Miguel Ojeda said he wanted to send a patch for it to the kernel as well, not sure if he wanted to take a different approach there, so adding both to Cc here. Arnd > --- > include/linux/compat.h | 2 ++ > include/linux/compiler-gcc.h | 7 ++++++- > include/linux/syscalls.h | 2 ++ > 3 files changed, 10 insertions(+), 1 deletion(-) > > diff --git a/include/linux/compat.h b/include/linux/compat.h > index 056be0d03722..d5d7700f26a6 100644 > --- a/include/linux/compat.h > +++ b/include/linux/compat.h > @@ -75,6 +75,8 @@ > __diag_push(); \ > __diag_ignore(GCC, 8, "-Wattribute-alias", \ > "Type aliasing is used to sanitize syscall arguments");\ > + __diag_ignore(GCC, 9, "-Wattribute-alias=1", \ > + "Type aliasing is used to sanitize syscall arguments");\ > asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \ > asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ > __attribute__((alias(__stringify(__se_compat_sys##name)))); \ > diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h > index e8579412ad21..75079668344c 100644 > --- a/include/linux/compiler-gcc.h > +++ b/include/linux/compiler-gcc.h > @@ -165,8 +165,13 @@ > #define __diag_str(s) __diag_str1(s) > #define __diag(s) _Pragma(__diag_str(GCC diagnostic s)) > > -#if GCC_VERSION >= 80000 > +#if GCC_VERSION >= 90000 > +#define __diag_GCC_8(s) > +#define __diag_GCC_9(s) __diag(s) > +#elif GCC_VERSION >= 80000 > #define __diag_GCC_8(s) __diag(s) > +#define __diag_GCC_9(s) > #else > #define __diag_GCC_8(s) > +#define __diag_GCC_9(s) > #endif > diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h > index 257cccba3062..a08059e1ccf4 100644 > --- a/include/linux/syscalls.h > +++ b/include/linux/syscalls.h > @@ -236,6 +236,8 @@ static inline int is_syscall_trace_event(struct trace_event_call *tp_event) > __diag_push(); \ > __diag_ignore(GCC, 8, "-Wattribute-alias", \ > "Type aliasing is used to sanitize syscall arguments");\ > + __diag_ignore(GCC, 9, "-Wattribute-alias=1", \ > + "Type aliasing is used to sanitize syscall arguments");\ > asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ > __attribute__((alias(__stringify(__se_sys##name)))); \ > ALLOW_ERROR_INJECTION(sys##name, ERRNO); \ > -- > 2.20.1 >