2 ##------------------------------------------------------------##
4 # The multiple-architecture stuff in this file is pretty
5 # cryptic. Read docs/internals/multiple-architectures.txt
6 # for at least a partial explanation of what is going on.
8 ##------------------------------------------------------------##
10 # Process this file with autoconf to produce a configure script.
12 # Define major, minor, micro and suffix here once, then reuse them
13 # for version number in valgrind.h and vg-entities (documentation).
14 # suffix must be empty for a release, otherwise it is GIT or RC1, etc.
15 # Also set the (expected/last) release date here.
16 # Do not forget to rerun ./autogen.sh
17 m4_define([v_major_ver], [3])
18 m4_define([v_minor_ver], [21])
19 m4_define([v_micro_ver], [0])
20 m4_define([v_suffix_ver], [RC1])
21 m4_define([v_rel_date], ["14 Apr 2023"])
22 m4_define([v_version],
23 m4_if(v_suffix_ver, [],
24 [v_major_ver.v_minor_ver.v_micro_ver],
25 [v_major_ver.v_minor_ver.v_micro_ver.v_suffix_ver]))
26 AC_INIT([Valgrind],[v_version],[valgrind-users@lists.sourceforge.net])
29 AC_SUBST(VG_VER_MAJOR, v_major_ver)
30 AC_SUBST(VG_VER_MINOR, v_minor_ver)
32 # For docs/xml/vg-entities.xml
33 AC_SUBST(VG_DATE, v_rel_date)
35 AC_CONFIG_SRCDIR(coregrind/m_main.c)
36 AC_CONFIG_HEADERS([config.h])
37 AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects])
41 #----------------------------------------------------------------------------
42 # Do NOT modify these flags here. Except in feature tests in which case
43 # the original values must be properly restored.
44 #----------------------------------------------------------------------------
48 #----------------------------------------------------------------------------
49 # Checks for various programs.
50 #----------------------------------------------------------------------------
53 m4_version_prereq([2.70], [AC_PROG_CC], [AC_PROG_CC_C99])
54 # Make sure we can compile in C99 mode.
55 if test "$ac_cv_prog_cc_c99" = "no"; then
56 AC_MSG_ERROR([Valgrind relies on a C compiler supporting C99])
60 # AC_PROG_OBJC apparently causes problems on older Linux distros (eg. with
61 # autoconf 2.59). If we ever have any Objective-C code in the Valgrind code
62 # base (eg. most likely as Darwin-specific tests) we'll need one of the
64 # - put AC_PROG_OBJC in a Darwin-specific part of this file
65 # - Use AC_PROG_OBJC here and up the minimum autoconf version
66 # - Use the following, which is apparently equivalent:
67 # m4_ifdef([AC_PROG_OBJC],
69 # [AC_CHECK_TOOL([OBJC], [gcc])
71 # AC_SUBST([OBJCFLAGS])
74 # Set LTO_RANLIB variable to an lto enabled ranlib
75 if test "x$LTO_RANLIB" = "x"; then
76 AC_PATH_PROGS([LTO_RANLIB], [gcc-ranlib])
78 AC_ARG_VAR([LTO_RANLIB],[Library indexer command for link time optimisation])
80 # provide a very basic definition for AC_PROG_SED if it's not provided by
81 # autoconf (as e.g. in autoconf 2.59).
82 m4_ifndef([AC_PROG_SED],
83 [AC_DEFUN([AC_PROG_SED],
85 AC_CHECK_PROGS([SED],[gsed sed])])])
88 AC_DEFUN([AC_PROG_SHA256SUM],
89 [AC_ARG_VAR([SHA256SUM])
90 AC_CHECK_PROGS([SHA256SUM],[gsha256sum sha256sum])])
93 # If no AR variable was specified, look up the name of the archiver. Otherwise
94 # do not touch the AR variable.
95 if test "x$AR" = "x"; then
96 AC_PATH_PROGS([AR], [`echo $LD | $SED 's/ld$/ar/'` "ar"], [ar])
98 AC_ARG_VAR([AR],[Archiver command])
100 # same for LTO_AR variable for lto enabled archiver
101 if test "x$LTO_AR" = "x"; then
102 AC_PATH_PROGS([LTO_AR], [gcc-ar])
104 AC_ARG_VAR([LTO_AR],[Archiver command for link time optimisation])
106 # figure out where perl lives
107 AC_PATH_PROG(PERL, perl)
109 # figure out where gdb lives
110 AC_PATH_PROG(GDB, gdb, "/no/gdb/was/found/at/configure/time")
111 AC_DEFINE_UNQUOTED(GDB_PATH, "$GDB", [path to GDB])
113 # some older automake's don't have it so try something on our own
114 ifdef([AM_PROG_AS],[AM_PROG_AS],
124 # Check if 'diff' supports -u (universal diffs) and use it if possible.
126 AC_MSG_CHECKING([for diff -u])
129 # Comparing two identical files results in 0.
130 tmpfile="tmp-xxx-yyy-zzz"
132 if diff -u $tmpfile $tmpfile ; then
141 # We don't want gcc < 3.0
142 AC_MSG_CHECKING([for a supported version of gcc])
144 # Obtain the compiler version.
146 # A few examples of how the ${CC} --version output looks like:
148 # ######## gcc variants ########
149 # Arch Linux: i686-pc-linux-gnu-gcc (GCC) 4.6.2
150 # Debian Linux: gcc (Debian 4.3.2-1.1) 4.3.2
151 # openSUSE: gcc (SUSE Linux) 4.5.1 20101208 [gcc-4_5-branch revision 167585]
152 # Exherbo Linux: x86_64-pc-linux-gnu-gcc (Exherbo gcc-4.6.2) 4.6.2
153 # MontaVista Linux for ARM: arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q1-203) 4.3.3
154 # OS/X 10.6: i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
155 # OS/X 10.7: i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
157 # ######## clang variants ########
158 # Clang: clang version 2.9 (tags/RELEASE_29/final)
159 # Apple clang: Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
160 # FreeBSD clang: FreeBSD clang version 3.1 (branches/release_31 156863) 20120523
162 # ######## Apple LLVM variants ########
163 # Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
164 # Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
167 if test "x`${CC} --version | $SED -n -e 's/.*\Apple \(LLVM\) version.*clang.*/\1/p'`" = "xLLVM" ;
170 gcc_version=`${CC} --version | $SED -n -e 's/.*LLVM version \([0-9.]*\).*$/\1/p'`
171 elif test "x`${CC} --version | $SED -n -e 's/.*\(clang\) version.*/\1/p'`" = "xclang" ;
174 # Don't use -dumpversion with clang: it will always produce "4.2.1".
175 gcc_version=`${CC} --version | $SED -n -e 's/.*clang version \([0-9.]*\).*$/\1/p'`
176 elif test "x`${CC} --version | $SED -n -e 's/icc.*\(ICC\).*/\1/p'`" = "xICC" ;
179 gcc_version=`${CC} -dumpversion 2>/dev/null`
182 gcc_version=`${CC} -dumpversion 2>/dev/null`
183 if test "x$gcc_version" = x; then
184 gcc_version=`${CC} --version | $SED -n -e 's/[^ ]*gcc[^ ]* ([^)]*) \([0-9.]*\).*$/\1/p'`
188 AM_CONDITIONAL(COMPILER_IS_CLANG, test $is_clang = clang -o $is_clang = applellvm)
189 AM_CONDITIONAL(COMPILER_IS_ICC, test $is_clang = icc)
191 # Note: m4 arguments are quoted with [ and ] so square brackets in shell
192 # statements have to be quoted.
193 case "${is_clang}-${gcc_version}" in
194 applellvm-5.1|applellvm-[[6-9]].*|applellvm-[[1-9][0-9]]*)
195 AC_MSG_RESULT([ok (Apple LLVM version ${gcc_version})])
197 icc-1[[3-9]].*|icc-202[[0-9]].*)
198 AC_MSG_RESULT([ok (ICC version ${gcc_version})])
200 notclang-[[3-9]]|notclang-[[3-9]].*|notclang-[[1-9][0-9]]*)
201 AC_MSG_RESULT([ok (${gcc_version})])
203 clang-2.9|clang-[[3-9]].*|clang-[[1-9][0-9]]*)
204 AC_MSG_RESULT([ok (clang-${gcc_version})])
207 AC_MSG_RESULT([no (${is_clang}-${gcc_version})])
208 AC_MSG_ERROR([please use gcc >= 3.0 or clang >= 2.9 or icc >= 13.0 or Apple LLVM >= 5.1])
212 #----------------------------------------------------------------------------
213 # Arch/OS/platform tests.
214 #----------------------------------------------------------------------------
215 # We create a number of arch/OS/platform-related variables. We prefix them
216 # all with "VGCONF_" which indicates that they are defined at
217 # configure-time, and distinguishes them from the VGA_*/VGO_*/VGP_*
218 # variables used when compiling C files.
222 AC_MSG_CHECKING([for a supported CPU])
224 # ARCH_MAX reflects the most that this CPU can do: for example if it
225 # is a 64-bit capable PowerPC, then it must be set to ppc64 and not ppc32.
226 # Ditto for amd64. It is used for more configuration below, but is not used
229 # Power PC returns powerpc for Big Endian. This was not changed when Little
230 # Endian support was added to the 64-bit architecture. The 64-bit Little
231 # Endian systems explicitly state le in the host_cpu. For clarity in the
232 # Valgrind code, the ARCH_MAX name will state LE or BE for the endianness of
233 # the 64-bit system. Big Endian is the only mode supported on 32-bit Power PC.
234 # The abreviation PPC or ppc refers to 32-bit and 64-bit systems with either
235 # Endianness. The name PPC64 or ppc64 to 64-bit systems of either Endianness.
236 # The names ppc64be or PPC64BE refer to only 64-bit systems that are Big
237 # Endian. Similarly, ppc64le or PPC64LE refer to only 64-bit systems that are
240 case "${host_cpu}" in
242 AC_MSG_RESULT([ok (${host_cpu})])
247 AC_MSG_RESULT([ok (${host_cpu})])
252 # this only referrs to 64-bit Big Endian
253 AC_MSG_RESULT([ok (${host_cpu})])
258 # this only referrs to 64-bit Little Endian
259 AC_MSG_RESULT([ok (${host_cpu})])
264 # On Linux this means only a 32-bit capable CPU.
265 AC_MSG_RESULT([ok (${host_cpu})])
270 AC_MSG_RESULT([ok (${host_cpu})])
275 AC_MSG_RESULT([ok (${host_cpu})])
280 AC_MSG_RESULT([ok (${host_cpu})])
285 AC_MSG_RESULT([ok (${host_cpu})])
290 AC_MSG_RESULT([ok (${host_cpu})])
295 AC_MSG_RESULT([ok (${host_cpu})])
300 AC_MSG_RESULT([ok (${host_cpu})])
305 AC_MSG_RESULT([ok (${host_cpu})])
309 AC_MSG_RESULT([ok (${host_cpu})])
314 AC_MSG_RESULT([no (${host_cpu})])
315 AC_MSG_ERROR([Unsupported host architecture. Sorry])
319 #----------------------------------------------------------------------------
321 # Sometimes it's convenient to subvert the bi-arch build system and
322 # just have a single build even though the underlying platform is
323 # capable of both. Hence handle --enable-only64bit and
324 # --enable-only32bit. Complain if both are issued :-)
325 # [Actually, if either of these options are used, I think both get built,
326 # but only one gets installed. So if you use an in-place build, both can be
329 # Check if a 64-bit only build has been requested
330 AC_CACHE_CHECK([for a 64-bit only build], vg_cv_only64bit,
331 [AC_ARG_ENABLE(only64bit,
332 [ --enable-only64bit do a 64-bit only build],
333 [vg_cv_only64bit=$enableval],
334 [vg_cv_only64bit=no])])
336 # Check if a 32-bit only build has been requested
337 AC_CACHE_CHECK([for a 32-bit only build], vg_cv_only32bit,
338 [AC_ARG_ENABLE(only32bit,
339 [ --enable-only32bit do a 32-bit only build],
340 [vg_cv_only32bit=$enableval],
341 [vg_cv_only32bit=no])])
344 if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
346 [Nonsensical: both --enable-only64bit and --enable-only32bit.])
349 #----------------------------------------------------------------------------
351 # VGCONF_OS is the primary build OS, eg. "linux". It is passed in to
352 # compilation of many C files via -VGO_$(VGCONF_OS) and
353 # -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS).
354 AC_MSG_CHECKING([for a supported OS])
361 AC_MSG_RESULT([ok (${host_os})])
364 # Ok, this is linux. Check the kernel version
365 AC_MSG_CHECKING([for the kernel version])
370 0.*|1.*|2.0.*|2.1.*|2.2.*|2.3.*|2.4.*|2.5.*)
371 AC_MSG_RESULT([unsupported (${kernel})])
372 AC_MSG_ERROR([Valgrind needs a Linux kernel >= 2.6])
376 AC_MSG_RESULT([2.6 or later (${kernel})])
383 AC_MSG_RESULT([ok (${host_os})])
385 AC_DEFINE([FREEBSD_10], 1000, [FREEBSD_VERS value for FreeBSD 10.x])
387 AC_DEFINE([FREEBSD_11], 1100, [FREEBSD_VERS value for FreeBSD 11.x])
389 AC_DEFINE([FREEBSD_12], 1200, [FREEBSD_VERS value for FreeBSD 12.0 to 12.1])
391 AC_DEFINE([FREEBSD_12_2], 1220, [FREEBSD_VERS value for FreeBSD 12.2])
393 AC_DEFINE([FREEBSD_13_0], 1300, [FREEBSD_VERS value for FreeBSD 13.0])
395 AC_DEFINE([FREEBSD_13_1], 1310, [FREEBSD_VERS value for FreeBSD 13.1])
397 AC_DEFINE([FREEBSD_13_2], 1320, [FREEBSD_VERS value for FreeBSD 13.2])
399 AC_DEFINE([FREEBSD_14], 1400, [FREEBSD_VERS value for FreeBSD 14.x])
402 AC_MSG_CHECKING([for the kernel version])
407 AC_MSG_RESULT([FreeBSD 10.x (${kernel})])
408 AC_DEFINE([FREEBSD_VERS], FREEBSD_10, [FreeBSD version])
409 freebsd_vers=$freebsd_10
412 AC_MSG_RESULT([FreeBSD 11.x (${kernel})])
413 AC_DEFINE([FREEBSD_VERS], FREEBSD_11, [FreeBSD version])
414 freebsd_vers=$freebsd_11
419 AC_MSG_RESULT([FreeBSD 12.x (${kernel})])
420 AC_DEFINE([FREEBSD_VERS], FREEBSD_12, [FreeBSD version])
421 freebsd_vers=$freebsd_12
424 AC_MSG_RESULT([FreeBSD 12.x (${kernel})])
425 AC_DEFINE([FREEBSD_VERS], FREEBSD_12_2, [FreeBSD version])
426 freebsd_vers=$freebsd_12_2
433 AC_MSG_RESULT([FreeBSD 13.0 (${kernel})])
434 AC_DEFINE([FREEBSD_VERS], FREEBSD_13_0, [FreeBSD version])
435 freebsd_vers=$freebsd_13_0
438 AC_MSG_RESULT([FreeBSD 13.1 (${kernel})])
439 AC_DEFINE([FREEBSD_VERS], FREEBSD_13_1, [FreeBSD version])
440 freebsd_vers=$freebsd_13_1
443 AC_MSG_RESULT([FreeBSD 13.2 (${kernel})])
444 AC_DEFINE([FREEBSD_VERS], FREEBSD_13_2, [FreeBSD version])
445 freebsd_vers=$freebsd_13_2
450 AC_MSG_RESULT([FreeBSD 14.x (${kernel})])
451 AC_DEFINE([FREEBSD_VERS], FREEBSD_14, [FreeBSD version])
452 freebsd_vers=$freebsd_14
455 AC_MSG_RESULT([unsupported (${kernel})])
456 AC_MSG_ERROR([Valgrind works on FreeBSD 10.x to 14.x])
460 DEFAULT_SUPP="$srcdir/freebsd.supp $srcdir/freebsd-helgrind.supp $srcdir/freebsd-drd.supp ${DEFAULT_SUPP}"
464 AC_MSG_RESULT([ok (${host_os})])
466 AC_DEFINE([DARWIN_10_5], 100500, [DARWIN_VERS value for Mac OS X 10.5])
467 AC_DEFINE([DARWIN_10_6], 100600, [DARWIN_VERS value for Mac OS X 10.6])
468 AC_DEFINE([DARWIN_10_7], 100700, [DARWIN_VERS value for Mac OS X 10.7])
469 AC_DEFINE([DARWIN_10_8], 100800, [DARWIN_VERS value for Mac OS X 10.8])
470 AC_DEFINE([DARWIN_10_9], 100900, [DARWIN_VERS value for Mac OS X 10.9])
471 AC_DEFINE([DARWIN_10_10], 101000, [DARWIN_VERS value for Mac OS X 10.10])
472 AC_DEFINE([DARWIN_10_11], 101100, [DARWIN_VERS value for Mac OS X 10.11])
473 AC_DEFINE([DARWIN_10_12], 101200, [DARWIN_VERS value for macOS 10.12])
474 AC_DEFINE([DARWIN_10_13], 101300, [DARWIN_VERS value for macOS 10.13])
476 AC_MSG_CHECKING([for the kernel version])
479 # Nb: for Darwin we set DEFAULT_SUPP here. That's because Darwin
480 # has only one relevant version, the OS version. The `uname` check
481 # is a good way to get that version (i.e. "Darwin 9.6.0" is Mac OS
482 # X 10.5.6, and "Darwin 10.x" is Mac OS X 10.6.x Snow Leopard,
483 # and possibly "Darwin 11.x" is Mac OS X 10.7.x Lion),
484 # and we don't know of an macros similar to __GLIBC__ to get that info.
486 # XXX: `uname -r` won't do the right thing for cross-compiles, but
487 # that's not a problem yet.
489 # jseward 21 Sept 2011: I seriously doubt whether V 3.7.0 will work
490 # on OS X 10.5.x; I haven't tested yet, and only plan to test 3.7.0
491 # on 10.6.8 and 10.7.1. Although tempted to delete the configure
492 # time support for 10.5 (the 9.* pattern just below), I'll leave it
493 # in for now, just in case anybody wants to give it a try. But I'm
494 # assuming that 3.7.0 is a Snow Leopard and Lion-only release.
497 AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard])
498 AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version])
499 DEFAULT_SUPP="$srcdir/darwin9.supp ${DEFAULT_SUPP}"
500 DEFAULT_SUPP="$srcdir/darwin9-drd.supp ${DEFAULT_SUPP}"
503 AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard])
504 AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version])
505 DEFAULT_SUPP="$srcdir/darwin10.supp ${DEFAULT_SUPP}"
506 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
509 AC_MSG_RESULT([Darwin 11.x (${kernel}) / Mac OS X 10.7 Lion])
510 AC_DEFINE([DARWIN_VERS], DARWIN_10_7, [Darwin / Mac OS X version])
511 DEFAULT_SUPP="$srcdir/darwin11.supp ${DEFAULT_SUPP}"
512 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
515 AC_MSG_RESULT([Darwin 12.x (${kernel}) / Mac OS X 10.8 Mountain Lion])
516 AC_DEFINE([DARWIN_VERS], DARWIN_10_8, [Darwin / Mac OS X version])
517 DEFAULT_SUPP="$srcdir/darwin12.supp ${DEFAULT_SUPP}"
518 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
521 AC_MSG_RESULT([Darwin 13.x (${kernel}) / Mac OS X 10.9 Mavericks])
522 AC_DEFINE([DARWIN_VERS], DARWIN_10_9, [Darwin / Mac OS X version])
523 DEFAULT_SUPP="$srcdir/darwin13.supp ${DEFAULT_SUPP}"
524 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
527 AC_MSG_RESULT([Darwin 14.x (${kernel}) / Mac OS X 10.10 Yosemite])
528 AC_DEFINE([DARWIN_VERS], DARWIN_10_10, [Darwin / Mac OS X version])
529 DEFAULT_SUPP="$srcdir/darwin14.supp ${DEFAULT_SUPP}"
530 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
533 AC_MSG_RESULT([Darwin 15.x (${kernel}) / Mac OS X 10.11 El Capitan])
534 AC_DEFINE([DARWIN_VERS], DARWIN_10_11, [Darwin / Mac OS X version])
535 DEFAULT_SUPP="$srcdir/darwin15.supp ${DEFAULT_SUPP}"
536 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
539 AC_MSG_RESULT([Darwin 16.x (${kernel}) / macOS 10.12 Sierra])
540 AC_DEFINE([DARWIN_VERS], DARWIN_10_12, [Darwin / Mac OS X version])
541 DEFAULT_SUPP="$srcdir/darwin16.supp ${DEFAULT_SUPP}"
542 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
545 AC_MSG_RESULT([Darwin 17.x (${kernel}) / macOS 10.13 High Sierra])
546 AC_DEFINE([DARWIN_VERS], DARWIN_10_13, [Darwin / Mac OS X version])
547 DEFAULT_SUPP="$srcdir/darwin17.supp ${DEFAULT_SUPP}"
548 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
551 AC_MSG_RESULT([unsupported (${kernel})])
552 AC_MSG_ERROR([Valgrind works on Darwin 10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x and 17.x (Mac OS X 10.6/7/8/9/10/11 and macOS 10.12/13)])
558 AC_MSG_RESULT([ok (${host_os})])
561 uname_v=$( uname -v )
564 DEFAULT_SUPP="$srcdir/solaris12.supp ${DEFAULT_SUPP}"
567 DEFAULT_SUPP="$srcdir/solaris11.supp ${DEFAULT_SUPP}"
573 AC_MSG_RESULT([ok (${host_os})])
575 DEFAULT_SUPP="$srcdir/solaris12.supp ${DEFAULT_SUPP}"
579 AC_MSG_RESULT([no (${host_os})])
580 AC_MSG_ERROR([Valgrind is operating system specific. Sorry.])
584 #----------------------------------------------------------------------------
586 # If we are building on a 64 bit platform test to see if the system
587 # supports building 32 bit programs and disable 32 bit support if it
588 # does not support building 32 bit programs
590 case "$ARCH_MAX-$VGCONF_OS" in
591 amd64-linux|ppc64be-linux|arm64-linux|amd64-solaris)
592 AC_MSG_CHECKING([for 32 bit build support])
595 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
600 vg_cv_only64bit="yes"
603 CFLAGS=$safe_CFLAGS;;
605 AC_MSG_CHECKING([for 32 bit build support])
607 CFLAGS="$CFLAGS -mips32 -mabi=32"
608 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
609 #include <sys/prctl.h>
613 vg_cv_only64bit="yes"
616 CFLAGS=$safe_CFLAGS;;
619 if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
621 [--enable-only32bit was specified but system does not support 32 bit builds])
624 #----------------------------------------------------------------------------
626 # VGCONF_ARCH_PRI is the arch for the primary build target, eg. "amd64". By
627 # default it's the same as ARCH_MAX. But if, say, we do a build on an amd64
628 # machine, but --enable-only32bit has been requested, then ARCH_MAX (see
629 # above) will be "amd64" since that reflects the most that this cpu can do,
630 # but VGCONF_ARCH_PRI will be downgraded to "x86", since that reflects the
631 # arch corresponding to the primary build (VGCONF_PLATFORM_PRI_CAPS). It is
632 # passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_PRI) and
633 # -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS).
634 AC_SUBST(VGCONF_ARCH_PRI)
636 # VGCONF_ARCH_SEC is the arch for the secondary build target, eg. "x86".
637 # It is passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_SEC)
638 # and -VGP_$(VGCONF_ARCH_SEC)_$(VGCONF_OS), if there is a secondary target.
639 # It is empty if there is no secondary target.
640 AC_SUBST(VGCONF_ARCH_SEC)
642 # VGCONF_PLATFORM_PRI_CAPS is the primary build target, eg. "AMD64_LINUX".
643 # The entire system, including regression and performance tests, will be
644 # built for this target. The "_CAPS" indicates that the name is in capital
645 # letters, and it also uses '_' rather than '-' as a separator, because it's
646 # used to create various Makefile variables, which are all in caps by
647 # convention and cannot contain '-' characters. This is in contrast to
648 # VGCONF_ARCH_PRI and VGCONF_OS which are not in caps.
649 AC_SUBST(VGCONF_PLATFORM_PRI_CAPS)
651 # VGCONF_PLATFORM_SEC_CAPS is the secondary build target, if there is one.
652 # Valgrind and tools will also be built for this target, but not the
653 # regression or performance tests.
655 # By default, the primary arch is the same as the "max" arch, as commented
656 # above (at the definition of ARCH_MAX). We may choose to downgrade it in
657 # the big case statement just below here, in the case where we're building
658 # on a 64 bit machine but have been requested only to do a 32 bit build.
659 AC_SUBST(VGCONF_PLATFORM_SEC_CAPS)
661 AC_MSG_CHECKING([for a supported CPU/OS combination])
663 # NB. The load address for a given platform may be specified in more
664 # than one place, in some cases, depending on whether we're doing a biarch,
665 # 32-bit only or 64-bit only build. eg see case for amd64-linux below.
666 # Be careful to give consistent values in all subcases. Also, all four
667 # valt_load_addres_{pri,sec}_{norml,inner} values must always be set,
668 # even if it is to "0xUNSET".
670 case "$ARCH_MAX-$VGCONF_OS" in
672 VGCONF_ARCH_PRI="x86"
674 VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
675 VGCONF_PLATFORM_SEC_CAPS=""
676 valt_load_address_pri_norml="0x58000000"
677 valt_load_address_pri_inner="0x38000000"
678 valt_load_address_sec_norml="0xUNSET"
679 valt_load_address_sec_inner="0xUNSET"
680 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
683 valt_load_address_sec_norml="0xUNSET"
684 valt_load_address_sec_inner="0xUNSET"
685 if test x$vg_cv_only64bit = xyes; then
686 VGCONF_ARCH_PRI="amd64"
688 VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
689 VGCONF_PLATFORM_SEC_CAPS=""
690 valt_load_address_pri_norml="0x58000000"
691 valt_load_address_pri_inner="0x38000000"
692 elif test x$vg_cv_only32bit = xyes; then
693 VGCONF_ARCH_PRI="x86"
695 VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
696 VGCONF_PLATFORM_SEC_CAPS=""
697 valt_load_address_pri_norml="0x58000000"
698 valt_load_address_pri_inner="0x38000000"
700 VGCONF_ARCH_PRI="amd64"
701 VGCONF_ARCH_SEC="x86"
702 VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
703 VGCONF_PLATFORM_SEC_CAPS="X86_LINUX"
704 valt_load_address_pri_norml="0x58000000"
705 valt_load_address_pri_inner="0x38000000"
706 valt_load_address_sec_norml="0x58000000"
707 valt_load_address_sec_inner="0x38000000"
709 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
712 VGCONF_ARCH_PRI="ppc32"
714 VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
715 VGCONF_PLATFORM_SEC_CAPS=""
716 valt_load_address_pri_norml="0x58000000"
717 valt_load_address_pri_inner="0x38000000"
718 valt_load_address_sec_norml="0xUNSET"
719 valt_load_address_sec_inner="0xUNSET"
720 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
723 valt_load_address_sec_norml="0xUNSET"
724 valt_load_address_sec_inner="0xUNSET"
725 if test x$vg_cv_only64bit = xyes; then
726 VGCONF_ARCH_PRI="ppc64be"
728 VGCONF_PLATFORM_PRI_CAPS="PPC64BE_LINUX"
729 VGCONF_PLATFORM_SEC_CAPS=""
730 valt_load_address_pri_norml="0x58000000"
731 valt_load_address_pri_inner="0x38000000"
732 elif test x$vg_cv_only32bit = xyes; then
733 VGCONF_ARCH_PRI="ppc32"
735 VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
736 VGCONF_PLATFORM_SEC_CAPS=""
737 valt_load_address_pri_norml="0x58000000"
738 valt_load_address_pri_inner="0x38000000"
740 VGCONF_ARCH_PRI="ppc64be"
741 VGCONF_ARCH_SEC="ppc32"
742 VGCONF_PLATFORM_PRI_CAPS="PPC64BE_LINUX"
743 VGCONF_PLATFORM_SEC_CAPS="PPC32_LINUX"
744 valt_load_address_pri_norml="0x58000000"
745 valt_load_address_pri_inner="0x38000000"
746 valt_load_address_sec_norml="0x58000000"
747 valt_load_address_sec_inner="0x38000000"
749 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
752 # Little Endian is only supported on PPC64
753 valt_load_address_sec_norml="0xUNSET"
754 valt_load_address_sec_inner="0xUNSET"
755 VGCONF_ARCH_PRI="ppc64le"
757 VGCONF_PLATFORM_PRI_CAPS="PPC64LE_LINUX"
758 VGCONF_PLATFORM_SEC_CAPS=""
759 valt_load_address_pri_norml="0x58000000"
760 valt_load_address_pri_inner="0x38000000"
761 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
764 VGCONF_ARCH_PRI="x86"
766 VGCONF_PLATFORM_PRI_CAPS="X86_FREEBSD"
767 VGCONF_PLATFORM_SEC_CAPS=""
768 valt_load_address_pri_norml="0x38000000"
769 valt_load_address_pri_inner="0x28000000"
770 valt_load_address_sec_norml="0xUNSET"
771 valt_load_address_sec_inner="0xUNSET"
772 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
775 if test x$vg_cv_only64bit = xyes; then
776 VGCONF_ARCH_PRI="amd64"
778 VGCONF_PLATFORM_PRI_CAPS="AMD64_FREEBSD"
779 VGCONF_PLATFORM_SEC_CAPS=""
780 elif test x$vg_cv_only32bit = xyes; then
781 VGCONF_ARCH_PRI="x86"
783 VGCONF_PLATFORM_PRI_CAPS="X86_FREEBSD"
784 VGCONF_PLATFORM_SEC_CAPS=""
786 VGCONF_ARCH_PRI="amd64"
787 VGCONF_ARCH_SEC="x86"
788 VGCONF_PLATFORM_PRI_CAPS="AMD64_FREEBSD"
789 VGCONF_PLATFORM_SEC_CAPS="X86_FREEBSD"
791 # These work with either base clang or ports installed gcc
792 # Hand rolled compilers probably need INSTALL_DIR/lib (at least for gcc)
793 if test x$is_clang = xclang ; then
794 FLAG_32ON64="-B/usr/lib32"
796 GCC_MAJOR_VERSION=`${CC} -dumpversion | $SED 's/\..*//' 2>/dev/null`
797 FLAG_32ON64="-B/usr/local/lib32/gcc${GCC_MAJOR_VERSION} -Wl,-rpath,/usr/local/lib32/gcc${GCC_MAJOR_VERSION}/"
799 valt_load_address_pri_norml="0x38000000"
800 valt_load_address_pri_inner="0x28000000"
801 valt_load_address_sec_norml="0x38000000"
802 valt_load_address_sec_inner="0x28000000"
803 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
805 # Darwin gets identified as 32-bit even when it supports 64-bit.
806 # (Not sure why, possibly because 'uname' returns "i386"?) Just about
807 # all Macs support both 32-bit and 64-bit, so we just build both. If
808 # someone has a really old 32-bit only machine they can (hopefully?)
809 # build with --enable-only32bit. See bug 243362.
810 x86-darwin|amd64-darwin)
812 valt_load_address_sec_norml="0xUNSET"
813 valt_load_address_sec_inner="0xUNSET"
814 if test x$vg_cv_only64bit = xyes; then
815 VGCONF_ARCH_PRI="amd64"
817 VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
818 VGCONF_PLATFORM_SEC_CAPS=""
819 valt_load_address_pri_norml="0x158000000"
820 valt_load_address_pri_inner="0x138000000"
821 elif test x$vg_cv_only32bit = xyes; then
822 VGCONF_ARCH_PRI="x86"
824 VGCONF_PLATFORM_PRI_CAPS="X86_DARWIN"
825 VGCONF_PLATFORM_SEC_CAPS=""
826 VGCONF_ARCH_PRI_CAPS="x86"
827 valt_load_address_pri_norml="0x58000000"
828 valt_load_address_pri_inner="0x38000000"
830 VGCONF_ARCH_PRI="amd64"
831 VGCONF_ARCH_SEC="x86"
832 VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
833 VGCONF_PLATFORM_SEC_CAPS="X86_DARWIN"
834 valt_load_address_pri_norml="0x158000000"
835 valt_load_address_pri_inner="0x138000000"
836 valt_load_address_sec_norml="0x58000000"
837 valt_load_address_sec_inner="0x38000000"
839 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
842 VGCONF_ARCH_PRI="arm"
843 VGCONF_PLATFORM_PRI_CAPS="ARM_LINUX"
844 VGCONF_PLATFORM_SEC_CAPS=""
845 valt_load_address_pri_norml="0x58000000"
846 valt_load_address_pri_inner="0x38000000"
847 valt_load_address_sec_norml="0xUNSET"
848 valt_load_address_sec_inner="0xUNSET"
849 AC_MSG_RESULT([ok (${host_cpu}-${host_os})])
852 valt_load_address_sec_norml="0xUNSET"
853 valt_load_address_sec_inner="0xUNSET"
854 if test x$vg_cv_only64bit = xyes; then
855 VGCONF_ARCH_PRI="arm64"
857 VGCONF_PLATFORM_PRI_CAPS="ARM64_LINUX"
858 VGCONF_PLATFORM_SEC_CAPS=""
859 valt_load_address_pri_norml="0x58000000"
860 valt_load_address_pri_inner="0x38000000"
861 elif test x$vg_cv_only32bit = xyes; then
862 VGCONF_ARCH_PRI="arm"
864 VGCONF_PLATFORM_PRI_CAPS="ARM_LINUX"
865 VGCONF_PLATFORM_SEC_CAPS=""
866 valt_load_address_pri_norml="0x58000000"
867 valt_load_address_pri_inner="0x38000000"
869 VGCONF_ARCH_PRI="arm64"
870 VGCONF_ARCH_SEC="arm"
871 VGCONF_PLATFORM_PRI_CAPS="ARM64_LINUX"
872 VGCONF_PLATFORM_SEC_CAPS="ARM_LINUX"
873 valt_load_address_pri_norml="0x58000000"
874 valt_load_address_pri_inner="0x38000000"
875 valt_load_address_sec_norml="0x58000000"
876 valt_load_address_sec_inner="0x38000000"
878 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
881 VGCONF_ARCH_PRI="s390x"
883 VGCONF_PLATFORM_PRI_CAPS="S390X_LINUX"
884 VGCONF_PLATFORM_SEC_CAPS=""
885 # To improve branch prediction hit rate we want to have
886 # the generated code close to valgrind (host) code
887 valt_load_address_pri_norml="0x800000000"
888 valt_load_address_pri_inner="0x810000000"
889 valt_load_address_sec_norml="0xUNSET"
890 valt_load_address_sec_inner="0xUNSET"
891 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
894 VGCONF_ARCH_PRI="mips32"
896 VGCONF_PLATFORM_PRI_CAPS="MIPS32_LINUX"
897 VGCONF_PLATFORM_SEC_CAPS=""
898 valt_load_address_pri_norml="0x58000000"
899 valt_load_address_pri_inner="0x38000000"
900 valt_load_address_sec_norml="0xUNSET"
901 valt_load_address_sec_inner="0xUNSET"
902 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
905 valt_load_address_sec_norml="0xUNSET"
906 valt_load_address_sec_inner="0xUNSET"
907 if test x$vg_cv_only64bit = xyes; then
908 VGCONF_ARCH_PRI="mips64"
909 VGCONF_PLATFORM_SEC_CAPS=""
910 VGCONF_PLATFORM_PRI_CAPS="MIPS64_LINUX"
911 VGCONF_PLATFORM_SEC_CAPS=""
912 valt_load_address_pri_norml="0x58000000"
913 valt_load_address_pri_inner="0x38000000"
914 elif test x$vg_cv_only32bit = xyes; then
915 VGCONF_ARCH_PRI="mips32"
917 VGCONF_PLATFORM_PRI_CAPS="MIPS32_LINUX"
918 VGCONF_PLATFORM_SEC_CAPS=""
919 valt_load_address_pri_norml="0x58000000"
920 valt_load_address_pri_inner="0x38000000"
922 VGCONF_ARCH_PRI="mips64"
923 VGCONF_ARCH_SEC="mips32"
924 VGCONF_PLATFORM_PRI_CAPS="MIPS64_LINUX"
925 VGCONF_PLATFORM_SEC_CAPS="MIPS32_LINUX"
926 valt_load_address_pri_norml="0x58000000"
927 valt_load_address_pri_inner="0x38000000"
928 valt_load_address_sec_norml="0x58000000"
929 valt_load_address_sec_inner="0x38000000"
931 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
934 VGCONF_ARCH_PRI="nanomips"
936 VGCONF_PLATFORM_PRI_CAPS="NANOMIPS_LINUX"
937 VGCONF_PLATFORM_SEC_CAPS=""
938 valt_load_address_pri_norml="0x58000000"
939 valt_load_address_pri_inner="0x38000000"
940 valt_load_address_sec_norml="0xUNSET"
941 valt_load_address_sec_inner="0xUNSET"
942 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
945 VGCONF_ARCH_PRI="x86"
947 VGCONF_PLATFORM_PRI_CAPS="X86_SOLARIS"
948 VGCONF_PLATFORM_SEC_CAPS=""
949 valt_load_address_pri_norml="0x58000000"
950 valt_load_address_pri_inner="0x38000000"
951 valt_load_address_sec_norml="0xUNSET"
952 valt_load_address_sec_inner="0xUNSET"
953 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
956 valt_load_address_sec_norml="0xUNSET"
957 valt_load_address_sec_inner="0xUNSET"
958 if test x$vg_cv_only64bit = xyes; then
959 VGCONF_ARCH_PRI="amd64"
961 VGCONF_PLATFORM_PRI_CAPS="AMD64_SOLARIS"
962 VGCONF_PLATFORM_SEC_CAPS=""
963 valt_load_address_pri_norml="0x58000000"
964 valt_load_address_pri_inner="0x38000000"
965 elif test x$vg_cv_only32bit = xyes; then
966 VGCONF_ARCH_PRI="x86"
968 VGCONF_PLATFORM_PRI_CAPS="X86_SOLARIS"
969 VGCONF_PLATFORM_SEC_CAPS=""
970 valt_load_address_pri_norml="0x58000000"
971 valt_load_address_pri_inner="0x38000000"
973 VGCONF_ARCH_PRI="amd64"
974 VGCONF_ARCH_SEC="x86"
975 VGCONF_PLATFORM_PRI_CAPS="AMD64_SOLARIS"
976 VGCONF_PLATFORM_SEC_CAPS="X86_SOLARIS"
977 valt_load_address_pri_norml="0x58000000"
978 valt_load_address_pri_inner="0x38000000"
979 valt_load_address_sec_norml="0x58000000"
980 valt_load_address_sec_inner="0x38000000"
982 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
985 VGCONF_ARCH_PRI="unknown"
986 VGCONF_ARCH_SEC="unknown"
987 VGCONF_PLATFORM_PRI_CAPS="UNKNOWN"
988 VGCONF_PLATFORM_SEC_CAPS="UNKNOWN"
989 valt_load_address_pri_norml="0xUNSET"
990 valt_load_address_pri_inner="0xUNSET"
991 valt_load_address_sec_norml="0xUNSET"
992 valt_load_address_sec_inner="0xUNSET"
993 AC_MSG_RESULT([no (${ARCH_MAX}-${VGCONF_OS})])
994 AC_MSG_ERROR([Valgrind is platform specific. Sorry. Please consider doing a port.])
998 #----------------------------------------------------------------------------
1000 # Set up VGCONF_ARCHS_INCLUDE_<arch>. Either one or two of these become
1002 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_X86,
1003 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
1004 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
1005 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_FREEBSD \
1006 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_FREEBSD \
1007 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
1008 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN \
1009 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \
1010 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_SOLARIS )
1011 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_AMD64,
1012 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
1013 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD \
1014 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN \
1015 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS )
1016 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC32,
1017 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
1018 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX )
1019 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC64,
1020 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64BE_LINUX \
1021 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64LE_LINUX )
1022 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM,
1023 test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
1024 -o x$VGCONF_PLATFORM_SEC_CAPS = xARM_LINUX )
1025 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM64,
1026 test x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX )
1027 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_S390X,
1028 test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX )
1029 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_MIPS32,
1030 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
1031 -o x$VGCONF_PLATFORM_SEC_CAPS = xMIPS32_LINUX )
1032 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_MIPS64,
1033 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX )
1034 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_NANOMIPS,
1035 test x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX )
1037 # Set up VGCONF_PLATFORMS_INCLUDE_<platform>. Either one or two of these
1039 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_LINUX,
1040 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
1041 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX)
1042 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX,
1043 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX)
1044 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX,
1045 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
1046 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX)
1047 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64BE_LINUX,
1048 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64BE_LINUX)
1049 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64LE_LINUX,
1050 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64LE_LINUX)
1051 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_ARM_LINUX,
1052 test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
1053 -o x$VGCONF_PLATFORM_SEC_CAPS = xARM_LINUX)
1054 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_ARM64_LINUX,
1055 test x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX)
1056 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_S390X_LINUX,
1057 test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \
1058 -o x$VGCONF_PLATFORM_SEC_CAPS = xS390X_LINUX)
1059 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_MIPS32_LINUX,
1060 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
1061 -o x$VGCONF_PLATFORM_SEC_CAPS = xMIPS32_LINUX)
1062 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_MIPS64_LINUX,
1063 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX)
1064 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_NANOMIPS_LINUX,
1065 test x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX)
1066 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_FREEBSD,
1067 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_FREEBSD \
1068 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_FREEBSD)
1069 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_FREEBSD,
1070 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD)
1071 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_DARWIN,
1072 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
1073 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN)
1074 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN,
1075 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
1076 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_SOLARIS,
1077 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \
1078 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_SOLARIS)
1079 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_SOLARIS,
1080 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS)
1083 # Similarly, set up VGCONF_OS_IS_<os>. Exactly one of these becomes defined.
1084 # Relies on the assumption that the primary and secondary targets are
1085 # for the same OS, so therefore only necessary to test the primary.
1086 AM_CONDITIONAL(VGCONF_OS_IS_LINUX,
1087 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
1088 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
1089 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
1090 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64BE_LINUX \
1091 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64LE_LINUX \
1092 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
1093 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX \
1094 -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \
1095 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
1096 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \
1097 -o x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX)
1098 AM_CONDITIONAL(VGCONF_OS_IS_FREEBSD,
1099 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_FREEBSD \
1100 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD)
1101 AM_CONDITIONAL(VGCONF_OS_IS_DARWIN,
1102 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
1103 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
1104 AM_CONDITIONAL(VGCONF_OS_IS_SOLARIS,
1105 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \
1106 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS)
1107 AM_CONDITIONAL(VGCONF_OS_IS_DARWIN_OR_FREEBSD,
1108 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_FREEBSD \
1109 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD \
1110 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
1111 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
1114 # Sometimes, in the Makefile.am files, it's useful to know whether or not
1115 # there is a secondary target.
1116 AM_CONDITIONAL(VGCONF_HAVE_PLATFORM_SEC,
1117 test x$VGCONF_PLATFORM_SEC_CAPS != x)
1119 dnl automake-1.10 does not have AM_COND_IF (added in 1.11), so we supply a
1120 dnl fallback definition
1121 dnl The macro is courtesy of Dave Hart:
1122 dnl https://lists.gnu.org/archive/html/automake/2010-12/msg00045.html
1123 m4_ifndef([AM_COND_IF], [AC_DEFUN([AM_COND_IF], [
1124 if test -z "$$1_TRUE"; then :
1133 #----------------------------------------------------------------------------
1135 #----------------------------------------------------------------------------
1137 # Check if this should be built as an inner Valgrind, to be run within
1138 # another Valgrind. Choose the load address accordingly.
1139 AC_SUBST(VALT_LOAD_ADDRESS_PRI)
1140 AC_SUBST(VALT_LOAD_ADDRESS_SEC)
1141 AC_CACHE_CHECK([for use as an inner Valgrind], vg_cv_inner,
1142 [AC_ARG_ENABLE(inner,
1143 [ --enable-inner enables self-hosting],
1144 [vg_cv_inner=$enableval],
1146 if test "$vg_cv_inner" = yes; then
1147 AC_DEFINE([ENABLE_INNER], 1, [configured to run as an inner Valgrind])
1148 VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_inner
1149 VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_inner
1151 VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_norml
1152 VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_norml
1155 #----------------------------------------------------------------------------
1156 # Undefined behaviour sanitiser
1157 #----------------------------------------------------------------------------
1158 # Check whether we should build with the undefined beahviour sanitiser.
1160 AC_CACHE_CHECK([for using the undefined behaviour sanitiser], vg_cv_ubsan,
1161 [AC_ARG_ENABLE(ubsan,
1162 [ --enable-ubsan enables the undefined behaviour sanitiser],
1163 [vg_cv_ubsan=$enableval],
1166 #----------------------------------------------------------------------------
1167 # Extra fine-tuning of installation directories
1168 #----------------------------------------------------------------------------
1170 [ --with-tmpdir=PATH Specify path for temporary files],
1173 AC_DEFINE_UNQUOTED(VG_TMPDIR, "$tmpdir", [Temporary files directory])
1174 AC_SUBST(VG_TMPDIR, [$tmpdir])
1176 #----------------------------------------------------------------------------
1178 #----------------------------------------------------------------------------
1179 AM_COND_IF([VGCONF_OS_IS_DARWIN],
1180 [AC_CHECK_PROG([XCRUN], [xcrun], [yes], [no])
1181 AC_MSG_CHECKING([for xcode sdk include path])
1182 AC_ARG_WITH(xcodedir,
1183 [ --with-xcode-path=PATH Specify path for xcode sdk includes],
1184 [xcodedir="$withval"],
1186 if test "x$XCRUN" != "xno" -a ! -d /usr/include; then
1187 xcrundir=`xcrun --sdk macosx --show-sdk-path`
1188 if test -z "$xcrundir"; then
1189 xcodedir="/usr/include"
1191 xcodedir="$xcrundir/usr/include"
1194 xcodedir="/usr/include"
1197 AC_MSG_RESULT([$xcodedir])
1198 AC_DEFINE_UNQUOTED(XCODE_DIR, "$xcodedir", [xcode sdk include directory])
1199 AC_SUBST(XCODE_DIR, [$xcodedir])])
1201 #----------------------------------------------------------------------------
1202 # Libc and suppressions
1203 #----------------------------------------------------------------------------
1204 # This variable will collect the suppression files to be used.
1205 AC_SUBST(DEFAULT_SUPP)
1207 AC_CHECK_HEADER([features.h])
1209 if test x$ac_cv_header_features_h = xyes; then
1210 AC_DEFINE([HAVE_HEADER_FEATURES_H], 1,
1211 [Define to 1 if you have the `features.h' header.])
1212 rm -f conftest.$ac_ext
1213 cat <<_ACEOF >conftest.$ac_ext
1214 #include <features.h>
1215 #if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__)
1216 glibc version is: __GLIBC__ __GLIBC_MINOR__
1219 GLIBC_VERSION="`$CPP -P conftest.$ac_ext | $SED -n 's/^glibc version is: //p' | $SED 's/ /./g'`"
1222 # not really a version check
1223 AC_EGREP_CPP([DARWIN_LIBC], [
1224 #include <sys/cdefs.h>
1225 #if defined(__DARWIN_VERS_1050)
1229 GLIBC_VERSION="darwin")
1231 AC_EGREP_CPP([FREEBSD_LIBC], [
1232 #include <sys/cdefs.h>
1233 #if defined(__FreeBSD__)
1237 GLIBC_VERSION="freebsd")
1239 # not really a version check
1240 AC_EGREP_CPP([BIONIC_LIBC], [
1241 #if defined(__ANDROID__)
1245 GLIBC_VERSION="bionic")
1247 # there is only one version of libc on Solaris
1248 if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \
1249 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS; then
1250 GLIBC_VERSION="solaris"
1253 # GLIBC_VERSION is empty if a musl libc is used, so use the toolchain tuple
1255 if test x$GLIBC_VERSION = x; then
1256 if $CC -dumpmachine | grep -q musl; then
1261 # If this is glibc then figure out the generic (in file) libc.so and
1262 # libpthread.so file paths to use in suppressions. Before 2.34 libpthread
1263 # was a separate library, afterwards it was merged into libc.so and
1264 # the library is called libc.so.6 (before it was libc-2.[0-9]+.so).
1265 # Use this fact to set GLIBC_LIBC_PATH and GLIBC_LIBPTHREAD_PATH.
1266 case ${GLIBC_VERSION} in
1268 AC_MSG_CHECKING([whether pthread_create needs libpthread])
1269 AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_create])],
1272 GLIBC_LIBC_PATH="*/lib*/libc.so.6"
1273 GLIBC_LIBPTHREAD_PATH="$GLIBC_LIBC_PATH"
1275 AC_MSG_RESULT([yes])
1276 GLIBC_LIBC_PATH="*/lib*/libc-2.*so*"
1277 GLIBC_LIBPTHREAD_PATH="*/lib*/libpthread-2.*so*"
1281 AC_MSG_CHECKING([not glibc...])
1282 AC_MSG_RESULT([${GLIBC_VERSION}])
1286 AC_MSG_CHECKING([the glibc version])
1288 case "${GLIBC_VERSION}" in
1290 AC_MSG_RESULT(${GLIBC_VERSION} family)
1291 DEFAULT_SUPP="$srcdir/glibc-2.2.supp ${DEFAULT_SUPP}"
1292 DEFAULT_SUPP="$srcdir/glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
1293 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1296 AC_MSG_RESULT(${GLIBC_VERSION} family)
1297 DEFAULT_SUPP="$srcdir/glibc-${GLIBC_VERSION}.supp ${DEFAULT_SUPP}"
1298 DEFAULT_SUPP="glibc-2.X-helgrind.supp ${DEFAULT_SUPP}"
1299 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1302 AC_MSG_RESULT(${GLIBC_VERSION} family)
1303 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
1304 DEFAULT_SUPP="glibc-2.X-helgrind.supp ${DEFAULT_SUPP}"
1305 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1308 AC_MSG_RESULT(${GLIBC_VERSION} family)
1309 AC_DEFINE([GLIBC_MANDATORY_STRLEN_REDIRECT], 1,
1310 [Define to 1 if strlen() has been optimized heavily (amd64 glibc >= 2.10)])
1311 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
1312 DEFAULT_SUPP="glibc-2.X-helgrind.supp ${DEFAULT_SUPP}"
1313 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1316 AC_MSG_RESULT(${GLIBC_VERSION} family)
1317 AC_DEFINE([GLIBC_MANDATORY_STRLEN_REDIRECT], 1,
1318 [Define to 1 if strlen() has been optimized heavily (amd64 glibc >= 2.10)])
1319 AC_DEFINE([GLIBC_MANDATORY_INDEX_AND_STRLEN_REDIRECT], 1,
1320 [Define to 1 if index() and strlen() have been optimized heavily (x86 glibc >= 2.12)])
1321 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
1322 DEFAULT_SUPP="glibc-2.X-helgrind.supp ${DEFAULT_SUPP}"
1323 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1326 AC_MSG_RESULT(Darwin)
1327 AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
1328 # DEFAULT_SUPP set by kernel version check above.
1331 AC_MSG_RESULT(FreeBSD)
1332 AC_DEFINE([FREEBSD_LIBC], 1, [Define to 1 if you're using FreeBSD])
1333 # DEFAULT_SUPP set by kernel version check above.
1336 AC_MSG_RESULT(Bionic)
1337 AC_DEFINE([BIONIC_LIBC], 1, [Define to 1 if you're using Bionic])
1338 DEFAULT_SUPP="$srcdir/bionic.supp ${DEFAULT_SUPP}"
1341 AC_MSG_RESULT(Solaris)
1342 # DEFAULT_SUPP set in host_os switch-case above.
1343 # No other suppression file is used.
1347 AC_DEFINE([MUSL_LIBC], 1, [Define to 1 if you're using Musl libc])
1348 DEFAULT_SUPP="$srcdir/musl.supp ${DEFAULT_SUPP}"
1351 AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
1352 AC_MSG_ERROR([Valgrind requires glibc version 2.2 or later, uClibc,])
1353 AC_MSG_ERROR([musl libc, Darwin libc, Bionic libc or Solaris libc])
1357 AC_SUBST(GLIBC_VERSION)
1358 AC_SUBST(GLIBC_LIBC_PATH)
1359 AC_SUBST(GLIBC_LIBPTHREAD_PATH)
1362 if test "$VGCONF_OS" != "solaris"; then
1363 # Add default suppressions for the X client libraries. Make no
1364 # attempt to detect whether such libraries are installed on the
1365 # build machine (or even if any X facilities are present); just
1366 # add the suppressions antidisirregardless.
1367 DEFAULT_SUPP="$srcdir/xfree-4.supp ${DEFAULT_SUPP}"
1368 DEFAULT_SUPP="$srcdir/xfree-3.supp ${DEFAULT_SUPP}"
1372 #----------------------------------------------------------------------------
1373 # Platform variants?
1374 #----------------------------------------------------------------------------
1376 # Normally the PLAT = (ARCH, OS) characterisation of the platform is enough.
1377 # But there are times where we need a bit more control. The motivating
1378 # and currently only case is Android: this is almost identical to
1379 # {x86,arm,mips}-linux, but not quite. So this introduces the concept of
1380 # platform variant tags, which get passed in the compile as
1381 # -DVGPV_<arch>_<os>_<variant> along with the main -DVGP_<arch>_<os> definition.
1383 # In almost all cases, the <variant> bit is "vanilla". But for Android
1384 # it is "android" instead.
1386 # Consequently (eg), plain arm-linux would build with
1388 # -DVGP_arm_linux -DVGPV_arm_linux_vanilla
1390 # whilst an Android build would have
1392 # -DVGP_arm_linux -DVGPV_arm_linux_android
1394 # Same for x86. The setup of the platform variant is pushed relatively far
1395 # down this file in order that we can inspect any of the variables set above.
1397 # In the normal case ..
1398 VGCONF_PLATVARIANT="vanilla"
1401 if test "$GLIBC_VERSION" = "bionic";
1403 VGCONF_PLATVARIANT="android"
1406 AC_SUBST(VGCONF_PLATVARIANT)
1409 # FIXME: do we also want to define automake variables
1410 # VGCONF_PLATVARIANT_IS_<WHATEVER>, where WHATEVER is (currently)
1411 # VANILLA or ANDROID ? This would be in the style of VGCONF_ARCHS_INCLUDE,
1412 # VGCONF_PLATFORMS_INCLUDE and VGCONF_OS_IS above? Could easily enough
1413 # do that. Problem is that we can't do and-ing in Makefile.am's, but
1414 # that's what we'd need to do to use this, since what we'd want to write
1417 # VGCONF_PLATFORMS_INCLUDE_ARM_LINUX && VGCONF_PLATVARIANT_IS_ANDROID
1419 # Hmm. Can't think of a nice clean solution to this.
1421 AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_VANILLA,
1422 test x$VGCONF_PLATVARIANT = xvanilla)
1423 AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_ANDROID,
1424 test x$VGCONF_PLATVARIANT = xandroid)
1427 #----------------------------------------------------------------------------
1428 # Checking for various library functions and other definitions
1429 #----------------------------------------------------------------------------
1431 # Check for AT_FDCWD
1433 AC_MSG_CHECKING([for AT_FDCWD])
1434 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1441 ac_have_at_fdcwd=yes
1442 AC_MSG_RESULT([yes])
1448 AM_CONDITIONAL([HAVE_AT_FDCWD], [test x$ac_have_at_fdcwd = xyes])
1450 # Check for stpncpy function definition in string.h
1451 # This explicitly checks with _GNU_SOURCE defined since that is also
1452 # used in the test case (some systems might define it without anyway
1453 # since stpncpy is part of The Open Group Base Specifications Issue 7
1454 # IEEE Std 1003.1-2008.
1455 AC_MSG_CHECKING([for stpncpy])
1456 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1463 char *r = stpncpy(d, s, n);
1465 ac_have_gnu_stpncpy=yes
1466 AC_MSG_RESULT([yes])
1468 ac_have_gnu_stpncpy=no
1472 AM_CONDITIONAL([HAVE_GNU_STPNCPY], [test x$ac_have_gnu_stpncpy = xyes])
1474 # Check for PTRACE_GETREGS
1476 AC_MSG_CHECKING([for PTRACE_GETREGS])
1477 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1480 #include <sys/ptrace.h>
1481 #include <sys/user.h>
1484 long res = ptrace (PTRACE_GETREGS, 0, p, p);
1486 AC_MSG_RESULT([yes])
1487 AC_DEFINE([HAVE_PTRACE_GETREGS], 1,
1488 [Define to 1 if you have the `PTRACE_GETREGS' ptrace request.])
1494 # Check for CLOCK_MONOTONIC
1496 AC_MSG_CHECKING([for CLOCK_MONOTONIC])
1498 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1502 clock_gettime(CLOCK_MONOTONIC, &t);
1505 AC_MSG_RESULT([yes])
1506 AC_DEFINE([HAVE_CLOCK_MONOTONIC], 1,
1507 [Define to 1 if you have the `CLOCK_MONOTONIC' constant.])
1513 # Check for ELF32/64_CHDR
1515 AC_CHECK_TYPES([Elf32_Chdr, Elf64_Chdr], [], [], [[#include <elf.h>]])
1518 # Check for PTHREAD_RWLOCK_T
1520 AC_MSG_CHECKING([for pthread_rwlock_t])
1522 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1524 #include <pthread.h>
1526 pthread_rwlock_t rwl;
1528 AC_MSG_RESULT([yes])
1529 AC_DEFINE([HAVE_PTHREAD_RWLOCK_T], 1,
1530 [Define to 1 if you have the `pthread_rwlock_t' type.])
1535 # Check for CLOCKID_T
1537 AC_MSG_CHECKING([for clockid_t])
1539 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1544 AC_MSG_RESULT([yes])
1545 AC_DEFINE([HAVE_CLOCKID_T], 1,
1546 [Define to 1 if you have the `clockid_t' type.])
1551 # Check for PTHREAD_MUTEX_ADAPTIVE_NP
1553 AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP])
1555 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1557 #include <pthread.h>
1559 return (PTHREAD_MUTEX_ADAPTIVE_NP);
1561 AC_MSG_RESULT([yes])
1562 AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1,
1563 [Define to 1 if you have the `PTHREAD_MUTEX_ADAPTIVE_NP' constant.])
1569 # Check for PTHREAD_MUTEX_ERRORCHECK_NP
1571 AC_MSG_CHECKING([for PTHREAD_MUTEX_ERRORCHECK_NP])
1573 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1575 #include <pthread.h>
1577 return (PTHREAD_MUTEX_ERRORCHECK_NP);
1579 AC_MSG_RESULT([yes])
1580 AC_DEFINE([HAVE_PTHREAD_MUTEX_ERRORCHECK_NP], 1,
1581 [Define to 1 if you have the `PTHREAD_MUTEX_ERRORCHECK_NP' constant.])
1587 # Check for PTHREAD_MUTEX_RECURSIVE_NP
1589 AC_MSG_CHECKING([for PTHREAD_MUTEX_RECURSIVE_NP])
1591 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1593 #include <pthread.h>
1595 return (PTHREAD_MUTEX_RECURSIVE_NP);
1597 AC_MSG_RESULT([yes])
1598 AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], 1,
1599 [Define to 1 if you have the `PTHREAD_MUTEX_RECURSIVE_NP' constant.])
1605 # Check for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
1607 AC_MSG_CHECKING([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP])
1609 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1611 #include <pthread.h>
1613 pthread_mutex_t m = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
1616 AC_MSG_RESULT([yes])
1617 AC_DEFINE([HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], 1,
1618 [Define to 1 if you have the `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' constant.])
1624 # Check whether pthread_mutex_t has a member called __m_kind.
1626 AC_CHECK_MEMBER([pthread_mutex_t.__m_kind],
1627 [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__M_KIND],
1629 [Define to 1 if pthread_mutex_t has a member called __m_kind.])
1632 [#include <pthread.h>])
1635 # Check whether pthread_mutex_t has a member called __data.__kind.
1637 AC_CHECK_MEMBER([pthread_mutex_t.__data.__kind],
1638 [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__DATA__KIND],
1640 [Define to 1 if pthread_mutex_t has a member __data.__kind.])
1643 [#include <pthread.h>])
1645 # Convenience function. Set flags based on the existing HWCAP entries.
1646 # The AT_HWCAP entries are generated by glibc, and are based on
1647 # functions supported by the hardware/system/libc.
1648 # Subsequent support for whether the capability will actually be utilized
1649 # will also be checked against the compiler capabilities.
1651 # AC_HWCAP_CONTAINS_FLAG[hwcap_string_to_match],[VARIABLE_TO_SET]
1652 AC_DEFUN([AC_HWCAP_CONTAINS_FLAG],[
1654 AC_MSG_CHECKING([if AT_HWCAP contains the $AUXV_CHECK_FOR indicator])
1655 if env LD_SHOW_AUXV=1 true | grep ^AT_HWCAP | grep -q -w ${AUXV_CHECK_FOR}
1657 AC_MSG_RESULT([yes])
1658 AC_SUBST([$2],[yes])
1665 # gather hardware capabilities. (hardware/kernel/libc)
1666 AC_HWCAP_CONTAINS_FLAG([altivec],[HWCAP_HAS_ALTIVEC])
1667 AC_HWCAP_CONTAINS_FLAG([vsx],[HWCAP_HAS_VSX])
1668 AC_HWCAP_CONTAINS_FLAG([dfp],[HWCAP_HAS_DFP])
1669 AC_HWCAP_CONTAINS_FLAG([arch_2_05],[HWCAP_HAS_ISA_2_05])
1670 AC_HWCAP_CONTAINS_FLAG([arch_2_06],[HWCAP_HAS_ISA_2_06])
1671 AC_HWCAP_CONTAINS_FLAG([arch_2_07],[HWCAP_HAS_ISA_2_07])
1672 AC_HWCAP_CONTAINS_FLAG([arch_3_00],[HWCAP_HAS_ISA_3_00])
1673 AC_HWCAP_CONTAINS_FLAG([arch_3_1],[HWCAP_HAS_ISA_3_1])
1674 AC_HWCAP_CONTAINS_FLAG([htm],[HWCAP_HAS_HTM])
1675 AC_HWCAP_CONTAINS_FLAG([mma],[HWCAP_HAS_MMA])
1678 AM_CONDITIONAL(HAS_ISA_2_05, [test x$HWCAP_HAS_ISA_2_05 = xyes])
1679 AM_CONDITIONAL(HAS_ISA_2_06, [test x$HWCAP_HAS_ISA_2_06 = xyes])
1680 # compiler support for isa 2.07 level instructions
1681 AC_MSG_CHECKING([that assembler knows ISA 2.07 instructions ])
1682 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1684 __asm__ __volatile__("mtvsrd 1,2 ");
1686 ac_asm_have_isa_2_07=yes
1687 AC_MSG_RESULT([yes])
1689 ac_asm_have_isa_2_07=no
1692 AM_CONDITIONAL(HAS_ISA_2_07, [test x$ac_asm_have_isa_2_07 = xyes \
1693 -a x$HWCAP_HAS_ISA_2_07 = xyes])
1695 # altivec (vsx) support.
1696 # does this compiler support -maltivec and does it have the include file
1698 AC_MSG_CHECKING([for Altivec support in the compiler ])
1700 CFLAGS="-maltivec -Werror"
1701 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1702 #include <altivec.h>
1704 vector unsigned int v;
1707 AC_MSG_RESULT([yes])
1713 AM_CONDITIONAL([HAS_ALTIVEC], [test x$ac_have_altivec = xyes \
1714 -a x$HWCAP_HAS_ALTIVEC = xyes])
1716 # Check that both: the compiler supports -mvsx and that the assembler
1717 # understands VSX instructions. If either of those doesn't work,
1718 # conclude that we can't do VSX.
1719 AC_MSG_CHECKING([for VSX compiler flag support])
1721 CFLAGS="-mvsx -Werror"
1722 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1725 ac_compiler_supports_vsx_flag=yes
1726 AC_MSG_RESULT([yes])
1728 ac_compiler_supports_vsx_flag=no
1733 AC_MSG_CHECKING([for VSX support in the assembler ])
1735 CFLAGS="-mvsx -Werror"
1736 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1737 #include <altivec.h>
1739 vector unsigned int v;
1740 __asm__ __volatile__("xsmaddadp 32, 32, 33" ::: "memory","cc");
1742 ac_compiler_supports_vsx=yes
1743 AC_MSG_RESULT([yes])
1745 ac_compiler_supports_vsx=no
1749 AM_CONDITIONAL([HAS_VSX], [test x$ac_compiler_supports_vsx_flag = xyes \
1750 -a x$ac_compiler_supports_vsx = xyes \
1751 -a x$HWCAP_HAS_VSX = xyes ])
1753 # DFP (Decimal Float)
1754 # The initial DFP support was added in Power 6. The dcffix instruction
1755 # support was added in Power 7.
1756 AC_MSG_CHECKING([that assembler knows DFP])
1757 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1760 __asm__ __volatile__("adtr 1, 2, 3")
1762 __asm__ __volatile__(".machine power7;\n" \
1768 AC_MSG_RESULT([yes])
1773 AC_MSG_CHECKING([that compiler knows -mhard-dfp switch])
1775 CFLAGS="-mhard-dfp -Werror"
1777 # The dcffix instruction is Power 7
1778 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1781 __asm__ __volatile__("adtr 1, 2, 3")
1783 __asm__ __volatile__(".machine power7;\n" \
1788 ac_compiler_have_dfp=yes
1789 AC_MSG_RESULT([yes])
1791 ac_compiler_have_dfp=no
1795 AM_CONDITIONAL(HAS_DFP, test x$ac_asm_have_dfp = xyes \
1796 -a x$ac_compiler_have_dfp = xyes \
1797 -a x$HWCAP_HAS_DFP = xyes )
1799 AC_MSG_CHECKING([that compiler knows DFP datatypes])
1800 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1802 _Decimal64 x = 0.0DD;
1804 ac_compiler_have_dfp_type=yes
1805 AC_MSG_RESULT([yes])
1807 ac_compiler_have_dfp_type=no
1810 AM_CONDITIONAL(BUILD_DFP_TESTS, test x$ac_compiler_have_dfp_type = xyes \
1811 -a x$HWCAP_HAS_DFP = xyes )
1814 # HTM (Hardware Transactional Memory)
1815 AC_MSG_CHECKING([if compiler accepts the -mhtm flag])
1817 CFLAGS="-mhtm -Werror"
1818 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1822 AC_MSG_RESULT([yes])
1823 ac_compiler_supports_htm=yes
1826 ac_compiler_supports_htm=no
1830 AC_MSG_CHECKING([if compiler can find the htm builtins])
1832 CFLAGS="-mhtm -Werror"
1833 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1835 if (__builtin_tbegin (0))
1838 AC_MSG_RESULT([yes])
1839 ac_compiler_sees_htm_builtins=yes
1842 ac_compiler_sees_htm_builtins=no
1846 AM_CONDITIONAL(SUPPORTS_HTM, test x$ac_compiler_supports_htm = xyes \
1847 -a x$ac_compiler_sees_htm_builtins = xyes \
1848 -a x$HWCAP_HAS_HTM = xyes )
1850 # isa 3.0 checking. (actually 3.0 or newer)
1851 AC_MSG_CHECKING([that assembler knows ISA 3.00 ])
1853 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1855 __asm__ __volatile__ (".machine power9;\n" \
1858 # guest_ppc_helpers.c needs the HAS_ISA_3_OO to enable copy, paste,
1861 CFLAGS="-DHAS_ISA_3_00"
1862 ac_asm_have_isa_3_00=yes
1863 AC_MSG_RESULT([yes])
1865 ac_asm_have_isa_3_00=no
1871 AC_MSG_CHECKING([that assembler knows xscvhpdp ])
1873 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1875 __asm__ __volatile__ (".machine power9;\n" \
1876 "xscvhpdp 1,2;\n" );
1878 ac_asm_have_xscvhpdp=yes
1879 AC_MSG_RESULT([yes])
1881 ac_asm_have_xscvhpdp=no
1885 # darn instruction checking
1886 AC_MSG_CHECKING([that assembler knows darn instruction ])
1888 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1890 __asm__ __volatile__(".machine power9; darn 1,0 ");
1892 ac_asm_have_darn_inst=yes
1893 AC_MSG_RESULT([yes])
1895 ac_asm_have_darn_inst=no
1900 AC_MSG_CHECKING([that assembler knows ISA 3.1 ])
1901 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1903 __asm__ __volatile__ (".machine power10;\n" \
1906 ac_asm_have_isa_3_1=yes
1907 AC_MSG_RESULT([yes])
1909 ac_asm_have_isa_3_1=no
1914 AM_CONDITIONAL(HAS_ISA_3_00, [test x$ac_asm_have_isa_3_00 = xyes \
1915 -a x$HWCAP_HAS_ISA_3_00 = xyes])
1917 AM_CONDITIONAL(HAS_XSCVHPDP, [test x$ac_asm_have_xscvhpdp = xyes])
1918 AM_CONDITIONAL(HAS_DARN, [test x$ac_asm_have_darn_inst = xyes])
1920 AM_CONDITIONAL(HAS_ISA_3_1, [test x$ac_asm_have_isa_3_1 = xyes \
1921 -a x$HWCAP_HAS_ISA_3_1 = xyes])
1923 # Check for pthread_create@GLIBC2.0
1924 AC_MSG_CHECKING([for pthread_create@GLIBC2.0()])
1927 CFLAGS="-lpthread -Werror"
1928 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1929 extern int pthread_create_glibc_2_0(void*, const void*,
1930 void *(*)(void*), void*);
1931 __asm__(".symver pthread_create_glibc_2_0, pthread_create@GLIBC_2.0");
1935 * Apparently on PowerPC linking this program succeeds and generates an
1936 * executable with the undefined symbol pthread_create@GLIBC_2.0.
1938 #error This test does not work properly on PowerPC.
1940 pthread_create_glibc_2_0(0, 0, 0, 0);
1944 ac_have_pthread_create_glibc_2_0=yes
1945 AC_MSG_RESULT([yes])
1946 AC_DEFINE([HAVE_PTHREAD_CREATE_GLIBC_2_0], 1,
1947 [Define to 1 if you have the `pthread_create@glibc2.0' function.])
1949 ac_have_pthread_create_glibc_2_0=no
1954 AM_CONDITIONAL(HAVE_PTHREAD_CREATE_GLIBC_2_0,
1955 test x$ac_have_pthread_create_glibc_2_0 = xyes)
1958 # Check for dlinfo RTLD_DI_TLS_MODID
1959 AC_MSG_CHECKING([for dlinfo RTLD_DI_TLS_MODID])
1963 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1970 size_t sizes[10000];
1971 size_t modid_offset;
1972 (void) dlinfo ((void*)sizes, RTLD_DI_TLS_MODID, &modid_offset);
1975 ac_have_dlinfo_rtld_di_tls_modid=yes
1976 AC_MSG_RESULT([yes])
1977 AC_DEFINE([HAVE_DLINFO_RTLD_DI_TLS_MODID], 1,
1978 [Define to 1 if you have a dlinfo that can do RTLD_DI_TLS_MODID.])
1980 ac_have_dlinfo_rtld_di_tls_modid=no
1985 AM_CONDITIONAL(HAVE_DLINFO_RTLD_DI_TLS_MODID,
1986 test x$ac_have_dlinfo_rtld_di_tls_modid = xyes)
1989 # Check for eventfd_t, eventfd() and eventfd_read()
1990 AC_MSG_CHECKING([for eventfd()])
1992 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1993 #include <sys/eventfd.h>
1999 eventfd_read(fd, &ev);
2002 AC_MSG_RESULT([yes])
2003 AC_DEFINE([HAVE_EVENTFD], 1,
2004 [Define to 1 if you have the `eventfd' function.])
2005 AC_DEFINE([HAVE_EVENTFD_READ], 1,
2006 [Define to 1 if you have the `eventfd_read' function.])
2011 # Check whether compiler can process #include <thread> without errors
2012 # clang 3.3 cannot process <thread> from e.g.
2013 # gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
2015 AC_MSG_CHECKING([that C++ compiler can compile C++17 code])
2017 safe_CXXFLAGS=$CXXFLAGS
2020 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
2025 AC_MSG_RESULT([yes])
2030 CXXFLAGS=$safe_CXXFLAGS
2033 AM_CONDITIONAL(HAVE_CXX17, test x$ac_have_cxx_17 = xyes)
2035 AC_MSG_CHECKING([that C++ compiler can include <thread> header file])
2037 safe_CXXFLAGS=$CXXFLAGS
2040 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
2044 ac_cxx_can_include_thread_header=yes
2045 AC_MSG_RESULT([yes])
2047 ac_cxx_can_include_thread_header=no
2050 CXXFLAGS=$safe_CXXFLAGS
2053 AM_CONDITIONAL(CXX_CAN_INCLUDE_THREAD_HEADER, test x$ac_cxx_can_include_thread_header = xyes)
2055 # Check whether compiler can process #include <condition_variable> without errors
2057 AC_MSG_CHECKING([that C++ compiler can include <condition_variable> header file])
2059 safe_CXXFLAGS=$CXXFLAGS
2062 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
2063 #include <condition_variable>
2066 ac_cxx_can_include_condition_variable_header=yes
2067 AC_MSG_RESULT([yes])
2069 ac_cxx_can_include_condition_variable_header=no
2072 CXXFLAGS=$safe_CXXFLAGS
2075 AM_CONDITIONAL(CXX_CAN_INCLUDE_CONDITION_VARIABLE_HEADER, test x$ac_cxx_can_include_condition_variable_header = xyes)
2077 # check for std::shared_timed_mutex, this is a C++ 14 feature
2079 AC_MSG_CHECKING([that C++ compiler can use std::shared_timed_mutex])
2081 safe_CXXFLAGS=$CXXFLAGS
2082 CXXFLAGS="-std=c++1y -pthread"
2084 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
2085 #include <shared_mutex>
2086 std::shared_timed_mutex test_mutex;
2089 ac_cxx_can_use_shared_timed_mutex=yes
2090 AC_MSG_RESULT([yes])
2092 ac_cxx_can_use_shared_timed_mutex=no
2095 CXXFLAGS=$safe_CXXFLAGS
2098 AM_CONDITIONAL(CXX_CAN_USE_SHARED_TIMED_MUTEX, test x$ac_cxx_can_use_shared_timed_mutex = xyes)
2100 # check for std::shared_mutex, this is a C++ 11 feature
2102 AC_MSG_CHECKING([that C++ compiler can use std::timed_mutex])
2104 safe_CXXFLAGS=$CXXFLAGS
2105 CXXFLAGS="-std=c++0x -pthread"
2107 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
2109 std::timed_mutex test_mutex;
2112 ac_cxx_can_use_timed_mutex=yes
2113 AC_MSG_RESULT([yes])
2115 ac_cxx_can_use_timed_mutex=no
2118 CXXFLAGS=$safe_CXXFLAGS
2121 AM_CONDITIONAL(CXX_CAN_USE_TIMED_MUTEX, test x$ac_cxx_can_use_timed_mutex = xyes)
2123 # On aarch64 before glibc 2.20 we would get the kernel user_pt_regs instead
2124 # of the user_regs_struct from sys/user.h. They are structurally the same
2125 # but we get either one or the other.
2127 AC_CHECK_TYPE([struct user_regs_struct],
2128 [sys_user_has_user_regs=yes], [sys_user_has_user_regs=no],
2129 [[#include <sys/ptrace.h>]
2130 [#include <sys/time.h>]
2131 [#include <sys/user.h>]])
2132 if test "$sys_user_has_user_regs" = "yes"; then
2133 AC_DEFINE(HAVE_SYS_USER_REGS, 1,
2134 [Define to 1 if <sys/user.h> defines struct user_regs_struct])
2137 AC_MSG_CHECKING([for __NR_membarrier])
2138 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2139 #include <linux/unistd.h>
2141 return __NR_membarrier
2143 ac_have_nr_membarrier=yes
2144 AC_MSG_RESULT([yes])
2146 ac_have_nr_membarrier=no
2150 AM_CONDITIONAL(HAVE_NR_MEMBARRIER, [test x$ac_have_nr_membarrier = xyes])
2152 #----------------------------------------------------------------------------
2153 # Checking for supported compiler flags.
2154 #----------------------------------------------------------------------------
2156 case "${host_cpu}" in
2158 ARCH=$(echo "$CFLAGS" | grep -E -e '-march=@<:@^ @:>@+' -e '\B-mips@<:@^ +@:>@')
2159 if test -z "$ARCH"; then
2160 # does this compiler support -march=mips32 (mips32 default) ?
2161 AC_MSG_CHECKING([if gcc accepts -march=mips32 -mabi=32])
2164 CFLAGS="$CFLAGS -mips32 -mabi=32 -Werror"
2166 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2169 FLAG_M32="-mips32 -mabi=32"
2170 AC_MSG_RESULT([yes])
2180 # does this compiler support -march=mips64r2 (mips64r2 default) ?
2181 AC_MSG_CHECKING([if gcc accepts -march=mips64r2 -mabi=64])
2184 CFLAGS="$CFLAGS -march=mips64r2 -mabi=64 -Werror"
2186 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2189 FLAG_M64="-march=mips64r2 -mabi=64"
2190 AC_MSG_RESULT([yes])
2203 # does this compiler support -m32 ?
2204 AC_MSG_CHECKING([if gcc accepts -m32])
2207 CFLAGS="${FLAG_32ON64} -m32 -Werror"
2209 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2212 FLAG_M32="${FLAG_32ON64} -m32"
2213 AC_MSG_RESULT([yes])
2223 # does this compiler support -m64 ?
2224 AC_MSG_CHECKING([if gcc accepts -m64])
2227 CFLAGS="-m64 -Werror"
2229 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2233 AC_MSG_RESULT([yes])
2245 ARCH=$(echo "$CFLAGS" | grep -E -e '-march=@<:@^ @:>@+' -e '\B-mips@<:@^ +@:>@')
2246 if test -z "$ARCH"; then
2247 # does this compiler support -march=octeon (Cavium OCTEON I Specific) ?
2248 AC_MSG_CHECKING([if gcc accepts -march=octeon])
2251 CFLAGS="$CFLAGS $FLAG_M64 -march=octeon -Werror"
2253 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2256 FLAG_OCTEON="-march=octeon"
2257 AC_MSG_RESULT([yes])
2264 AC_SUBST(FLAG_OCTEON)
2267 # does this compiler support -march=octeon2 (Cavium OCTEON II Specific) ?
2268 AC_MSG_CHECKING([if gcc accepts -march=octeon2])
2271 CFLAGS="$CFLAGS $FLAG_M64 -march=octeon2 -Werror"
2273 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2276 FLAG_OCTEON2="-march=octeon2"
2277 AC_MSG_RESULT([yes])
2284 AC_SUBST(FLAG_OCTEON2)
2288 # does this compiler support -mmsa (MIPS MSA ASE) ?
2289 AC_MSG_CHECKING([if gcc accepts -mmsa])
2292 CFLAGS="$CFLAGS -mmsa -Werror"
2294 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2298 AC_MSG_RESULT([yes])
2307 # Are we compiling for the MIPS64 n32 ABI?
2308 AC_MSG_CHECKING([if gcc is producing mips n32 binaries])
2309 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
2310 #if !defined(_MIPS_SIM) || (defined(_MIPS_SIM) && (_MIPS_SIM != _ABIN32))
2315 FLAG_M64="-march=mips64r2 -mabi=n32"
2316 AC_MSG_RESULT([yes])
2321 # Are we compiling for the MIPS64 n64 ABI?
2322 AC_MSG_CHECKING([if gcc is producing mips n64 binaries])
2323 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
2324 #if !defined(_MIPS_SIM) || (defined(_MIPS_SIM) && (_MIPS_SIM != _ABI64))
2329 AC_MSG_RESULT([yes])
2334 # We enter the code block below in the following case:
2335 # Target architecture is set to mips64, the desired abi
2336 # was not specified and the compiler's default abi setting
2337 # is neither n32 nor n64.
2338 # Probe for and set the abi to either n64 or n32, in that order,
2339 # which is required for a mips64 build of valgrind.
2340 if test "$ARCH_MAX" = "mips64" -a "x$VGCONF_ABI" = "x"; then
2342 CFLAGS="$CFLAGS -mabi=64 -Werror"
2343 AC_MSG_CHECKING([if gcc is n64 capable])
2344 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
2348 AC_MSG_RESULT([yes])
2354 if test "x$VGCONF_ABI" = "x"; then
2356 CFLAGS="$CFLAGS -mabi=n32 -Werror"
2357 AC_MSG_CHECKING([if gcc is n32 capable])
2358 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
2362 FLAG_M64="-march=mips64r2 -mabi=n32"
2363 AC_MSG_RESULT([yes])
2371 AM_CONDITIONAL([VGCONF_HAVE_ABI],
2372 [test x$VGCONF_ABI != x])
2373 AC_SUBST(VGCONF_ABI)
2376 # does this compiler support -mmmx ?
2377 AC_MSG_CHECKING([if gcc accepts -mmmx])
2380 CFLAGS="-mmmx -Werror"
2382 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2386 AC_MSG_RESULT([yes])
2396 # does this compiler support -msse ?
2397 AC_MSG_CHECKING([if gcc accepts -msse])
2400 CFLAGS="-msse -Werror"
2402 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2406 AC_MSG_RESULT([yes])
2416 # does this compiler support -mpreferred-stack-boundary=2 when
2417 # generating code for a 32-bit target? Note that we only care about
2418 # this when generating code for (32-bit) x86, so if the compiler
2419 # doesn't recognise -m32 it's no big deal. We'll just get code for
2420 # the Memcheck and other helper functions, that is a bit slower than
2421 # it could be, on x86; and no difference at all on any other platform.
2422 AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary=2 -m32])
2425 CFLAGS="-mpreferred-stack-boundary=2 -m32 -Werror"
2427 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2430 PREFERRED_STACK_BOUNDARY_2="-mpreferred-stack-boundary=2"
2431 AC_MSG_RESULT([yes])
2433 PREFERRED_STACK_BOUNDARY_2=""
2438 AC_SUBST(PREFERRED_STACK_BOUNDARY_2)
2441 # does this compiler support -mlong-double-128 ?
2442 AC_MSG_CHECKING([if gcc accepts -mlong-double-128])
2444 CFLAGS="-mlong-double-128 -Werror"
2445 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2448 ac_compiler_supports_mlong_double_128=yes
2449 AC_MSG_RESULT([yes])
2451 ac_compiler_supports_mlong_double_128=no
2455 AM_CONDITIONAL(HAS_MLONG_DOUBLE_128, test x$ac_compiler_supports_mlong_double_128 = xyes)
2456 FLAG_MLONG_DOUBLE_128="-mlong-double-128"
2457 AC_SUBST(FLAG_MLONG_DOUBLE_128)
2459 # does this toolchain support lto ?
2460 # Not checked for if --enable-lto=no was given, or if LTO_AR or LTO_RANLIG
2462 # If not enable-lto=* arg is provided, default to no, as lto builds are
2463 # a lot slower, and so not appropriate for Valgrind developments.
2464 # --enable-lto=yes should be used by distro packagers.
2465 AC_CACHE_CHECK([for using the link time optimisation], vg_cv_lto,
2467 [ --enable-lto enables building with link time optimisation],
2468 [vg_cv_lto=$enableval],
2471 if test "x${vg_cv_lto}" != "xno" -a "x${LTO_AR}" != "x" -a "x${LTO_RANLIB}" != "x"; then
2472 AC_MSG_CHECKING([if toolchain accepts lto])
2474 TEST_LTO_CFLAGS="-flto -flto-partition=one -fuse-linker-plugin"
2475 # Note : using 'one' partition is giving a slightly smaller/faster memcheck
2476 # and ld/lto-trans1 still needs a reasonable memory (about 0.5GB) when linking.
2477 CFLAGS="$TEST_LTO_CFLAGS -Werror"
2479 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2480 extern void somefun(void);
2484 LTO_CFLAGS=$TEST_LTO_CFLAGS
2485 AC_MSG_RESULT([yes])
2493 AC_SUBST(LTO_CFLAGS)
2495 # if we could not compile with lto args, or lto was disabled,
2496 # then set LTO_AR/LTO_RANLIB to the non lto values
2497 # define in config.h ENABLE_LTO (not needed by the code currently, but
2498 # this guarantees we recompile everything if we re-configure and rebuild
2499 # in a build dir previously build with another value of --enable-lto
2500 if test "x${LTO_CFLAGS}" = "x"; then
2502 LTO_RANLIB=${RANLIB}
2506 AC_DEFINE([ENABLE_LTO], 1, [configured to build with lto link time optimisation])
2509 # Convenience function to check whether GCC supports a particular
2510 # warning option. Takes two arguments,
2511 # first the warning flag name to check (without -W), then the
2512 # substitution name to set with -Wno-warning-flag if the flag exists,
2513 # or the empty string if the compiler doesn't accept the flag. Note
2514 # that checking is done against the warning flag itself, but the
2515 # substitution is then done to cancel the warning flag.
2516 AC_DEFUN([AC_GCC_WARNING_SUBST_NO],[
2517 AC_MSG_CHECKING([if gcc accepts -W$1])
2519 CFLAGS="-W$1 -Werror"
2520 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [
2521 AC_SUBST([$2], [-Wno-$1])
2522 AC_MSG_RESULT([yes])], [
2524 AC_MSG_RESULT([no])])
2528 # A variation of the above for arguments that
2530 AC_DEFUN([AC_GCC_WARNING_SUBST_NO_VAL],[
2531 AC_MSG_CHECKING([if gcc accepts -W$1=$2])
2533 CFLAGS="-W$1=$2 -Werror"
2534 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [
2535 AC_SUBST([$3], [-Wno-$1])
2536 AC_MSG_RESULT([yes])], [
2538 AC_MSG_RESULT([no])])
2542 # Convenience function. Like AC_GCC_WARNING_SUBST_NO, except it substitutes
2543 # -W$1 (instead of -Wno-$1).
2544 AC_DEFUN([AC_GCC_WARNING_SUBST],[
2545 AC_MSG_CHECKING([if gcc accepts -W$1])
2547 CFLAGS="-W$1 -Werror"
2548 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [
2549 AC_SUBST([$2], [-W$1])
2550 AC_MSG_RESULT([yes])], [
2552 AC_MSG_RESULT([no])])
2556 AC_GCC_WARNING_SUBST_NO([memset-transposed-args], [FLAG_W_NO_MEMSET_TRANSPOSED_ARGS])
2557 AC_GCC_WARNING_SUBST_NO([nonnull], [FLAG_W_NO_NONNULL])
2558 AC_GCC_WARNING_SUBST_NO([overflow], [FLAG_W_NO_OVERFLOW])
2559 AC_GCC_WARNING_SUBST_NO([pointer-sign], [FLAG_W_NO_POINTER_SIGN])
2560 AC_GCC_WARNING_SUBST_NO([uninitialized], [FLAG_W_NO_UNINITIALIZED])
2561 AC_GCC_WARNING_SUBST_NO([maybe-uninitialized], [FLAG_W_NO_MAYBE_UNINITIALIZED])
2562 AC_GCC_WARNING_SUBST_NO([unused-function], [FLAG_W_NO_UNUSED_FUNCTION])
2563 AC_GCC_WARNING_SUBST_NO([static-local-in-inline], [FLAG_W_NO_STATIC_LOCAL_IN_INLINE])
2564 AC_GCC_WARNING_SUBST_NO([mismatched-new-delete], [FLAG_W_NO_MISMATCHED_NEW_DELETE])
2565 AC_GCC_WARNING_SUBST_NO([infinite-recursion], [FLAG_W_NO_INFINITE_RECURSION])
2566 AC_GCC_WARNING_SUBST_NO([expansion-to-defined], [FLAG_W_NO_EXPANSION_TO_DEFINED])
2567 AC_GCC_WARNING_SUBST_NO([unused-but-set-variable], [FLAG_W_NO_UNUSED_BUT_SET_VARIABLE])
2568 AC_GCC_WARNING_SUBST_NO([non-power-of-two-alignment], [FLAG_W_NO_NON_POWER_OF_TWO_ALIGNMENT])
2569 AC_GCC_WARNING_SUBST_NO([sign-compare], [FLAG_W_NO_SIGN_COMPARE])
2570 AC_GCC_WARNING_SUBST_NO([stringop-overflow], [FLAG_W_NO_STRINGOP_OVERFLOW])
2571 AC_GCC_WARNING_SUBST_NO([stringop-overread], [FLAG_W_NO_STRINGOP_OVERREAD])
2572 AC_GCC_WARNING_SUBST_NO([stringop-truncation], [FLAG_W_NO_STRINGOP_TRUNCATION])
2573 AC_GCC_WARNING_SUBST_NO([format-overflow], [FLAG_W_NO_FORMAT_OVERFLOW])
2574 AC_GCC_WARNING_SUBST_NO([use-after-free], [FLAG_W_NO_USE_AFTER_FREE])
2575 AC_GCC_WARNING_SUBST_NO([free-nonheap-object], [FLAG_W_NO_FREE_NONHEAP_OBJECT])
2576 AC_GCC_WARNING_SUBST_NO([fortify-source], [FLAG_W_NO_FORTIFY_SOURCE])
2577 AC_GCC_WARNING_SUBST_NO([builtin-memcpy-chk-size], [FLAG_W_NO_BUILTIN_MEMCPY_CHK_SIZE])
2578 AC_GCC_WARNING_SUBST_NO([incompatible-pointer-types-discards-qualifiers], [FLAG_W_NO_INCOMPATIBLE_POINTER_TYPES_DISCARDS_QUALIFIERS])
2579 AC_GCC_WARNING_SUBST_NO([suspicious-bzero], [FLAG_W_NO_SUSPICIOUS_BZERO])
2581 AC_GCC_WARNING_SUBST_NO_VAL([alloc-size-larger-than], [1677216], [FLAG_W_NO_ALLOC_SIZE_LARGER_THAN])
2583 AC_GCC_WARNING_SUBST([write-strings], [FLAG_W_WRITE_STRINGS])
2584 AC_GCC_WARNING_SUBST([empty-body], [FLAG_W_EMPTY_BODY])
2585 AC_GCC_WARNING_SUBST([format], [FLAG_W_FORMAT])
2586 AC_GCC_WARNING_SUBST([format-signedness], [FLAG_W_FORMAT_SIGNEDNESS])
2587 AC_GCC_WARNING_SUBST([cast-qual], [FLAG_W_CAST_QUAL])
2588 AC_GCC_WARNING_SUBST([old-style-declaration], [FLAG_W_OLD_STYLE_DECLARATION])
2589 AC_GCC_WARNING_SUBST([ignored-qualifiers], [FLAG_W_IGNORED_QUALIFIERS])
2590 AC_GCC_WARNING_SUBST([missing-parameter-type], [FLAG_W_MISSING_PARAMETER_TYPE])
2591 AC_GCC_WARNING_SUBST([logical-op], [FLAG_W_LOGICAL_OP])
2592 AC_GCC_WARNING_SUBST([enum-conversion], [FLAG_W_ENUM_CONVERSION])
2593 AC_GCC_WARNING_SUBST([implicit-fallthrough=2], [FLAG_W_IMPLICIT_FALLTHROUGH])
2595 # Does this compiler support -Wformat-security ?
2596 # Special handling is needed, because certain GCC versions require -Wformat
2597 # being present if -Wformat-security is given. Otherwise a warning is issued.
2598 # However, AC_GCC_WARNING_SUBST will stick in -Werror (see r15323 for rationale).
2599 # And with that the warning will be turned into an error with the result
2600 # that -Wformat-security is believed to be unsupported when in fact it is.
2601 AC_MSG_CHECKING([if gcc accepts -Wformat-security])
2603 CFLAGS="-Wformat -Wformat-security -Werror"
2604 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [
2605 AC_SUBST([FLAG_W_FORMAT_SECURITY], [-Wformat-security])
2606 AC_MSG_RESULT([yes])], [
2607 AC_SUBST([FLAG_W_FORMAT_SECURITY], [])
2608 AC_MSG_RESULT([no])])
2611 # does this compiler support -Wextra or the older -W ?
2613 AC_MSG_CHECKING([if gcc accepts -Wextra or -W])
2616 CFLAGS="-Wextra -Werror"
2618 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2621 AC_SUBST([FLAG_W_EXTRA], [-Wextra])
2622 AC_MSG_RESULT([-Wextra])
2625 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2628 AC_SUBST([FLAG_W_EXTRA], [-W])
2631 AC_SUBST([FLAG_W_EXTRA], [])
2632 AC_MSG_RESULT([not supported])
2637 # On ARM we do not want to pass -Wcast-align as that produces loads
2638 # of warnings. GCC is just being conservative. See here:
2639 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65459#c4
2640 if test "X$VGCONF_ARCH_PRI" = "Xarm"; then
2641 AC_SUBST([FLAG_W_CAST_ALIGN], [""])
2643 AC_SUBST([FLAG_W_CAST_ALIGN], [-Wcast-align])
2646 # does this compiler support -faligned-new ?
2647 AC_MSG_CHECKING([if g++ accepts -faligned-new])
2649 safe_CXXFLAGS=$CXXFLAGS
2650 CXXFLAGS="-faligned-new -Werror"
2653 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2656 FLAG_FALIGNED_NEW="-faligned-new"
2657 AC_MSG_RESULT([yes])
2659 FLAG_FALIGNED_NEW=""
2662 CXXFLAGS=$safe_CXXFLAGS
2665 AC_SUBST(FLAG_FALIGNED_NEW)
2667 # does this compiler support -fsized-deallocation ?
2668 AC_MSG_CHECKING([if g++ accepts -fsized-deallocation])
2670 safe_CXXFLAGS=$CXXFLAGS
2671 CXXFLAGS="-fsized-deallocation -Werror"
2674 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2677 FLAG_FSIZED_DEALLOCATION="-fsized-deallocation"
2678 ac_have_sized_deallocation=yes
2679 AC_MSG_RESULT([yes])
2681 FLAG_FSIZED_DEALLOCATION=""
2682 ac_have_sized_deallocation=no
2685 CXXFLAGS=$safe_CXXFLAGS
2688 AC_SUBST(FLAG_FSIZED_DEALLOCATION)
2689 AM_CONDITIONAL([HAVE_FSIZED_DEALLOCATION], [test x$ac_have_sized_deallocation = xyes])
2691 # does this compiler support C++17 aligned new/delete?
2692 AC_MSG_CHECKING([if g++ supports aligned new and delete])
2694 safe_CXXFLAGS=$CXXFLAGS
2695 CXXFLAGS="-std=c++17"
2698 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2702 operator delete(nullptr, std::align_val_t(64U));
2704 ac_have_aligned_cxx_alloc=yes
2705 AC_MSG_RESULT([yes])
2707 ac_have_aligned_cxx_alloc=no
2710 CXXFLAGS=$safe_CXXFLAGS
2713 AM_CONDITIONAL([HAVE_ALIGNED_CXX_ALLOC], [test x$ac_have_aligned_cxx_alloc = xyes])
2715 # does this compiler support -fno-stack-protector ?
2716 AC_MSG_CHECKING([if gcc accepts -fno-stack-protector])
2719 CFLAGS="-fno-stack-protector -Werror"
2721 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2724 no_stack_protector=yes
2725 FLAG_FNO_STACK_PROTECTOR="-fno-stack-protector"
2726 AC_MSG_RESULT([yes])
2728 no_stack_protector=no
2729 FLAG_FNO_STACK_PROTECTOR=""
2734 AC_SUBST(FLAG_FNO_STACK_PROTECTOR)
2736 # does this compiler support -finline-functions ?
2737 AC_MSG_CHECKING([if gcc accepts -finline-functions])
2740 CFLAGS="-finline-functions -Werror"
2742 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2745 inline_functions=yes
2746 FLAG_FINLINE_FUNCTIONS="-finline-functions"
2747 AC_MSG_RESULT([yes])
2750 FLAG_FINLINE_FUNCTIONS=""
2755 AC_SUBST(FLAG_FINLINE_FUNCTIONS)
2757 # Does GCC support disabling Identical Code Folding?
2758 # We want to disabled Identical Code Folding for the
2759 # tools preload shared objects to get better backraces.
2760 # For GCC 5.1+ -fipa-icf is enabled by default at -O2.
2761 # "The optimization reduces code size and may disturb
2762 # unwind stacks by replacing a function by equivalent
2763 # one with a different name."
2764 AC_MSG_CHECKING([if gcc accepts -fno-ipa-icf])
2767 CFLAGS="-fno-ipa-icf -Werror"
2769 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2773 FLAG_FNO_IPA_ICF="-fno-ipa-icf"
2774 AC_MSG_RESULT([yes])
2782 AC_SUBST(FLAG_FNO_IPA_ICF)
2785 # Does this compiler support -fsanitize=undefined. This is true for
2786 # GCC 4.9 and newer. However, the undefined behaviour sanitiser in GCC 5.1
2787 # also checks for alignment violations on memory accesses which the valgrind
2788 # code base is sprinkled (if not littered) with. As those alignment issues
2789 # don't pose a problem we want to suppress warnings about them.
2790 # In GCC 5.1 this can be done by passing -fno-sanitize=alignment. Earlier
2791 # GCCs do not support that.
2793 # Only checked for if --enable-ubsan was given.
2794 if test "x${vg_cv_ubsan}" = "xyes"; then
2795 AC_MSG_CHECKING([if gcc accepts -fsanitize=undefined -fno-sanitize=alignment])
2797 CFLAGS="-fsanitize=undefined -fno-sanitize=alignment -Werror"
2798 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2801 FLAG_FSANITIZE="-fsanitize=undefined -fno-sanitize=alignment"
2802 LIB_UBSAN="-static-libubsan"
2803 AC_MSG_RESULT([yes])
2805 CFLAGS="-fsanitize=undefined -Werror"
2806 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2809 FLAG_FSANITIZE="-fsanitize=undefined"
2810 LIB_UBSAN="-static-libubsan"
2811 AC_MSG_RESULT([yes])
2819 AC_SUBST(FLAG_FSANITIZE)
2822 # does this compiler support --param inline-unit-growth=... ?
2824 AC_MSG_CHECKING([if gcc accepts --param inline-unit-growth])
2827 CFLAGS="--param inline-unit-growth=900 -Werror"
2829 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2832 AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH],
2833 ["--param inline-unit-growth=900"])
2834 AC_MSG_RESULT([yes])
2836 AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH], [""])
2842 # does this compiler support -gdwarf-4 -fdebug-types-section ?
2844 AC_MSG_CHECKING([if gcc accepts -gdwarf-4 -fdebug-types-section])
2847 CFLAGS="-gdwarf-4 -fdebug-types-section -Werror"
2849 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2853 AC_MSG_RESULT([yes])
2858 AM_CONDITIONAL(DWARF4, test x$ac_have_dwarf4 = xyes)
2862 # does this compiler support -g -gz=zlib ?
2864 AC_MSG_CHECKING([if gcc accepts -g -gz=zlib])
2867 CFLAGS="-g -gz=zlib"
2869 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2873 AC_MSG_RESULT([yes])
2878 AM_CONDITIONAL(GZ_ZLIB, test x$ac_have_gz_zlib = xyes)
2882 # does this compiler support -g -gz=zlib-gnu ?
2884 AC_MSG_CHECKING([if gcc accepts -g -gz=zlib-gnu])
2887 CFLAGS="-g -gz=zlib-gnu"
2889 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2892 ac_have_gz_zlib_gnu=yes
2893 AC_MSG_RESULT([yes])
2895 ac_have_gz_zlib_gnu=no
2898 AM_CONDITIONAL(GZ_ZLIB_GNU, test x$ac_have_gz_zlib_gnu = xyes)
2902 # does this compiler support nested functions ?
2904 AC_MSG_CHECKING([if gcc accepts nested functions])
2906 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2907 int foo() { return 1; }
2910 ac_have_nested_functions=yes
2911 AC_MSG_RESULT([yes])
2913 ac_have_nested_functions=no
2916 AM_CONDITIONAL([HAVE_NESTED_FUNCTIONS], [test x$ac_have_nested_functions = xyes])
2919 # does this compiler support the 'p' constraint in ASM statements ?
2921 AC_MSG_CHECKING([if gcc accepts the 'p' constraint in asm statements])
2923 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2925 __asm__ __volatile__ ("movdqa (%0),%%xmm6\n" : "=p" (p));
2927 ac_have_asm_constraint_p=yes
2928 AC_MSG_RESULT([yes])
2930 ac_have_asm_constraint_p=no
2933 AM_CONDITIONAL([HAVE_ASM_CONSTRAINT_P], [test x$ac_have_asm_constraint_p = xyes])
2936 # Does this compiler and linker support -pie?
2937 # Some compilers actually do not support -pie and report its usage
2938 # as an error. We need to check if it is safe to use it first.
2940 AC_MSG_CHECKING([if gcc accepts -pie])
2945 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2948 AC_SUBST([FLAG_PIE], ["-pie"])
2949 AC_MSG_RESULT([yes])
2951 AC_SUBST([FLAG_PIE], [""])
2956 AC_MSG_CHECKING([if gcc accepts -ansi])
2961 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2965 AC_MSG_RESULT([yes])
2970 AM_CONDITIONAL([HAVE_ANSI], [test x$ac_have_ansi = xyes])
2975 # Does this compiler support -no-pie?
2976 # On Ubuntu 16.10+, gcc produces position independent executables (PIE) by
2977 # default. However this gets in the way with some tests, we use -no-pie
2980 AC_MSG_CHECKING([if gcc accepts -no-pie])
2983 CFLAGS="-no-pie -Werror"
2985 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2988 AC_SUBST([FLAG_NO_PIE], ["-no-pie"])
2989 AC_MSG_RESULT([yes])
2991 AC_SUBST([FLAG_NO_PIE], [""])
2997 # We want to use use the -Ttext-segment option to the linker.
2998 # GNU (bfd) ld supports this directly. Newer GNU gold linkers
2999 # support it as an alias of -Ttext. Sadly GNU (bfd) ld's -Ttext
3000 # semantics are NOT what we want (GNU gold -Ttext is fine).
3002 # For GNU (bfd) ld -Ttext-segment chooses the base at which ELF headers
3003 # will reside. -Ttext aligns just the .text section start (but not any
3006 # LLVM ld.lld 10.0 changed the semantics of its -Ttext. See "Breaking changes"
3007 # in https://releases.llvm.org/10.0.0/tools/lld/docs/ReleaseNotes.html
3008 # The --image-base option (since version 6.0?) provides the semantics needed.
3009 # -Ttext-segment generates an error, but -Ttext now more closely
3010 # follows the GNU (bfd) ld's -Ttext.
3012 # So test first for --image-base support, and if that fails then
3013 # for -Ttext-segment which is supported by all bfd ld versions
3014 # and use that if it exists. If it doesn't exist it must be an older
3015 # version of gold and we can fall back to using -Ttext which has the
3019 AC_MSG_CHECKING([if the linker accepts -Wl,--image-base])
3021 CFLAGS="-static -nodefaultlibs -nostartfiles -Wl,--image-base=$valt_load_address_pri_norml -Werror"
3024 [AC_LANG_SOURCE([int _start () { return 0; }])],
3026 linker_using_t_text="no"
3027 AC_SUBST([FLAG_T_TEXT], ["--image-base"])
3028 AC_MSG_RESULT([yes])
3032 AC_MSG_CHECKING([if the linker accepts -Wl,-Ttext-segment])
3034 CFLAGS="-static -nodefaultlibs -nostartfiles -Wl,-Ttext-segment=$valt_load_address_pri_norml -Werror"
3037 [AC_LANG_SOURCE([int _start () { return 0; }])],
3039 linker_using_t_text="no"
3040 AC_SUBST([FLAG_T_TEXT], ["-Ttext-segment"])
3041 AC_MSG_RESULT([yes])
3043 linker_using_t_text="yes"
3044 AC_SUBST([FLAG_T_TEXT], ["-Ttext"])
3051 # If the linker only supports -Ttext (not -Ttext-segment or --image-base) then we will
3052 # have to strip any build-id ELF NOTEs from the statically linked tools.
3053 # Otherwise the build-id NOTE might end up at the default load address.
3054 # (Pedantically if the linker is gold then -Ttext is fine, but newer
3055 # gold versions also support -Ttext-segment. So just assume that unless
3056 # we can use -Ttext-segment we need to strip the build-id NOTEs.
3057 if test "x${linker_using_t_text}" = "xyes"; then
3058 AC_MSG_NOTICE([ld -Ttext used, need to strip build-id NOTEs.])
3059 # does the linker support -Wl,--build-id=none ? Note, it's
3060 # important that we test indirectly via whichever C compiler
3061 # is selected, rather than testing /usr/bin/ld or whatever
3063 AC_MSG_CHECKING([if the linker accepts -Wl,--build-id=none])
3065 CFLAGS="-Wl,--build-id=none -Werror"
3068 [AC_LANG_PROGRAM([ ], [return 0;])],
3070 AC_SUBST([FLAG_NO_BUILD_ID], ["-Wl,--build-id=none"])
3071 AC_MSG_RESULT([yes])
3073 AC_SUBST([FLAG_NO_BUILD_ID], [""])
3077 AC_MSG_NOTICE([ld --image-base or -Ttext-segment used, no need to strip build-id NOTEs.])
3078 AC_SUBST([FLAG_NO_BUILD_ID], [""])
3082 # does the ppc assembler support "mtocrf" et al?
3083 AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf])
3085 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3086 __asm__ __volatile__("mtocrf 4,0");
3087 __asm__ __volatile__("mfocrf 0,4");
3089 ac_have_as_ppc_mftocrf=yes
3090 AC_MSG_RESULT([yes])
3092 ac_have_as_ppc_mftocrf=no
3095 if test x$ac_have_as_ppc_mftocrf = xyes ; then
3096 AC_DEFINE(HAVE_AS_PPC_MFTOCRF, 1, [Define to 1 if as supports mtocrf/mfocrf.])
3100 # does the ppc assembler support "lfdp" and other phased out floating point insns?
3101 AC_MSG_CHECKING([if ppc32/64 asm supports phased out floating point instructions])
3103 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3104 do { typedef struct {
3108 dbl_pair_t dbl_pair[3];
3109 __asm__ volatile ("lfdp 10, %0"::"m" (dbl_pair[0]));
3112 ac_have_as_ppc_fpPO=yes
3113 AC_MSG_RESULT([yes])
3115 ac_have_as_ppc_fpPO=no
3118 if test x$ac_have_as_ppc_fpPO = xyes ; then
3119 AC_DEFINE(HAVE_AS_PPC_FPPO, 1, [Define to 1 if as supports floating point phased out category.])
3123 # does the amd64 assembler understand "fxsave64" and "fxrstor64"?
3124 AC_MSG_CHECKING([if amd64 assembler supports fxsave64/fxrstor64])
3126 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3128 asm __volatile__("fxsave64 (%0)" : : "r" (p) : "memory" );
3129 asm __volatile__("fxrstor64 (%0)" : : "r" (p) : "memory" );
3131 ac_have_as_amd64_fxsave64=yes
3132 AC_MSG_RESULT([yes])
3134 ac_have_as_amd64_fxsave64=no
3137 if test x$ac_have_as_amd64_fxsave64 = xyes ; then
3138 AC_DEFINE(HAVE_AS_AMD64_FXSAVE64, 1, [Define to 1 if as supports fxsave64/fxrstor64.])
3141 # does the x86/amd64 assembler understand SSE3 instructions?
3142 # Note, this doesn't generate a C-level symbol. It generates a
3143 # automake-level symbol (BUILD_SSE3_TESTS), used in test Makefile.am's
3144 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE3])
3146 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3147 do { long long int x;
3148 __asm__ __volatile__("fisttpq (%0)" : :"r"(&x) ); }
3152 AC_MSG_RESULT([yes])
3158 AM_CONDITIONAL(BUILD_SSE3_TESTS, test x$ac_have_as_sse3 = xyes)
3161 # Ditto for SSSE3 instructions (note extra S)
3162 # Note, this doesn't generate a C-level symbol. It generates a
3163 # automake-level symbol (BUILD_SSSE3_TESTS), used in test Makefile.am's
3164 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSSE3])
3166 save_CFLAGS="$CFLAGS"
3167 CFLAGS="$CFLAGS -msse -Werror"
3168 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3169 do { long long int x;
3170 __asm__ __volatile__(
3171 "pabsb (%0),%%xmm7" : : "r"(&x) : "xmm7" ); }
3174 ac_have_as_ssse3=yes
3175 AC_MSG_RESULT([yes])
3180 CFLAGS="$save_CFLAGS"
3182 AM_CONDITIONAL(BUILD_SSSE3_TESTS, test x$ac_have_as_ssse3 = xyes)
3185 # does the x86/amd64 assembler understand the PCLMULQDQ instruction?
3186 # Note, this doesn't generate a C-level symbol. It generates a
3187 # automake-level symbol (BUILD_PCLMULQDQ_TESTS), used in test Makefile.am's
3188 AC_MSG_CHECKING([if x86/amd64 assembler supports 'pclmulqdq'])
3189 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3191 __asm__ __volatile__(
3192 "pclmulqdq \$17,%%xmm6,%%xmm7" : : : "xmm6", "xmm7" ); }
3195 ac_have_as_pclmulqdq=yes
3196 AC_MSG_RESULT([yes])
3198 ac_have_as_pclmulqdq=no
3202 AM_CONDITIONAL(BUILD_PCLMULQDQ_TESTS, test x$ac_have_as_pclmulqdq = xyes)
3205 # does the x86/amd64 assembler understand the VPCLMULQDQ instruction?
3206 # Note, this doesn't generate a C-level symbol. It generates a
3207 # automake-level symbol (BUILD_VPCLMULQDQ_TESTS), used in test Makefile.am's
3208 AC_MSG_CHECKING([if x86/amd64 assembler supports 'vpclmulqdq'])
3209 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3212 * Carry-less multiplication of xmm1 with xmm2 and store the result in
3213 * xmm3. The immediate is used to determine which quadwords of xmm1 and
3214 * xmm2 should be used.
3216 __asm__ __volatile__(
3217 "vpclmulqdq \$0,%%xmm1,%%xmm2,%%xmm3" : : : );
3220 ac_have_as_vpclmulqdq=yes
3221 AC_MSG_RESULT([yes])
3223 ac_have_as_vpclmulqdq=no
3227 AM_CONDITIONAL(BUILD_VPCLMULQDQ_TESTS, test x$ac_have_as_vpclmulqdq = xyes)
3230 # does the x86/amd64 assembler understand FMA4 instructions?
3231 # Note, this doesn't generate a C-level symbol. It generates a
3232 # automake-level symbol (BUILD_AFM4_TESTS), used in test Makefile.am's
3233 AC_MSG_CHECKING([if x86/amd64 assembler supports FMA4 'vfmaddpd'])
3234 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3236 __asm__ __volatile__(
3237 "vfmaddpd %%xmm7,%%xmm8,%%xmm6,%%xmm9" : : : );
3240 ac_have_as_vfmaddpd=yes
3241 AC_MSG_RESULT([yes])
3243 ac_have_as_vfmaddpd=no
3247 AM_CONDITIONAL(BUILD_FMA4_TESTS, test x$ac_have_as_vfmaddpd = xyes)
3250 # does the x86/amd64 assembler understand the LZCNT instruction?
3251 # Note, this doesn't generate a C-level symbol. It generates a
3252 # automake-level symbol (BUILD_LZCNT_TESTS), used in test Makefile.am's
3253 AC_MSG_CHECKING([if x86/amd64 assembler supports 'lzcnt'])
3255 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3257 __asm__ __volatile__("lzcnt %%rax,%%rax" : : : "rax");
3260 ac_have_as_lzcnt=yes
3261 AC_MSG_RESULT([yes])
3267 AM_CONDITIONAL([BUILD_LZCNT_TESTS], [test x$ac_have_as_lzcnt = xyes])
3270 # does the x86/amd64 assembler understand the LOOPNEL instruction?
3271 # Note, this doesn't generate a C-level symbol. It generates a
3272 # automake-level symbol (BUILD_LOOPNEL_TESTS), used in test Makefile.am's
3273 AC_MSG_CHECKING([if x86/amd64 assembler supports 'loopnel'])
3275 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3277 __asm__ __volatile__("1: loopnel 1b\n");
3280 ac_have_as_loopnel=yes
3281 AC_MSG_RESULT([yes])
3283 ac_have_as_loopnel=no
3287 AM_CONDITIONAL([BUILD_LOOPNEL_TESTS], [test x$ac_have_as_loopnel = xyes])
3290 # does the x86/amd64 assembler understand ADDR32 ?
3291 # Note, this doesn't generate a C-level symbol. It generates a
3292 # automake-level symbol (BUILD_ADDR32_TESTS), used in test Makefile.am's
3293 AC_MSG_CHECKING([if x86/amd64 assembler supports 'addr32'])
3295 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3297 asm volatile ("addr32 rep movsb");
3300 ac_have_as_addr32=yes
3301 AC_MSG_RESULT([yes])
3303 ac_have_as_addr32=no
3307 AM_CONDITIONAL([BUILD_ADDR32_TESTS], [test x$ac_have_as_addr32 = xyes])
3310 # does the x86/amd64 assembler understand SSE 4.2 instructions?
3311 # Note, this doesn't generate a C-level symbol. It generates a
3312 # automake-level symbol (BUILD_SSE42_TESTS), used in test Makefile.am's
3313 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE4.2])
3315 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3316 do { long long int x;
3317 __asm__ __volatile__(
3318 "crc32q %%r15,%%r15" : : : "r15" );
3319 __asm__ __volatile__(
3320 "pblendvb (%%rcx), %%xmm11" : : : "memory", "xmm11");
3321 __asm__ __volatile__(
3322 "aesdec %%xmm2, %%xmm1" : : : "xmm2", "xmm1"); }
3325 ac_have_as_sse42=yes
3326 AC_MSG_RESULT([yes])
3332 AM_CONDITIONAL(BUILD_SSE42_TESTS, test x$ac_have_as_sse42 = xyes)
3335 # does the x86/amd64 assembler understand AVX instructions?
3336 # Note, this doesn't generate a C-level symbol. It generates a
3337 # automake-level symbol (BUILD_AVX_TESTS), used in test Makefile.am's
3338 AC_MSG_CHECKING([if x86/amd64 assembler speaks AVX])
3340 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3341 do { long long int x;
3342 __asm__ __volatile__(
3343 "vmovupd (%%rsp), %%ymm7" : : : "xmm7" );
3344 __asm__ __volatile__(
3345 "vaddpd %%ymm6,%%ymm7,%%ymm8" : : : "xmm6","xmm7","xmm8"); }
3349 AC_MSG_RESULT([yes])
3355 AM_CONDITIONAL(BUILD_AVX_TESTS, test x$ac_have_as_avx = xyes)
3358 # does the x86/amd64 assembler understand AVX2 instructions?
3359 # Note, this doesn't generate a C-level symbol. It generates a
3360 # automake-level symbol (BUILD_AVX2_TESTS), used in test Makefile.am's
3361 AC_MSG_CHECKING([if x86/amd64 assembler speaks AVX2])
3363 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3364 do { long long int x;
3365 __asm__ __volatile__(
3366 "vpsravd (%%rsp), %%ymm8, %%ymm7" : : : "xmm7", "xmm8" );
3367 __asm__ __volatile__(
3368 "vpaddb %%ymm6,%%ymm7,%%ymm8" : : : "xmm6","xmm7","xmm8"); }
3372 AC_MSG_RESULT([yes])
3378 AM_CONDITIONAL(BUILD_AVX2_TESTS, test x$ac_have_as_avx2 = xyes)
3381 # does the x86/amd64 assembler understand TSX instructions and
3382 # the XACQUIRE/XRELEASE prefixes?
3383 # Note, this doesn't generate a C-level symbol. It generates a
3384 # automake-level symbol (BUILD_TSX_TESTS), used in test Makefile.am's
3385 AC_MSG_CHECKING([if x86/amd64 assembler speaks TSX])
3387 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3389 __asm__ __volatile__(
3392 " xacquire lock incq 0(%rsp) \n\t"
3393 " xrelease lock incq 0(%rsp) \n"
3398 AC_MSG_RESULT([yes])
3404 AM_CONDITIONAL(BUILD_TSX_TESTS, test x$ac_have_as_tsx = xyes)
3407 # does the x86/amd64 assembler understand BMI1 and BMI2 instructions?
3408 # Note, this doesn't generate a C-level symbol. It generates a
3409 # automake-level symbol (BUILD_BMI_TESTS), used in test Makefile.am's
3410 AC_MSG_CHECKING([if x86/amd64 assembler speaks BMI1 and BMI2])
3412 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3413 do { unsigned int h, l;
3414 __asm__ __volatile__( "mulx %rax,%rcx,%r8" );
3415 __asm__ __volatile__(
3416 "andn %2, %1, %0" : "=r" (h) : "r" (0x1234567), "r" (0x7654321) );
3417 __asm__ __volatile__(
3418 "movl %2, %%edx; mulx %3, %1, %0" : "=r" (h), "=r" (l) : "g" (0x1234567), "rm" (0x7654321) : "edx" ); }
3422 AC_MSG_RESULT([yes])
3428 AM_CONDITIONAL(BUILD_BMI_TESTS, test x$ac_have_as_bmi = xyes)
3431 # does the x86/amd64 assembler understand FMA instructions?
3432 # Note, this doesn't generate a C-level symbol. It generates a
3433 # automake-level symbol (BUILD_FMA_TESTS), used in test Makefile.am's
3434 AC_MSG_CHECKING([if x86/amd64 assembler speaks FMA])
3436 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3437 do { unsigned int h, l;
3438 __asm__ __volatile__(
3439 "vfmadd132ps (%%rsp), %%ymm8, %%ymm7" : : : "xmm7", "xmm8" );
3440 __asm__ __volatile__(
3441 "vfnmsub231sd (%%rsp), %%xmm8, %%xmm7" : : : "xmm7", "xmm8" );
3442 __asm__ __volatile__(
3443 "vfmsubadd213pd (%%rsp), %%xmm8, %%xmm7" : : : "xmm7", "xmm8" ); }
3447 AC_MSG_RESULT([yes])
3453 AM_CONDITIONAL(BUILD_FMA_TESTS, test x$ac_have_as_fma = xyes)
3456 # does the amd64 assembler understand MPX instructions?
3457 # Note, this doesn't generate a C-level symbol. It generates a
3458 # automake-level symbol (BUILD_MPX_TESTS), used in test Makefile.am's
3459 AC_MSG_CHECKING([if amd64 assembler knows the MPX instructions])
3461 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3463 asm ("bndmov %bnd0,(%rsp)");
3464 asm ("bndldx 3(%rbx,%rdx), %bnd2");
3465 asm ("bnd call foo\n"
3472 AC_MSG_RESULT([yes])
3478 AM_CONDITIONAL(BUILD_MPX_TESTS, test x$ac_have_as_mpx = xyes)
3481 # does the amd64 assembler understand ADX instructions?
3482 # Note, this doesn't generate a C-level symbol. It generates a
3483 # automake-level symbol (BUILD_ADX_TESTS), used in test Makefile.am's
3484 AC_MSG_CHECKING([if amd64 assembler knows the ADX instructions])
3486 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3488 asm ("adcxq %r14,%r8");
3492 AC_MSG_RESULT([yes])
3498 AM_CONDITIONAL(BUILD_ADX_TESTS, test x$ac_have_as_adx = xyes)
3501 # does the amd64 assembler understand the RDRAND instruction?
3502 # Note, this doesn't generate a C-level symbol. It generates a
3503 # automake-level symbol (BUILD_RDRAND_TESTS), used in test Makefile.am's
3504 AC_MSG_CHECKING([if amd64 assembler knows the RDRAND instruction])
3506 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3508 asm ("rdrand %r14");
3509 asm ("rdrand %r14d");
3510 asm ("rdrand %r14w");
3513 ac_have_as_rdrand=yes
3514 AC_MSG_RESULT([yes])
3516 ac_have_as_rdrand=no
3520 AM_CONDITIONAL(BUILD_RDRAND_TESTS, test x$ac_have_as_rdrand = xyes)
3522 # does the amd64 assembler understand the RDSEED instruction?
3523 # Note, this doesn't generate a C-level symbol. It generates a
3524 # automake-level symbol (BUILD_RDSEED_TESTS), used in test Makefile.am's
3525 AC_MSG_CHECKING([if amd64 assembler knows the RDSEED instruction])
3527 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3529 asm ("rdseed %r14");
3530 asm ("rdseed %r14d");
3531 asm ("rdseed %r14w");
3534 ac_have_as_rdseed=yes
3535 AC_MSG_RESULT([yes])
3537 ac_have_as_rdseed=no
3541 AM_CONDITIONAL(BUILD_RDSEED_TESTS, test x$ac_have_as_rdseed = xyes)
3543 # does the amd64 assembler understand the F16C instructions (VCVTPH2PS and
3545 # Note, this doesn't generate a C-level symbol. It generates a
3546 # automake-level symbol (BUILD_F16C_TESTS), used in test Makefile.am's
3547 AC_MSG_CHECKING([if amd64 assembler knows the F16C instructions])
3549 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3551 asm ("vcvtph2ps %xmm5, %ymm10");
3552 // If we put the dollar sign and zero together, the shell processing
3553 // this configure.ac script substitutes the command name in. Sigh.
3554 asm ("vcvtps2ph $" "0, %ymm10, %xmm5");
3558 AC_MSG_RESULT([yes])
3564 AM_CONDITIONAL(BUILD_F16C_TESTS, test x$ac_have_as_f16c = xyes)
3567 # does the x86/amd64 assembler understand MOVBE?
3568 # Note, this doesn't generate a C-level symbol. It generates a
3569 # automake-level symbol (BUILD_MOVBE_TESTS), used in test Makefile.am's
3570 AC_MSG_CHECKING([if x86/amd64 assembler knows the MOVBE insn])
3572 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3573 do { long long int x;
3574 __asm__ __volatile__(
3575 "movbe (%%rsp), %%r15" : : : "memory", "r15" ); }
3578 ac_have_as_movbe=yes
3579 AC_MSG_RESULT([yes])
3585 AM_CONDITIONAL(BUILD_MOVBE_TESTS, test x$ac_have_as_movbe = xyes)
3588 # Does the C compiler support the "ifunc" attribute
3589 # Note, this doesn't generate a C-level symbol. It generates a
3590 # automake-level symbol (BUILD_IFUNC_TESTS), used in test Makefile.am's
3591 AC_MSG_CHECKING([if gcc supports the ifunc attribute])
3593 AC_LINK_IFELSE([AC_LANG_SOURCE([[
3594 static void mytest(void) {}
3596 static void (*resolve_test(void))(void)
3598 return (void (*)(void))&mytest;
3601 void test(void) __attribute__((ifunc("resolve_test")));
3609 ac_have_ifunc_attr=yes
3610 AC_MSG_RESULT([yes])
3612 ac_have_ifunc_attr=no
3616 AM_CONDITIONAL(BUILD_IFUNC_TESTS, test x$ac_have_ifunc_attr = xyes)
3618 # Does the C compiler support the armv8 crc feature flag
3619 # Note, this doesn't generate a C-level symbol. It generates a
3620 # automake-level symbol (BUILD_ARMV8_CRC_TESTS), used in test Makefile.am's
3621 AC_MSG_CHECKING([if gcc supports the armv8 crc feature flag])
3623 save_CFLAGS="$CFLAGS"
3624 CFLAGS="$CFLAGS -march=armv8-a+crc -Werror"
3625 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3631 ac_have_armv8_crc_feature=yes
3632 AC_MSG_RESULT([yes])
3634 ac_have_armv8_crc_feature=no
3637 CFLAGS="$save_CFLAGS"
3639 AM_CONDITIONAL(BUILD_ARMV8_CRC_TESTS, test x$ac_have_armv8_crc_feature = xyes)
3642 # Does the C compiler support the armv81 flag and the assembler v8.1 instructions
3643 # Note, this doesn't generate a C-level symbol. It generates a
3644 # automake-level symbol (BUILD_ARMV81_TESTS), used in test Makefile.am's
3645 AC_MSG_CHECKING([if gcc supports the armv81 feature flag and assembler supports v8.1 instructions])
3647 save_CFLAGS="$CFLAGS"
3648 CFLAGS="$CFLAGS -march=armv8.1-a -Werror"
3649 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3652 __asm__ __volatile__("ldadd x0, x1, [x2]" ::: "memory");
3656 ac_have_armv81_feature=yes
3657 AC_MSG_RESULT([yes])
3659 ac_have_armv81_feature=no
3662 CFLAGS="$save_CFLAGS"
3664 AM_CONDITIONAL(BUILD_ARMV81_TESTS, test x$ac_have_armv81_feature = xyes)
3667 # Does the C compiler support the armv82 flag and the assembler v8.2 instructions
3668 # Note, this doesn't generate a C-level symbol. It generates a
3669 # automake-level symbol (BUILD_ARMV82_TESTS), used in test Makefile.am's
3670 AC_MSG_CHECKING([if gcc supports the armv82 feature flag and assembler supports v8.2 instructions])
3672 save_CFLAGS="$CFLAGS"
3673 CFLAGS="$CFLAGS -march=armv8.2-a+fp16 -Werror"
3674 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3677 __asm__ __volatile__("faddp h0, v1.2h");
3681 ac_have_armv82_feature=yes
3682 AC_MSG_RESULT([yes])
3684 ac_have_armv82_feature=no
3687 CFLAGS="$save_CFLAGS"
3689 AM_CONDITIONAL(BUILD_ARMV82_TESTS, test x$ac_have_armv82_feature = xyes)
3692 # XXX JRS 2010 Oct 13: what is this for? For sure, we don't need this
3693 # when building the tool executables. I think we should get rid of it.
3695 # Check for TLS support in the compiler and linker
3696 AC_LINK_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
3698 [vg_cv_linktime_tls=yes],
3699 [vg_cv_linktime_tls=no])
3700 # Native compilation: check whether running a program using TLS succeeds.
3701 # Linking only is not sufficient -- e.g. on Red Hat 7.3 linking TLS programs
3702 # succeeds but running programs using TLS fails.
3703 # Cross-compiling: check whether linking a program using TLS succeeds.
3704 AC_CACHE_CHECK([for TLS support], vg_cv_tls,
3705 [AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS],
3706 [vg_cv_tls=$enableval],
3707 [AC_RUN_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
3711 [vg_cv_tls=$vg_cv_linktime_tls])])])
3713 if test "$vg_cv_tls" = yes -a $is_clang != applellvm; then
3714 AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variables])
3718 #----------------------------------------------------------------------------
3719 # Solaris-specific checks.
3720 #----------------------------------------------------------------------------
3722 if test "$VGCONF_OS" = "solaris" ; then
3723 AC_CHECK_HEADERS([sys/lgrp_user_impl.h])
3725 # Solaris-specific check determining if the Sun Studio Assembler is used to
3726 # build Valgrind. The test checks if the x86/amd64 assembler understands the
3727 # cmovl.l instruction, if yes then it's Sun Assembler.
3729 # C-level symbol: none
3730 # Automake-level symbol: SOLARIS_SUN_STUDIO_AS
3732 AC_MSG_CHECKING([if x86/amd64 assembler speaks cmovl.l (Solaris-specific)])
3733 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3735 __asm__ __volatile__("cmovl.l %edx, %eax");
3737 solaris_have_sun_studio_as=yes
3738 AC_MSG_RESULT([yes])
3740 solaris_have_sun_studio_as=no
3743 AM_CONDITIONAL(SOLARIS_SUN_STUDIO_AS, test x$solaris_have_sun_studio_as = xyes)
3745 # Solaris-specific check determining if symbols __xpg4 and __xpg6
3746 # are present in linked shared libraries when gcc is invoked with -std=gnu99.
3747 # See solaris/vgpreload-solaris.mapfile for details.
3748 # gcc on older Solaris instructs linker to include these symbols,
3749 # gcc on illumos and newer Solaris does not.
3751 # C-level symbol: none
3752 # Automake-level symbol: SOLARIS_XPG_SYMBOLS_PRESENT
3754 save_CFLAGS="$CFLAGS"
3755 CFLAGS="$CFLAGS -std=gnu99"
3756 AC_MSG_CHECKING([if xpg symbols are present with -std=gnu99 (Solaris-specific)])
3757 temp_dir=$( /usr/bin/mktemp -d )
3758 cat <<_ACEOF >${temp_dir}/mylib.c
3760 int myfunc(void) { printf("LaPutyka\n"); }
3762 ${CC} ${CFLAGS} -fpic -shared -o ${temp_dir}/mylib.so ${temp_dir}/mylib.c
3763 xpg_present=$( /usr/bin/nm ${temp_dir}/mylib.so | ${EGREP} '(__xpg4|__xpg6)' )
3764 if test "x${xpg_present}" = "x" ; then
3765 solaris_xpg_symbols_present=no
3768 solaris_xpg_symbols_present=yes
3769 AC_MSG_RESULT([yes])
3772 AM_CONDITIONAL(SOLARIS_XPG_SYMBOLS_PRESENT, test x$solaris_xpg_symbols_present = xyes)
3773 CFLAGS="$save_CFLAGS"
3776 # Solaris-specific check determining if gcc enables largefile support by
3777 # default for 32-bit executables. If it does, then set SOLARIS_UNDEF_LARGESOURCE
3778 # variable with gcc flags which disable it.
3780 AC_MSG_CHECKING([if gcc enables largefile support for 32-bit apps (Solaris-specific)])
3781 save_CFLAGS="$CFLAGS"
3782 CFLAGS="$CFLAGS -m32"
3783 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3784 return _LARGEFILE_SOURCE;
3786 SOLARIS_UNDEF_LARGESOURCE="-U_LARGEFILE_SOURCE -U_LARGEFILE64_SOURCE -U_FILE_OFFSET_BITS"
3787 AC_MSG_RESULT([yes])
3789 SOLARIS_UNDEF_LARGESOURCE=""
3793 AC_SUBST(SOLARIS_UNDEF_LARGESOURCE)
3796 # Solaris-specific check determining if /proc/self/cmdline
3797 # or /proc/<pid>/cmdline is supported.
3799 # C-level symbol: SOLARIS_PROC_CMDLINE
3800 # Automake-level symbol: SOLARIS_PROC_CMDLINE
3802 AC_CHECK_FILE([/proc/self/cmdline],
3804 solaris_proc_cmdline=yes
3805 AC_DEFINE([SOLARIS_PROC_CMDLINE], 1,
3806 [Define to 1 if you have /proc/self/cmdline.])
3808 solaris_proc_cmdline=no
3810 AM_CONDITIONAL(SOLARIS_PROC_CMDLINE, test x$solaris_proc_cmdline = xyes)
3813 # Solaris-specific check determining default platform for the Valgrind launcher.
3814 # Used in case the launcher cannot select platform by looking at the client
3815 # image (for example because the executable is a shell script).
3817 # C-level symbol: SOLARIS_LAUNCHER_DEFAULT_PLATFORM
3818 # Automake-level symbol: none
3820 AC_MSG_CHECKING([for default platform of Valgrind launcher (Solaris-specific)])
3821 # Get the ELF class of /bin/sh first.
3822 if ! test -f /bin/sh; then
3823 AC_MSG_ERROR([Shell interpreter `/bin/sh' not found.])
3825 elf_class=$( /usr/bin/file /bin/sh | sed -n 's/.*ELF \(..\)-bit.*/\1/p' )
3826 case "$elf_class" in
3828 default_arch="$VGCONF_ARCH_PRI";
3831 if test "x$VGCONF_ARCH_SEC" != "x"; then
3832 default_arch="$VGCONF_ARCH_SEC"
3834 default_arch="$VGCONF_ARCH_PRI";
3838 AC_MSG_ERROR([Cannot determine ELF class of `/bin/sh'.])
3841 default_platform="$default_arch-$VGCONF_OS"
3842 AC_MSG_RESULT([$default_platform])
3843 AC_DEFINE_UNQUOTED([SOLARIS_LAUNCHER_DEFAULT_PLATFORM], ["$default_platform"],
3844 [Default platform for Valgrind launcher.])
3847 # Solaris-specific check determining if the old syscalls are available.
3849 # C-level symbol: SOLARIS_OLD_SYSCALLS
3850 # Automake-level symbol: SOLARIS_OLD_SYSCALLS
3852 AC_MSG_CHECKING([for the old Solaris syscalls (Solaris-specific)])
3853 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3854 #include <sys/syscall.h>
3858 solaris_old_syscalls=yes
3859 AC_MSG_RESULT([yes])
3860 AC_DEFINE([SOLARIS_OLD_SYSCALLS], 1,
3861 [Define to 1 if you have the old Solaris syscalls.])
3863 solaris_old_syscalls=no
3866 AM_CONDITIONAL(SOLARIS_OLD_SYSCALLS, test x$solaris_old_syscalls = xyes)
3869 # Solaris-specific check determining if the new accept() syscall is available.
3872 # int accept(int sock, struct sockaddr *name, socklen_t *namelenp,
3875 # New syscall (available on illumos):
3876 # int accept(int sock, struct sockaddr *name, socklen_t *namelenp,
3877 # int version, int flags);
3879 # If the old syscall is present then the following syscall will fail with
3880 # ENOTSOCK (because file descriptor 0 is not a socket), if the new syscall is
3881 # available then it will fail with EINVAL (because the flags parameter is
3884 # C-level symbol: SOLARIS_NEW_ACCEPT_SYSCALL
3885 # Automake-level symbol: none
3887 AC_MSG_CHECKING([for the new `accept' syscall (Solaris-specific)])
3888 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
3889 #include <sys/syscall.h>
3893 syscall(SYS_accept, 0, 0, 0, 0, -1);
3894 return !(errno == EINVAL);
3896 AC_MSG_RESULT([yes])
3897 AC_DEFINE([SOLARIS_NEW_ACCEPT_SYSCALL], 1,
3898 [Define to 1 if you have the new `accept' syscall.])
3904 # Solaris-specific check determining if the new illumos pipe() syscall is
3908 # longlong_t pipe();
3910 # New syscall (available on illumos):
3911 # int pipe(intptr_t arg, int flags);
3913 # If the old syscall is present then the following call will succeed, if the
3914 # new syscall is available then it will fail with EFAULT (because address 0
3915 # cannot be accessed).
3917 # C-level symbol: SOLARIS_NEW_PIPE_SYSCALL
3918 # Automake-level symbol: none
3920 AC_MSG_CHECKING([for the new `pipe' syscall (Solaris-specific)])
3921 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
3922 #include <sys/syscall.h>
3926 syscall(SYS_pipe, 0, 0);
3927 return !(errno == EFAULT);
3929 AC_MSG_RESULT([yes])
3930 AC_DEFINE([SOLARIS_NEW_PIPE_SYSCALL], 1,
3931 [Define to 1 if you have the new `pipe' syscall.])
3937 # Solaris-specific check determining if the new lwp_sigqueue() syscall is
3941 # int lwp_kill(id_t lwpid, int sig);
3943 # New syscall (available on Solaris 11):
3944 # int lwp_sigqueue(id_t lwpid, int sig, void *value,
3945 # int si_code, timespec_t *timeout);
3947 # C-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL
3948 # Automake-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL
3950 AC_MSG_CHECKING([for the new `lwp_sigqueue' syscall (Solaris-specific)])
3951 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3952 #include <sys/syscall.h>
3954 return !SYS_lwp_sigqueue;
3956 solaris_lwp_sigqueue_syscall=yes
3957 AC_MSG_RESULT([yes])
3958 AC_DEFINE([SOLARIS_LWP_SIGQUEUE_SYSCALL], 1,
3959 [Define to 1 if you have the new `lwp_sigqueue' syscall.])
3961 solaris_lwp_sigqueue_syscall=no
3964 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL, test x$solaris_lwp_sigqueue_syscall = xyes)
3967 # Solaris-specific check determining if the lwp_sigqueue() syscall
3968 # takes both pid and thread id arguments or just thread id.
3970 # Old syscall (available up to Solaris 11.3):
3971 # int lwp_sigqueue(id_t lwpid, int sig, void *value,
3972 # int si_code, timespec_t *timeout);
3974 # New syscall (available since Solaris 11.4):
3975 # int lwp_sigqueue(pid_t pid, id_t lwpid, int sig, void *value,
3976 # int si_code, timespec_t *timeout);
3978 # If the old syscall is present then the following syscall will fail with
3979 # EINVAL (because signal is out of range); if the new syscall is available
3980 # then it will fail with ESRCH (because it would not find such thread in the
3983 # C-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID
3984 # Automake-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID
3986 AM_COND_IF(SOLARIS_LWP_SIGQUEUE_SYSCALL,
3987 AC_MSG_CHECKING([if the `lwp_sigqueue' syscall accepts pid (Solaris-specific)])
3988 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
3989 #include <sys/syscall.h>
3993 syscall(SYS_lwp_sigqueue, 0, 101, 0, 0, 0, 0);
3994 return !(errno == ESRCH);
3996 solaris_lwp_sigqueue_syscall_takes_pid=yes
3997 AC_MSG_RESULT([yes])
3998 AC_DEFINE([SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID], 1,
3999 [Define to 1 if you have the new `lwp_sigqueue' syscall which accepts pid.])
4001 solaris_lwp_sigqueue_syscall_takes_pid=no
4004 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID,
4005 test x$solaris_lwp_sigqueue_syscall_takes_pid = xyes)
4007 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID, test x = y)
4011 # Solaris-specific check determining if the new lwp_name() syscall is
4014 # New syscall (available on Solaris 11):
4015 # int lwp_name(int opcode, id_t lwpid, char *name, size_t len);
4017 # C-level symbol: SOLARIS_LWP_NAME_SYSCALL
4018 # Automake-level symbol: SOLARIS_LWP_NAME_SYSCALL
4020 AC_MSG_CHECKING([for the new `lwp_name' syscall (Solaris-specific)])
4021 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4022 #include <sys/syscall.h>
4024 return !SYS_lwp_name;
4026 solaris_lwp_name_syscall=yes
4027 AC_MSG_RESULT([yes])
4028 AC_DEFINE([SOLARIS_LWP_NAME_SYSCALL], 1,
4029 [Define to 1 if you have the new `lwp_name' syscall.])
4031 solaris_lwp_name_syscall=no
4034 AM_CONDITIONAL(SOLARIS_LWP_NAME_SYSCALL, test x$solaris_lwp_name_syscall = xyes)
4037 # Solaris-specific check determining if the new getrandom() syscall is
4040 # New syscall (available on Solaris 11):
4041 # int getrandom(void *buf, size_t buflen, uint_t flags);
4043 # C-level symbol: SOLARIS_GETRANDOM_SYSCALL
4044 # Automake-level symbol: SOLARIS_GETRANDOM_SYSCALL
4046 AC_MSG_CHECKING([for the new `getrandom' syscall (Solaris-specific)])
4047 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4048 #include <sys/syscall.h>
4050 return !SYS_getrandom;
4052 solaris_getrandom_syscall=yes
4053 AC_MSG_RESULT([yes])
4054 AC_DEFINE([SOLARIS_GETRANDOM_SYSCALL], 1,
4055 [Define to 1 if you have the new `getrandom' syscall.])
4057 solaris_getrandom_syscall=no
4060 AM_CONDITIONAL(SOLARIS_GETRANDOM_SYSCALL, test x$solaris_getrandom_syscall = xyes)
4063 # Solaris-specific check determining if the new zone() syscall subcodes
4064 # ZONE_LIST_DEFUNCT and ZONE_GETATTR_DEFUNCT are available. These subcodes
4065 # were added in Solaris 11 but are missing on illumos.
4067 # C-level symbol: SOLARIS_ZONE_DEFUNCT
4068 # Automake-level symbol: SOLARIS_ZONE_DEFUNCT
4070 AC_MSG_CHECKING([for ZONE_LIST_DEFUNCT and ZONE_GETATTR_DEFUNCT (Solaris-specific)])
4071 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4072 #include <sys/zone.h>
4074 return !(ZONE_LIST_DEFUNCT && ZONE_GETATTR_DEFUNCT);
4076 solaris_zone_defunct=yes
4077 AC_MSG_RESULT([yes])
4078 AC_DEFINE([SOLARIS_ZONE_DEFUNCT], 1,
4079 [Define to 1 if you have the `ZONE_LIST_DEFUNCT' and `ZONE_GETATTR_DEFUNC' constants.])
4081 solaris_zone_defunct=no
4084 AM_CONDITIONAL(SOLARIS_ZONE_DEFUNCT, test x$solaris_zone_defunct = xyes)
4087 # Solaris-specific check determining if commands A_GETSTAT and A_SETSTAT
4088 # for auditon(2) subcode of the auditsys() syscall are available.
4089 # These commands are available in Solaris 11 and illumos but were removed
4092 # C-level symbol: SOLARIS_AUDITON_STAT
4093 # Automake-level symbol: SOLARIS_AUDITON_STAT
4095 AC_MSG_CHECKING([for A_GETSTAT and A_SETSTAT auditon(2) commands (Solaris-specific)])
4096 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4097 #include <bsm/audit.h>
4099 return !(A_GETSTAT && A_SETSTAT);
4101 solaris_auditon_stat=yes
4102 AC_MSG_RESULT([yes])
4103 AC_DEFINE([SOLARIS_AUDITON_STAT], 1,
4104 [Define to 1 if you have the `A_GETSTAT' and `A_SETSTAT' constants.])
4106 solaris_auditon_stat=no
4109 AM_CONDITIONAL(SOLARIS_AUDITON_STAT, test x$solaris_auditon_stat = xyes)
4112 # Solaris-specific check determining if the new shmsys() syscall subcodes
4113 # IPC_XSTAT64, SHMADV, SHM_ADV_GET, SHM_ADV_SET and SHMGET_OSM are available.
4114 # These subcodes were added in Solaris 11 but are missing on illumos.
4116 # C-level symbol: SOLARIS_SHM_NEW
4117 # Automake-level symbol: SOLARIS_SHM_NEW
4119 AC_MSG_CHECKING([for SHMADV, SHM_ADV_GET, SHM_ADV_SET and SHMGET_OSM (Solaris-specific)])
4120 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4121 #include <sys/ipc_impl.h>
4122 #include <sys/shm.h>
4123 #include <sys/shm_impl.h>
4125 return !(IPC_XSTAT64 && SHMADV && SHM_ADV_GET && SHM_ADV_SET && SHMGET_OSM);
4128 AC_MSG_RESULT([yes])
4129 AC_DEFINE([SOLARIS_SHM_NEW], 1,
4130 [Define to 1 if you have the `IPC_XSTAT64', `SHMADV', `SHM_ADV_GET', `SHM_ADV_SET' and `SHMGET_OSM' constants.])
4135 AM_CONDITIONAL(SOLARIS_SHM_NEW, test x$solaris_shm_new = xyes)
4138 # Solaris-specific check determining if prxregset_t is available. Illumos
4139 # currently does not define it on the x86 platform.
4141 # C-level symbol: SOLARIS_PRXREGSET_T
4142 # Automake-level symbol: SOLARIS_PRXREGSET_T
4144 AC_MSG_CHECKING([for the `prxregset_t' type (Solaris-specific)])
4145 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4146 #include <sys/procfs_isa.h>
4148 return !sizeof(prxregset_t);
4150 solaris_prxregset_t=yes
4151 AC_MSG_RESULT([yes])
4152 AC_DEFINE([SOLARIS_PRXREGSET_T], 1,
4153 [Define to 1 if you have the `prxregset_t' type.])
4155 solaris_prxregset_t=no
4158 AM_CONDITIONAL(SOLARIS_PRXREGSET_T, test x$solaris_prxregset_t = xyes)
4161 # Solaris-specific check determining if the new frealpathat() syscall is
4164 # New syscall (available on Solaris 11.1):
4165 # int frealpathat(int fd, char *path, char *buf, size_t buflen);
4167 # C-level symbol: SOLARIS_FREALPATHAT_SYSCALL
4168 # Automake-level symbol: SOLARIS_FREALPATHAT_SYSCALL
4170 AC_MSG_CHECKING([for the new `frealpathat' syscall (Solaris-specific)])
4171 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4172 #include <sys/syscall.h>
4174 return !SYS_frealpathat;
4176 solaris_frealpathat_syscall=yes
4177 AC_MSG_RESULT([yes])
4178 AC_DEFINE([SOLARIS_FREALPATHAT_SYSCALL], 1,
4179 [Define to 1 if you have the new `frealpathat' syscall.])
4181 solaris_frealpathat_syscall=no
4184 AM_CONDITIONAL(SOLARIS_FREALPATHAT_SYSCALL, test x$solaris_frealpathat_syscall = xyes)
4187 # Solaris-specific check determining if the new uuidsys() syscall is
4190 # New syscall (available on newer Solaris):
4191 # int uuidsys(struct uuid *uuid);
4193 # C-level symbol: SOLARIS_UUIDSYS_SYSCALL
4194 # Automake-level symbol: SOLARIS_UUIDSYS_SYSCALL
4196 AC_MSG_CHECKING([for the new `uuidsys' syscall (Solaris-specific)])
4197 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4198 #include <sys/syscall.h>
4200 return !SYS_uuidsys;
4202 solaris_uuidsys_syscall=yes
4203 AC_MSG_RESULT([yes])
4204 AC_DEFINE([SOLARIS_UUIDSYS_SYSCALL], 1,
4205 [Define to 1 if you have the new `uuidsys' syscall.])
4207 solaris_uuidsys_syscall=no
4210 AM_CONDITIONAL(SOLARIS_UUIDSYS_SYSCALL, test x$solaris_uuidsys_syscall = xyes)
4213 # Solaris-specific check determining if the new labelsys() syscall subcode
4214 # TNDB_GET_TNIP is available. This subcode was added in Solaris 11 but is
4215 # missing on illumos.
4217 # C-level symbol: SOLARIS_TNDB_GET_TNIP
4218 # Automake-level symbol: SOLARIS_TNDB_GET_TNIP
4220 AC_MSG_CHECKING([for TNDB_GET_TNIP (Solaris-specific)])
4221 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4222 #include <sys/tsol/tndb.h>
4224 return !TNDB_GET_TNIP;
4226 solaris_tndb_get_tnip=yes
4227 AC_MSG_RESULT([yes])
4228 AC_DEFINE([SOLARIS_TNDB_GET_TNIP], 1,
4229 [Define to 1 if you have the `TNDB_GET_TNIP' constant.])
4231 solaris_tndb_get_tnip=no
4234 AM_CONDITIONAL(SOLARIS_TNDB_GET_TNIP, test x$solaris_tndb_get_tnip = xyes)
4237 # Solaris-specific check determining if the new labelsys() syscall opcodes
4238 # TSOL_GETCLEARANCE and TSOL_SETCLEARANCE are available. These opcodes were
4239 # added in Solaris 11 but are missing on illumos.
4241 # C-level symbol: SOLARIS_TSOL_CLEARANCE
4242 # Automake-level symbol: SOLARIS_TSOL_CLEARANCE
4244 AC_MSG_CHECKING([for TSOL_GETCLEARANCE and TSOL_SETCLEARANCE (Solaris-specific)])
4245 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4246 #include <sys/tsol/tsyscall.h>
4248 return !(TSOL_GETCLEARANCE && TSOL_SETCLEARANCE);
4250 solaris_tsol_clearance=yes
4251 AC_MSG_RESULT([yes])
4252 AC_DEFINE([SOLARIS_TSOL_CLEARANCE], 1,
4253 [Define to 1 if you have the `TSOL_GETCLEARANCE' and `TSOL_SETCLEARANCE' constants.])
4255 solaris_tsol_clearance=no
4258 AM_CONDITIONAL(SOLARIS_TSOL_CLEARANCE, test x$solaris_tsol_clearance = xyes)
4261 # Solaris-specific check determining if the new pset() syscall subcode
4262 # PSET_GET_NAME is available. This subcode was added in Solaris 11.4 but
4263 # is missing on illumos and Solaris 11.3.
4265 # C-level symbol: SOLARIS_PSET_GET_NAME
4266 # Automake-level symbol: SOLARIS_PSET_GET_NAME
4268 AC_MSG_CHECKING([for PSET_GET_NAME (Solaris-specific)])
4269 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4270 #include <sys/pset.h>
4272 return !(PSET_GET_NAME);
4274 solaris_pset_get_name=yes
4275 AC_MSG_RESULT([yes])
4276 AC_DEFINE([SOLARIS_PSET_GET_NAME], 1,
4277 [Define to 1 if you have the `PSET_GET_NAME' constants.])
4279 solaris_pset_get_name=no
4282 AM_CONDITIONAL(SOLARIS_PSET_GET_NAME, test x$solaris_pset_get_name = xyes)
4285 # Solaris-specific check determining if the utimesys() syscall is
4286 # available (on illumos and older Solaris).
4288 # C-level symbol: SOLARIS_UTIMESYS_SYSCALL
4289 # Automake-level symbol: SOLARIS_UTIMESYS_SYSCALL
4291 AC_MSG_CHECKING([for the `utimesys' syscall (Solaris-specific)])
4292 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4293 #include <sys/syscall.h>
4295 return !SYS_utimesys;
4297 solaris_utimesys_syscall=yes
4298 AC_MSG_RESULT([yes])
4299 AC_DEFINE([SOLARIS_UTIMESYS_SYSCALL], 1,
4300 [Define to 1 if you have the `utimesys' syscall.])
4302 solaris_utimesys_syscall=no
4305 AM_CONDITIONAL(SOLARIS_UTIMESYS_SYSCALL, test x$solaris_utimesys_syscall = xyes)
4308 # Solaris-specific check determining if the utimensat() syscall is
4309 # available (on newer Solaris).
4311 # C-level symbol: SOLARIS_UTIMENSAT_SYSCALL
4312 # Automake-level symbol: SOLARIS_UTIMENSAT_SYSCALL
4314 AC_MSG_CHECKING([for the `utimensat' syscall (Solaris-specific)])
4315 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4316 #include <sys/syscall.h>
4318 return !SYS_utimensat;
4320 solaris_utimensat_syscall=yes
4321 AC_MSG_RESULT([yes])
4322 AC_DEFINE([SOLARIS_UTIMENSAT_SYSCALL], 1,
4323 [Define to 1 if you have the `utimensat' syscall.])
4325 solaris_utimensat_syscall=no
4328 AM_CONDITIONAL(SOLARIS_UTIMENSAT_SYSCALL, test x$solaris_utimensat_syscall = xyes)
4331 # Solaris-specific check determining if the spawn() syscall is available
4332 # (on newer Solaris).
4334 # C-level symbol: SOLARIS_SPAWN_SYSCALL
4335 # Automake-level symbol: SOLARIS_SPAWN_SYSCALL
4337 AC_MSG_CHECKING([for the `spawn' syscall (Solaris-specific)])
4338 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4339 #include <sys/syscall.h>
4343 solaris_spawn_syscall=yes
4344 AC_MSG_RESULT([yes])
4345 AC_DEFINE([SOLARIS_SPAWN_SYSCALL], 1,
4346 [Define to 1 if you have the `spawn' syscall.])
4348 solaris_spawn_syscall=no
4351 AM_CONDITIONAL(SOLARIS_SPAWN_SYSCALL, test x$solaris_spawn_syscall = xyes)
4354 # Solaris-specific check determining if commands MODNVL_CTRLMAP through
4355 # MODDEVINFO_CACHE_TS for modctl() syscall are available (on newer Solaris).
4357 # C-level symbol: SOLARIS_MODCTL_MODNVL
4358 # Automake-level symbol: SOLARIS_MODCTL_MODNVL
4360 AC_MSG_CHECKING([for MODNVL_CTRLMAP through MODDEVINFO_CACHE_TS modctl(2) commands (Solaris-specific)])
4361 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4362 #include <sys/modctl.h>
4364 return !(MODNVL_CTRLMAP && MODDEVINFO_CACHE_TS);
4366 solaris_modctl_modnvl=yes
4367 AC_MSG_RESULT([yes])
4368 AC_DEFINE([SOLARIS_MODCTL_MODNVL], 1,
4369 [Define to 1 if you have the `MODNVL_CTRLMAP' through `MODDEVINFO_CACHE_TS' constants.])
4371 solaris_modctl_modnvl=no
4374 AM_CONDITIONAL(SOLARIS_MODCTL_MODNVL, test x$solaris_modctl_modnvl = xyes)
4377 # Solaris-specific check determining whether nscd (name switch cache daemon)
4378 # attaches its door at /system/volatile/name_service_door (Solaris)
4379 # or at /var/run/name_service_door (illumos).
4381 # Note that /var/run is a symlink to /system/volatile on Solaris
4382 # but not vice versa on illumos.
4384 # C-level symbol: SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE
4385 # Automake-level symbol: SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE
4387 AC_MSG_CHECKING([for nscd door location (Solaris-specific)])
4388 if test -e /system/volatile/name_service_door; then
4389 solaris_nscd_door_system_volatile=yes
4390 AC_MSG_RESULT([/system/volatile/name_service_door])
4391 AC_DEFINE([SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE], 1,
4392 [Define to 1 if nscd attaches to /system/volatile/name_service_door.])
4394 solaris_nscd_door_system_volatile=no
4395 AC_MSG_RESULT([/var/run/name_service_door])
4397 AM_CONDITIONAL(SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE, test x$solaris_nscd_door_system_volatile = xyes)
4400 # Solaris-specific check determining if the new gethrt() fasttrap is available.
4402 # New fasttrap (available on Solaris 11):
4403 # hrt_t *gethrt(void);
4405 # C-level symbol: SOLARIS_GETHRT_FASTTRAP
4406 # Automake-level symbol: SOLARIS_GETHRT_FASTTRAP
4408 AC_MSG_CHECKING([for the new `gethrt' fasttrap (Solaris-specific)])
4409 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4410 #include <sys/trap.h>
4414 solaris_gethrt_fasttrap=yes
4415 AC_MSG_RESULT([yes])
4416 AC_DEFINE([SOLARIS_GETHRT_FASTTRAP], 1,
4417 [Define to 1 if you have the new `gethrt' fasttrap.])
4419 solaris_gethrt_fasttrap=no
4422 AM_CONDITIONAL(SOLARIS_GETHRT_FASTTRAP, test x$solaris_gethrt_fasttrap = xyes)
4425 # Solaris-specific check determining if the new get_zone_offset() fasttrap
4428 # New fasttrap (available on Solaris 11):
4429 # zonehrtoffset_t *get_zone_offset(void);
4431 # C-level symbol: SOLARIS_GETZONEOFFSET_FASTTRAP
4432 # Automake-level symbol: SOLARIS_GETZONEOFFSET_FASTTRAP
4434 AC_MSG_CHECKING([for the new `get_zone_offset' fasttrap (Solaris-specific)])
4435 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4436 #include <sys/trap.h>
4438 return !T_GETZONEOFFSET;
4440 solaris_getzoneoffset_fasttrap=yes
4441 AC_MSG_RESULT([yes])
4442 AC_DEFINE([SOLARIS_GETZONEOFFSET_FASTTRAP], 1,
4443 [Define to 1 if you have the new `get_zone_offset' fasttrap.])
4445 solaris_getzoneoffset_fasttrap=no
4448 AM_CONDITIONAL(SOLARIS_GETZONEOFFSET_FASTTRAP, test x$solaris_getzoneoffset_fasttrap = xyes)
4451 # Solaris-specific check determining if the execve() syscall
4452 # takes fourth argument (flags) or not.
4454 # Old syscall (available on illumos):
4455 # int execve(const char *fname, const char **argv, const char **envp);
4457 # New syscall (available on Solaris):
4458 # int execve(uintptr_t file, const char **argv, const char **envp, int flags);
4460 # If the new syscall is present then it will fail with EINVAL (because flags
4461 # are invalid); if the old syscall is available then it will fail with ENOENT
4462 # (because the file could not be found).
4464 # C-level symbol: SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS
4465 # Automake-level symbol: SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS
4467 AC_MSG_CHECKING([if the `execve' syscall accepts flags (Solaris-specific)])
4468 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
4469 #include <sys/syscall.h>
4473 syscall(SYS_execve, "/no/existing/path", 0, 0, 0xdeadbeef, 0, 0);
4474 return !(errno == EINVAL);
4476 solaris_execve_syscall_takes_flags=yes
4477 AC_MSG_RESULT([yes])
4478 AC_DEFINE([SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS], 1,
4479 [Define to 1 if you have the new `execve' syscall which accepts flags.])
4481 solaris_execve_syscall_takes_flags=no
4484 AM_CONDITIONAL(SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS,
4485 test x$solaris_execve_syscall_takes_flags = xyes)
4488 # Solaris-specific check determining version of the repository cache protocol.
4489 # Every Solaris version uses a different one, ranging from 21 to current 25.
4490 # The check is very ugly, though.
4492 # C-level symbol: SOLARIS_REPCACHE_PROTOCOL_VERSION vv
4493 # Automake-level symbol: none
4495 AC_PATH_PROG(DIS_PATH, dis, false)
4496 if test "x$DIS_PATH" = "xfalse"; then
4497 AC_MSG_FAILURE([Object code disassembler (`dis') not found.])
4499 AC_CHECK_LIB(scf, scf_handle_bind, [], [
4500 AC_MSG_WARN([Function `scf_handle_bind' was not found in `libscf'.])
4501 AC_MSG_ERROR([Cannot determine version of the repository cache protocol.])
4504 AC_MSG_CHECKING([for version of the repository cache protocol (Solaris-specific)])
4505 if test "X$VGCONF_ARCH_PRI" = "Xamd64"; then
4506 libscf=/usr/lib/64/libscf.so.1
4508 libscf=/usr/lib/libscf.so.1
4510 if ! $DIS_PATH -F scf_handle_bind $libscf | grep -q -E '0x(4d01)?526570'; then
4511 AC_MSG_WARN([Function `scf_handle_bind' does not contain repository cache protocol version.])
4512 AC_MSG_ERROR([Cannot determine version of the repository cache protocol.])
4514 hex=$( $DIS_PATH -F scf_handle_bind $libscf | perl -pe '($_) = /0x(?:4d01)?526570(\d{2}),/' )
4515 if test -z "$hex"; then
4516 AC_MSG_WARN([Version of the repository cache protocol is empty?!])
4517 AC_MSG_ERROR([Cannot determine version of the repository cache protocol.])
4519 version=$( printf "%d\n" 0x$hex )
4520 AC_MSG_RESULT([$version])
4521 AC_DEFINE_UNQUOTED([SOLARIS_REPCACHE_PROTOCOL_VERSION], [$version],
4522 [Version number of the repository door cache protocol.])
4525 # Solaris-specific check determining if "sysstat" segment reservation type
4528 # New "sysstat" segment reservation (available on Solaris 11.4):
4529 # - program header type: PT_SUNW_SYSSTAT
4530 # - auxiliary vector entry: AT_SUN_SYSSTAT_ADDR
4532 # C-level symbol: SOLARIS_RESERVE_SYSSTAT_ADDR
4533 # Automake-level symbol: SOLARIS_RESERVE_SYSSTAT_ADDR
4535 AC_MSG_CHECKING([for the new `sysstat' segment reservation (Solaris-specific)])
4536 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4537 #include <sys/auxv.h>
4539 return !AT_SUN_SYSSTAT_ADDR;
4541 solaris_reserve_sysstat_addr=yes
4542 AC_MSG_RESULT([yes])
4543 AC_DEFINE([SOLARIS_RESERVE_SYSSTAT_ADDR], 1,
4544 [Define to 1 if you have the new `sysstat' segment reservation.])
4546 solaris_reserve_sysstat_addr=no
4549 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ADDR, test x$solaris_reserve_sysstat_addr = xyes)
4552 # Solaris-specific check determining if "sysstat_zone" segment reservation type
4555 # New "sysstat_zone" segment reservation (available on Solaris 11.4):
4556 # - program header type: PT_SUNW_SYSSTAT_ZONE
4557 # - auxiliary vector entry: AT_SUN_SYSSTAT_ZONE_ADDR
4559 # C-level symbol: SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR
4560 # Automake-level symbol: SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR
4562 AC_MSG_CHECKING([for the new `sysstat_zone' segment reservation (Solaris-specific)])
4563 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4564 #include <sys/auxv.h>
4566 return !AT_SUN_SYSSTAT_ZONE_ADDR;
4568 solaris_reserve_sysstat_zone_addr=yes
4569 AC_MSG_RESULT([yes])
4570 AC_DEFINE([SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR], 1,
4571 [Define to 1 if you have the new `sysstat_zone' segment reservation.])
4573 solaris_reserve_sysstat_zone_addr=no
4576 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR, test x$solaris_reserve_sysstat_zone_addr = xyes)
4579 # Solaris-specific check determining if the system_stats() syscall is available
4580 # (on newer Solaris).
4582 # C-level symbol: SOLARIS_SYSTEM_STATS_SYSCALL
4583 # Automake-level symbol: SOLARIS_SYSTEM_STATS_SYSCALL
4585 AC_MSG_CHECKING([for the `system_stats' syscall (Solaris-specific)])
4586 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4587 #include <sys/syscall.h>
4589 return !SYS_system_stats;
4591 solaris_system_stats_syscall=yes
4592 AC_MSG_RESULT([yes])
4593 AC_DEFINE([SOLARIS_SYSTEM_STATS_SYSCALL], 1,
4594 [Define to 1 if you have the `system_stats' syscall.])
4596 solaris_system_stats_syscall=no
4599 AM_CONDITIONAL(SOLARIS_SYSTEM_STATS_SYSCALL, test x$solaris_system_stats_syscall = xyes)
4602 # Solaris-specific check determining if fpregset_t defines struct _fpchip_state
4603 # (on newer illumos) or struct fpchip_state (Solaris, older illumos).
4605 # C-level symbol: SOLARIS_FPCHIP_STATE_TAKES_UNDERSCORE
4606 # Automake-level symbol: none
4608 AC_CHECK_TYPE([struct _fpchip_state],
4609 [solaris_fpchip_state_takes_underscore=yes],
4610 [solaris_fpchip_state_takes_underscore=no],
4611 [[#include <sys/regset.h>]])
4612 if test "$solaris_fpchip_state_takes_underscore" = "yes"; then
4613 AC_DEFINE(SOLARIS_FPCHIP_STATE_TAKES_UNDERSCORE, 1,
4614 [Define to 1 if fpregset_t defines struct _fpchip_state])
4618 # Solaris-specific check determining if schedctl page shared between kernel
4619 # and userspace program is executable (illumos, older Solaris) or not (newer
4622 # C-level symbol: SOLARIS_SCHEDCTL_PAGE_EXEC
4623 # Automake-level symbol: none
4625 AC_MSG_CHECKING([if schedctl page is executable (Solaris-specific)])
4626 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
4630 #include <schedctl.h>
4634 schedctl_t *scp = schedctl_init();
4638 int fd = open("/proc/self/map", O_RDONLY);
4643 while ((rd = read(fd, &map, sizeof(map))) == sizeof(map)) {
4644 if (map.pr_vaddr == ((uintptr_t) scp & PAGEMASK)) {
4645 fprintf(stderr, "%#lx [%zu] %s\n", map.pr_vaddr, map.pr_size,
4646 (map.pr_mflags & MA_EXEC) ? "x" : "no-x");
4647 return (map.pr_mflags & MA_EXEC);
4653 solaris_schedctl_page_exec=no
4656 solaris_schedctl_page_exec=yes
4657 AC_MSG_RESULT([yes])
4658 AC_DEFINE([SOLARIS_SCHEDCTL_PAGE_EXEC], 1,
4659 [Define to 1 if you have the schedctl page executable.])
4663 # Solaris-specific check determining if PT_SUNWDTRACE program header provides
4664 # scratch space for DTrace fasttrap provider (illumos, older Solaris) or just
4665 # an initial thread pointer for libc (newer Solaris).
4667 # C-level symbol: SOLARIS_PT_SUNDWTRACE_THRP
4668 # Automake-level symbol: none
4670 AC_MSG_CHECKING([if PT_SUNWDTRACE serves for initial thread pointer (Solaris-specific)])
4671 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
4672 #include <sys/fasttrap_isa.h>
4674 return !FT_SCRATCHSIZE;
4676 solaris_pt_sunwdtrace_thrp=yes
4677 AC_MSG_RESULT([yes])
4678 AC_DEFINE([SOLARIS_PT_SUNDWTRACE_THRP], 1,
4679 [Define to 1 if PT_SUNWDTRACE program header provides just an initial thread pointer for libc.])
4681 solaris_pt_sunwdtrace_thrp=no
4686 AM_CONDITIONAL(SOLARIS_SUN_STUDIO_AS, false)
4687 AM_CONDITIONAL(SOLARIS_XPG_SYMBOLS_PRESENT, false)
4688 AM_CONDITIONAL(SOLARIS_PROC_CMDLINE, false)
4689 AM_CONDITIONAL(SOLARIS_OLD_SYSCALLS, false)
4690 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL, false)
4691 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID, false)
4692 AM_CONDITIONAL(SOLARIS_LWP_NAME_SYSCALL, false)
4693 AM_CONDITIONAL(SOLARIS_GETRANDOM_SYSCALL, false)
4694 AM_CONDITIONAL(SOLARIS_ZONE_DEFUNCT, false)
4695 AM_CONDITIONAL(SOLARIS_AUDITON_STAT, false)
4696 AM_CONDITIONAL(SOLARIS_SHM_NEW, false)
4697 AM_CONDITIONAL(SOLARIS_PRXREGSET_T, false)
4698 AM_CONDITIONAL(SOLARIS_FREALPATHAT_SYSCALL, false)
4699 AM_CONDITIONAL(SOLARIS_UUIDSYS_SYSCALL, false)
4700 AM_CONDITIONAL(SOLARIS_TNDB_GET_TNIP, false)
4701 AM_CONDITIONAL(SOLARIS_TSOL_CLEARANCE, false)
4702 AM_CONDITIONAL(SOLARIS_PSET_GET_NAME, false)
4703 AM_CONDITIONAL(SOLARIS_UTIMESYS_SYSCALL, false)
4704 AM_CONDITIONAL(SOLARIS_UTIMENSAT_SYSCALL, false)
4705 AM_CONDITIONAL(SOLARIS_SPAWN_SYSCALL, false)
4706 AM_CONDITIONAL(SOLARIS_MODCTL_MODNVL, false)
4707 AM_CONDITIONAL(SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE, false)
4708 AM_CONDITIONAL(SOLARIS_GETHRT_FASTTRAP, false)
4709 AM_CONDITIONAL(SOLARIS_GETZONEOFFSET_FASTTRAP, false)
4710 AM_CONDITIONAL(SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS, false)
4711 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ADDR, false)
4712 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR, false)
4713 AM_CONDITIONAL(SOLARIS_SYSTEM_STATS_SYSCALL, false)
4714 fi # test "$VGCONF_OS" = "solaris"
4716 #----------------------------------------------------------------------------
4717 # FreeBSD-specific checks.
4718 #----------------------------------------------------------------------------
4720 # Rather than having a large number of feature test as above with Solaris
4721 # these tests are per-version. This may not be entirely relialable for
4722 # FreeBSD development branches (XX.Y-CURRENT) or pre-release branches
4723 # (XX.Y-STABLE) but it should work for XX-Y-RELEASE
4725 if test "$VGCONF_OS" = "freebsd" ; then
4727 AM_CONDITIONAL(FREEBSD_VERS_13_PLUS, test $freebsd_vers -ge $freebsd_13_0)
4731 AM_CONDITIONAL(FREEBSD_VERS_13_PLUS, false)
4733 fi # test "$VGCONF_OS" = "freebsd"
4736 #----------------------------------------------------------------------------
4737 # Checks for C header files.
4738 #----------------------------------------------------------------------------
4740 AC_CHECK_HEADERS([ \
4758 # Verify whether the <linux/futex.h> header is usable.
4759 AC_MSG_CHECKING([if <linux/futex.h> is usable])
4761 save_CFLAGS="$CFLAGS"
4762 CFLAGS="$CFLAGS -D__user="
4763 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4764 #include <linux/futex.h>
4768 ac_have_usable_linux_futex_h=yes
4769 AC_DEFINE([HAVE_USABLE_LINUX_FUTEX_H], 1,
4770 [Define to 1 if you have a usable <linux/futex.h> header file.])
4771 AC_MSG_RESULT([yes])
4773 ac_have_usable_linux_futex_h=no
4776 CFLAGS="$save_CFLAGS"
4779 #----------------------------------------------------------------------------
4780 # Checks for typedefs, structures, and compiler characteristics.
4781 #----------------------------------------------------------------------------
4785 AC_CHECK_HEADERS_ONCE([sys/time.h])
4787 AC_CHECK_TYPE([struct statx], [
4788 AC_DEFINE([HAVE_STRUCT_STATX_IN_SYS_STAT_H], 1,
4789 [Define to 1 if <sys/stat.h> declares struct statx.])
4792 #include <sys/stat.h>
4796 #----------------------------------------------------------------------------
4797 # Checks for library functions.
4798 #----------------------------------------------------------------------------
4802 AC_CHECK_LIB([pthread], [pthread_create])
4803 AC_CHECK_LIB([rt], [clock_gettime])
4823 pthread_barrier_init \
4824 pthread_condattr_setclock \
4825 pthread_mutex_timedlock \
4826 pthread_rwlock_timedrdlock \
4827 pthread_rwlock_timedwrlock \
4828 pthread_setname_np \
4854 # AC_CHECK_LIB adds any library found to the variable LIBS, and links these
4855 # libraries with any shared object and/or executable. This is NOT what we
4856 # want for e.g. vgpreload_core-x86-linux.so
4859 AM_CONDITIONAL([HAVE_PTHREAD_BARRIER],
4860 [test x$ac_cv_func_pthread_barrier_init = xyes])
4861 AM_CONDITIONAL([HAVE_PTHREAD_MUTEX_TIMEDLOCK],
4862 [test x$ac_cv_func_pthread_mutex_timedlock = xyes])
4863 AM_CONDITIONAL([HAVE_PTHREAD_SPINLOCK],
4864 [test x$ac_cv_func_pthread_spin_lock = xyes])
4865 AM_CONDITIONAL([HAVE_PTHREAD_SETNAME_NP],
4866 [test x$ac_cv_func_pthread_setname_np = xyes])
4867 AM_CONDITIONAL([HAVE_COPY_FILE_RANGE],
4868 [test x$ac_cv_func_copy_file_range = xyes])
4869 AM_CONDITIONAL([HAVE_PREADV_PWRITEV],
4870 [test x$ac_cv_func_preadv = xyes && test x$ac_cv_func_pwritev = xyes])
4871 AM_CONDITIONAL([HAVE_PREADV2_PWRITEV2],
4872 [test x$ac_cv_func_preadv2 = xyes && test x$ac_cv_func_pwritev2 = xyes])
4873 AM_CONDITIONAL([HAVE_SETCONTEXT], [test x$ac_cv_func_setcontext = xyes])
4874 AM_CONDITIONAL([HAVE_SWAPCONTEXT], [test x$ac_cv_func_swapcontext = xyes])
4875 AM_CONDITIONAL([HAVE_MEMFD_CREATE],
4876 [test x$ac_cv_func_memfd_create = xyes])
4878 if test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
4879 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \
4880 -o x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX; then
4881 AC_DEFINE([DISABLE_PTHREAD_SPINLOCK_INTERCEPT], 1,
4882 [Disable intercept pthread_spin_lock() on MIPS32, MIPS64 and nanoMIPS.])
4885 #----------------------------------------------------------------------------
4887 #----------------------------------------------------------------------------
4888 # Do we have a useable MPI setup on the primary and/or secondary targets?
4889 # On Linux, by default, assumes mpicc and -m32/-m64
4890 # Note: this is a kludge in that it assumes the specified mpicc
4891 # understands -m32/-m64 regardless of what is specified using
4893 AC_PATH_PROG([MPI_CC], [mpicc], [mpicc],
4894 [$PATH:/usr/lib/openmpi/bin:/usr/lib64/openmpi/bin])
4897 if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
4898 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_FREEBSD \
4899 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
4900 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
4901 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
4902 -o x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX \
4903 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS ; then
4904 mflag_primary=$FLAG_M32
4905 elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
4906 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD \
4907 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
4908 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX \
4909 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \
4910 -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX ; then
4911 mflag_primary=$FLAG_M64
4912 elif test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN ; then
4913 mflag_primary="$FLAG_M32 -arch i386"
4914 elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN ; then
4915 mflag_primary="$FLAG_M64 -arch x86_64"
4919 if test x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
4920 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX \
4921 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_SOLARIS \
4922 -o x$VGCONF_PLATFORM_SEC_CAPS = xMIPS32_LINUX \
4923 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_FREEBSD ; then
4924 mflag_secondary=$FLAG_M32
4925 elif test x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN ; then
4926 mflag_secondary="$FLAG_M32 -arch i386"
4931 [ --with-mpicc= Specify name of MPI2-ised C compiler],
4936 ## We AM_COND_IF here instead of automake "if" in mpi/Makefile.am so that we can
4937 ## use these values in the check for a functioning mpicc.
4939 ## We leave the MPI_FLAG_M3264_ logic in mpi/Makefile.am and assume that
4940 ## mflag_primary/mflag_secondary are sufficient approximations of that behavior
4941 AM_COND_IF([VGCONF_OS_IS_LINUX],
4942 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic"
4943 LDFLAGS_MPI="-fpic -shared"])
4944 AM_COND_IF([VGCONF_OS_IS_FREEBSD],
4945 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic"
4946 LDFLAGS_MPI="-fpic -shared"])
4947 AM_COND_IF([VGCONF_OS_IS_DARWIN],
4948 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -dynamic"
4949 LDFLAGS_MPI="-dynamic -dynamiclib -all_load"])
4950 AM_COND_IF([VGCONF_OS_IS_SOLARIS],
4951 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic"
4952 LDFLAGS_MPI="-fpic -shared"])
4954 AC_SUBST([CFLAGS_MPI])
4955 AC_SUBST([LDFLAGS_MPI])
4958 ## See if MPI_CC works for the primary target
4960 AC_MSG_CHECKING([primary target for usable MPI2-compliant C compiler and mpi.h])
4962 saved_CFLAGS=$CFLAGS
4964 CFLAGS="$CFLAGS_MPI $mflag_primary"
4965 saved_LDFLAGS="$LDFLAGS"
4966 LDFLAGS="$LDFLAGS_MPI $mflag_primary"
4967 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4971 int ni, na, nd, comb;
4972 int r = MPI_Init(NULL,NULL);
4973 r |= MPI_Type_get_envelope( MPI_INT, &ni, &na, &nd, &comb );
4974 r |= MPI_Finalize();
4977 ac_have_mpi2_pri=yes
4978 AC_MSG_RESULT([yes, $MPI_CC])
4984 CFLAGS=$saved_CFLAGS
4985 LDFLAGS="$saved_LDFLAGS"
4986 AM_CONDITIONAL(BUILD_MPIWRAP_PRI, test x$ac_have_mpi2_pri = xyes)
4988 ## See if MPI_CC works for the secondary target. Complication: what if
4989 ## there is no secondary target? We need this to then fail.
4990 ## Kludge this by making MPI_CC something which will surely fail in
4993 AC_MSG_CHECKING([secondary target for usable MPI2-compliant C compiler and mpi.h])
4995 saved_CFLAGS=$CFLAGS
4996 saved_LDFLAGS="$LDFLAGS"
4997 LDFLAGS="$LDFLAGS_MPI $mflag_secondary"
4998 if test x$VGCONF_PLATFORM_SEC_CAPS = x ; then
4999 CC="$MPI_CC this will surely fail"
5003 CFLAGS="$CFLAGS_MPI $mflag_secondary"
5004 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5008 int ni, na, nd, comb;
5009 int r = MPI_Init(NULL,NULL);
5010 r |= MPI_Type_get_envelope( MPI_INT, &ni, &na, &nd, &comb );
5011 r |= MPI_Finalize();
5014 ac_have_mpi2_sec=yes
5015 AC_MSG_RESULT([yes, $MPI_CC])
5021 CFLAGS=$saved_CFLAGS
5022 LDFLAGS="$saved_LDFLAGS"
5023 AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec = xyes)
5026 #----------------------------------------------------------------------------
5027 # Other library checks
5028 #----------------------------------------------------------------------------
5029 # There now follow some tests for Boost, and OpenMP. These
5030 # tests are present because Drd has some regression tests that use
5031 # these packages. All regression test programs all compiled only
5032 # for the primary target. And so it is important that the configure
5033 # checks that follow, use the correct -m32 or -m64 flag for the
5034 # primary target (called $mflag_primary). Otherwise, we can end up
5035 # in a situation (eg) where, on amd64-linux, the test for Boost checks
5036 # for usable 64-bit Boost facilities, but because we are doing a 32-bit
5037 # only build (meaning, the primary target is x86-linux), the build
5038 # of the regtest programs that use Boost fails, because they are
5039 # build as 32-bit (IN THIS EXAMPLE).
5041 # Hence: ALWAYS USE $mflag_primary FOR CONFIGURE TESTS FOR FACILITIES
5042 # NEEDED BY THE REGRESSION TEST PROGRAMS.
5045 # Check whether the boost library 1.35 or later has been installed.
5046 # The Boost.Threads library has undergone a major rewrite in version 1.35.0.
5048 AC_MSG_CHECKING([for boost])
5051 safe_CXXFLAGS=$CXXFLAGS
5052 CXXFLAGS="$mflag_primary"
5054 LIBS="-lboost_thread-mt -lboost_system-mt $LIBS"
5056 AC_LINK_IFELSE([AC_LANG_SOURCE([
5057 #include <boost/thread.hpp>
5058 static void thread_func(void)
5060 int main(int argc, char** argv)
5062 boost::thread t(thread_func);
5067 ac_have_boost_1_35=yes
5068 AC_SUBST([BOOST_CFLAGS], [])
5069 AC_SUBST([BOOST_LIBS], ["-lboost_thread-mt -lboost_system-mt"])
5070 AC_MSG_RESULT([yes])
5072 ac_have_boost_1_35=no
5077 CXXFLAGS=$safe_CXXFLAGS
5080 AM_CONDITIONAL([HAVE_BOOST_1_35], [test x$ac_have_boost_1_35 = xyes])
5083 # does this compiler support -fopenmp, does it have the include file
5084 # <omp.h> and does it have libgomp ?
5086 AC_MSG_CHECKING([for OpenMP])
5089 CFLAGS="-fopenmp $mflag_primary -Werror"
5091 AC_LINK_IFELSE([AC_LANG_SOURCE([
5093 int main(int argc, char** argv)
5101 AC_MSG_RESULT([yes])
5108 AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes])
5111 # Check for __builtin_popcount
5112 AC_MSG_CHECKING([for __builtin_popcount()])
5113 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5115 __builtin_popcount(2);
5118 AC_MSG_RESULT([yes])
5119 AC_DEFINE([HAVE_BUILTIN_POPCOUT], 1,
5120 [Define to 1 if compiler provides __builtin_popcount().])
5125 # Check for __builtin_clz
5126 AC_MSG_CHECKING([for __builtin_clz()])
5127 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5132 AC_MSG_RESULT([yes])
5133 AC_DEFINE([HAVE_BUILTIN_CLZ], 1,
5134 [Define to 1 if compiler provides __builtin_clz().])
5139 # Check for __builtin_ctz
5140 AC_MSG_CHECKING([for __builtin_ctz()])
5141 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5146 AC_MSG_RESULT([yes])
5147 AC_DEFINE([HAVE_BUILTIN_CTZ], 1,
5148 [Define to 1 if compiler provides __builtin_ctz().])
5153 # does this compiler have built-in functions for atomic memory access for the
5155 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the primary target])
5158 CFLAGS="$mflag_primary"
5160 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
5162 return (__sync_bool_compare_and_swap(&variable, 1, 2)
5163 && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
5165 ac_have_builtin_atomic_primary=yes
5166 AC_MSG_RESULT([yes])
5167 AC_DEFINE(HAVE_BUILTIN_ATOMIC, 1, [Define to 1 if gcc supports __sync_bool_compare_and_swap() and __sync_add_and_fetch() for the primary target])
5169 ac_have_builtin_atomic_primary=no
5175 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC],
5176 [test x$ac_have_builtin_atomic_primary = xyes])
5179 # does this compiler have built-in functions for atomic memory access for the
5180 # secondary target ?
5182 if test x$VGCONF_PLATFORM_SEC_CAPS != x; then
5184 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the secondary target])
5187 CFLAGS="$mflag_secondary"
5189 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
5191 return (__sync_add_and_fetch(&variable, 1) ? 1 : 0)
5193 ac_have_builtin_atomic_secondary=yes
5194 AC_MSG_RESULT([yes])
5196 ac_have_builtin_atomic_secondary=no
5204 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_SECONDARY],
5205 [test x$ac_have_builtin_atomic_secondary = xyes])
5207 # does this compiler have built-in functions for atomic memory access on
5208 # 64-bit integers for all targets ?
5210 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch on uint64_t for all targets])
5212 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5215 uint64_t variable = 1;
5216 return __sync_add_and_fetch(&variable, 1)
5218 ac_have_builtin_atomic64_primary=yes
5220 ac_have_builtin_atomic64_primary=no
5223 if test x$VGCONF_PLATFORM_SEC_CAPS != x; then
5226 CFLAGS="$mflag_secondary"
5228 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5231 uint64_t variable = 1;
5232 return __sync_add_and_fetch(&variable, 1)
5234 ac_have_builtin_atomic64_secondary=yes
5236 ac_have_builtin_atomic64_secondary=no
5243 if test x$ac_have_builtin_atomic64_primary = xyes && \
5244 test x$VGCONF_PLATFORM_SEC_CAPS = x \
5245 -o x$ac_have_builtin_atomic64_secondary = xyes; then
5246 AC_MSG_RESULT([yes])
5247 ac_have_builtin_atomic64=yes
5250 ac_have_builtin_atomic64=no
5253 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC64],
5254 [test x$ac_have_builtin_atomic64 = xyes])
5257 AC_MSG_CHECKING([if platform has openat2 syscall])
5259 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5260 #include <sys/syscall.h>
5269 AM_CONDITIONAL([HAVE_OPENAT2],
5270 [test x$ac_have_openat2 = xyes])
5272 # does g++ have built-in functions for atomic memory access ?
5273 AC_MSG_CHECKING([if g++ supports __sync_add_and_fetch])
5275 safe_CXXFLAGS=$CXXFLAGS
5276 CXXFLAGS="$mflag_primary"
5279 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
5281 return (__sync_bool_compare_and_swap(&variable, 1, 2)
5282 && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
5284 ac_have_builtin_atomic_cxx=yes
5285 AC_MSG_RESULT([yes])
5286 AC_DEFINE(HAVE_BUILTIN_ATOMIC_CXX, 1, [Define to 1 if g++ supports __sync_bool_compare_and_swap() and __sync_add_and_fetch()])
5288 ac_have_builtin_atomic_cxx=no
5293 CXXFLAGS=$safe_CXXFLAGS
5295 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_CXX], [test x$ac_have_builtin_atomic_cxx = xyes])
5298 if test x$ac_have_usable_linux_futex_h = xyes \
5299 -a x$ac_have_builtin_atomic_primary = xyes; then
5300 ac_enable_linux_ticket_lock_primary=yes
5302 AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_PRIMARY],
5303 [test x$ac_enable_linux_ticket_lock_primary = xyes])
5305 if test x$VGCONF_PLATFORM_SEC_CAPS != x \
5306 -a x$ac_have_usable_linux_futex_h = xyes \
5307 -a x$ac_have_builtin_atomic_secondary = xyes; then
5308 ac_enable_linux_ticket_lock_secondary=yes
5310 AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_SECONDARY],
5311 [test x$ac_enable_linux_ticket_lock_secondary = xyes])
5314 # does libstdc++ support annotating shared pointers ?
5315 AC_MSG_CHECKING([if libstdc++ supports annotating shared pointers])
5317 safe_CXXFLAGS=$CXXFLAGS
5318 CXXFLAGS="-std=c++0x"
5321 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5324 std::shared_ptr<int> p
5326 ac_have_shared_ptr=yes
5328 ac_have_shared_ptr=no
5330 if test x$ac_have_shared_ptr = xyes; then
5331 # If compilation of the program below fails because of a syntax error
5332 # triggered by substituting one of the annotation macros then that
5333 # means that libstdc++ supports these macros.
5334 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5335 #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(a) (a)----
5336 #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(a) (a)----
5339 std::shared_ptr<int> p
5341 ac_have_shared_pointer_annotation=no
5344 ac_have_shared_pointer_annotation=yes
5345 AC_MSG_RESULT([yes])
5346 AC_DEFINE(HAVE_SHARED_POINTER_ANNOTATION, 1,
5347 [Define to 1 if libstd++ supports annotating shared pointers])
5350 ac_have_shared_pointer_annotation=no
5355 CXXFLAGS=$safe_CXXFLAGS
5357 AM_CONDITIONAL([HAVE_SHARED_POINTER_ANNOTATION],
5358 [test x$ac_have_shared_pointer_annotation = xyes])
5361 #----------------------------------------------------------------------------
5362 # Ok. We're done checking.
5363 #----------------------------------------------------------------------------
5365 # Nb: VEX/Makefile is generated from Makefile.vex.in.
5368 VEX/Makefile:Makefile.vex.in
5372 glibc-2.X-helgrind.supp
5376 docs/xml/vg-entities.xml
5381 gdbserver_tests/Makefile
5382 gdbserver_tests/solaris/Makefile
5388 memcheck/tests/Makefile
5389 memcheck/tests/common/Makefile
5390 memcheck/tests/amd64/Makefile
5391 memcheck/tests/x86/Makefile
5392 memcheck/tests/linux/Makefile
5393 memcheck/tests/linux/debuginfod-check.vgtest
5394 memcheck/tests/darwin/Makefile
5395 memcheck/tests/solaris/Makefile
5396 memcheck/tests/freebsd/Makefile
5397 memcheck/tests/amd64-linux/Makefile
5398 memcheck/tests/arm64-linux/Makefile
5399 memcheck/tests/x86-linux/Makefile
5400 memcheck/tests/amd64-solaris/Makefile
5401 memcheck/tests/x86-solaris/Makefile
5402 memcheck/tests/amd64-freebsd/Makefile
5403 memcheck/tests/x86-freebsd/Makefile
5404 memcheck/tests/ppc32/Makefile
5405 memcheck/tests/ppc64/Makefile
5406 memcheck/tests/s390x/Makefile
5407 memcheck/tests/mips32/Makefile
5408 memcheck/tests/mips64/Makefile
5409 memcheck/tests/vbit-test/Makefile
5411 cachegrind/tests/Makefile
5412 cachegrind/tests/x86/Makefile
5413 cachegrind/cg_annotate
5417 callgrind/callgrind_annotate
5418 callgrind/callgrind_control
5419 callgrind/tests/Makefile
5421 helgrind/tests/Makefile
5423 drd/scripts/download-and-build-splash2
5426 massif/tests/Makefile
5431 lackey/tests/Makefile
5434 none/tests/scripts/Makefile
5435 none/tests/amd64/Makefile
5436 none/tests/ppc32/Makefile
5437 none/tests/ppc64/Makefile
5438 none/tests/x86/Makefile
5439 none/tests/arm/Makefile
5440 none/tests/arm64/Makefile
5441 none/tests/s390x/Makefile
5442 none/tests/mips32/Makefile
5443 none/tests/mips64/Makefile
5444 none/tests/nanomips/Makefile
5445 none/tests/linux/Makefile
5446 none/tests/darwin/Makefile
5447 none/tests/solaris/Makefile
5448 none/tests/freebsd/Makefile
5449 none/tests/amd64-linux/Makefile
5450 none/tests/x86-linux/Makefile
5451 none/tests/amd64-darwin/Makefile
5452 none/tests/x86-darwin/Makefile
5453 none/tests/amd64-solaris/Makefile
5454 none/tests/x86-solaris/Makefile
5455 none/tests/x86-freebsd/Makefile
5457 exp-bbv/tests/Makefile
5458 exp-bbv/tests/x86/Makefile
5459 exp-bbv/tests/x86-linux/Makefile
5460 exp-bbv/tests/amd64-linux/Makefile
5461 exp-bbv/tests/ppc32-linux/Makefile
5462 exp-bbv/tests/arm-linux/Makefile
5466 AC_CONFIG_FILES([coregrind/link_tool_exe_linux],
5467 [chmod +x coregrind/link_tool_exe_linux])
5468 AC_CONFIG_FILES([coregrind/link_tool_exe_freebsd],
5469 [chmod +x coregrind/link_tool_exe_freebsd])
5470 AC_CONFIG_FILES([coregrind/link_tool_exe_darwin],
5471 [chmod +x coregrind/link_tool_exe_darwin])
5472 AC_CONFIG_FILES([coregrind/link_tool_exe_solaris],
5473 [chmod +x coregrind/link_tool_exe_solaris])
5474 AC_CONFIG_FILES([tests/filter_stderr_basic],
5475 [chmod +x tests/filter_stderr_basic])
5476 AC_CONFIG_FILES([tests/filter_discards],
5477 [chmod +x tests/filter_discards])
5478 AC_CONFIG_FILES([memcheck/tests/filter_stderr],
5479 [chmod +x memcheck/tests/filter_stderr])
5480 AC_CONFIG_FILES([memcheck/tests/filter_dw4],
5481 [chmod +x memcheck/tests/filter_dw4])
5482 AC_CONFIG_FILES([memcheck/tests/filter_overlaperror],
5483 [chmod +x memcheck/tests/filter_overlaperror])
5484 AC_CONFIG_FILES([memcheck/tests/x86/filter_pushfpopf],
5485 [chmod +x memcheck/tests/x86/filter_pushfpopf])
5486 AC_CONFIG_FILES([gdbserver_tests/filter_gdb],
5487 [chmod +x gdbserver_tests/filter_gdb])
5488 AC_CONFIG_FILES([gdbserver_tests/filter_memcheck_monitor],
5489 [chmod +x gdbserver_tests/filter_memcheck_monitor])
5490 AC_CONFIG_FILES([gdbserver_tests/filter_stderr],
5491 [chmod +x gdbserver_tests/filter_stderr])
5492 AC_CONFIG_FILES([gdbserver_tests/filter_vgdb],
5493 [chmod +x gdbserver_tests/filter_vgdb])
5494 AC_CONFIG_FILES([drd/tests/filter_stderr],
5495 [chmod +x drd/tests/filter_stderr])
5496 AC_CONFIG_FILES([drd/tests/filter_error_count],
5497 [chmod +x drd/tests/filter_error_count])
5498 AC_CONFIG_FILES([drd/tests/filter_error_summary],
5499 [chmod +x drd/tests/filter_error_summary])
5500 AC_CONFIG_FILES([drd/tests/filter_stderr_and_thread_no_and_offset],
5501 [chmod +x drd/tests/filter_stderr_and_thread_no_and_offset])
5502 AC_CONFIG_FILES([drd/tests/filter_thread_no],
5503 [chmod +x drd/tests/filter_thread_no])
5504 AC_CONFIG_FILES([drd/tests/filter_xml_and_thread_no],
5505 [chmod +x drd/tests/filter_xml_and_thread_no])
5506 AC_CONFIG_FILES([helgrind/tests/filter_stderr],
5507 [chmod +x helgrind/tests/filter_stderr])
5513 Maximum build arch: ${ARCH_MAX}
5514 Primary build arch: ${VGCONF_ARCH_PRI}
5515 Secondary build arch: ${VGCONF_ARCH_SEC}
5516 Build OS: ${VGCONF_OS}
5517 Link Time Optimisation: ${vg_cv_lto}
5518 Primary build target: ${VGCONF_PLATFORM_PRI_CAPS}
5519 Secondary build target: ${VGCONF_PLATFORM_SEC_CAPS}
5520 Platform variant: ${VGCONF_PLATVARIANT}
5521 Primary -DVGPV string: -DVGPV_${VGCONF_ARCH_PRI}_${VGCONF_OS}_${VGCONF_PLATVARIANT}=1
5522 Default supp files: ${DEFAULT_SUPP}