aboutsummaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-07-31 05:15:48 +0000
committerUlrich Drepper <drepper@redhat.com>1999-07-31 05:15:48 +0000
commit3d558f4ec7fecbac0dddb4d321a1ec10f14e8e03 (patch)
tree03f30bc95d97fe7f240c01644ca564a814bf542b /configure.in
parent94ffedf6e607675b0eeb7dfec020d722a0b94230 (diff)
downloadglibc-3d558f4ec7fecbac0dddb4d321a1ec10f14e8e03.zip
glibc-3d558f4ec7fecbac0dddb4d321a1ec10f14e8e03.tar.gz
glibc-3d558f4ec7fecbac0dddb4d321a1ec10f14e8e03.tar.bz2
Update.
* configure.in: Add test for local label subtraction. * config.h.in: Ad HAVE_SUBTRACT_LOCAL_LABELS. * stdio-common/vfprintf.c (vfprintf): Use subtraction of local labels to reduce number of runtime relocations and move jump tables in read-only seciton.
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 e6b2dac..6203266 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.