X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=scripts%2Fgcc-goto.sh;h=a2af2e88daf3e094bc786f368ce4fe88d5b947d7;hb=dbfad21422f8d2c0866185b3e449c4a6ebaec4e2;hp=98cffcb941ea6e319fd4bee04db7f06de379031b;hpb=882aba01052476cbe3cd7339a3e6784b2437f18d;p=firefly-linux-kernel-4.4.55.git diff --git a/scripts/gcc-goto.sh b/scripts/gcc-goto.sh index 98cffcb941ea..a2af2e88daf3 100644 --- a/scripts/gcc-goto.sh +++ b/scripts/gcc-goto.sh @@ -2,4 +2,20 @@ # Test for gcc 'asm goto' support # Copyright (C) 2010, Jason Baron -echo "int main(void) { entry: asm goto (\"\"::::entry); return 0; }" | $@ -x c - -c -o /dev/null >/dev/null 2>&1 && echo "y" +cat << "END" | $@ -x c - -c -o /dev/null >/dev/null 2>&1 && echo "y" +int main(void) +{ +#ifdef __arm__ + /* + * Not related to asm goto, but used by jump label + * and broken on some ARM GCC versions (see GCC Bug 48637). + */ + static struct { int dummy; int state; } tp; + asm (".long %c0" :: "i" (&tp.state)); +#endif + +entry: + asm goto ("" :::: entry); + return 0; +} +END