Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

ARM: 7333/2: jump label: detect %c support for ARM

Some versions of ARM GCC which do support asm goto, do not support
the %c specifier.  Since we need the %c to support jump labels
on ARM, detect that too in the asm goto detection script to avoid
build errors with these versions.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48637

Acked-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information...
commit a9468f30b5eac6957c86aea97954553bfb7c1f18 1 parent 9b5a146
rabinv rabinv authored Russell King committed

Showing 1 changed file with 17 additions and 1 deletion. Show diff stats Hide diff stats

  1. +17 1 scripts/gcc-goto.sh
18 scripts/gcc-goto.sh
@@ -2,4 +2,20 @@
2 2 # Test for gcc 'asm goto' support
3 3 # Copyright (C) 2010, Jason Baron <jbaron@redhat.com>
4 4
5   -echo "int main(void) { entry: asm goto (\"\"::::entry); return 0; }" | $@ -x c - -c -o /dev/null >/dev/null 2>&1 && echo "y"
  5 +cat << "END" | $@ -x c - -c -o /dev/null >/dev/null 2>&1 && echo "y"
  6 +int main(void)
  7 +{
  8 +#ifdef __arm__
  9 + /*
  10 + * Not related to asm goto, but used by jump label
  11 + * and broken on some ARM GCC versions (see GCC Bug 48637).
  12 + */
  13 + static struct { int dummy; int state; } tp;
  14 + asm (".long %c0" :: "i" (&tp.state));
  15 +#endif
  16 +
  17 +entry:
  18 + asm goto ("" :::: entry);
  19 + return 0;
  20 +}
  21 +END

0 comments on commit a9468f3

Please sign in to comment.
Something went wrong with that request. Please try again.