2012-11-12 16:53:47 +01:00
|
|
|
# -*- Autoconf -*-
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
2012-11-14 01:02:12 +01:00
|
|
|
AC_PREREQ([2.64])
|
2012-11-12 16:53:47 +01:00
|
|
|
AC_INIT(package-unused, version-unused, libsanitizer)
|
|
|
|
AC_CONFIG_SRCDIR([include/sanitizer/common_interface_defs.h])
|
2012-11-15 01:03:37 +01:00
|
|
|
|
|
|
|
AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
|
|
|
|
AC_ARG_ENABLE(version-specific-runtime-libs,
|
|
|
|
[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
|
|
|
|
[case "$enableval" in
|
|
|
|
yes) version_specific_libs=yes ;;
|
|
|
|
no) version_specific_libs=no ;;
|
|
|
|
*) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
|
|
|
|
esac],
|
|
|
|
[version_specific_libs=no])
|
|
|
|
AC_MSG_RESULT($version_specific_libs)
|
|
|
|
|
|
|
|
# Do not delete or change the following two lines. For why, see
|
|
|
|
# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
|
|
|
|
AC_CANONICAL_SYSTEM
|
|
|
|
target_alias=${target_alias-$host_alias}
|
|
|
|
AC_SUBST(target_alias)
|
2012-12-11 22:32:11 +01:00
|
|
|
GCC_LIBSTDCXX_RAW_CXX_FLAGS
|
2012-11-15 01:03:37 +01:00
|
|
|
|
2013-03-22 15:14:42 +01:00
|
|
|
AM_INIT_AUTOMAKE(foreign no-dist)
|
2012-11-15 01:03:37 +01:00
|
|
|
AM_ENABLE_MULTILIB(, ..)
|
2012-11-16 16:19:15 +01:00
|
|
|
AM_MAINTAINER_MODE
|
2012-11-15 01:03:37 +01:00
|
|
|
|
|
|
|
# Calculate toolexeclibdir
|
|
|
|
# Also toolexecdir, though it's only used in toolexeclibdir
|
|
|
|
case ${version_specific_libs} in
|
|
|
|
yes)
|
|
|
|
# Need the gcc compiler version to know where to install libraries
|
|
|
|
# and header files if --enable-version-specific-runtime-libs option
|
|
|
|
# is selected.
|
|
|
|
toolexecdir='$(libdir)/gcc/$(target_alias)'
|
|
|
|
toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
|
|
|
|
;;
|
|
|
|
no)
|
|
|
|
if test -n "$with_cross_host" &&
|
|
|
|
test x"$with_cross_host" != x"no"; then
|
|
|
|
# Install a library built with a cross compiler in tooldir, not libdir.
|
|
|
|
toolexecdir='$(exec_prefix)/$(target_alias)'
|
|
|
|
toolexeclibdir='$(toolexecdir)/lib'
|
|
|
|
else
|
|
|
|
toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
|
|
|
|
toolexeclibdir='$(libdir)'
|
|
|
|
fi
|
|
|
|
multi_os_directory=`$CC -print-multi-os-directory`
|
|
|
|
case $multi_os_directory in
|
|
|
|
.) ;; # Avoid trailing /.
|
|
|
|
*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
AC_SUBST(toolexecdir)
|
|
|
|
AC_SUBST(toolexeclibdir)
|
2012-11-12 16:53:47 +01:00
|
|
|
|
|
|
|
# Checks for programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CXX
|
|
|
|
AM_PROG_AS
|
|
|
|
|
|
|
|
AC_LIBTOOL_DLOPEN
|
|
|
|
AM_PROG_LIBTOOL
|
|
|
|
|
|
|
|
AC_SUBST(enable_shared)
|
|
|
|
AC_SUBST(enable_static)
|
|
|
|
|
2012-11-23 01:31:54 +01:00
|
|
|
AC_CHECK_SIZEOF([void *])
|
|
|
|
|
2012-11-15 01:03:37 +01:00
|
|
|
if test "${multilib}" = "yes"; then
|
|
|
|
multilib_arg="--enable-multilib"
|
|
|
|
else
|
|
|
|
multilib_arg=
|
|
|
|
fi
|
2012-11-23 01:31:54 +01:00
|
|
|
|
|
|
|
# Get target configury.
|
|
|
|
unset TSAN_SUPPORTED
|
re PR sanitizer/59061 (Port leaksanitizer)
PR sanitizer/59061
* common.opt (static-liblsan): Add.
* config/gnu-user.h (STATIC_LIBLSAN_LIBS, STATIC_LIBUBSAN_LIBS):
Define.
* flag-types.h (enum sanitize_code): Add SANITIZE_LEAK. Renumber
SANITIZE_SHIFT, SANITIZE_DIVIDE, SANITIZE_UNREACHABLE, SANITIZE_VLA,
SANITIZE_RETURN.
* opts.c (common_handle_option): Handle -fsanitize=leak.
* gcc.c (ADD_STATIC_LIBLSAN_LIBS, LIBLSAN_SPEC): Define.
(LIBUBSAN_SPEC): Don't test LIBUBSAN_EARLY_SPEC.
(LIBUBSAN_EARLY_SPEC): Remove.
(SANITIZER_EARLY_SPEC): Don't do anything for libubsan.
(SANITIZER_SPEC): Add -fsanitize=leak handling.
(sanitize_spec_function): Handle %sanitize(leak).
* doc/invoke.texi (-static-liblsan, -fsanitize=leak): Document.
* c-c++-common/asan/no-redundant-instrumentation-7.c: Fix
cleanup-tree-dump directive.
* configure.tgt: Set LSAN_SUPPORTED=yes for x86_64-linux.
* configure.ac (LSAN_SUPPORTED): New AM_CONDITIONAL.
* configure: Regenerated.
* lsan/Makefile.am (toolexeclib_LTLIBRARIES, lsan_files,
liblsan_la_SOURCES, liblsan_la_LIBADD, liblsan_la_LDFLAGS): Add.
* lsan/Makefile.in: Regenerated.
From-SVN: r205290
2013-11-22 22:13:08 +01:00
|
|
|
unset LSAN_SUPPORTED
|
2012-11-23 01:31:54 +01:00
|
|
|
. ${srcdir}/configure.tgt
|
|
|
|
AM_CONDITIONAL(TSAN_SUPPORTED, [test "x$TSAN_SUPPORTED" = "xyes"])
|
re PR sanitizer/59061 (Port leaksanitizer)
PR sanitizer/59061
* common.opt (static-liblsan): Add.
* config/gnu-user.h (STATIC_LIBLSAN_LIBS, STATIC_LIBUBSAN_LIBS):
Define.
* flag-types.h (enum sanitize_code): Add SANITIZE_LEAK. Renumber
SANITIZE_SHIFT, SANITIZE_DIVIDE, SANITIZE_UNREACHABLE, SANITIZE_VLA,
SANITIZE_RETURN.
* opts.c (common_handle_option): Handle -fsanitize=leak.
* gcc.c (ADD_STATIC_LIBLSAN_LIBS, LIBLSAN_SPEC): Define.
(LIBUBSAN_SPEC): Don't test LIBUBSAN_EARLY_SPEC.
(LIBUBSAN_EARLY_SPEC): Remove.
(SANITIZER_EARLY_SPEC): Don't do anything for libubsan.
(SANITIZER_SPEC): Add -fsanitize=leak handling.
(sanitize_spec_function): Handle %sanitize(leak).
* doc/invoke.texi (-static-liblsan, -fsanitize=leak): Document.
* c-c++-common/asan/no-redundant-instrumentation-7.c: Fix
cleanup-tree-dump directive.
* configure.tgt: Set LSAN_SUPPORTED=yes for x86_64-linux.
* configure.ac (LSAN_SUPPORTED): New AM_CONDITIONAL.
* configure: Regenerated.
* lsan/Makefile.am (toolexeclib_LTLIBRARIES, lsan_files,
liblsan_la_SOURCES, liblsan_la_LIBADD, liblsan_la_LDFLAGS): Add.
* lsan/Makefile.in: Regenerated.
From-SVN: r205290
2013-11-22 22:13:08 +01:00
|
|
|
AM_CONDITIONAL(LSAN_SUPPORTED, [test "x$LSAN_SUPPORTED" = "xyes"])
|
2012-11-12 16:53:47 +01:00
|
|
|
|
2013-11-29 13:30:36 +01:00
|
|
|
# Check for functions needed.
|
|
|
|
AC_CHECK_FUNCS(clock_getres clock_gettime clock_settime)
|
|
|
|
|
|
|
|
# Common libraries that we need to link against for all sanitizer libs.
|
2013-12-05 15:41:38 +01:00
|
|
|
link_sanitizer_common='-lpthread -ldl -lm'
|
2013-11-29 13:30:36 +01:00
|
|
|
|
|
|
|
# Set up the set of additional libraries that we need to link against for libasan.
|
|
|
|
link_libasan=$link_sanitizer_common
|
|
|
|
AC_SUBST(link_libasan)
|
|
|
|
|
|
|
|
# Set up the set of additional libraries that we need to link against for libtsan.
|
|
|
|
link_libtsan=$link_sanitizer_common
|
|
|
|
AC_SUBST(link_libtsan)
|
|
|
|
|
|
|
|
# Set up the set of additional libraries that we need to link against for libubsan.
|
|
|
|
link_libubsan=$link_sanitizer_common
|
|
|
|
AC_SUBST(link_libubsan)
|
|
|
|
|
|
|
|
# Set up the set of additional libraries that we need to link against for liblsan.
|
|
|
|
link_liblsan=$link_sanitizer_common
|
|
|
|
AC_SUBST(link_liblsan)
|
|
|
|
|
|
|
|
# At least for glibc, clock_gettime is in librt. But don't pull that
|
|
|
|
# in if it still doesn't give us the function we want. This
|
|
|
|
# test is copied from libgomp.
|
|
|
|
if test $ac_cv_func_clock_gettime = no; then
|
|
|
|
AC_CHECK_LIB(rt, clock_gettime,
|
|
|
|
[link_libasan="-lrt $link_libasan"
|
|
|
|
link_libtsan="-lrt $link_libtsan"
|
|
|
|
# Other sanitizers do not override clock_* API
|
|
|
|
])
|
|
|
|
fi
|
|
|
|
|
2012-11-24 19:24:13 +01:00
|
|
|
case "$host" in
|
2012-12-06 15:49:44 +01:00
|
|
|
*-*-darwin*) MAC_INTERPOSE=true ; enable_static=no ;;
|
2012-12-04 08:00:35 +01:00
|
|
|
*) MAC_INTERPOSE=false ;;
|
2012-11-24 19:24:13 +01:00
|
|
|
esac
|
2012-12-04 08:00:35 +01:00
|
|
|
AM_CONDITIONAL(USING_MAC_INTERPOSE, $MAC_INTERPOSE)
|
2012-11-24 19:24:13 +01:00
|
|
|
|
2013-11-29 13:30:36 +01:00
|
|
|
AC_CONFIG_FILES([Makefile libsanitizer.spec])
|
2012-11-12 16:53:47 +01:00
|
|
|
|
2013-11-04 22:33:31 +01:00
|
|
|
AC_CONFIG_FILES(AC_FOREACH([DIR], [interception sanitizer_common lsan asan ubsan], [DIR/Makefile ]),
|
2012-11-12 16:53:47 +01:00
|
|
|
[cat > vpsed$$ << \_EOF
|
|
|
|
s!`test -f '$<' || echo '$(srcdir)/'`!!
|
|
|
|
_EOF
|
|
|
|
sed -f vpsed$$ $ac_file > tmp$$
|
|
|
|
mv tmp$$ $ac_file
|
|
|
|
rm vpsed$$
|
|
|
|
echo 'MULTISUBDIR =' >> $ac_file
|
2012-11-15 17:00:47 +01:00
|
|
|
ml_norecursion=yes
|
|
|
|
. ${multi_basedir}/config-ml.in
|
|
|
|
AS_UNSET([ml_norecursion])
|
2012-11-12 16:53:47 +01:00
|
|
|
])
|
|
|
|
|
2012-11-23 01:31:54 +01:00
|
|
|
if test "x$TSAN_SUPPORTED" = "xyes"; then
|
2012-11-22 23:03:11 +01:00
|
|
|
AC_CONFIG_FILES(AC_FOREACH([DIR], [tsan], [DIR/Makefile ]),
|
|
|
|
[cat > vpsed$$ << \_EOF
|
|
|
|
s!`test -f '$<' || echo '$(srcdir)/'`!!
|
|
|
|
_EOF
|
|
|
|
sed -f vpsed$$ $ac_file > tmp$$
|
|
|
|
mv tmp$$ $ac_file
|
|
|
|
rm vpsed$$
|
|
|
|
echo 'MULTISUBDIR =' >> $ac_file
|
|
|
|
ml_norecursion=yes
|
|
|
|
. ${multi_basedir}/config-ml.in
|
|
|
|
AS_UNSET([ml_norecursion])
|
|
|
|
])
|
|
|
|
fi
|
|
|
|
|
2012-11-12 16:53:47 +01:00
|
|
|
AC_OUTPUT
|