Skip to content

Commit

Permalink
linkage.h: fix build breakage due to symbol prefix handling
Browse files Browse the repository at this point in the history
Al's commit e1b5bb6 ("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." cleans up the whole mess around symbol prefixes, so this patch
just attempts to fix the build in the meantime.

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.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Mea-culpa-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: uclinux-dist-devel@blackfin.uclinux.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
James Hogan authored and torvalds committed May 1, 2013
1 parent 73287a4 commit 126de6b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions include/linux/linkage.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down

0 comments on commit 126de6b

Please sign in to comment.