From: Stefan Agner <stefan@agner.ch>
To: torvalds@linux-foundation.org, ndesaulniers@google.com
Cc: akpm@linux-foundation.org, keescook@chromium.org,
tglx@linutronix.de, mingo@kernel.org, aryabinin@virtuozzo.com,
will.deacon@arm.com, linux@rasmusvillemoes.dk, dwmw@amazon.co.uk,
paullawrence@google.com, arnd@arndb.de,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Stefan Agner <stefan@agner.ch>
Subject: [PATCH] include/linux/compiler-clang.h: define __naked
Date: Sun, 9 Sep 2018 23:04:55 -0700 [thread overview]
Message-ID: <20180910060455.20409-1-stefan@agner.ch> (raw)
ARM32 arch code uses the __naked attribute. This has previously been
defined in include/linux/compiler-gcc.h, which is no longer included
for Clang. Define __naked for Clang. Conservatively add all attributes
previously used (and supported by Clang).
This fixes compile errors when building ARM32 using Clang:
arch/arm/mach-exynos/mcpm-exynos.c:193:13: error: variable has incomplete type 'void'
static void __naked exynos_pm_power_up_setup(unsigned int affinity_level)
^
Fixes: 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutually exclusive")
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
include/linux/compiler-clang.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
index b1ce500fe8b3..a593e3ac0720 100644
--- a/include/linux/compiler-clang.h
+++ b/include/linux/compiler-clang.h
@@ -23,6 +23,12 @@
#define __no_sanitize_address __attribute__((no_sanitize("address")))
+/*
+ * ARM32 is currently the only user of __naked supported by Clang. Follow
+ * gcc: Do not trace naked functions and make sure they don't get inlined.
+ */
+#define __naked __attribute__((naked)) noinline notrace
+
/*
* Not all versions of clang implement the the type-generic versions
* of the builtin overflow checkers. Fortunately, clang implements
--
2.18.0
next reply other threads:[~2018-09-10 6:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-10 6:04 Stefan Agner [this message]
2018-09-10 12:14 ` [PATCH] include/linux/compiler-clang.h: define __naked Arnd Bergmann
2018-09-10 16:51 ` Nick Desaulniers
2018-09-12 4:19 ` Miguel Ojeda
2018-09-13 4:02 ` Miguel Ojeda
2018-09-13 22:20 ` Nick Desaulniers
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=20180910060455.20409-1-stefan@agner.ch \
--to=stefan@agner.ch \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=aryabinin@virtuozzo.com \
--cc=dwmw@amazon.co.uk \
--cc=keescook@chromium.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=mingo@kernel.org \
--cc=ndesaulniers@google.com \
--cc=paullawrence@google.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=will.deacon@arm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).