about summary refs log tree commit diff
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in30
1 files changed, 30 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index e6b2dacf1d..6203266658 100644
--- a/configure.in
+++ b/configure.in
@@ -1050,6 +1050,36 @@ if test "$libc_cv_gcc_builtin_expect" = yes; then
   AC_DEFINE(HAVE_BUILTIN_EXPECT)
 fi
 
+dnl Check whether the compiler supports subtraction of local labels.
+AC_CACHE_CHECK(for local label subtraction, libc_cv_gcc_subtract_local_labels,
+[cat > conftest.c <<EOF
+changequote(,)dnl
+#line __oline__ "configure"
+int foo (int a)
+{
+  static const int ar[] = { &&l1 - &&l1, &&l2 - &&l1 };
+  void *p = &&l1 + ar[a];
+  goto *p;
+ l1:
+  return 1;
+ l2:
+  return 2;
+}
+changequote([,])dnl
+EOF
+dnl No \ in command here because it ends up inside ''.
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -nostdlib -nostartfiles
+			    -o conftest conftest.c -lgcc >&AC_FD_CC]); then
+  libc_cv_gcc_subtract_local_labels=yes
+else
+  libc_cv_gcc_subtract_local_labels=no
+fi
+rm -f conftest*])
+if test "$libc_cv_gcc_subtract_local_labels" = yes; then
+  AC_DEFINE(HAVE_SUBTRACT_LOCAL_LABELS)
+fi
+
+
 ### End of automated tests.
 ### Now run sysdeps configure fragments.