Commit e612894e authored by Miguel Ojeda's avatar Miguel Ojeda Committed by Khalid Elmously

Backport minimal compiler_attributes.h to support GCC 9

BugLink: https://bugs.launchpad.net/bugs/1845038

This adds support for __copy to v4.9.y so that we can use it in
init/exit_module to avoid -Werror=missing-attributes errors on GCC 9.

Link: https://lore.kernel.org/lkml/259986242.BvXPX32bHu@devpool35/
Cc: <stable@vger.kernel.org>
Suggested-by: default avatarRolf Eike Beer <eb@emlix.com>
Signed-off-by: default avatarMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 426be6a6
......@@ -52,6 +52,22 @@ extern void __chk_io_ptr(const volatile void __iomem *);
#ifdef __KERNEL__
/*
* Minimal backport of compiler_attributes.h to add support for __copy
* to v4.9.y so that we can use it in init/exit_module to avoid
* -Werror=missing-attributes errors on GCC 9.
*/
#ifndef __has_attribute
# define __has_attribute(x) __GCC4_has_attribute_##x
# define __GCC4_has_attribute___copy__ 0
#endif
#if __has_attribute(__copy__)
# define __copy(symbol) __attribute__((__copy__(symbol)))
#else
# define __copy(symbol)
#endif
#ifdef __GNUC__
#include <linux/compiler-gcc.h>
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment