linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Using __always_inline attribute
@ 2017-06-13 22:39 Sodagudi Prasad
  2017-06-14 10:06 ` Will Deacon
  0 siblings, 1 reply; 15+ messages in thread
From: Sodagudi Prasad @ 2017-06-13 22:39 UTC (permalink / raw)
  To: linux-arm-kernel


Hi All,

With a variant of a CLANG(based on 4.0) following errors observed on 
Linux 4.12-rc5 tag.

net/built-in.o: In function `__xchg_mb':
arch/arm64/include/asm/cmpxchg.h:99: \
                     undefined reference to `__compiletime_assert_99'
arch/arm64/include/asm/cmpxchg.h:99: \
                     undefined reference to `__compiletime_assert_99

Clang does not seems to be marking this macro as inline and causing 
above compilation issue due to BUILD_BUG().

We added  __always_inline attribute to this macro as shown below, so 
that clang forces this macro to be always inline.
Based on definition of __xchg##sfx, it should always be inline.  Can we 
force this macro to be __always_inline ?


diff --git a/arch/arm64/include/asm/cmpxchg.h 
b/arch/arm64/include/asm/cmpxchg.h
index ae852ad..ce57cec 100644
--- a/arch/arm64/include/asm/cmpxchg.h
+++ b/arch/arm64/include/asm/cmpxchg.h
@@ -73,7 +73,7 @@
  #undef __XCHG_CASE

  #define __XCHG_GEN(sfx)                                                 
        \
-static inline unsigned long __xchg##sfx(unsigned long x,               
\
+static __always_inline unsigned long __xchg##sfx(unsigned long x,       
        \
                                         volatile void *ptr,             
\
                                         int size)                       
\
  {                                                                      
\


-Thanks, Prasad

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
Forum,
Linux Foundation Collaborative Project

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-06-23  6:45 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-13 22:39 Using __always_inline attribute Sodagudi Prasad
2017-06-14 10:06 ` Will Deacon
2017-06-14 22:33   ` Sodagudi Prasad
2017-06-15  0:50     ` Sodagudi Prasad
2017-06-15 15:54     ` Mark Rutland
2017-06-19 15:53       ` [PATCH] compiler, clang: Add always_inline attribute to inline Prasad Sodagudi
2017-06-19 20:25         ` David Rientjes
2017-06-19 21:14           ` Sodagudi Prasad
2017-06-19 21:42             ` David Rientjes
2017-06-19 22:19               ` Sodagudi Prasad
2017-06-20 10:59                 ` Mark Rutland
2017-06-20 23:12                   ` David Rientjes
2017-06-22  9:43                     ` Mark Rutland
2017-06-23  6:45                       ` Sodagudi Prasad
2017-06-20 10:52               ` Mark Rutland

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).