From: Masahiro Yamada <masahiroy@kernel.org>
To: Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>, Marco Elver <elver@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Revert "kbuild: avoid static_assert for genksyms"
Date: Wed, 23 Dec 2020 15:15:25 +0900 [thread overview]
Message-ID: <CAK7LNARhCdhpniwXzd1a9H-OpgksBqxakOjiDEAHiwWTmrStoQ@mail.gmail.com> (raw)
In-Reply-To: <20201219183911.181442-1-masahiroy@kernel.org>
On Sun, Dec 20, 2020 at 3:40 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> This reverts commit 14dc3983b5dff513a90bd5a8cc90acaf7867c3d0.
>
> Macro Elver had sent a fix proper fix earlier, and also pointed out
> corner cases:
>
> "I guess what you propose is simpler, but might still have corner cases
> where we still get warnings. In particular, if some file (for whatever
> reason) does not include build_bug.h and uses a raw _Static_assert(),
> then we still get warnings. E.g. I see 1 user of raw _Static_assert()
> (drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h )."
>
> I believe the raw use of _Static_assert() should be allowed, so this
> should be fixed in genksyms.
>
> Even after commit 14dc3983b5df ("kbuild: avoid static_assert for
> genksyms"), I confirmed the following test code emits the warning.
>
> ---------------->8----------------
> #include <linux/export.h>
>
> _Static_assert((1 ?: 0), "");
>
> void foo(void) { }
> EXPORT_SYMBOL(foo);
> ---------------->8----------------
>
> WARNING: modpost: EXPORT symbol "foo" [vmlinux] version generation failed, symbol will not be versioned.
>
> Now that commit 869b91992bce ("genksyms: Ignore module scoped
I updated the commit id in the mainline.
9ab55d7f240f
Now, applied to linux-kbuild.
> _Static_assert()") fixed this issue properly, the workaround should
> be reverted.
>
> Link: https://lkml.org/lkml/2020/12/10/845
> Cc: Marco Elver <elver@google.com>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
>
> I will apply this after Macro's patch is pulled.
>
>
>
> include/linux/build_bug.h | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/include/linux/build_bug.h b/include/linux/build_bug.h
> index 7bb66e15b481..e3a0be2c90ad 100644
> --- a/include/linux/build_bug.h
> +++ b/include/linux/build_bug.h
> @@ -77,9 +77,4 @@
> #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
> #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
>
> -#ifdef __GENKSYMS__
> -/* genksyms gets confused by _Static_assert */
> -#define _Static_assert(expr, ...)
> -#endif
> -
> #endif /* _LINUX_BUILD_BUG_H */
> --
> 2.27.0
>
--
Best Regards
Masahiro Yamada
prev parent reply other threads:[~2020-12-23 6:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-19 18:39 [PATCH] Revert "kbuild: avoid static_assert for genksyms" Masahiro Yamada
2020-12-23 6:15 ` Masahiro Yamada [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAK7LNARhCdhpniwXzd1a9H-OpgksBqxakOjiDEAHiwWTmrStoQ@mail.gmail.com \
--to=masahiroy@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=elver@google.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.