summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2013-12-06 07:01:50 (GMT)
committerJason Evans <jasone@canonware.com>2013-12-06 07:01:50 (GMT)
commitd37d5adee4e4570cfda83e5f1b948a25b9226224 (patch)
treec69c1d7a8ccb3b73c2cdadee8ed732461cd0300b /configure.ac
parentdc1bed62272045651e4bbf2cd85f6fccaf7b1331 (diff)
downloadjemalloc-d37d5adee4e4570cfda83e5f1b948a25b9226224.zip
jemalloc-d37d5adee4e4570cfda83e5f1b948a25b9226224.tar.gz
jemalloc-d37d5adee4e4570cfda83e5f1b948a25b9226224.tar.bz2
Disable floating point code/linking when possible.
Unless heap profiling is enabled, disable floating point code and don't link with libm. This, in combination with e.g. EXTRA_CFLAGS=-mno-sse on x64 systems, makes it possible to completely disable floating point register use. Some versions of glibc neglect to save/restore caller-saved floating point registers during dynamic lazy symbol loading, and the symbol loading code uses whatever malloc the application happens to have linked/loaded with, the result being potential floating point register corruption.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac11
1 files changed, 6 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 7f0fecc..1103cc7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -356,11 +356,6 @@ AC_SUBST([ARFLAGS])
AC_SUBST([AROUT])
AC_SUBST([CC_MM])
-if test "x$abi" != "xpecoff"; then
- dnl Heap profiling uses the log(3) function.
- LIBS="$LIBS -lm"
-fi
-
JE_COMPILABLE([__attribute__ syntax],
[static __attribute__((unused)) void foo(void){}],
[],
@@ -774,6 +769,12 @@ if test "x$enable_prof" = "x1" ; then
AC_MSG_ERROR([Heap profiling requires TLS]);
fi
force_tls="1"
+
+ if test "x$abi" != "xpecoff"; then
+ dnl Heap profiling uses the log(3) function.
+ LIBS="$LIBS -lm"
+ fi
+
AC_DEFINE([JEMALLOC_PROF], [ ])
fi
AC_SUBST([enable_prof])