Skip to contentSkip to conversation

bfin: remove inline keyword

PATCH Applied Romain Naour 2 participants 3 messages Nov 5, 2016 – Nov 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 bfin: remove inline keyword

Xenomai user space tools fail to build for bfin target since it's provide it's own pthread_atfork(), shm_open() and shm_unlink() definition using the inline keyword and weak attribute.

With gcc 5+ the weak attribute is discarded by the inline keyword, so each symbol are global and are redefined several time while linking.

Fixes:
http://autobuild.buildroot.net/results/0c2/0c2e5eb4edd4f9427f61d3c9b67a12a7a0e24140

---
 include/asm-blackfin/syscall.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
include/asm-blackfin/syscall.h +5 -5
index 9eda8b9..b5728b5 100644
@@ -132,9 +132,9 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
 #define XENOMAI_SKINCALL5(id,op,a1,a2,a3,a4,a5) XENOMAI_DO_SYSCALL(5,id,op,a1,a2,a3,a4,a5)
 
 /* uClibc does not provide pthread_atfork() for this arch; provide it
-   here. Note: let the compiler decides whether it wants to actually
-   inline this routine, i.e. do not force always_inline. */
-inline __attribute__((weak)) int pthread_atfork(void (*prepare)(void),
+   here.
+*/
+__attribute__((weak)) int pthread_atfork(void (*prepare)(void),
 						void (*parent)(void),
 						void (*child)(void))
 {
@@ -143,7 +143,7 @@ inline __attribute__((weak)) int pthread_atfork(void (*prepare)(void),
 
 #include <errno.h>
 
-inline __attribute__((weak)) int shm_open(const char *name,
+__attribute__((weak)) int shm_open(const char *name,
 					  int oflag,
 					  mode_t mode)
 {
@@ -151,7 +151,7 @@ inline __attribute__((weak)) int shm_open(const char *name,
 	return -1;
 }
 
-inline __attribute__((weak)) int shm_unlink(const char *name)
+__attribute__((weak)) int shm_unlink(const char *name)
 {
 	errno = ENOSYS;
 	return -1;
Signature · 1 line
2.5.5
#1 lore raw

PATCH 2/2 nios2: remove inline keyword

Xenomai user space tools fail to build for bfin target since it's provide it's own pthread_atfork(), shm_open() and shm_unlink() definition using the inline keyword and weak attribute.

With gcc 5+ the weak attribute is discarded by the inline keyword, so each symbol are global and are redefined several time while linking.

Like for the bfin issue:
http://autobuild.buildroot.net/results/0c2/0c2e5eb4edd4f9427f61d3c9b67a12a7a0e24140

---
 include/asm-nios2/syscall.h | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
include/asm-nios2/syscall.h +4 -6
index 44badc6..214871e 100644
@@ -226,11 +226,9 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
 
 /*
  * uClibc does not always provide the following symbols for this arch;
- * provide placeholders here. Note: let the compiler decides whether
- * it wants to actually inline this routine, i.e. do not force
- * always_inline.
+ * provide placeholders here.
  */
-inline __attribute__((weak)) int pthread_atfork(void (*prepare)(void),
+__attribute__((weak)) int pthread_atfork(void (*prepare)(void),
 						void (*parent)(void),
 						void (*child)(void))
 {
@@ -239,7 +237,7 @@ inline __attribute__((weak)) int pthread_atfork(void (*prepare)(void),
 
 #include <errno.h>
 
-inline __attribute__((weak)) int shm_open(const char *name,
+__attribute__((weak)) int shm_open(const char *name,
 					  int oflag,
 					  mode_t mode)
 {
@@ -247,7 +245,7 @@ inline __attribute__((weak)) int shm_open(const char *name,
 	return -1;
 }
 
-inline __attribute__((weak)) int shm_unlink(const char *name)
+__attribute__((weak)) int shm_unlink(const char *name)
 {
 	errno = ENOSYS;
 	return -1;
Signature · 1 line
2.5.5
#2 lore raw
In reply to Romain Naour
Quoted 4 lines · Romain Naour

Xenomai user space tools fail to build for bfin target since it's provide it's own pthread_atfork(), shm_open() and shm_unlink() definition using the inline keyword and weak attribute.

Quoted 8 lines

With gcc 5+ the weak attribute is discarded by the inline keyword, so each symbol are global and are redefined several time while linking.

Fixes:
http://autobuild.buildroot.net/results/0c2/0c2e5eb4edd4f9427f61d3c9b67a12a7a0e24140

Merged, thanks.

Signature · 1 line
Philippe.