linkage.h: fix build breakage due to symbol prefix handling
PATCH 1/1 linkage.h: fix build breakage due to symbol prefix handling
Al's commit e1b5bb6d1236d4ad2084c53aa83dde7cdf6f8eea ("consolidate cond_syscall and SYSCALL_ALIAS declarations") broke the build on blackfin and metag due to the following code:
#ifndef SYMBOL_NAME #ifdef CONFIG_SYMBOL_PREFIX #define SYMBOL_NAME(x) CONFIG_SYMBOL_PREFIX ## x #else #define SYMBOL_NAME(x) x #endif #endif #define __SYMBOL_NAME(x) __stringify(SYMBOL_NAME(x))
__stringify literally stringifies CONFIG_SYMBOL_PREFIX ##x, so you get lines like this in kernel/sys_ni.s:
.weak CONFIG_SYMBOL_PREFIXsys_quotactl
.set CONFIG_SYMBOL_PREFIXsys_quotactl,CONFIG_SYMBOL_PREFIXsys_ni_syscall
The patches in Rusty's modules-next tree such as "CONFIG_SYMBOL_PREFIX:
cleanup." clean up the whole mess around symbol prefixes, so this patch just attempts to fix the build in the mean time. The intermediate definition of SYMBOL_NAME above isn't used and is incorrect when CONFIG_SYMBOL_PREFIX is defined as CONFIG_SYMBOL_PREFIX is a quoted string literal, so define __SYMBOL_NAME directly depending on CONFIG_SYMBOL_PREFIX.
--- include/linux/linkage.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
include/linux/linkage.h +2 -5
@@ -15,14 +15,11 @@#define asmlinkage CPP_ASMLINKAGE#endif -#ifndef SYMBOL_NAME #ifdef CONFIG_SYMBOL_PREFIX -#define SYMBOL_NAME (x) CONFIG_SYMBOL_PREFIX ## x +#define __SYMBOL_NAME (x) CONFIG_SYMBOL_PREFIX __stringify(x)#else -#define SYMBOL_NAME (x) x +#define __SYMBOL_NAME (x) __stringify(x)#endif -#endif -#define __SYMBOL_NAME (x) __stringify(SYMBOL_NAME(x))#ifndef cond_syscall#define cond_syscall (x) asm(".weak\t" __SYMBOL_NAME(x) \
Signature · 1 line
1.8.1.2
Quoted 19 lines · James Hogan
Al's commit
e1b5bb6d1236d4ad2084c53aa83dde7cdf6f8eea("consolidatecond_syscallandSYSCALL_ALIASdeclarations") broke the build on blackfin and metag due to the following code:#ifndef SYMBOL_NAME #ifdef CONFIG_SYMBOL_PREFIX #define SYMBOL_NAME(x) CONFIG_SYMBOL_PREFIX ## x #else #define SYMBOL_NAME(x) x #endif #endif #define __SYMBOL_NAME(x) __stringify(SYMBOL_NAME(x))
__stringifyliterally stringifiesCONFIG_SYMBOL_PREFIX##x, so you get lines like this inkernel/sys_ni.s:.weak
CONFIG_SYMBOL_PREFIXsys_quotactl
.set CONFIG_SYMBOL_PREFIXsys_quotactl,CONFIG_SYMBOL_PREFIXsys_ni_syscall
Quoted 7 lines
The patches in Rusty's modules-next tree such as "
CONFIG_SYMBOL_PREFIX:
cleanup." clean up the whole mess around symbol prefixes, so this patch just attempts to fix the build in the mean time. The intermediate definition ofSYMBOL_NAMEabove isn't used and is incorrect whenCONFIG_SYMBOL_PREFIXis defined asCONFIG_SYMBOL_PREFIXis a quoted string literal, so define__SYMBOL_NAMEdirectly depending onCONFIG_SYMBOL_PREFIX.
Oh, hell... Guys, my deep apologies - what happened is that this thing has been caught in -next, rebase done here (on top of Rusty's commit) and *not* pushed to linux-next. Unfortunately, folks had been too polite and didn't keep kicking me - mistake, since the whole thing got forgotten ;-/ Sigh...
Quoted 28 lines · Al Viro
Quoted 19 lines · James Hogan
Al's commit
e1b5bb6d1236d4ad2084c53aa83dde7cdf6f8eea("consolidatecond_syscallandSYSCALL_ALIASdeclarations") broke the build on blackfin and metag due to the following code:#ifndef SYMBOL_NAME #ifdef CONFIG_SYMBOL_PREFIX #define SYMBOL_NAME(x) CONFIG_SYMBOL_PREFIX ## x #else #define SYMBOL_NAME(x) x #endif #endif #define __SYMBOL_NAME(x) __stringify(SYMBOL_NAME(x))
__stringifyliterally stringifiesCONFIG_SYMBOL_PREFIX##x, so you get lines like this inkernel/sys_ni.s:.weak
CONFIG_SYMBOL_PREFIXsys_quotactl
.set CONFIG_SYMBOL_PREFIXsys_quotactl,CONFIG_SYMBOL_PREFIXsys_ni_syscallQuoted 7 lines
The patches in Rusty's modules-next tree such as "
CONFIG_SYMBOL_PREFIX:
cleanup." clean up the whole mess around symbol prefixes, so this patch just attempts to fix the build in the mean time. The intermediate definition ofSYMBOL_NAMEabove isn't used and is incorrect whenCONFIG_SYMBOL_PREFIXis defined asCONFIG_SYMBOL_PREFIXis a quoted string literal, so define__SYMBOL_NAMEdirectly depending onCONFIG_SYMBOL_PREFIX.
Quoted 5 lines
Oh, hell... Guys, my deep apologies - what happened is that this thing has been caught in -next, rebase done here (on top of Rusty's commit) and *not* pushed to linux-next. Unfortunately, folks had been too polite and didn't keep kicking me - mistake, since the whole thing got forgotten ;-/ Sigh...
No worries. Unfortunately after the tip of linux-next started working again with Rusty's commit it sort of fell off my radar.
Cheers
James
Quoted 3 lines · Al Viro
Oh, hell... Guys, my deep apologies - what happened is that this thing has been caught in -next, rebase done here (on top of Rusty's commit) and *not* pushed to linux-next.
Curiouser and curiouser... FWIW, what I have is
$ cat .git/refs/heads/linkage-fixed 898429c05290b8c05d035199f65a3bb034b34bb7 $ cat .git/refs/heads/remotes/next 898429c05290b8c05d035199f65a3bb034b34bb7 both being the aforementioned rebase; I really wonder WTF had I been doing that could've produced that... How does git deal with that sort of ambiguities? $ git log remotes/next | head -3 commit 898429c05290b8c05d035199f65a3bb034b34bb7 Author: Al Viro <[email protected]> Date: Tue Mar 19 14:25:51 2013 -0400 $ git log remotes/next/master | head -3 commit d7c35d45ce991ae01b6008abef120173fc9c3814 Author: Stephen Rothwell <[email protected]> Date: Tue Apr 30 16:26:41 2013 +1000 (the latter, of course, coming from remote for linux-next mirror)
Quoted 19 lines · James Hogan
Al's commit
e1b5bb6d1236d4ad2084c53aa83dde7cdf6f8eea("consolidatecond_syscallandSYSCALL_ALIASdeclarations") broke the build on blackfin and metag due to the following code:#ifndef SYMBOL_NAME #ifdef CONFIG_SYMBOL_PREFIX #define SYMBOL_NAME(x) CONFIG_SYMBOL_PREFIX ## x #else #define SYMBOL_NAME(x) x #endif #endif #define __SYMBOL_NAME(x) __stringify(SYMBOL_NAME(x))
__stringifyliterally stringifiesCONFIG_SYMBOL_PREFIX##x, so you get lines like this inkernel/sys_ni.s:.weak
CONFIG_SYMBOL_PREFIXsys_quotactl
.set CONFIG_SYMBOL_PREFIXsys_quotactl,CONFIG_SYMBOL_PREFIXsys_ni_syscall
Quoted 7 lines
The patches in Rusty's modules-next tree such as "
CONFIG_SYMBOL_PREFIX:
cleanup." clean up the whole mess around symbol prefixes, so this patch just attempts to fix the build in the mean time. The intermediate definition ofSYMBOL_NAMEabove isn't used and is incorrect whenCONFIG_SYMBOL_PREFIXis defined asCONFIG_SYMBOL_PREFIXis a quoted string literal, so define__SYMBOL_NAMEdirectly depending onCONFIG_SYMBOL_PREFIX.
I just pushed my modules-next tree to Linus, so hopefully the nightmare is over soon!
Cheers,
Rusty.
Hi all,
Quoted 29 lines · On Thu, 02 May 2013 09:58:08 +0930 Rusty Russell <[email protected]> wrote:
Quoted 19 lines · James Hogan
Al's commit
e1b5bb6d1236d4ad2084c53aa83dde7cdf6f8eea("consolidatecond_syscallandSYSCALL_ALIASdeclarations") broke the build on blackfin and metag due to the following code:#ifndef SYMBOL_NAME #ifdef CONFIG_SYMBOL_PREFIX #define SYMBOL_NAME(x) CONFIG_SYMBOL_PREFIX ## x #else #define SYMBOL_NAME(x) x #endif #endif #define __SYMBOL_NAME(x) __stringify(SYMBOL_NAME(x))
__stringifyliterally stringifiesCONFIG_SYMBOL_PREFIX##x, so you get lines like this inkernel/sys_ni.s:.weak
CONFIG_SYMBOL_PREFIXsys_quotactl
.set CONFIG_SYMBOL_PREFIXsys_quotactl,CONFIG_SYMBOL_PREFIXsys_ni_syscallQuoted 7 lines
The patches in Rusty's modules-next tree such as "
CONFIG_SYMBOL_PREFIX:
cleanup." clean up the whole mess around symbol prefixes, so this patch just attempts to fix the build in the mean time. The intermediate definition ofSYMBOL_NAMEabove isn't used and is incorrect whenCONFIG_SYMBOL_PREFIXis defined asCONFIG_SYMBOL_PREFIXis a quoted string literal, so define__SYMBOL_NAMEdirectly depending onCONFIG_SYMBOL_PREFIX.
Quoted 2 lines
I just pushed my modules-next tree to Linus, so hopefully the nightmare is over soon!
This is the merge fix patch I have been carrying in linux-next since March 14: (this probably does not quite apply any more but, hey ...)
From: Stephen Rothwell <[email protected]>
Date: Thu, 14 Mar 2013 17:14:41 +1100
Subject: [PATCH] cond_syscall and SYSCALL_ALIAS merge fixup
--- include/linux/linkage.h | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-)
include/linux/linkage.h +6 -14
@@ -2,7 +2,7 @@#define _LINUX_LINKAGE_H#include <linux/compiler.h> -#include <linux/stringify.h> +#include <linux/export.h> #include <asm/linkage.h> #ifdef __cplusplus
@@ -15,24 +15,16 @@#define asmlinkage CPP_ASMLINKAGE#endif -#ifndef SYMBOL_NAME -#ifdef CONFIG_SYMBOL_PREFIX -#define SYMBOL_NAME (x) CONFIG_SYMBOL_PREFIX ## x -#else -#define SYMBOL_NAME (x) x -#endif -#endif -#define __SYMBOL_NAME (x) __stringify(SYMBOL_NAME(x)) -#ifndef cond_syscall -#define cond_syscall (x) asm(".weak\t" __SYMBOL_NAME(x) \ - "\n\t.set\t" __SYMBOL_NAME(x) "," __SYMBOL_NAME(sys_ni_syscall)); +#define cond_syscall (x) asm(".weak\t" VMLINUX_SYMBOL_STR(x) "\n\t" \ + ".set\t" VMLINUX_SYMBOL_STR(x) "," \ + VMLINUX_SYMBOL_STR(sys_ni_syscall))#endif #ifndef SYSCALL_ALIAS #define SYSCALL_ALIAS (alias, name) \ - asm ("\t.globl " __SYMBOL_NAME(alias) \ - "\n\t.set\t" __SYMBOL_NAME(alias) "," __SYMBOL_NAME(name)) + asm ("\t.globl " VMLINUX_SYMBOL_STR(alias) \ + "\n\t.set\t" VMLINUX_SYMBOL_STR(alias) "," VMLINUX_SYMBOL_STR(name))#endif #define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE)
Signature · 5 lines
1.8.1 -- Cheers, Stephen Rothwell [email protected]
Hi Rusty,
Quoted 58 lines · On Thu, 2 May 2013 13:37:37 +1000 Stephen Rothwell <[email protected]> wrote:
This is the merge fix patch I have been carrying in linux-next since March 14: (this probably does not quite apply any more but, hey ...)
From: Stephen Rothwell <[email protected]>
Date: Thu, 14 Mar 2013 17:14:41 +1100
Subject: [PATCH]cond_syscallandSYSCALL_ALIASmerge fixupSigned-off-by Stephen Rothwell <[email protected]>--- include/linux/linkage.h | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-)include/linux/linkage.h +6
-14@@ -2,7 +2,7 @@#define _LINUX_LINKAGE_H#include <linux/compiler.h> -#include <linux/stringify.h> +#include <linux/export.h> #include <asm/linkage.h> #ifdef __cplusplus@@ -15,24 +15,16 @@#define asmlinkage CPP_ASMLINKAGE#endif -#ifndef SYMBOL_NAME -#ifdef CONFIG_SYMBOL_PREFIX -#define SYMBOL_NAME (x) CONFIG_SYMBOL_PREFIX ## x -#else -#define SYMBOL_NAME (x) x -#endif -#endif -#define __SYMBOL_NAME (x) __stringify(SYMBOL_NAME(x)) -#ifndef cond_syscall -#define cond_syscall (x) asm(".weak\t" __SYMBOL_NAME(x) \ - "\n\t.set\t" __SYMBOL_NAME(x) "," __SYMBOL_NAME(sys_ni_syscall)); +#define cond_syscall (x) asm(".weak\t" VMLINUX_SYMBOL_STR(x) "\n\t" \ + ".set\t" VMLINUX_SYMBOL_STR(x) "," \ + VMLINUX_SYMBOL_STR(sys_ni_syscall))#endif #ifndef SYSCALL_ALIAS #define SYSCALL_ALIAS (alias, name) \ - asm ("\t.globl " __SYMBOL_NAME(alias) \ - "\n\t.set\t" __SYMBOL_NAME(alias) "," __SYMBOL_NAME(name)) + asm ("\t.globl " VMLINUX_SYMBOL_STR(alias) \ + "\n\t.set\t" VMLINUX_SYMBOL_STR(alias) "," VMLINUX_SYMBOL_STR(name))#endif #define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE)Signature · 1 line
1.8.1
Version from today's merge fix. Rusty, you should show this to Linus when you ask him to merge your modules tree (assuming it looks right :-)).
From: Stephen Rothwell <[email protected]>
Date: Thu, 14 Mar 2013 17:14:41 +1100
Subject: [PATCH] cond_syscall and SYSCALL_ALIAS merge fixup
--- include/linux/linkage.h | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-)
include/linux/linkage.h +6 -11
@@ -2,7 +2,7 @@#define _LINUX_LINKAGE_H#include <linux/compiler.h> -#include <linux/stringify.h> +#include <linux/export.h> #include <asm/linkage.h> #ifdef __cplusplus
@@ -15,21 +15,16 @@#define asmlinkage CPP_ASMLINKAGE#endif -#ifdef CONFIG_SYMBOL_PREFIX -#define __SYMBOL_NAME (x) CONFIG_SYMBOL_PREFIX __stringify(x) -#else -#define __SYMBOL_NAME (x) __stringify(x) -#endif -#ifndef cond_syscall -#define cond_syscall (x) asm(".weak\t" __SYMBOL_NAME(x) \ - "\n\t.set\t" __SYMBOL_NAME(x) "," __SYMBOL_NAME(sys_ni_syscall)); +#define cond_syscall (x) asm(".weak\t" VMLINUX_SYMBOL_STR(x) "\n\t" \ + ".set\t" VMLINUX_SYMBOL_STR(x) "," \ + VMLINUX_SYMBOL_STR(sys_ni_syscall))#endif #ifndef SYSCALL_ALIAS #define SYSCALL_ALIAS (alias, name) \ - asm ("\t.globl " __SYMBOL_NAME(alias) \ - "\n\t.set\t" __SYMBOL_NAME(alias) "," __SYMBOL_NAME(name)) + asm ("\t.globl " VMLINUX_SYMBOL_STR(alias) \ + "\n\t.set\t" VMLINUX_SYMBOL_STR(alias) "," VMLINUX_SYMBOL_STR(name))#endif #define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE)
Signature · 2 lines
Cheers, Stephen Rothwell [email protected]
Quoted 8 lines · Stephen Rothwell
Version from today's merge fix. Rusty, you should show this to Linus when you ask him to merge your modules tree (assuming it looks right :-)).
From: Stephen Rothwell <[email protected]>
Date: Thu, 14 Mar 2013 17:14:41 +1100
Subject: [PATCH]cond_syscallandSYSCALL_ALIASmerge fixupSigned-off-by Stephen Rothwell <[email protected]>
I ended up with something similar, except I didn't remove linux/stringify.h from the includes.
Thanks!
Rusty.
Quoted 48 lines
--- include/linux/linkage.h | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-)include/linux/linkage.h +6
-11@@ -2,7 +2,7 @@#define _LINUX_LINKAGE_H#include <linux/compiler.h> -#include <linux/stringify.h> +#include <linux/export.h> #include <asm/linkage.h> #ifdef __cplusplus@@ -15,21 +15,16 @@#define asmlinkage CPP_ASMLINKAGE#endif -#ifdef CONFIG_SYMBOL_PREFIX -#define __SYMBOL_NAME (x) CONFIG_SYMBOL_PREFIX __stringify(x) -#else -#define __SYMBOL_NAME (x) __stringify(x) -#endif -#ifndef cond_syscall -#define cond_syscall (x) asm(".weak\t" __SYMBOL_NAME(x) \ - "\n\t.set\t" __SYMBOL_NAME(x) "," __SYMBOL_NAME(sys_ni_syscall)); +#define cond_syscall (x) asm(".weak\t" VMLINUX_SYMBOL_STR(x) "\n\t" \ + ".set\t" VMLINUX_SYMBOL_STR(x) "," \ + VMLINUX_SYMBOL_STR(sys_ni_syscall))#endif #ifndef SYSCALL_ALIAS #define SYSCALL_ALIAS (alias, name) \ - asm ("\t.globl " __SYMBOL_NAME(alias) \ - "\n\t.set\t" __SYMBOL_NAME(alias) "," __SYMBOL_NAME(name)) + asm ("\t.globl " VMLINUX_SYMBOL_STR(alias) \ + "\n\t.set\t" VMLINUX_SYMBOL_STR(alias) "," VMLINUX_SYMBOL_STR(name))#endif #define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE)Signature · 3 lines
-- Cheers, Stephen Rothwell [email protected]
Hi Rusty,
Quoted 5 lines · On Mon, 06 May 2013 14:59:05 +0930 Rusty Russell <[email protected]> wrote:
Quoted 3 lines · Stephen Rothwell
Version from today's merge fix. Rusty, you should show this to Linus when you ask him to merge your modules tree (assuming it looks right :-)).
Quoted 8 lines
Quoted 5 lines
From: Stephen Rothwell <[email protected]>
Date: Thu, 14 Mar 2013 17:14:41 +1100
Subject: [PATCH]cond_syscallandSYSCALL_ALIASmerge fixupSigned-off-by Stephen Rothwell <[email protected]>I ended up with something similar, except I didn't remove
linux/stringify.hfrom the includes.
Well, the stringify include was only added in Al's patch during this merge window, so it should be perfectly safe to remove again (now that all the "stringify" calls have been removed again).
Signature · 2 lines
Cheers, Stephen Rothwell [email protected]