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], [23])
19 m4_define([v_micro_ver], [0])
20 m4_define([v_suffix_ver], [GIT])
21 m4_define([v_rel_date], ["?? Apr 2024"])
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])
401 AC_DEFINE([FREEBSD_15], 1500, [FREEBSD_VERS value for FreeBSD 15.x])
404 AC_MSG_CHECKING([for the kernel version])
409 AC_MSG_RESULT([FreeBSD 10.x (${kernel})])
410 AC_DEFINE([FREEBSD_VERS], FREEBSD_10, [FreeBSD version])
411 freebsd_vers=$freebsd_10
414 AC_MSG_RESULT([FreeBSD 11.x (${kernel})])
415 AC_DEFINE([FREEBSD_VERS], FREEBSD_11, [FreeBSD version])
416 freebsd_vers=$freebsd_11
421 AC_MSG_RESULT([FreeBSD 12.x (${kernel})])
422 AC_DEFINE([FREEBSD_VERS], FREEBSD_12, [FreeBSD version])
423 freebsd_vers=$freebsd_12
426 AC_MSG_RESULT([FreeBSD 12.x (${kernel})])
427 AC_DEFINE([FREEBSD_VERS], FREEBSD_12_2, [FreeBSD version])
428 freebsd_vers=$freebsd_12_2
435 AC_MSG_RESULT([FreeBSD 13.0 (${kernel})])
436 AC_DEFINE([FREEBSD_VERS], FREEBSD_13_0, [FreeBSD version])
437 freebsd_vers=$freebsd_13_0
440 AC_MSG_RESULT([FreeBSD 13.1 (${kernel})])
441 AC_DEFINE([FREEBSD_VERS], FREEBSD_13_1, [FreeBSD version])
442 freebsd_vers=$freebsd_13_1
445 AC_MSG_RESULT([FreeBSD 13.2 (${kernel})])
446 AC_DEFINE([FREEBSD_VERS], FREEBSD_13_2, [FreeBSD version])
447 freebsd_vers=$freebsd_13_2
450 AC_MSG_RESULT([unsupported (${kernel})])
451 AC_MSG_ERROR([Valgrind works on FreeBSD 10.x to 15.x])
456 AC_MSG_RESULT([FreeBSD 14.x (${kernel})])
457 AC_DEFINE([FREEBSD_VERS], FREEBSD_14, [FreeBSD version])
458 freebsd_vers=$freebsd_14
461 AC_MSG_RESULT([FreeBSD 15.x (${kernel})])
462 AC_DEFINE([FREEBSD_VERS], FREEBSD_15, [FreeBSD version])
463 freebsd_vers=$freebsd_15
466 AC_MSG_RESULT([unsupported (${kernel})])
467 AC_MSG_ERROR([Valgrind works on FreeBSD 10.x to 15.x])
471 DEFAULT_SUPP="$srcdir/freebsd.supp $srcdir/freebsd-helgrind.supp $srcdir/freebsd-drd.supp ${DEFAULT_SUPP}"
475 AC_MSG_RESULT([ok (${host_os})])
477 AC_DEFINE([DARWIN_10_5], 100500, [DARWIN_VERS value for Mac OS X 10.5])
478 AC_DEFINE([DARWIN_10_6], 100600, [DARWIN_VERS value for Mac OS X 10.6])
479 AC_DEFINE([DARWIN_10_7], 100700, [DARWIN_VERS value for Mac OS X 10.7])
480 AC_DEFINE([DARWIN_10_8], 100800, [DARWIN_VERS value for Mac OS X 10.8])
481 AC_DEFINE([DARWIN_10_9], 100900, [DARWIN_VERS value for Mac OS X 10.9])
482 AC_DEFINE([DARWIN_10_10], 101000, [DARWIN_VERS value for Mac OS X 10.10])
483 AC_DEFINE([DARWIN_10_11], 101100, [DARWIN_VERS value for Mac OS X 10.11])
484 AC_DEFINE([DARWIN_10_12], 101200, [DARWIN_VERS value for macOS 10.12])
485 AC_DEFINE([DARWIN_10_13], 101300, [DARWIN_VERS value for macOS 10.13])
487 AC_MSG_CHECKING([for the kernel version])
490 # Nb: for Darwin we set DEFAULT_SUPP here. That's because Darwin
491 # has only one relevant version, the OS version. The `uname` check
492 # is a good way to get that version (i.e. "Darwin 9.6.0" is Mac OS
493 # X 10.5.6, and "Darwin 10.x" is Mac OS X 10.6.x Snow Leopard,
494 # and possibly "Darwin 11.x" is Mac OS X 10.7.x Lion),
495 # and we don't know of an macros similar to __GLIBC__ to get that info.
497 # XXX: `uname -r` won't do the right thing for cross-compiles, but
498 # that's not a problem yet.
500 # jseward 21 Sept 2011: I seriously doubt whether V 3.7.0 will work
501 # on OS X 10.5.x; I haven't tested yet, and only plan to test 3.7.0
502 # on 10.6.8 and 10.7.1. Although tempted to delete the configure
503 # time support for 10.5 (the 9.* pattern just below), I'll leave it
504 # in for now, just in case anybody wants to give it a try. But I'm
505 # assuming that 3.7.0 is a Snow Leopard and Lion-only release.
508 AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard])
509 AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version])
510 DEFAULT_SUPP="$srcdir/darwin9.supp ${DEFAULT_SUPP}"
511 DEFAULT_SUPP="$srcdir/darwin9-drd.supp ${DEFAULT_SUPP}"
514 AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard])
515 AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version])
516 DEFAULT_SUPP="$srcdir/darwin10.supp ${DEFAULT_SUPP}"
517 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
520 AC_MSG_RESULT([Darwin 11.x (${kernel}) / Mac OS X 10.7 Lion])
521 AC_DEFINE([DARWIN_VERS], DARWIN_10_7, [Darwin / Mac OS X version])
522 DEFAULT_SUPP="$srcdir/darwin11.supp ${DEFAULT_SUPP}"
523 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
526 AC_MSG_RESULT([Darwin 12.x (${kernel}) / Mac OS X 10.8 Mountain Lion])
527 AC_DEFINE([DARWIN_VERS], DARWIN_10_8, [Darwin / Mac OS X version])
528 DEFAULT_SUPP="$srcdir/darwin12.supp ${DEFAULT_SUPP}"
529 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
532 AC_MSG_RESULT([Darwin 13.x (${kernel}) / Mac OS X 10.9 Mavericks])
533 AC_DEFINE([DARWIN_VERS], DARWIN_10_9, [Darwin / Mac OS X version])
534 DEFAULT_SUPP="$srcdir/darwin13.supp ${DEFAULT_SUPP}"
535 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
538 AC_MSG_RESULT([Darwin 14.x (${kernel}) / Mac OS X 10.10 Yosemite])
539 AC_DEFINE([DARWIN_VERS], DARWIN_10_10, [Darwin / Mac OS X version])
540 DEFAULT_SUPP="$srcdir/darwin14.supp ${DEFAULT_SUPP}"
541 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
544 AC_MSG_RESULT([Darwin 15.x (${kernel}) / Mac OS X 10.11 El Capitan])
545 AC_DEFINE([DARWIN_VERS], DARWIN_10_11, [Darwin / Mac OS X version])
546 DEFAULT_SUPP="$srcdir/darwin15.supp ${DEFAULT_SUPP}"
547 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
550 AC_MSG_RESULT([Darwin 16.x (${kernel}) / macOS 10.12 Sierra])
551 AC_DEFINE([DARWIN_VERS], DARWIN_10_12, [Darwin / Mac OS X version])
552 DEFAULT_SUPP="$srcdir/darwin16.supp ${DEFAULT_SUPP}"
553 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
556 AC_MSG_RESULT([Darwin 17.x (${kernel}) / macOS 10.13 High Sierra])
557 AC_DEFINE([DARWIN_VERS], DARWIN_10_13, [Darwin / Mac OS X version])
558 DEFAULT_SUPP="$srcdir/darwin17.supp ${DEFAULT_SUPP}"
559 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
562 AC_MSG_RESULT([unsupported (${kernel})])
563 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)])
569 AC_MSG_RESULT([ok (${host_os})])
572 uname_v=$( uname -v )
575 DEFAULT_SUPP="$srcdir/solaris12.supp ${DEFAULT_SUPP}"
578 DEFAULT_SUPP="$srcdir/solaris11.supp ${DEFAULT_SUPP}"
584 AC_MSG_RESULT([ok (${host_os})])
586 DEFAULT_SUPP="$srcdir/solaris12.supp ${DEFAULT_SUPP}"
590 AC_MSG_RESULT([no (${host_os})])
591 AC_MSG_ERROR([Valgrind is operating system specific. Sorry.])
595 #----------------------------------------------------------------------------
597 # If we are building on a 64 bit platform test to see if the system
598 # supports building 32 bit programs and disable 32 bit support if it
599 # does not support building 32 bit programs
601 case "$ARCH_MAX-$VGCONF_OS" in
602 amd64-linux|ppc64be-linux|arm64-linux|amd64-solaris)
603 AC_MSG_CHECKING([for 32 bit build support])
606 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
611 vg_cv_only64bit="yes"
614 CFLAGS=$safe_CFLAGS;;
616 AC_MSG_CHECKING([for 32 bit build support])
618 CFLAGS="$CFLAGS -mips32 -mabi=32"
619 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
620 #include <sys/prctl.h>
624 vg_cv_only64bit="yes"
627 CFLAGS=$safe_CFLAGS;;
630 if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
632 [--enable-only32bit was specified but system does not support 32 bit builds])
635 #----------------------------------------------------------------------------
637 # VGCONF_ARCH_PRI is the arch for the primary build target, eg. "amd64". By
638 # default it's the same as ARCH_MAX. But if, say, we do a build on an amd64
639 # machine, but --enable-only32bit has been requested, then ARCH_MAX (see
640 # above) will be "amd64" since that reflects the most that this cpu can do,
641 # but VGCONF_ARCH_PRI will be downgraded to "x86", since that reflects the
642 # arch corresponding to the primary build (VGCONF_PLATFORM_PRI_CAPS). It is
643 # passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_PRI) and
644 # -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS).
645 AC_SUBST(VGCONF_ARCH_PRI)
647 # VGCONF_ARCH_SEC is the arch for the secondary build target, eg. "x86".
648 # It is passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_SEC)
649 # and -VGP_$(VGCONF_ARCH_SEC)_$(VGCONF_OS), if there is a secondary target.
650 # It is empty if there is no secondary target.
651 AC_SUBST(VGCONF_ARCH_SEC)
653 # VGCONF_PLATFORM_PRI_CAPS is the primary build target, eg. "AMD64_LINUX".
654 # The entire system, including regression and performance tests, will be
655 # built for this target. The "_CAPS" indicates that the name is in capital
656 # letters, and it also uses '_' rather than '-' as a separator, because it's
657 # used to create various Makefile variables, which are all in caps by
658 # convention and cannot contain '-' characters. This is in contrast to
659 # VGCONF_ARCH_PRI and VGCONF_OS which are not in caps.
660 AC_SUBST(VGCONF_PLATFORM_PRI_CAPS)
662 # VGCONF_PLATFORM_SEC_CAPS is the secondary build target, if there is one.
663 # Valgrind and tools will also be built for this target, but not the
664 # regression or performance tests.
666 # By default, the primary arch is the same as the "max" arch, as commented
667 # above (at the definition of ARCH_MAX). We may choose to downgrade it in
668 # the big case statement just below here, in the case where we're building
669 # on a 64 bit machine but have been requested only to do a 32 bit build.
670 AC_SUBST(VGCONF_PLATFORM_SEC_CAPS)
672 AC_MSG_CHECKING([for a supported CPU/OS combination])
674 # NB. The load address for a given platform may be specified in more
675 # than one place, in some cases, depending on whether we're doing a biarch,
676 # 32-bit only or 64-bit only build. eg see case for amd64-linux below.
677 # Be careful to give consistent values in all subcases. Also, all four
678 # valt_load_addres_{pri,sec}_{norml,inner} values must always be set,
679 # even if it is to "0xUNSET".
681 case "$ARCH_MAX-$VGCONF_OS" in
683 VGCONF_ARCH_PRI="x86"
685 VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
686 VGCONF_PLATFORM_SEC_CAPS=""
687 valt_load_address_pri_norml="0x58000000"
688 valt_load_address_pri_inner="0x38000000"
689 valt_load_address_sec_norml="0xUNSET"
690 valt_load_address_sec_inner="0xUNSET"
691 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
694 valt_load_address_sec_norml="0xUNSET"
695 valt_load_address_sec_inner="0xUNSET"
696 if test x$vg_cv_only64bit = xyes; then
697 VGCONF_ARCH_PRI="amd64"
699 VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
700 VGCONF_PLATFORM_SEC_CAPS=""
701 valt_load_address_pri_norml="0x58000000"
702 valt_load_address_pri_inner="0x38000000"
703 elif test x$vg_cv_only32bit = xyes; then
704 VGCONF_ARCH_PRI="x86"
706 VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
707 VGCONF_PLATFORM_SEC_CAPS=""
708 valt_load_address_pri_norml="0x58000000"
709 valt_load_address_pri_inner="0x38000000"
711 VGCONF_ARCH_PRI="amd64"
712 VGCONF_ARCH_SEC="x86"
713 VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
714 VGCONF_PLATFORM_SEC_CAPS="X86_LINUX"
715 valt_load_address_pri_norml="0x58000000"
716 valt_load_address_pri_inner="0x38000000"
717 valt_load_address_sec_norml="0x58000000"
718 valt_load_address_sec_inner="0x38000000"
720 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
723 VGCONF_ARCH_PRI="ppc32"
725 VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
726 VGCONF_PLATFORM_SEC_CAPS=""
727 valt_load_address_pri_norml="0x58000000"
728 valt_load_address_pri_inner="0x38000000"
729 valt_load_address_sec_norml="0xUNSET"
730 valt_load_address_sec_inner="0xUNSET"
731 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
734 valt_load_address_sec_norml="0xUNSET"
735 valt_load_address_sec_inner="0xUNSET"
736 if test x$vg_cv_only64bit = xyes; then
737 VGCONF_ARCH_PRI="ppc64be"
739 VGCONF_PLATFORM_PRI_CAPS="PPC64BE_LINUX"
740 VGCONF_PLATFORM_SEC_CAPS=""
741 valt_load_address_pri_norml="0x58000000"
742 valt_load_address_pri_inner="0x38000000"
743 elif test x$vg_cv_only32bit = xyes; then
744 VGCONF_ARCH_PRI="ppc32"
746 VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
747 VGCONF_PLATFORM_SEC_CAPS=""
748 valt_load_address_pri_norml="0x58000000"
749 valt_load_address_pri_inner="0x38000000"
751 VGCONF_ARCH_PRI="ppc64be"
752 VGCONF_ARCH_SEC="ppc32"
753 VGCONF_PLATFORM_PRI_CAPS="PPC64BE_LINUX"
754 VGCONF_PLATFORM_SEC_CAPS="PPC32_LINUX"
755 valt_load_address_pri_norml="0x58000000"
756 valt_load_address_pri_inner="0x38000000"
757 valt_load_address_sec_norml="0x58000000"
758 valt_load_address_sec_inner="0x38000000"
760 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
763 # Little Endian is only supported on PPC64
764 valt_load_address_sec_norml="0xUNSET"
765 valt_load_address_sec_inner="0xUNSET"
766 VGCONF_ARCH_PRI="ppc64le"
768 VGCONF_PLATFORM_PRI_CAPS="PPC64LE_LINUX"
769 VGCONF_PLATFORM_SEC_CAPS=""
770 valt_load_address_pri_norml="0x58000000"
771 valt_load_address_pri_inner="0x38000000"
772 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
775 VGCONF_ARCH_PRI="x86"
777 VGCONF_PLATFORM_PRI_CAPS="X86_FREEBSD"
778 VGCONF_PLATFORM_SEC_CAPS=""
779 valt_load_address_pri_norml="0x38000000"
780 valt_load_address_pri_inner="0x28000000"
781 valt_load_address_sec_norml="0xUNSET"
782 valt_load_address_sec_inner="0xUNSET"
783 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
786 if test x$vg_cv_only64bit = xyes; then
787 VGCONF_ARCH_PRI="amd64"
789 VGCONF_PLATFORM_PRI_CAPS="AMD64_FREEBSD"
790 VGCONF_PLATFORM_SEC_CAPS=""
791 elif test x$vg_cv_only32bit = xyes; then
792 VGCONF_ARCH_PRI="x86"
794 VGCONF_PLATFORM_PRI_CAPS="X86_FREEBSD"
795 VGCONF_PLATFORM_SEC_CAPS=""
797 VGCONF_ARCH_PRI="amd64"
798 VGCONF_ARCH_SEC="x86"
799 VGCONF_PLATFORM_PRI_CAPS="AMD64_FREEBSD"
800 VGCONF_PLATFORM_SEC_CAPS="X86_FREEBSD"
802 # These work with either base clang or ports installed gcc
803 # Hand rolled compilers probably need INSTALL_DIR/lib (at least for gcc)
804 if test x$is_clang = xclang ; then
805 FLAG_32ON64="-B/usr/lib32"
807 GCC_MAJOR_VERSION=`${CC} -dumpversion | $SED 's/\..*//' 2>/dev/null`
808 FLAG_32ON64="-B/usr/local/lib32/gcc${GCC_MAJOR_VERSION} -Wl,-rpath,/usr/local/lib32/gcc${GCC_MAJOR_VERSION}/"
809 FLAG_32ON64_GXX="-L/usr/local/lib32/gcc${GCC_MAJOR_VERSION} -lgcc_s"
810 AC_SUBST(FLAG_32ON64_GXX)
812 valt_load_address_pri_norml="0x38000000"
813 valt_load_address_pri_inner="0x28000000"
814 valt_load_address_sec_norml="0x38000000"
815 valt_load_address_sec_inner="0x28000000"
816 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
818 # Darwin gets identified as 32-bit even when it supports 64-bit.
819 # (Not sure why, possibly because 'uname' returns "i386"?) Just about
820 # all Macs support both 32-bit and 64-bit, so we just build both. If
821 # someone has a really old 32-bit only machine they can (hopefully?)
822 # build with --enable-only32bit. See bug 243362.
823 x86-darwin|amd64-darwin)
825 valt_load_address_sec_norml="0xUNSET"
826 valt_load_address_sec_inner="0xUNSET"
827 if test x$vg_cv_only64bit = xyes; then
828 VGCONF_ARCH_PRI="amd64"
830 VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
831 VGCONF_PLATFORM_SEC_CAPS=""
832 valt_load_address_pri_norml="0x158000000"
833 valt_load_address_pri_inner="0x138000000"
834 elif test x$vg_cv_only32bit = xyes; then
835 VGCONF_ARCH_PRI="x86"
837 VGCONF_PLATFORM_PRI_CAPS="X86_DARWIN"
838 VGCONF_PLATFORM_SEC_CAPS=""
839 VGCONF_ARCH_PRI_CAPS="x86"
840 valt_load_address_pri_norml="0x58000000"
841 valt_load_address_pri_inner="0x38000000"
843 VGCONF_ARCH_PRI="amd64"
844 VGCONF_ARCH_SEC="x86"
845 VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
846 VGCONF_PLATFORM_SEC_CAPS="X86_DARWIN"
847 valt_load_address_pri_norml="0x158000000"
848 valt_load_address_pri_inner="0x138000000"
849 valt_load_address_sec_norml="0x58000000"
850 valt_load_address_sec_inner="0x38000000"
852 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
855 VGCONF_ARCH_PRI="arm"
856 VGCONF_PLATFORM_PRI_CAPS="ARM_LINUX"
857 VGCONF_PLATFORM_SEC_CAPS=""
858 valt_load_address_pri_norml="0x58000000"
859 valt_load_address_pri_inner="0x38000000"
860 valt_load_address_sec_norml="0xUNSET"
861 valt_load_address_sec_inner="0xUNSET"
862 AC_MSG_RESULT([ok (${host_cpu}-${host_os})])
865 valt_load_address_sec_norml="0xUNSET"
866 valt_load_address_sec_inner="0xUNSET"
867 if test x$vg_cv_only64bit = xyes; then
868 VGCONF_ARCH_PRI="arm64"
870 VGCONF_PLATFORM_PRI_CAPS="ARM64_LINUX"
871 VGCONF_PLATFORM_SEC_CAPS=""
872 valt_load_address_pri_norml="0x58000000"
873 valt_load_address_pri_inner="0x38000000"
874 elif test x$vg_cv_only32bit = xyes; then
875 VGCONF_ARCH_PRI="arm"
877 VGCONF_PLATFORM_PRI_CAPS="ARM_LINUX"
878 VGCONF_PLATFORM_SEC_CAPS=""
879 valt_load_address_pri_norml="0x58000000"
880 valt_load_address_pri_inner="0x38000000"
882 VGCONF_ARCH_PRI="arm64"
883 VGCONF_ARCH_SEC="arm"
884 VGCONF_PLATFORM_PRI_CAPS="ARM64_LINUX"
885 VGCONF_PLATFORM_SEC_CAPS="ARM_LINUX"
886 valt_load_address_pri_norml="0x58000000"
887 valt_load_address_pri_inner="0x38000000"
888 valt_load_address_sec_norml="0x58000000"
889 valt_load_address_sec_inner="0x38000000"
891 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
894 VGCONF_ARCH_PRI="s390x"
896 VGCONF_PLATFORM_PRI_CAPS="S390X_LINUX"
897 VGCONF_PLATFORM_SEC_CAPS=""
898 # To improve branch prediction hit rate we want to have
899 # the generated code close to valgrind (host) code
900 valt_load_address_pri_norml="0x800000000"
901 valt_load_address_pri_inner="0x810000000"
902 valt_load_address_sec_norml="0xUNSET"
903 valt_load_address_sec_inner="0xUNSET"
904 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
907 VGCONF_ARCH_PRI="mips32"
909 VGCONF_PLATFORM_PRI_CAPS="MIPS32_LINUX"
910 VGCONF_PLATFORM_SEC_CAPS=""
911 valt_load_address_pri_norml="0x58000000"
912 valt_load_address_pri_inner="0x38000000"
913 valt_load_address_sec_norml="0xUNSET"
914 valt_load_address_sec_inner="0xUNSET"
915 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
918 valt_load_address_sec_norml="0xUNSET"
919 valt_load_address_sec_inner="0xUNSET"
920 if test x$vg_cv_only64bit = xyes; then
921 VGCONF_ARCH_PRI="mips64"
922 VGCONF_PLATFORM_SEC_CAPS=""
923 VGCONF_PLATFORM_PRI_CAPS="MIPS64_LINUX"
924 VGCONF_PLATFORM_SEC_CAPS=""
925 valt_load_address_pri_norml="0x58000000"
926 valt_load_address_pri_inner="0x38000000"
927 elif test x$vg_cv_only32bit = xyes; then
928 VGCONF_ARCH_PRI="mips32"
930 VGCONF_PLATFORM_PRI_CAPS="MIPS32_LINUX"
931 VGCONF_PLATFORM_SEC_CAPS=""
932 valt_load_address_pri_norml="0x58000000"
933 valt_load_address_pri_inner="0x38000000"
935 VGCONF_ARCH_PRI="mips64"
936 VGCONF_ARCH_SEC="mips32"
937 VGCONF_PLATFORM_PRI_CAPS="MIPS64_LINUX"
938 VGCONF_PLATFORM_SEC_CAPS="MIPS32_LINUX"
939 valt_load_address_pri_norml="0x58000000"
940 valt_load_address_pri_inner="0x38000000"
941 valt_load_address_sec_norml="0x58000000"
942 valt_load_address_sec_inner="0x38000000"
944 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
947 VGCONF_ARCH_PRI="nanomips"
949 VGCONF_PLATFORM_PRI_CAPS="NANOMIPS_LINUX"
950 VGCONF_PLATFORM_SEC_CAPS=""
951 valt_load_address_pri_norml="0x58000000"
952 valt_load_address_pri_inner="0x38000000"
953 valt_load_address_sec_norml="0xUNSET"
954 valt_load_address_sec_inner="0xUNSET"
955 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
958 VGCONF_ARCH_PRI="x86"
960 VGCONF_PLATFORM_PRI_CAPS="X86_SOLARIS"
961 VGCONF_PLATFORM_SEC_CAPS=""
962 valt_load_address_pri_norml="0x58000000"
963 valt_load_address_pri_inner="0x38000000"
964 valt_load_address_sec_norml="0xUNSET"
965 valt_load_address_sec_inner="0xUNSET"
966 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
969 valt_load_address_sec_norml="0xUNSET"
970 valt_load_address_sec_inner="0xUNSET"
971 if test x$vg_cv_only64bit = xyes; then
972 VGCONF_ARCH_PRI="amd64"
974 VGCONF_PLATFORM_PRI_CAPS="AMD64_SOLARIS"
975 VGCONF_PLATFORM_SEC_CAPS=""
976 valt_load_address_pri_norml="0x58000000"
977 valt_load_address_pri_inner="0x38000000"
978 elif test x$vg_cv_only32bit = xyes; then
979 VGCONF_ARCH_PRI="x86"
981 VGCONF_PLATFORM_PRI_CAPS="X86_SOLARIS"
982 VGCONF_PLATFORM_SEC_CAPS=""
983 valt_load_address_pri_norml="0x58000000"
984 valt_load_address_pri_inner="0x38000000"
986 VGCONF_ARCH_PRI="amd64"
987 VGCONF_ARCH_SEC="x86"
988 VGCONF_PLATFORM_PRI_CAPS="AMD64_SOLARIS"
989 VGCONF_PLATFORM_SEC_CAPS="X86_SOLARIS"
990 valt_load_address_pri_norml="0x58000000"
991 valt_load_address_pri_inner="0x38000000"
992 valt_load_address_sec_norml="0x58000000"
993 valt_load_address_sec_inner="0x38000000"
995 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
998 VGCONF_ARCH_PRI="unknown"
999 VGCONF_ARCH_SEC="unknown"
1000 VGCONF_PLATFORM_PRI_CAPS="UNKNOWN"
1001 VGCONF_PLATFORM_SEC_CAPS="UNKNOWN"
1002 valt_load_address_pri_norml="0xUNSET"
1003 valt_load_address_pri_inner="0xUNSET"
1004 valt_load_address_sec_norml="0xUNSET"
1005 valt_load_address_sec_inner="0xUNSET"
1006 AC_MSG_RESULT([no (${ARCH_MAX}-${VGCONF_OS})])
1007 AC_MSG_ERROR([Valgrind is platform specific. Sorry. Please consider doing a port.])
1011 #----------------------------------------------------------------------------
1013 # Set up VGCONF_ARCHS_INCLUDE_<arch>. Either one or two of these become
1015 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_X86,
1016 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
1017 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
1018 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_FREEBSD \
1019 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_FREEBSD \
1020 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
1021 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN \
1022 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \
1023 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_SOLARIS )
1024 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_AMD64,
1025 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
1026 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD \
1027 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN \
1028 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS )
1029 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC32,
1030 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
1031 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX )
1032 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC64,
1033 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64BE_LINUX \
1034 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64LE_LINUX )
1035 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM,
1036 test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
1037 -o x$VGCONF_PLATFORM_SEC_CAPS = xARM_LINUX )
1038 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM64,
1039 test x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX )
1040 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_S390X,
1041 test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX )
1042 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_MIPS32,
1043 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
1044 -o x$VGCONF_PLATFORM_SEC_CAPS = xMIPS32_LINUX )
1045 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_MIPS64,
1046 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX )
1047 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_NANOMIPS,
1048 test x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX )
1050 # Set up VGCONF_PLATFORMS_INCLUDE_<platform>. Either one or two of these
1052 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_LINUX,
1053 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
1054 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX)
1055 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX,
1056 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX)
1057 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX,
1058 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
1059 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX)
1060 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64BE_LINUX,
1061 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64BE_LINUX)
1062 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64LE_LINUX,
1063 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64LE_LINUX)
1064 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_ARM_LINUX,
1065 test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
1066 -o x$VGCONF_PLATFORM_SEC_CAPS = xARM_LINUX)
1067 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_ARM64_LINUX,
1068 test x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX)
1069 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_S390X_LINUX,
1070 test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \
1071 -o x$VGCONF_PLATFORM_SEC_CAPS = xS390X_LINUX)
1072 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_MIPS32_LINUX,
1073 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
1074 -o x$VGCONF_PLATFORM_SEC_CAPS = xMIPS32_LINUX)
1075 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_MIPS64_LINUX,
1076 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX)
1077 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_NANOMIPS_LINUX,
1078 test x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX)
1079 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_FREEBSD,
1080 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_FREEBSD \
1081 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_FREEBSD)
1082 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_FREEBSD,
1083 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD)
1084 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_DARWIN,
1085 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
1086 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN)
1087 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN,
1088 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
1089 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_SOLARIS,
1090 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \
1091 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_SOLARIS)
1092 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_SOLARIS,
1093 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS)
1096 # Similarly, set up VGCONF_OS_IS_<os>. Exactly one of these becomes defined.
1097 # Relies on the assumption that the primary and secondary targets are
1098 # for the same OS, so therefore only necessary to test the primary.
1099 AM_CONDITIONAL(VGCONF_OS_IS_LINUX,
1100 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
1101 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
1102 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
1103 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64BE_LINUX \
1104 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64LE_LINUX \
1105 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
1106 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX \
1107 -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \
1108 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
1109 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \
1110 -o x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX)
1111 AM_CONDITIONAL(VGCONF_OS_IS_FREEBSD,
1112 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_FREEBSD \
1113 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD)
1114 AM_CONDITIONAL(VGCONF_OS_IS_DARWIN,
1115 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
1116 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
1117 AM_CONDITIONAL(VGCONF_OS_IS_SOLARIS,
1118 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \
1119 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS)
1120 AM_CONDITIONAL(VGCONF_OS_IS_DARWIN_OR_FREEBSD,
1121 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_FREEBSD \
1122 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD \
1123 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
1124 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
1127 # Sometimes, in the Makefile.am files, it's useful to know whether or not
1128 # there is a secondary target.
1129 AM_CONDITIONAL(VGCONF_HAVE_PLATFORM_SEC,
1130 test x$VGCONF_PLATFORM_SEC_CAPS != x)
1132 dnl automake-1.10 does not have AM_COND_IF (added in 1.11), so we supply a
1133 dnl fallback definition
1134 dnl The macro is courtesy of Dave Hart:
1135 dnl https://lists.gnu.org/archive/html/automake/2010-12/msg00045.html
1136 m4_ifndef([AM_COND_IF], [AC_DEFUN([AM_COND_IF], [
1137 if test -z "$$1_TRUE"; then :
1146 #----------------------------------------------------------------------------
1148 #----------------------------------------------------------------------------
1150 # Check if this should be built as an inner Valgrind, to be run within
1151 # another Valgrind. Choose the load address accordingly.
1152 AC_SUBST(VALT_LOAD_ADDRESS_PRI)
1153 AC_SUBST(VALT_LOAD_ADDRESS_SEC)
1154 AC_CACHE_CHECK([for use as an inner Valgrind], vg_cv_inner,
1155 [AC_ARG_ENABLE(inner,
1156 [ --enable-inner enables self-hosting],
1157 [vg_cv_inner=$enableval],
1159 if test "$vg_cv_inner" = yes; then
1160 AC_DEFINE([ENABLE_INNER], 1, [configured to run as an inner Valgrind])
1161 VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_inner
1162 VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_inner
1164 VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_norml
1165 VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_norml
1168 #----------------------------------------------------------------------------
1169 # Undefined behaviour sanitiser
1170 #----------------------------------------------------------------------------
1171 # Check whether we should build with the undefined beahviour sanitiser.
1173 AC_CACHE_CHECK([for using the undefined behaviour sanitiser], vg_cv_ubsan,
1174 [AC_ARG_ENABLE(ubsan,
1175 [ --enable-ubsan enables the undefined behaviour sanitiser],
1176 [vg_cv_ubsan=$enableval],
1179 #----------------------------------------------------------------------------
1180 # Extra fine-tuning of installation directories
1181 #----------------------------------------------------------------------------
1183 [ --with-tmpdir=PATH Specify path for temporary files],
1186 AC_DEFINE_UNQUOTED(VG_TMPDIR, "$tmpdir", [Temporary files directory])
1187 AC_SUBST(VG_TMPDIR, [$tmpdir])
1189 #----------------------------------------------------------------------------
1191 #----------------------------------------------------------------------------
1192 AM_COND_IF([VGCONF_OS_IS_DARWIN],
1193 [AC_CHECK_PROG([XCRUN], [xcrun], [yes], [no])
1194 AC_MSG_CHECKING([for xcode sdk include path])
1195 AC_ARG_WITH(xcodedir,
1196 [ --with-xcode-path=PATH Specify path for xcode sdk includes],
1197 [xcodedir="$withval"],
1199 if test "x$XCRUN" != "xno" -a ! -d /usr/include; then
1200 xcrundir=`xcrun --sdk macosx --show-sdk-path`
1201 if test -z "$xcrundir"; then
1202 xcodedir="/usr/include"
1204 xcodedir="$xcrundir/usr/include"
1207 xcodedir="/usr/include"
1210 AC_MSG_RESULT([$xcodedir])
1211 AC_DEFINE_UNQUOTED(XCODE_DIR, "$xcodedir", [xcode sdk include directory])
1212 AC_SUBST(XCODE_DIR, [$xcodedir])])
1214 #----------------------------------------------------------------------------
1215 # Where to install gdb scripts, defaults to VG_LIBDIR (pkglibexecdir)
1216 #----------------------------------------------------------------------------
1217 AC_MSG_CHECKING([where gdb scripts are installed])
1218 AC_ARG_WITH(gdbscripts-dir,
1219 [ --with-gdbscripts-dir=PATH Specify path to install gdb scripts],
1220 [gdbscriptsdir=${withval}],
1221 [gdbscriptsdir=${libexecdir}/valgrind])
1222 AC_MSG_RESULT([$gdbscriptsdir])
1223 if test "x$gdbscriptsdir" != "xno"; then
1224 AC_SUBST(VG_GDBSCRIPTS_DIR, [$gdbscriptsdir])
1225 AM_CONDITIONAL(GDBSCRIPTS, true)
1227 AC_SUBST(VG_GDBSCRIPTS_DIR, [])
1228 AM_CONDITIONAL(GDBSCRIPTS, false)
1231 #----------------------------------------------------------------------------
1232 # Libc and suppressions
1233 #----------------------------------------------------------------------------
1234 # This variable will collect the suppression files to be used.
1235 AC_SUBST(DEFAULT_SUPP)
1237 AC_CHECK_HEADER([features.h])
1239 if test x$ac_cv_header_features_h = xyes; then
1240 AC_DEFINE([HAVE_HEADER_FEATURES_H], 1,
1241 [Define to 1 if you have the `features.h' header.])
1242 rm -f conftest.$ac_ext
1243 cat <<_ACEOF >conftest.$ac_ext
1244 #include <features.h>
1245 #if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__)
1246 glibc version is: __GLIBC__ __GLIBC_MINOR__
1249 GLIBC_VERSION="`$CPP -P conftest.$ac_ext | $SED -n 's/^glibc version is: //p' | $SED 's/ /./g'`"
1252 # not really a version check
1253 AC_EGREP_CPP([DARWIN_LIBC], [
1254 #include <sys/cdefs.h>
1255 #if defined(__DARWIN_VERS_1050)
1259 GLIBC_VERSION="darwin")
1261 AC_EGREP_CPP([FREEBSD_LIBC], [
1262 #include <sys/cdefs.h>
1263 #if defined(__FreeBSD__)
1267 GLIBC_VERSION="freebsd")
1269 # not really a version check
1270 AC_EGREP_CPP([BIONIC_LIBC], [
1271 #if defined(__ANDROID__)
1275 GLIBC_VERSION="bionic")
1277 # there is only one version of libc on Solaris
1278 if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \
1279 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS; then
1280 GLIBC_VERSION="solaris"
1283 # GLIBC_VERSION is empty if a musl libc is used, so use the toolchain tuple
1285 if test x$GLIBC_VERSION = x; then
1286 if $CC -dumpmachine | grep -q musl; then
1291 # If this is glibc then figure out the generic (in file) libc.so and
1292 # libpthread.so file paths to use in suppressions. Before 2.34 libpthread
1293 # was a separate library, afterwards it was merged into libc.so and
1294 # the library is called libc.so.6 (before it was libc-2.[0-9]+.so).
1295 # Use this fact to set GLIBC_LIBC_PATH and GLIBC_LIBPTHREAD_PATH.
1296 case ${GLIBC_VERSION} in
1298 AC_MSG_CHECKING([whether pthread_create needs libpthread])
1299 AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_create])],
1302 GLIBC_LIBC_PATH="*/lib*/libc.so.6"
1303 GLIBC_LIBPTHREAD_PATH="$GLIBC_LIBC_PATH"
1305 AC_MSG_RESULT([yes])
1306 GLIBC_LIBC_PATH="*/lib*/libc-2.*so*"
1307 GLIBC_LIBPTHREAD_PATH="*/lib*/libpthread-2.*so*"
1311 AC_MSG_CHECKING([not glibc...])
1312 AC_MSG_RESULT([${GLIBC_VERSION}])
1316 AC_MSG_CHECKING([the glibc version])
1318 case "${GLIBC_VERSION}" in
1320 AC_MSG_RESULT(${GLIBC_VERSION} family)
1321 DEFAULT_SUPP="$srcdir/glibc-2.2.supp ${DEFAULT_SUPP}"
1322 DEFAULT_SUPP="$srcdir/glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
1323 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1326 AC_MSG_RESULT(${GLIBC_VERSION} family)
1327 DEFAULT_SUPP="$srcdir/glibc-${GLIBC_VERSION}.supp ${DEFAULT_SUPP}"
1328 DEFAULT_SUPP="glibc-2.X-helgrind.supp ${DEFAULT_SUPP}"
1329 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1332 AC_MSG_RESULT(${GLIBC_VERSION} family)
1333 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
1334 DEFAULT_SUPP="glibc-2.X-helgrind.supp ${DEFAULT_SUPP}"
1335 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1338 AC_MSG_RESULT(${GLIBC_VERSION} family)
1339 AC_DEFINE([GLIBC_MANDATORY_STRLEN_REDIRECT], 1,
1340 [Define to 1 if strlen() has been optimized heavily (amd64 glibc >= 2.10)])
1341 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
1342 DEFAULT_SUPP="glibc-2.X-helgrind.supp ${DEFAULT_SUPP}"
1343 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1346 AC_MSG_RESULT(${GLIBC_VERSION} family)
1347 AC_DEFINE([GLIBC_MANDATORY_STRLEN_REDIRECT], 1,
1348 [Define to 1 if strlen() has been optimized heavily (amd64 glibc >= 2.10)])
1349 AC_DEFINE([GLIBC_MANDATORY_INDEX_AND_STRLEN_REDIRECT], 1,
1350 [Define to 1 if index() and strlen() have been optimized heavily (x86 glibc >= 2.12)])
1351 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
1352 DEFAULT_SUPP="glibc-2.X-helgrind.supp ${DEFAULT_SUPP}"
1353 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1356 AC_MSG_RESULT(Darwin)
1357 AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
1358 # DEFAULT_SUPP set by kernel version check above.
1361 AC_MSG_RESULT(FreeBSD)
1362 AC_DEFINE([FREEBSD_LIBC], 1, [Define to 1 if you're using FreeBSD])
1363 # DEFAULT_SUPP set by kernel version check above.
1366 AC_MSG_RESULT(Bionic)
1367 AC_DEFINE([BIONIC_LIBC], 1, [Define to 1 if you're using Bionic])
1368 DEFAULT_SUPP="$srcdir/bionic.supp ${DEFAULT_SUPP}"
1371 AC_MSG_RESULT(Solaris)
1372 # DEFAULT_SUPP set in host_os switch-case above.
1373 # No other suppression file is used.
1377 AC_DEFINE([MUSL_LIBC], 1, [Define to 1 if you're using Musl libc])
1378 DEFAULT_SUPP="$srcdir/musl.supp ${DEFAULT_SUPP}"
1381 AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
1382 AC_MSG_ERROR([Valgrind requires glibc version 2.2 or later, uClibc,])
1383 AC_MSG_ERROR([musl libc, Darwin libc, Bionic libc or Solaris libc])
1387 AC_SUBST(GLIBC_VERSION)
1388 AC_SUBST(GLIBC_LIBC_PATH)
1389 AC_SUBST(GLIBC_LIBPTHREAD_PATH)
1392 if test "$VGCONF_OS" != "solaris"; then
1393 # Add default suppressions for the X client libraries. Make no
1394 # attempt to detect whether such libraries are installed on the
1395 # build machine (or even if any X facilities are present); just
1396 # add the suppressions antidisirregardless.
1397 DEFAULT_SUPP="$srcdir/xfree-4.supp ${DEFAULT_SUPP}"
1398 DEFAULT_SUPP="$srcdir/xfree-3.supp ${DEFAULT_SUPP}"
1402 #----------------------------------------------------------------------------
1403 # Platform variants?
1404 #----------------------------------------------------------------------------
1406 # Normally the PLAT = (ARCH, OS) characterisation of the platform is enough.
1407 # But there are times where we need a bit more control. The motivating
1408 # and currently only case is Android: this is almost identical to
1409 # {x86,arm,mips}-linux, but not quite. So this introduces the concept of
1410 # platform variant tags, which get passed in the compile as
1411 # -DVGPV_<arch>_<os>_<variant> along with the main -DVGP_<arch>_<os> definition.
1413 # In almost all cases, the <variant> bit is "vanilla". But for Android
1414 # it is "android" instead.
1416 # Consequently (eg), plain arm-linux would build with
1418 # -DVGP_arm_linux -DVGPV_arm_linux_vanilla
1420 # whilst an Android build would have
1422 # -DVGP_arm_linux -DVGPV_arm_linux_android
1424 # Same for x86. The setup of the platform variant is pushed relatively far
1425 # down this file in order that we can inspect any of the variables set above.
1427 # In the normal case ..
1428 VGCONF_PLATVARIANT="vanilla"
1431 if test "$GLIBC_VERSION" = "bionic";
1433 VGCONF_PLATVARIANT="android"
1436 AC_SUBST(VGCONF_PLATVARIANT)
1439 # FIXME: do we also want to define automake variables
1440 # VGCONF_PLATVARIANT_IS_<WHATEVER>, where WHATEVER is (currently)
1441 # VANILLA or ANDROID ? This would be in the style of VGCONF_ARCHS_INCLUDE,
1442 # VGCONF_PLATFORMS_INCLUDE and VGCONF_OS_IS above? Could easily enough
1443 # do that. Problem is that we can't do and-ing in Makefile.am's, but
1444 # that's what we'd need to do to use this, since what we'd want to write
1447 # VGCONF_PLATFORMS_INCLUDE_ARM_LINUX && VGCONF_PLATVARIANT_IS_ANDROID
1449 # Hmm. Can't think of a nice clean solution to this.
1451 AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_VANILLA,
1452 test x$VGCONF_PLATVARIANT = xvanilla)
1453 AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_ANDROID,
1454 test x$VGCONF_PLATVARIANT = xandroid)
1457 #----------------------------------------------------------------------------
1458 # Checking for various library functions and other definitions
1459 #----------------------------------------------------------------------------
1461 # Check for AT_FDCWD
1463 AC_MSG_CHECKING([for AT_FDCWD])
1464 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1471 ac_have_at_fdcwd=yes
1472 AC_MSG_RESULT([yes])
1478 AM_CONDITIONAL([HAVE_AT_FDCWD], [test x$ac_have_at_fdcwd = xyes])
1480 # Check for stpncpy function definition in string.h
1481 # This explicitly checks with _GNU_SOURCE defined since that is also
1482 # used in the test case (some systems might define it without anyway
1483 # since stpncpy is part of The Open Group Base Specifications Issue 7
1484 # IEEE Std 1003.1-2008.
1485 AC_MSG_CHECKING([for stpncpy])
1486 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1493 char *r = stpncpy(d, s, n);
1495 ac_have_gnu_stpncpy=yes
1496 AC_MSG_RESULT([yes])
1498 ac_have_gnu_stpncpy=no
1502 AM_CONDITIONAL([HAVE_GNU_STPNCPY], [test x$ac_have_gnu_stpncpy = xyes])
1504 # Check for PTRACE_GETREGS
1506 AC_MSG_CHECKING([for PTRACE_GETREGS])
1507 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1510 #include <sys/ptrace.h>
1511 #include <sys/user.h>
1514 long res = ptrace (PTRACE_GETREGS, 0, p, p);
1516 AC_MSG_RESULT([yes])
1517 AC_DEFINE([HAVE_PTRACE_GETREGS], 1,
1518 [Define to 1 if you have the `PTRACE_GETREGS' ptrace request.])
1524 # Check for CLOCK_MONOTONIC
1526 AC_MSG_CHECKING([for CLOCK_MONOTONIC])
1528 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1532 clock_gettime(CLOCK_MONOTONIC, &t);
1535 AC_MSG_RESULT([yes])
1536 AC_DEFINE([HAVE_CLOCK_MONOTONIC], 1,
1537 [Define to 1 if you have the `CLOCK_MONOTONIC' constant.])
1543 # Check for ELF32/64_CHDR
1545 AC_CHECK_TYPES([Elf32_Chdr, Elf64_Chdr], [], [], [[#include <elf.h>]])
1548 # Check for PTHREAD_RWLOCK_T
1550 AC_MSG_CHECKING([for pthread_rwlock_t])
1552 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1554 #include <pthread.h>
1556 pthread_rwlock_t rwl;
1558 AC_MSG_RESULT([yes])
1559 AC_DEFINE([HAVE_PTHREAD_RWLOCK_T], 1,
1560 [Define to 1 if you have the `pthread_rwlock_t' type.])
1565 # Check for CLOCKID_T
1567 AC_MSG_CHECKING([for clockid_t])
1569 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1574 AC_MSG_RESULT([yes])
1575 AC_DEFINE([HAVE_CLOCKID_T], 1,
1576 [Define to 1 if you have the `clockid_t' type.])
1581 # Check for PTHREAD_MUTEX_ADAPTIVE_NP
1583 AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP])
1585 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1587 #include <pthread.h>
1589 return (PTHREAD_MUTEX_ADAPTIVE_NP);
1591 AC_MSG_RESULT([yes])
1592 AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1,
1593 [Define to 1 if you have the `PTHREAD_MUTEX_ADAPTIVE_NP' constant.])
1599 # Check for PTHREAD_MUTEX_ERRORCHECK_NP
1601 AC_MSG_CHECKING([for PTHREAD_MUTEX_ERRORCHECK_NP])
1603 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1605 #include <pthread.h>
1607 return (PTHREAD_MUTEX_ERRORCHECK_NP);
1609 AC_MSG_RESULT([yes])
1610 AC_DEFINE([HAVE_PTHREAD_MUTEX_ERRORCHECK_NP], 1,
1611 [Define to 1 if you have the `PTHREAD_MUTEX_ERRORCHECK_NP' constant.])
1617 # Check for PTHREAD_MUTEX_RECURSIVE_NP
1619 AC_MSG_CHECKING([for PTHREAD_MUTEX_RECURSIVE_NP])
1621 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1623 #include <pthread.h>
1625 return (PTHREAD_MUTEX_RECURSIVE_NP);
1627 AC_MSG_RESULT([yes])
1628 AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], 1,
1629 [Define to 1 if you have the `PTHREAD_MUTEX_RECURSIVE_NP' constant.])
1635 # Check for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
1637 AC_MSG_CHECKING([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP])
1639 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1641 #include <pthread.h>
1643 pthread_mutex_t m = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
1646 AC_MSG_RESULT([yes])
1647 AC_DEFINE([HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], 1,
1648 [Define to 1 if you have the `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' constant.])
1654 # Check whether pthread_mutex_t has a member called __m_kind.
1656 AC_CHECK_MEMBER([pthread_mutex_t.__m_kind],
1657 [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__M_KIND],
1659 [Define to 1 if pthread_mutex_t has a member called __m_kind.])
1662 [#include <pthread.h>])
1665 # Check whether pthread_mutex_t has a member called __data.__kind.
1667 AC_CHECK_MEMBER([pthread_mutex_t.__data.__kind],
1668 [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__DATA__KIND],
1670 [Define to 1 if pthread_mutex_t has a member __data.__kind.])
1673 [#include <pthread.h>])
1675 # Convenience function. Set flags based on the existing HWCAP entries.
1676 # The AT_HWCAP entries are generated by glibc, and are based on
1677 # functions supported by the hardware/system/libc.
1678 # Subsequent support for whether the capability will actually be utilized
1679 # will also be checked against the compiler capabilities.
1681 # AC_HWCAP_CONTAINS_FLAG[hwcap_string_to_match],[VARIABLE_TO_SET]
1682 AC_DEFUN([AC_HWCAP_CONTAINS_FLAG],[
1684 AC_MSG_CHECKING([if AT_HWCAP contains the $AUXV_CHECK_FOR indicator])
1685 if env LD_SHOW_AUXV=1 true | grep ^AT_HWCAP | grep -q -w ${AUXV_CHECK_FOR}
1687 AC_MSG_RESULT([yes])
1688 AC_SUBST([$2],[yes])
1695 # gather hardware capabilities. (hardware/kernel/libc)
1696 AC_HWCAP_CONTAINS_FLAG([altivec],[HWCAP_HAS_ALTIVEC])
1697 AC_HWCAP_CONTAINS_FLAG([vsx],[HWCAP_HAS_VSX])
1698 AC_HWCAP_CONTAINS_FLAG([dfp],[HWCAP_HAS_DFP])
1699 AC_HWCAP_CONTAINS_FLAG([arch_2_05],[HWCAP_HAS_ISA_2_05])
1700 AC_HWCAP_CONTAINS_FLAG([arch_2_06],[HWCAP_HAS_ISA_2_06])
1701 AC_HWCAP_CONTAINS_FLAG([arch_2_07],[HWCAP_HAS_ISA_2_07])
1702 AC_HWCAP_CONTAINS_FLAG([arch_3_00],[HWCAP_HAS_ISA_3_00])
1703 AC_HWCAP_CONTAINS_FLAG([arch_3_1],[HWCAP_HAS_ISA_3_1])
1704 AC_HWCAP_CONTAINS_FLAG([htm],[HWCAP_HAS_HTM])
1705 AC_HWCAP_CONTAINS_FLAG([mma],[HWCAP_HAS_MMA])
1708 AM_CONDITIONAL(HAS_ISA_2_05, [test x$HWCAP_HAS_ISA_2_05 = xyes])
1709 AM_CONDITIONAL(HAS_ISA_2_06, [test x$HWCAP_HAS_ISA_2_06 = xyes])
1710 # compiler support for isa 2.07 level instructions
1711 AC_MSG_CHECKING([that assembler knows ISA 2.07 instructions ])
1712 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1714 __asm__ __volatile__("mtvsrd 1,2 ");
1716 ac_asm_have_isa_2_07=yes
1717 AC_MSG_RESULT([yes])
1719 ac_asm_have_isa_2_07=no
1722 AM_CONDITIONAL(HAS_ISA_2_07, [test x$ac_asm_have_isa_2_07 = xyes \
1723 -a x$HWCAP_HAS_ISA_2_07 = xyes])
1725 # altivec (vsx) support.
1726 # does this compiler support -maltivec and does it have the include file
1728 AC_MSG_CHECKING([for Altivec support in the compiler ])
1730 CFLAGS="-maltivec -Werror"
1731 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1732 #include <altivec.h>
1734 vector unsigned int v;
1737 AC_MSG_RESULT([yes])
1743 AM_CONDITIONAL([HAS_ALTIVEC], [test x$ac_have_altivec = xyes \
1744 -a x$HWCAP_HAS_ALTIVEC = xyes])
1746 # Check that both: the compiler supports -mvsx and that the assembler
1747 # understands VSX instructions. If either of those doesn't work,
1748 # conclude that we can't do VSX.
1749 AC_MSG_CHECKING([for VSX compiler flag support])
1751 CFLAGS="-mvsx -Werror"
1752 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1755 ac_compiler_supports_vsx_flag=yes
1756 AC_MSG_RESULT([yes])
1758 ac_compiler_supports_vsx_flag=no
1763 AC_MSG_CHECKING([for VSX support in the assembler ])
1765 CFLAGS="-mvsx -Werror"
1766 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1767 #include <altivec.h>
1769 vector unsigned int v;
1770 __asm__ __volatile__("xsmaddadp 32, 32, 33" ::: "memory","cc");
1772 ac_compiler_supports_vsx=yes
1773 AC_MSG_RESULT([yes])
1775 ac_compiler_supports_vsx=no
1779 AM_CONDITIONAL([HAS_VSX], [test x$ac_compiler_supports_vsx_flag = xyes \
1780 -a x$ac_compiler_supports_vsx = xyes \
1781 -a x$HWCAP_HAS_VSX = xyes ])
1783 # DFP (Decimal Float)
1784 # The initial DFP support was added in Power 6. The dcffix instruction
1785 # support was added in Power 7.
1786 AC_MSG_CHECKING([that assembler knows DFP])
1787 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1790 __asm__ __volatile__("adtr 1, 2, 3")
1792 __asm__ __volatile__(".machine power7;\n" \
1798 AC_MSG_RESULT([yes])
1803 AC_MSG_CHECKING([that compiler knows -mhard-dfp switch])
1805 CFLAGS="-mhard-dfp -Werror"
1807 # The dcffix instruction is Power 7
1808 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1811 __asm__ __volatile__("adtr 1, 2, 3")
1813 __asm__ __volatile__(".machine power7;\n" \
1818 ac_compiler_have_dfp=yes
1819 AC_MSG_RESULT([yes])
1821 ac_compiler_have_dfp=no
1825 AM_CONDITIONAL(HAS_DFP, test x$ac_asm_have_dfp = xyes \
1826 -a x$ac_compiler_have_dfp = xyes \
1827 -a x$HWCAP_HAS_DFP = xyes )
1829 AC_MSG_CHECKING([that compiler knows DFP datatypes])
1830 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1832 _Decimal64 x = 0.0DD;
1834 ac_compiler_have_dfp_type=yes
1835 AC_MSG_RESULT([yes])
1837 ac_compiler_have_dfp_type=no
1840 AM_CONDITIONAL(BUILD_DFP_TESTS, test x$ac_compiler_have_dfp_type = xyes \
1841 -a x$HWCAP_HAS_DFP = xyes )
1844 # HTM (Hardware Transactional Memory)
1845 AC_MSG_CHECKING([if compiler accepts the -mhtm flag])
1847 CFLAGS="-mhtm -Werror"
1848 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1852 AC_MSG_RESULT([yes])
1853 ac_compiler_supports_htm=yes
1856 ac_compiler_supports_htm=no
1860 AC_MSG_CHECKING([if compiler can find the htm builtins])
1862 CFLAGS="-mhtm -Werror"
1863 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1865 if (__builtin_tbegin (0))
1868 AC_MSG_RESULT([yes])
1869 ac_compiler_sees_htm_builtins=yes
1872 ac_compiler_sees_htm_builtins=no
1876 AM_CONDITIONAL(SUPPORTS_HTM, test x$ac_compiler_supports_htm = xyes \
1877 -a x$ac_compiler_sees_htm_builtins = xyes \
1878 -a x$HWCAP_HAS_HTM = xyes )
1880 # isa 3.0 checking. (actually 3.0 or newer)
1881 AC_MSG_CHECKING([that assembler knows ISA 3.00 ])
1883 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1885 __asm__ __volatile__ (".machine power9;\n" \
1888 # guest_ppc_helpers.c needs the HAS_ISA_3_OO to enable copy, paste,
1891 CFLAGS="-DHAS_ISA_3_00"
1892 ac_asm_have_isa_3_00=yes
1893 AC_MSG_RESULT([yes])
1895 ac_asm_have_isa_3_00=no
1901 AC_MSG_CHECKING([that assembler knows xscvhpdp ])
1903 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1905 __asm__ __volatile__ (".machine power9;\n" \
1906 "xscvhpdp 1,2;\n" );
1908 ac_asm_have_xscvhpdp=yes
1909 AC_MSG_RESULT([yes])
1911 ac_asm_have_xscvhpdp=no
1915 # darn instruction checking
1916 AC_MSG_CHECKING([that assembler knows darn instruction ])
1918 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1920 __asm__ __volatile__(".machine power9; darn 1,0 ");
1922 ac_asm_have_darn_inst=yes
1923 AC_MSG_RESULT([yes])
1925 ac_asm_have_darn_inst=no
1930 AC_MSG_CHECKING([that assembler knows ISA 3.1 ])
1931 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1933 __asm__ __volatile__ (".machine power10;\n" \
1936 ac_asm_have_isa_3_1=yes
1937 AC_MSG_RESULT([yes])
1939 ac_asm_have_isa_3_1=no
1944 AM_CONDITIONAL(HAS_ISA_3_00, [test x$ac_asm_have_isa_3_00 = xyes \
1945 -a x$HWCAP_HAS_ISA_3_00 = xyes])
1947 AM_CONDITIONAL(HAS_XSCVHPDP, [test x$ac_asm_have_xscvhpdp = xyes])
1948 AM_CONDITIONAL(HAS_DARN, [test x$ac_asm_have_darn_inst = xyes])
1950 AM_CONDITIONAL(HAS_ISA_3_1, [test x$ac_asm_have_isa_3_1 = xyes \
1951 -a x$HWCAP_HAS_ISA_3_1 = xyes])
1953 # Check for pthread_create@GLIBC2.0
1954 AC_MSG_CHECKING([for pthread_create@GLIBC2.0()])
1957 CFLAGS="-lpthread -Werror"
1958 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1959 extern int pthread_create_glibc_2_0(void*, const void*,
1960 void *(*)(void*), void*);
1961 __asm__(".symver pthread_create_glibc_2_0, pthread_create@GLIBC_2.0");
1965 * Apparently on PowerPC linking this program succeeds and generates an
1966 * executable with the undefined symbol pthread_create@GLIBC_2.0.
1968 #error This test does not work properly on PowerPC.
1970 pthread_create_glibc_2_0(0, 0, 0, 0);
1974 ac_have_pthread_create_glibc_2_0=yes
1975 AC_MSG_RESULT([yes])
1976 AC_DEFINE([HAVE_PTHREAD_CREATE_GLIBC_2_0], 1,
1977 [Define to 1 if you have the `pthread_create@glibc2.0' function.])
1979 ac_have_pthread_create_glibc_2_0=no
1984 AM_CONDITIONAL(HAVE_PTHREAD_CREATE_GLIBC_2_0,
1985 test x$ac_have_pthread_create_glibc_2_0 = xyes)
1988 # Check for dlinfo RTLD_DI_TLS_MODID
1989 AC_MSG_CHECKING([for dlinfo RTLD_DI_TLS_MODID])
1993 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2000 size_t sizes[10000];
2001 size_t modid_offset;
2002 (void) dlinfo ((void*)sizes, RTLD_DI_TLS_MODID, &modid_offset);
2005 ac_have_dlinfo_rtld_di_tls_modid=yes
2006 AC_MSG_RESULT([yes])
2007 AC_DEFINE([HAVE_DLINFO_RTLD_DI_TLS_MODID], 1,
2008 [Define to 1 if you have a dlinfo that can do RTLD_DI_TLS_MODID.])
2010 ac_have_dlinfo_rtld_di_tls_modid=no
2015 AM_CONDITIONAL(HAVE_DLINFO_RTLD_DI_TLS_MODID,
2016 test x$ac_have_dlinfo_rtld_di_tls_modid = xyes)
2019 # Check for eventfd_t, eventfd() and eventfd_read()
2020 AC_MSG_CHECKING([for eventfd()])
2022 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2023 #include <sys/eventfd.h>
2029 eventfd_read(fd, &ev);
2032 AC_MSG_RESULT([yes])
2033 AC_DEFINE([HAVE_EVENTFD], 1,
2034 [Define to 1 if you have the `eventfd' function.])
2035 AC_DEFINE([HAVE_EVENTFD_READ], 1,
2036 [Define to 1 if you have the `eventfd_read' function.])
2041 # Check whether compiler can process #include <thread> without errors
2042 # clang 3.3 cannot process <thread> from e.g.
2043 # gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
2045 AC_MSG_CHECKING([that C++ compiler can compile C++17 code])
2047 safe_CXXFLAGS=$CXXFLAGS
2050 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
2055 AC_MSG_RESULT([yes])
2060 CXXFLAGS=$safe_CXXFLAGS
2063 AM_CONDITIONAL(HAVE_CXX17, test x$ac_have_cxx_17 = xyes)
2065 AC_MSG_CHECKING([that C++ compiler can include <thread> header file])
2067 safe_CXXFLAGS=$CXXFLAGS
2070 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
2074 ac_cxx_can_include_thread_header=yes
2075 AC_MSG_RESULT([yes])
2077 ac_cxx_can_include_thread_header=no
2080 CXXFLAGS=$safe_CXXFLAGS
2083 AM_CONDITIONAL(CXX_CAN_INCLUDE_THREAD_HEADER, test x$ac_cxx_can_include_thread_header = xyes)
2085 # Check whether compiler can process #include <condition_variable> without errors
2087 AC_MSG_CHECKING([that C++ compiler can include <condition_variable> header file])
2089 safe_CXXFLAGS=$CXXFLAGS
2092 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
2093 #include <condition_variable>
2096 ac_cxx_can_include_condition_variable_header=yes
2097 AC_MSG_RESULT([yes])
2099 ac_cxx_can_include_condition_variable_header=no
2102 CXXFLAGS=$safe_CXXFLAGS
2105 AM_CONDITIONAL(CXX_CAN_INCLUDE_CONDITION_VARIABLE_HEADER, test x$ac_cxx_can_include_condition_variable_header = xyes)
2107 # check for std::shared_timed_mutex, this is a C++ 14 feature
2109 AC_MSG_CHECKING([that C++ compiler can use std::shared_timed_mutex])
2111 safe_CXXFLAGS=$CXXFLAGS
2112 CXXFLAGS="-std=c++1y -pthread"
2114 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
2115 #include <shared_mutex>
2116 std::shared_timed_mutex test_mutex;
2119 ac_cxx_can_use_shared_timed_mutex=yes
2120 AC_MSG_RESULT([yes])
2122 ac_cxx_can_use_shared_timed_mutex=no
2125 CXXFLAGS=$safe_CXXFLAGS
2128 AM_CONDITIONAL(CXX_CAN_USE_SHARED_TIMED_MUTEX, test x$ac_cxx_can_use_shared_timed_mutex = xyes)
2130 # check for std::shared_mutex, this is a C++ 11 feature
2132 AC_MSG_CHECKING([that C++ compiler can use std::timed_mutex])
2134 safe_CXXFLAGS=$CXXFLAGS
2135 CXXFLAGS="-std=c++0x -pthread"
2137 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
2139 std::timed_mutex test_mutex;
2142 ac_cxx_can_use_timed_mutex=yes
2143 AC_MSG_RESULT([yes])
2145 ac_cxx_can_use_timed_mutex=no
2148 CXXFLAGS=$safe_CXXFLAGS
2151 AM_CONDITIONAL(CXX_CAN_USE_TIMED_MUTEX, test x$ac_cxx_can_use_timed_mutex = xyes)
2153 # On aarch64 before glibc 2.20 we would get the kernel user_pt_regs instead
2154 # of the user_regs_struct from sys/user.h. They are structurally the same
2155 # but we get either one or the other.
2157 AC_CHECK_TYPE([struct user_regs_struct],
2158 [sys_user_has_user_regs=yes], [sys_user_has_user_regs=no],
2159 [[#include <sys/ptrace.h>]
2160 [#include <sys/time.h>]
2161 [#include <sys/user.h>]])
2162 if test "$sys_user_has_user_regs" = "yes"; then
2163 AC_DEFINE(HAVE_SYS_USER_REGS, 1,
2164 [Define to 1 if <sys/user.h> defines struct user_regs_struct])
2167 AC_MSG_CHECKING([for __NR_membarrier])
2168 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2169 #include <linux/unistd.h>
2171 return __NR_membarrier
2173 ac_have_nr_membarrier=yes
2174 AC_MSG_RESULT([yes])
2176 ac_have_nr_membarrier=no
2180 AM_CONDITIONAL(HAVE_NR_MEMBARRIER, [test x$ac_have_nr_membarrier = xyes])
2182 #----------------------------------------------------------------------------
2183 # Checking for supported compiler flags.
2184 #----------------------------------------------------------------------------
2186 case "${host_cpu}" in
2188 ARCH=$(echo "$CFLAGS" | grep -E -e '-march=@<:@^ @:>@+' -e '\B-mips@<:@^ +@:>@')
2189 if test -z "$ARCH"; then
2190 # does this compiler support -march=mips32 (mips32 default) ?
2191 AC_MSG_CHECKING([if gcc accepts -march=mips32 -mabi=32])
2194 CFLAGS="$CFLAGS -mips32 -mabi=32 -Werror"
2196 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2199 FLAG_M32="-mips32 -mabi=32"
2200 AC_MSG_RESULT([yes])
2210 # does this compiler support -march=mips64r2 (mips64r2 default) ?
2211 AC_MSG_CHECKING([if gcc accepts -march=mips64r2 -mabi=64])
2214 CFLAGS="$CFLAGS -march=mips64r2 -mabi=64 -Werror"
2216 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2219 FLAG_M64="-march=mips64r2 -mabi=64"
2220 AC_MSG_RESULT([yes])
2233 # does this compiler support -m32 ?
2234 AC_MSG_CHECKING([if gcc accepts -m32])
2237 CFLAGS="${FLAG_32ON64} -m32 -Werror"
2239 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2242 FLAG_M32="${FLAG_32ON64} -m32"
2243 AC_MSG_RESULT([yes])
2253 # does this compiler support -m64 ?
2254 AC_MSG_CHECKING([if gcc accepts -m64])
2257 CFLAGS="-m64 -Werror"
2259 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2263 AC_MSG_RESULT([yes])
2275 ARCH=$(echo "$CFLAGS" | grep -E -e '-march=@<:@^ @:>@+' -e '\B-mips@<:@^ +@:>@')
2276 if test -z "$ARCH"; then
2277 # does this compiler support -march=octeon (Cavium OCTEON I Specific) ?
2278 AC_MSG_CHECKING([if gcc accepts -march=octeon])
2281 CFLAGS="$CFLAGS $FLAG_M64 -march=octeon -Werror"
2283 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2286 FLAG_OCTEON="-march=octeon"
2287 AC_MSG_RESULT([yes])
2294 AC_SUBST(FLAG_OCTEON)
2297 # does this compiler support -march=octeon2 (Cavium OCTEON II Specific) ?
2298 AC_MSG_CHECKING([if gcc accepts -march=octeon2])
2301 CFLAGS="$CFLAGS $FLAG_M64 -march=octeon2 -Werror"
2303 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2306 FLAG_OCTEON2="-march=octeon2"
2307 AC_MSG_RESULT([yes])
2314 AC_SUBST(FLAG_OCTEON2)
2318 # does this compiler support -mmsa (MIPS MSA ASE) ?
2319 AC_MSG_CHECKING([if gcc accepts -mmsa])
2322 CFLAGS="$CFLAGS -mmsa -Werror"
2324 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2328 AC_MSG_RESULT([yes])
2337 # Are we compiling for the MIPS64 n32 ABI?
2338 AC_MSG_CHECKING([if gcc is producing mips n32 binaries])
2339 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
2340 #if !defined(_MIPS_SIM) || (defined(_MIPS_SIM) && (_MIPS_SIM != _ABIN32))
2345 FLAG_M64="-march=mips64r2 -mabi=n32"
2346 AC_MSG_RESULT([yes])
2351 # Are we compiling for the MIPS64 n64 ABI?
2352 AC_MSG_CHECKING([if gcc is producing mips n64 binaries])
2353 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
2354 #if !defined(_MIPS_SIM) || (defined(_MIPS_SIM) && (_MIPS_SIM != _ABI64))
2359 AC_MSG_RESULT([yes])
2364 # We enter the code block below in the following case:
2365 # Target architecture is set to mips64, the desired abi
2366 # was not specified and the compiler's default abi setting
2367 # is neither n32 nor n64.
2368 # Probe for and set the abi to either n64 or n32, in that order,
2369 # which is required for a mips64 build of valgrind.
2370 if test "$ARCH_MAX" = "mips64" -a "x$VGCONF_ABI" = "x"; then
2372 CFLAGS="$CFLAGS -mabi=64 -Werror"
2373 AC_MSG_CHECKING([if gcc is n64 capable])
2374 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
2378 AC_MSG_RESULT([yes])
2384 if test "x$VGCONF_ABI" = "x"; then
2386 CFLAGS="$CFLAGS -mabi=n32 -Werror"
2387 AC_MSG_CHECKING([if gcc is n32 capable])
2388 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
2392 FLAG_M64="-march=mips64r2 -mabi=n32"
2393 AC_MSG_RESULT([yes])
2401 AM_CONDITIONAL([VGCONF_HAVE_ABI],
2402 [test x$VGCONF_ABI != x])
2403 AC_SUBST(VGCONF_ABI)
2406 # does this compiler support -mmmx ?
2407 AC_MSG_CHECKING([if gcc accepts -mmmx])
2410 CFLAGS="-mmmx -Werror"
2412 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2416 AC_MSG_RESULT([yes])
2426 # does this compiler support -msse ?
2427 AC_MSG_CHECKING([if gcc accepts -msse])
2430 CFLAGS="-msse -Werror"
2432 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2436 AC_MSG_RESULT([yes])
2446 # does this compiler support -mpreferred-stack-boundary=2 when
2447 # generating code for a 32-bit target? Note that we only care about
2448 # this when generating code for (32-bit) x86, so if the compiler
2449 # doesn't recognise -m32 it's no big deal. We'll just get code for
2450 # the Memcheck and other helper functions, that is a bit slower than
2451 # it could be, on x86; and no difference at all on any other platform.
2452 AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary=2 -m32])
2455 CFLAGS="-mpreferred-stack-boundary=2 -m32 -Werror"
2457 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2460 PREFERRED_STACK_BOUNDARY_2="-mpreferred-stack-boundary=2"
2461 AC_MSG_RESULT([yes])
2463 PREFERRED_STACK_BOUNDARY_2=""
2468 AC_SUBST(PREFERRED_STACK_BOUNDARY_2)
2471 # does this compiler support -mlong-double-128 ?
2472 AC_MSG_CHECKING([if gcc accepts -mlong-double-128])
2474 CFLAGS="-mlong-double-128 -Werror"
2475 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2478 ac_compiler_supports_mlong_double_128=yes
2479 AC_MSG_RESULT([yes])
2481 ac_compiler_supports_mlong_double_128=no
2485 AM_CONDITIONAL(HAS_MLONG_DOUBLE_128, test x$ac_compiler_supports_mlong_double_128 = xyes)
2486 FLAG_MLONG_DOUBLE_128="-mlong-double-128"
2487 AC_SUBST(FLAG_MLONG_DOUBLE_128)
2489 # does this toolchain support lto ?
2490 # Not checked for if --enable-lto=no was given, or if LTO_AR or LTO_RANLIG
2492 # If not enable-lto=* arg is provided, default to no, as lto builds are
2493 # a lot slower, and so not appropriate for Valgrind developments.
2494 # --enable-lto=yes should be used by distro packagers.
2495 AC_CACHE_CHECK([for using the link time optimisation], vg_cv_lto,
2497 [ --enable-lto enables building with link time optimisation],
2498 [vg_cv_lto=$enableval],
2501 if test "x${vg_cv_lto}" != "xno" -a "x${LTO_AR}" != "x" -a "x${LTO_RANLIB}" != "x"; then
2502 AC_MSG_CHECKING([if toolchain accepts lto])
2504 TEST_LTO_CFLAGS="-flto -flto-partition=one -fuse-linker-plugin"
2505 # Note : using 'one' partition is giving a slightly smaller/faster memcheck
2506 # and ld/lto-trans1 still needs a reasonable memory (about 0.5GB) when linking.
2507 CFLAGS="$TEST_LTO_CFLAGS -Werror"
2509 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2510 extern void somefun(void);
2514 LTO_CFLAGS=$TEST_LTO_CFLAGS
2515 AC_MSG_RESULT([yes])
2523 AC_SUBST(LTO_CFLAGS)
2525 # if we could not compile with lto args, or lto was disabled,
2526 # then set LTO_AR/LTO_RANLIB to the non lto values
2527 # define in config.h ENABLE_LTO (not needed by the code currently, but
2528 # this guarantees we recompile everything if we re-configure and rebuild
2529 # in a build dir previously build with another value of --enable-lto
2530 if test "x${LTO_CFLAGS}" = "x"; then
2532 LTO_RANLIB=${RANLIB}
2536 AC_DEFINE([ENABLE_LTO], 1, [configured to build with lto link time optimisation])
2539 # Convenience function to check whether GCC supports a particular
2540 # warning option. Takes two arguments,
2541 # first the warning flag name to check (without -W), then the
2542 # substitution name to set with -Wno-warning-flag if the flag exists,
2543 # or the empty string if the compiler doesn't accept the flag. Note
2544 # that checking is done against the warning flag itself, but the
2545 # substitution is then done to cancel the warning flag.
2546 AC_DEFUN([AC_GCC_WARNING_SUBST_NO],[
2547 AC_MSG_CHECKING([if gcc accepts -W$1])
2549 CFLAGS="-W$1 -Werror"
2550 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [
2551 AC_SUBST([$2], [-Wno-$1])
2552 AC_MSG_RESULT([yes])], [
2554 AC_MSG_RESULT([no])])
2558 # A variation of the above for arguments that
2560 AC_DEFUN([AC_GCC_WARNING_SUBST_NO_VAL],[
2561 AC_MSG_CHECKING([if gcc accepts -W$1=$2])
2563 CFLAGS="-W$1=$2 -Werror"
2564 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [
2565 AC_SUBST([$3], [-Wno-$1])
2566 AC_MSG_RESULT([yes])], [
2568 AC_MSG_RESULT([no])])
2572 # Convenience function. Like AC_GCC_WARNING_SUBST_NO, except it substitutes
2573 # -W$1 (instead of -Wno-$1).
2574 AC_DEFUN([AC_GCC_WARNING_SUBST],[
2575 AC_MSG_CHECKING([if gcc accepts -W$1])
2577 CFLAGS="-W$1 -Werror"
2578 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [
2579 AC_SUBST([$2], [-W$1])
2580 AC_MSG_RESULT([yes])], [
2582 AC_MSG_RESULT([no])])
2586 AC_GCC_WARNING_SUBST_NO([memset-transposed-args], [FLAG_W_NO_MEMSET_TRANSPOSED_ARGS])
2587 AC_GCC_WARNING_SUBST_NO([nonnull], [FLAG_W_NO_NONNULL])
2588 AC_GCC_WARNING_SUBST_NO([overflow], [FLAG_W_NO_OVERFLOW])
2589 AC_GCC_WARNING_SUBST_NO([pointer-sign], [FLAG_W_NO_POINTER_SIGN])
2590 AC_GCC_WARNING_SUBST_NO([uninitialized], [FLAG_W_NO_UNINITIALIZED])
2591 AC_GCC_WARNING_SUBST_NO([maybe-uninitialized], [FLAG_W_NO_MAYBE_UNINITIALIZED])
2592 AC_GCC_WARNING_SUBST_NO([unused-function], [FLAG_W_NO_UNUSED_FUNCTION])
2593 AC_GCC_WARNING_SUBST_NO([static-local-in-inline], [FLAG_W_NO_STATIC_LOCAL_IN_INLINE])
2594 AC_GCC_WARNING_SUBST_NO([mismatched-new-delete], [FLAG_W_NO_MISMATCHED_NEW_DELETE])
2595 AC_GCC_WARNING_SUBST_NO([infinite-recursion], [FLAG_W_NO_INFINITE_RECURSION])
2596 AC_GCC_WARNING_SUBST_NO([expansion-to-defined], [FLAG_W_NO_EXPANSION_TO_DEFINED])
2597 AC_GCC_WARNING_SUBST_NO([unused-variable], [FLAG_W_NO_UNUSED_VARIABLE])
2598 AC_GCC_WARNING_SUBST_NO([unused-but-set-variable], [FLAG_W_NO_UNUSED_BUT_SET_VARIABLE])
2599 AC_GCC_WARNING_SUBST_NO([non-power-of-two-alignment], [FLAG_W_NO_NON_POWER_OF_TWO_ALIGNMENT])
2600 AC_GCC_WARNING_SUBST_NO([sign-compare], [FLAG_W_NO_SIGN_COMPARE])
2601 AC_GCC_WARNING_SUBST_NO([stringop-overflow], [FLAG_W_NO_STRINGOP_OVERFLOW])
2602 AC_GCC_WARNING_SUBST_NO([stringop-overread], [FLAG_W_NO_STRINGOP_OVERREAD])
2603 AC_GCC_WARNING_SUBST_NO([stringop-truncation], [FLAG_W_NO_STRINGOP_TRUNCATION])
2604 AC_GCC_WARNING_SUBST_NO([format-overflow], [FLAG_W_NO_FORMAT_OVERFLOW])
2605 AC_GCC_WARNING_SUBST_NO([use-after-free], [FLAG_W_NO_USE_AFTER_FREE])
2606 AC_GCC_WARNING_SUBST_NO([free-nonheap-object], [FLAG_W_NO_FREE_NONHEAP_OBJECT])
2607 AC_GCC_WARNING_SUBST_NO([fortify-source], [FLAG_W_NO_FORTIFY_SOURCE])
2608 AC_GCC_WARNING_SUBST_NO([builtin-memcpy-chk-size], [FLAG_W_NO_BUILTIN_MEMCPY_CHK_SIZE])
2609 AC_GCC_WARNING_SUBST_NO([incompatible-pointer-types-discards-qualifiers], [FLAG_W_NO_INCOMPATIBLE_POINTER_TYPES_DISCARDS_QUALIFIERS])
2610 AC_GCC_WARNING_SUBST_NO([suspicious-bzero], [FLAG_W_NO_SUSPICIOUS_BZERO])
2611 AC_GCC_WARNING_SUBST_NO([attributes], [FLAG_W_NO_ATTRIBUTES])
2613 AC_GCC_WARNING_SUBST_NO_VAL([alloc-size-larger-than], [1677216], [FLAG_W_NO_ALLOC_SIZE_LARGER_THAN])
2615 AC_GCC_WARNING_SUBST([write-strings], [FLAG_W_WRITE_STRINGS])
2616 AC_GCC_WARNING_SUBST([empty-body], [FLAG_W_EMPTY_BODY])
2617 AC_GCC_WARNING_SUBST([format], [FLAG_W_FORMAT])
2618 AC_GCC_WARNING_SUBST([format-signedness], [FLAG_W_FORMAT_SIGNEDNESS])
2619 AC_GCC_WARNING_SUBST([cast-qual], [FLAG_W_CAST_QUAL])
2620 AC_GCC_WARNING_SUBST([old-style-declaration], [FLAG_W_OLD_STYLE_DECLARATION])
2621 AC_GCC_WARNING_SUBST([ignored-qualifiers], [FLAG_W_IGNORED_QUALIFIERS])
2622 AC_GCC_WARNING_SUBST([missing-parameter-type], [FLAG_W_MISSING_PARAMETER_TYPE])
2623 AC_GCC_WARNING_SUBST([logical-op], [FLAG_W_LOGICAL_OP])
2624 AC_GCC_WARNING_SUBST([enum-conversion], [FLAG_W_ENUM_CONVERSION])
2625 AC_GCC_WARNING_SUBST([implicit-fallthrough=2], [FLAG_W_IMPLICIT_FALLTHROUGH])
2627 # Does this compiler support -Wformat-security ?
2628 # Special handling is needed, because certain GCC versions require -Wformat
2629 # being present if -Wformat-security is given. Otherwise a warning is issued.
2630 # However, AC_GCC_WARNING_SUBST will stick in -Werror (see r15323 for rationale).
2631 # And with that the warning will be turned into an error with the result
2632 # that -Wformat-security is believed to be unsupported when in fact it is.
2633 AC_MSG_CHECKING([if gcc accepts -Wformat-security])
2635 CFLAGS="-Wformat -Wformat-security -Werror"
2636 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [
2637 AC_SUBST([FLAG_W_FORMAT_SECURITY], [-Wformat-security])
2638 AC_MSG_RESULT([yes])], [
2639 AC_SUBST([FLAG_W_FORMAT_SECURITY], [])
2640 AC_MSG_RESULT([no])])
2643 # does this compiler support -Wextra or the older -W ?
2645 AC_MSG_CHECKING([if gcc accepts -Wextra or -W])
2648 CFLAGS="-Wextra -Werror"
2650 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2653 AC_SUBST([FLAG_W_EXTRA], [-Wextra])
2654 AC_MSG_RESULT([-Wextra])
2657 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2660 AC_SUBST([FLAG_W_EXTRA], [-W])
2663 AC_SUBST([FLAG_W_EXTRA], [])
2664 AC_MSG_RESULT([not supported])
2669 # On ARM we do not want to pass -Wcast-align as that produces loads
2670 # of warnings. GCC is just being conservative. See here:
2671 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65459#c4
2672 if test "X$VGCONF_ARCH_PRI" = "Xarm"; then
2673 AC_SUBST([FLAG_W_CAST_ALIGN], [""])
2675 AC_SUBST([FLAG_W_CAST_ALIGN], [-Wcast-align])
2678 # does this compiler support -faligned-new ?
2679 AC_MSG_CHECKING([if g++ accepts -faligned-new])
2681 safe_CXXFLAGS=$CXXFLAGS
2682 CXXFLAGS="-faligned-new -Werror"
2685 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2688 FLAG_FALIGNED_NEW="-faligned-new"
2689 AC_MSG_RESULT([yes])
2691 FLAG_FALIGNED_NEW=""
2694 CXXFLAGS=$safe_CXXFLAGS
2697 AC_SUBST(FLAG_FALIGNED_NEW)
2699 # does this compiler support -fsized-deallocation ?
2700 AC_MSG_CHECKING([if g++ accepts -fsized-deallocation])
2702 safe_CXXFLAGS=$CXXFLAGS
2703 CXXFLAGS="-fsized-deallocation -Werror"
2706 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2709 FLAG_FSIZED_DEALLOCATION="-fsized-deallocation"
2710 ac_have_sized_deallocation=yes
2711 AC_MSG_RESULT([yes])
2713 FLAG_FSIZED_DEALLOCATION=""
2714 ac_have_sized_deallocation=no
2717 CXXFLAGS=$safe_CXXFLAGS
2720 AC_SUBST(FLAG_FSIZED_DEALLOCATION)
2721 AM_CONDITIONAL([HAVE_FSIZED_DEALLOCATION], [test x$ac_have_sized_deallocation = xyes])
2723 # does this compiler support C++17 aligned new/delete?
2724 AC_MSG_CHECKING([if g++ supports aligned new and delete])
2726 safe_CXXFLAGS=$CXXFLAGS
2727 CXXFLAGS="-std=c++17"
2730 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2734 operator delete(nullptr, std::align_val_t(64U));
2736 ac_have_aligned_cxx_alloc=yes
2737 AC_MSG_RESULT([yes])
2739 ac_have_aligned_cxx_alloc=no
2742 CXXFLAGS=$safe_CXXFLAGS
2745 AM_CONDITIONAL([HAVE_ALIGNED_CXX_ALLOC], [test x$ac_have_aligned_cxx_alloc = xyes])
2747 # does this compiler support -fno-stack-protector ?
2748 AC_MSG_CHECKING([if gcc accepts -fno-stack-protector])
2751 CFLAGS="-fno-stack-protector -Werror"
2753 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2756 no_stack_protector=yes
2757 FLAG_FNO_STACK_PROTECTOR="-fno-stack-protector"
2758 AC_MSG_RESULT([yes])
2760 no_stack_protector=no
2761 FLAG_FNO_STACK_PROTECTOR=""
2766 AC_SUBST(FLAG_FNO_STACK_PROTECTOR)
2768 # does this compiler support -finline-functions ?
2769 AC_MSG_CHECKING([if gcc accepts -finline-functions])
2772 CFLAGS="-finline-functions -Werror"
2774 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2777 inline_functions=yes
2778 FLAG_FINLINE_FUNCTIONS="-finline-functions"
2779 AC_MSG_RESULT([yes])
2782 FLAG_FINLINE_FUNCTIONS=""
2787 AC_SUBST(FLAG_FINLINE_FUNCTIONS)
2789 # Does GCC support disabling Identical Code Folding?
2790 # We want to disabled Identical Code Folding for the
2791 # tools preload shared objects to get better backraces.
2792 # For GCC 5.1+ -fipa-icf is enabled by default at -O2.
2793 # "The optimization reduces code size and may disturb
2794 # unwind stacks by replacing a function by equivalent
2795 # one with a different name."
2796 AC_MSG_CHECKING([if gcc accepts -fno-ipa-icf])
2799 CFLAGS="-fno-ipa-icf -Werror"
2801 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2805 FLAG_FNO_IPA_ICF="-fno-ipa-icf"
2806 AC_MSG_RESULT([yes])
2814 AC_SUBST(FLAG_FNO_IPA_ICF)
2817 # Does this compiler support -fsanitize=undefined. This is true for
2818 # GCC 4.9 and newer. However, the undefined behaviour sanitiser in GCC 5.1
2819 # also checks for alignment violations on memory accesses which the valgrind
2820 # code base is sprinkled (if not littered) with. As those alignment issues
2821 # don't pose a problem we want to suppress warnings about them.
2822 # In GCC 5.1 this can be done by passing -fno-sanitize=alignment. Earlier
2823 # GCCs do not support that.
2825 # Only checked for if --enable-ubsan was given.
2826 if test "x${vg_cv_ubsan}" = "xyes"; then
2827 AC_MSG_CHECKING([if gcc accepts -fsanitize=undefined -fno-sanitize=alignment])
2829 CFLAGS="-fsanitize=undefined -fno-sanitize=alignment -Werror"
2830 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2833 FLAG_FSANITIZE="-fsanitize=undefined -fno-sanitize=alignment"
2834 LIB_UBSAN="-static-libubsan"
2835 AC_MSG_RESULT([yes])
2837 CFLAGS="-fsanitize=undefined -Werror"
2838 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2841 FLAG_FSANITIZE="-fsanitize=undefined"
2842 LIB_UBSAN="-static-libubsan"
2843 AC_MSG_RESULT([yes])
2851 AC_SUBST(FLAG_FSANITIZE)
2854 # does this compiler support --param inline-unit-growth=... ?
2856 AC_MSG_CHECKING([if gcc accepts --param inline-unit-growth])
2859 CFLAGS="--param inline-unit-growth=900 -Werror"
2861 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2864 AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH],
2865 ["--param inline-unit-growth=900"])
2866 AC_MSG_RESULT([yes])
2868 AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH], [""])
2874 # does this compiler support -gdwarf-4 -fdebug-types-section ?
2876 AC_MSG_CHECKING([if gcc accepts -gdwarf-4 -fdebug-types-section])
2879 CFLAGS="-gdwarf-4 -fdebug-types-section -Werror"
2881 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2885 AC_MSG_RESULT([yes])
2890 AM_CONDITIONAL(DWARF4, test x$ac_have_dwarf4 = xyes)
2894 # does this compiler support -g -gz=zlib ?
2896 AC_MSG_CHECKING([if gcc accepts -g -gz=zlib])
2899 CFLAGS="-g -gz=zlib"
2901 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2905 AC_MSG_RESULT([yes])
2910 AM_CONDITIONAL(GZ_ZLIB, test x$ac_have_gz_zlib = xyes)
2914 # does this compiler support -g -gz=zlib-gnu ?
2916 AC_MSG_CHECKING([if gcc accepts -g -gz=zlib-gnu])
2919 CFLAGS="-g -gz=zlib-gnu"
2921 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2924 ac_have_gz_zlib_gnu=yes
2925 AC_MSG_RESULT([yes])
2927 ac_have_gz_zlib_gnu=no
2930 AM_CONDITIONAL(GZ_ZLIB_GNU, test x$ac_have_gz_zlib_gnu = xyes)
2934 # does this compiler support nested functions ?
2936 AC_MSG_CHECKING([if gcc accepts nested functions])
2938 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2939 int foo() { return 1; }
2942 ac_have_nested_functions=yes
2943 AC_MSG_RESULT([yes])
2945 ac_have_nested_functions=no
2948 AM_CONDITIONAL([HAVE_NESTED_FUNCTIONS], [test x$ac_have_nested_functions = xyes])
2951 # does this compiler support the 'p' constraint in ASM statements ?
2953 AC_MSG_CHECKING([if gcc accepts the 'p' constraint in asm statements])
2955 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2957 __asm__ __volatile__ ("movdqa (%0),%%xmm6\n" : "=p" (p));
2959 ac_have_asm_constraint_p=yes
2960 AC_MSG_RESULT([yes])
2962 ac_have_asm_constraint_p=no
2965 AM_CONDITIONAL([HAVE_ASM_CONSTRAINT_P], [test x$ac_have_asm_constraint_p = xyes])
2968 # Does this compiler and linker support -pie?
2969 # Some compilers actually do not support -pie and report its usage
2970 # as an error. We need to check if it is safe to use it first.
2972 AC_MSG_CHECKING([if gcc accepts -pie])
2977 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2980 AC_SUBST([FLAG_PIE], ["-pie"])
2981 AC_MSG_RESULT([yes])
2983 AC_SUBST([FLAG_PIE], [""])
2988 AC_MSG_CHECKING([if gcc accepts -ansi])
2993 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2997 AC_MSG_RESULT([yes])
3002 AM_CONDITIONAL([HAVE_ANSI], [test x$ac_have_ansi = xyes])
3007 # Does this compiler support -no-pie?
3008 # On Ubuntu 16.10+, gcc produces position independent executables (PIE) by
3009 # default. However this gets in the way with some tests, we use -no-pie
3012 AC_MSG_CHECKING([if gcc accepts -no-pie])
3015 CFLAGS="-no-pie -Werror"
3017 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
3020 AC_SUBST([FLAG_NO_PIE], ["-no-pie"])
3021 AC_MSG_RESULT([yes])
3023 AC_SUBST([FLAG_NO_PIE], [""])
3029 # We want to use use the -Ttext-segment option to the linker.
3030 # GNU (bfd) ld supports this directly. Newer GNU gold linkers
3031 # support it as an alias of -Ttext. Sadly GNU (bfd) ld's -Ttext
3032 # semantics are NOT what we want (GNU gold -Ttext is fine).
3034 # For GNU (bfd) ld -Ttext-segment chooses the base at which ELF headers
3035 # will reside. -Ttext aligns just the .text section start (but not any
3038 # LLVM ld.lld 10.0 changed the semantics of its -Ttext. See "Breaking changes"
3039 # in https://releases.llvm.org/10.0.0/tools/lld/docs/ReleaseNotes.html
3040 # The --image-base option (since version 6.0?) provides the semantics needed.
3041 # -Ttext-segment generates an error, but -Ttext now more closely
3042 # follows the GNU (bfd) ld's -Ttext.
3044 # So test first for --image-base support, and if that fails then
3045 # for -Ttext-segment which is supported by all bfd ld versions
3046 # and use that if it exists. If it doesn't exist it must be an older
3047 # version of gold and we can fall back to using -Ttext which has the
3051 AC_MSG_CHECKING([if the linker accepts -Wl,--image-base])
3053 CFLAGS="-static -nodefaultlibs -nostartfiles -Wl,--image-base=$valt_load_address_pri_norml -Werror"
3056 [AC_LANG_SOURCE([int _start () { return 0; }])],
3058 linker_using_t_text="no"
3059 AC_SUBST([FLAG_T_TEXT], ["--image-base"])
3060 AC_MSG_RESULT([yes])
3064 AC_MSG_CHECKING([if the linker accepts -Wl,-Ttext-segment])
3066 CFLAGS="-static -nodefaultlibs -nostartfiles -Wl,-Ttext-segment=$valt_load_address_pri_norml -Werror"
3069 [AC_LANG_SOURCE([int _start () { return 0; }])],
3071 linker_using_t_text="no"
3072 AC_SUBST([FLAG_T_TEXT], ["-Ttext-segment"])
3073 AC_MSG_RESULT([yes])
3075 linker_using_t_text="yes"
3076 AC_SUBST([FLAG_T_TEXT], ["-Ttext"])
3083 # If the linker only supports -Ttext (not -Ttext-segment or --image-base) then we will
3084 # have to strip any build-id ELF NOTEs from the statically linked tools.
3085 # Otherwise the build-id NOTE might end up at the default load address.
3086 # (Pedantically if the linker is gold then -Ttext is fine, but newer
3087 # gold versions also support -Ttext-segment. So just assume that unless
3088 # we can use -Ttext-segment we need to strip the build-id NOTEs.
3089 if test "x${linker_using_t_text}" = "xyes"; then
3090 AC_MSG_NOTICE([ld -Ttext used, need to strip build-id NOTEs.])
3091 # does the linker support -Wl,--build-id=none ? Note, it's
3092 # important that we test indirectly via whichever C compiler
3093 # is selected, rather than testing /usr/bin/ld or whatever
3095 AC_MSG_CHECKING([if the linker accepts -Wl,--build-id=none])
3097 CFLAGS="-Wl,--build-id=none -Werror"
3100 [AC_LANG_PROGRAM([ ], [return 0;])],
3102 AC_SUBST([FLAG_NO_BUILD_ID], ["-Wl,--build-id=none"])
3103 AC_MSG_RESULT([yes])
3105 AC_SUBST([FLAG_NO_BUILD_ID], [""])
3109 AC_MSG_NOTICE([ld --image-base or -Ttext-segment used, no need to strip build-id NOTEs.])
3110 AC_SUBST([FLAG_NO_BUILD_ID], [""])
3114 # On s390x, if the linker supports -Wl,--s390-pgste, then we build the
3115 # tools with that flag. This enables running programs that need it, such
3117 if test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX; then
3118 AC_MSG_CHECKING([if the linker accepts -Wl,--s390-pgste])
3120 CFLAGS="-Wl,--s390-pgste"
3123 [AC_LANG_PROGRAM([ ], [return 0;])],
3125 AC_SUBST([FLAG_S390_PGSTE], ["-Wl,--s390-pgste"])
3126 AC_MSG_RESULT([yes])
3128 AC_SUBST([FLAG_S390_PGSTE], [""])
3134 # does the ppc assembler support "mtocrf" et al?
3135 AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf])
3137 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3138 __asm__ __volatile__("mtocrf 4,0");
3139 __asm__ __volatile__("mfocrf 0,4");
3141 ac_have_as_ppc_mftocrf=yes
3142 AC_MSG_RESULT([yes])
3144 ac_have_as_ppc_mftocrf=no
3147 if test x$ac_have_as_ppc_mftocrf = xyes ; then
3148 AC_DEFINE(HAVE_AS_PPC_MFTOCRF, 1, [Define to 1 if as supports mtocrf/mfocrf.])
3152 # does the ppc assembler support "lfdp" and other phased out floating point insns?
3153 AC_MSG_CHECKING([if ppc32/64 asm supports phased out floating point instructions])
3155 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3156 do { typedef struct {
3160 dbl_pair_t dbl_pair[3];
3161 __asm__ volatile ("lfdp 10, %0"::"m" (dbl_pair[0]));
3164 ac_have_as_ppc_fpPO=yes
3165 AC_MSG_RESULT([yes])
3167 ac_have_as_ppc_fpPO=no
3170 if test x$ac_have_as_ppc_fpPO = xyes ; then
3171 AC_DEFINE(HAVE_AS_PPC_FPPO, 1, [Define to 1 if as supports floating point phased out category.])
3175 # does the amd64 assembler understand "fxsave64" and "fxrstor64"?
3176 AC_MSG_CHECKING([if amd64 assembler supports fxsave64/fxrstor64])
3178 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3180 asm __volatile__("fxsave64 (%0)" : : "r" (p) : "memory" );
3181 asm __volatile__("fxrstor64 (%0)" : : "r" (p) : "memory" );
3183 ac_have_as_amd64_fxsave64=yes
3184 AC_MSG_RESULT([yes])
3186 ac_have_as_amd64_fxsave64=no
3189 if test x$ac_have_as_amd64_fxsave64 = xyes ; then
3190 AC_DEFINE(HAVE_AS_AMD64_FXSAVE64, 1, [Define to 1 if as supports fxsave64/fxrstor64.])
3193 # does the x86/amd64 assembler understand SSE3 instructions?
3194 # Note, this doesn't generate a C-level symbol. It generates a
3195 # automake-level symbol (BUILD_SSE3_TESTS), used in test Makefile.am's
3196 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE3])
3198 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3199 do { long long int x;
3200 __asm__ __volatile__("fisttpq (%0)" : :"r"(&x) ); }
3204 AC_MSG_RESULT([yes])
3210 AM_CONDITIONAL(BUILD_SSE3_TESTS, test x$ac_have_as_sse3 = xyes)
3213 # Ditto for SSSE3 instructions (note extra S)
3214 # Note, this doesn't generate a C-level symbol. It generates a
3215 # automake-level symbol (BUILD_SSSE3_TESTS), used in test Makefile.am's
3216 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSSE3])
3218 save_CFLAGS="$CFLAGS"
3219 CFLAGS="$CFLAGS -msse -Werror"
3220 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3221 do { long long int x;
3222 __asm__ __volatile__(
3223 "pabsb (%0),%%xmm7" : : "r"(&x) : "xmm7" ); }
3226 ac_have_as_ssse3=yes
3227 AC_MSG_RESULT([yes])
3232 CFLAGS="$save_CFLAGS"
3234 AM_CONDITIONAL(BUILD_SSSE3_TESTS, test x$ac_have_as_ssse3 = xyes)
3237 # does the x86/amd64 assembler understand the PCLMULQDQ instruction?
3238 # Note, this doesn't generate a C-level symbol. It generates a
3239 # automake-level symbol (BUILD_PCLMULQDQ_TESTS), used in test Makefile.am's
3240 AC_MSG_CHECKING([if x86/amd64 assembler supports 'pclmulqdq'])
3241 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3243 __asm__ __volatile__(
3244 "pclmulqdq \$17,%%xmm6,%%xmm7" : : : "xmm6", "xmm7" ); }
3247 ac_have_as_pclmulqdq=yes
3248 AC_MSG_RESULT([yes])
3250 ac_have_as_pclmulqdq=no
3254 AM_CONDITIONAL(BUILD_PCLMULQDQ_TESTS, test x$ac_have_as_pclmulqdq = xyes)
3257 # does the x86/amd64 assembler understand the VPCLMULQDQ instruction?
3258 # Note, this doesn't generate a C-level symbol. It generates a
3259 # automake-level symbol (BUILD_VPCLMULQDQ_TESTS), used in test Makefile.am's
3260 AC_MSG_CHECKING([if x86/amd64 assembler supports 'vpclmulqdq'])
3261 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3264 * Carry-less multiplication of xmm1 with xmm2 and store the result in
3265 * xmm3. The immediate is used to determine which quadwords of xmm1 and
3266 * xmm2 should be used.
3268 __asm__ __volatile__(
3269 "vpclmulqdq \$0,%%xmm1,%%xmm2,%%xmm3" : : : );
3272 ac_have_as_vpclmulqdq=yes
3273 AC_MSG_RESULT([yes])
3275 ac_have_as_vpclmulqdq=no
3279 AM_CONDITIONAL(BUILD_VPCLMULQDQ_TESTS, test x$ac_have_as_vpclmulqdq = xyes)
3282 # does the x86/amd64 assembler understand FMA4 instructions?
3283 # Note, this doesn't generate a C-level symbol. It generates a
3284 # automake-level symbol (BUILD_AFM4_TESTS), used in test Makefile.am's
3285 AC_MSG_CHECKING([if x86/amd64 assembler supports FMA4 'vfmaddpd'])
3286 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3288 __asm__ __volatile__(
3289 "vfmaddpd %%xmm7,%%xmm8,%%xmm6,%%xmm9" : : : );
3292 ac_have_as_vfmaddpd=yes
3293 AC_MSG_RESULT([yes])
3295 ac_have_as_vfmaddpd=no
3299 AM_CONDITIONAL(BUILD_FMA4_TESTS, test x$ac_have_as_vfmaddpd = xyes)
3302 # does the x86/amd64 assembler understand the LZCNT instruction?
3303 # Note, this doesn't generate a C-level symbol. It generates a
3304 # automake-level symbol (BUILD_LZCNT_TESTS), used in test Makefile.am's
3305 AC_MSG_CHECKING([if x86/amd64 assembler supports 'lzcnt'])
3307 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3309 __asm__ __volatile__("lzcnt %%rax,%%rax" : : : "rax");
3312 ac_have_as_lzcnt=yes
3313 AC_MSG_RESULT([yes])
3319 AM_CONDITIONAL([BUILD_LZCNT_TESTS], [test x$ac_have_as_lzcnt = xyes])
3322 # does the x86/amd64 assembler understand the LOOPNEL instruction?
3323 # Note, this doesn't generate a C-level symbol. It generates a
3324 # automake-level symbol (BUILD_LOOPNEL_TESTS), used in test Makefile.am's
3325 AC_MSG_CHECKING([if x86/amd64 assembler supports 'loopnel'])
3327 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3329 __asm__ __volatile__("1: loopnel 1b\n");
3332 ac_have_as_loopnel=yes
3333 AC_MSG_RESULT([yes])
3335 ac_have_as_loopnel=no
3339 AM_CONDITIONAL([BUILD_LOOPNEL_TESTS], [test x$ac_have_as_loopnel = xyes])
3342 # does the x86/amd64 assembler understand ADDR32 ?
3343 # Note, this doesn't generate a C-level symbol. It generates a
3344 # automake-level symbol (BUILD_ADDR32_TESTS), used in test Makefile.am's
3345 AC_MSG_CHECKING([if x86/amd64 assembler supports 'addr32'])
3347 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3349 asm volatile ("addr32 rep movsb");
3352 ac_have_as_addr32=yes
3353 AC_MSG_RESULT([yes])
3355 ac_have_as_addr32=no
3359 AM_CONDITIONAL([BUILD_ADDR32_TESTS], [test x$ac_have_as_addr32 = xyes])
3362 # does the x86/amd64 assembler understand SSE 4.2 instructions?
3363 # Note, this doesn't generate a C-level symbol. It generates a
3364 # automake-level symbol (BUILD_SSE42_TESTS), used in test Makefile.am's
3365 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE4.2])
3367 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3368 do { long long int x;
3369 __asm__ __volatile__(
3370 "crc32q %%r15,%%r15" : : : "r15" );
3371 __asm__ __volatile__(
3372 "pblendvb (%%rcx), %%xmm11" : : : "memory", "xmm11");
3373 __asm__ __volatile__(
3374 "aesdec %%xmm2, %%xmm1" : : : "xmm2", "xmm1"); }
3377 ac_have_as_sse42=yes
3378 AC_MSG_RESULT([yes])
3384 AM_CONDITIONAL(BUILD_SSE42_TESTS, test x$ac_have_as_sse42 = xyes)
3387 # does the x86/amd64 assembler understand AVX instructions?
3388 # Note, this doesn't generate a C-level symbol. It generates a
3389 # automake-level symbol (BUILD_AVX_TESTS), used in test Makefile.am's
3390 AC_MSG_CHECKING([if x86/amd64 assembler speaks AVX])
3392 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3393 do { long long int x;
3394 __asm__ __volatile__(
3395 "vmovupd (%%rsp), %%ymm7" : : : "xmm7" );
3396 __asm__ __volatile__(
3397 "vaddpd %%ymm6,%%ymm7,%%ymm8" : : : "xmm6","xmm7","xmm8"); }
3401 AC_MSG_RESULT([yes])
3407 AM_CONDITIONAL(BUILD_AVX_TESTS, test x$ac_have_as_avx = xyes)
3410 # does the x86/amd64 assembler understand AVX2 instructions?
3411 # Note, this doesn't generate a C-level symbol. It generates a
3412 # automake-level symbol (BUILD_AVX2_TESTS), used in test Makefile.am's
3413 AC_MSG_CHECKING([if x86/amd64 assembler speaks AVX2])
3415 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3416 do { long long int x;
3417 __asm__ __volatile__(
3418 "vpsravd (%%rsp), %%ymm8, %%ymm7" : : : "xmm7", "xmm8" );
3419 __asm__ __volatile__(
3420 "vpaddb %%ymm6,%%ymm7,%%ymm8" : : : "xmm6","xmm7","xmm8"); }
3424 AC_MSG_RESULT([yes])
3430 AM_CONDITIONAL(BUILD_AVX2_TESTS, test x$ac_have_as_avx2 = xyes)
3433 # does the x86/amd64 assembler understand TSX instructions and
3434 # the XACQUIRE/XRELEASE prefixes?
3435 # Note, this doesn't generate a C-level symbol. It generates a
3436 # automake-level symbol (BUILD_TSX_TESTS), used in test Makefile.am's
3437 AC_MSG_CHECKING([if x86/amd64 assembler speaks TSX])
3439 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3441 __asm__ __volatile__(
3444 " xacquire lock incq 0(%rsp) \n\t"
3445 " xrelease lock incq 0(%rsp) \n"
3450 AC_MSG_RESULT([yes])
3456 AM_CONDITIONAL(BUILD_TSX_TESTS, test x$ac_have_as_tsx = xyes)
3459 # does the x86/amd64 assembler understand BMI1 and BMI2 instructions?
3460 # Note, this doesn't generate a C-level symbol. It generates a
3461 # automake-level symbol (BUILD_BMI_TESTS), used in test Makefile.am's
3462 AC_MSG_CHECKING([if x86/amd64 assembler speaks BMI1 and BMI2])
3464 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3465 do { unsigned int h, l;
3466 __asm__ __volatile__( "mulx %rax,%rcx,%r8" );
3467 __asm__ __volatile__(
3468 "andn %2, %1, %0" : "=r" (h) : "r" (0x1234567), "r" (0x7654321) );
3469 __asm__ __volatile__(
3470 "movl %2, %%edx; mulx %3, %1, %0" : "=r" (h), "=r" (l) : "g" (0x1234567), "rm" (0x7654321) : "edx" ); }
3474 AC_MSG_RESULT([yes])
3480 AM_CONDITIONAL(BUILD_BMI_TESTS, test x$ac_have_as_bmi = xyes)
3483 # does the x86/amd64 assembler understand FMA instructions?
3484 # Note, this doesn't generate a C-level symbol. It generates a
3485 # automake-level symbol (BUILD_FMA_TESTS), used in test Makefile.am's
3486 AC_MSG_CHECKING([if x86/amd64 assembler speaks FMA])
3488 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3489 do { unsigned int h, l;
3490 __asm__ __volatile__(
3491 "vfmadd132ps (%%rsp), %%ymm8, %%ymm7" : : : "xmm7", "xmm8" );
3492 __asm__ __volatile__(
3493 "vfnmsub231sd (%%rsp), %%xmm8, %%xmm7" : : : "xmm7", "xmm8" );
3494 __asm__ __volatile__(
3495 "vfmsubadd213pd (%%rsp), %%xmm8, %%xmm7" : : : "xmm7", "xmm8" ); }
3499 AC_MSG_RESULT([yes])
3505 AM_CONDITIONAL(BUILD_FMA_TESTS, test x$ac_have_as_fma = xyes)
3508 # does the amd64 assembler understand MPX instructions?
3509 # Note, this doesn't generate a C-level symbol. It generates a
3510 # automake-level symbol (BUILD_MPX_TESTS), used in test Makefile.am's
3511 AC_MSG_CHECKING([if amd64 assembler knows the MPX instructions])
3513 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3515 asm ("bndmov %bnd0,(%rsp)");
3516 asm ("bndldx 3(%rbx,%rdx), %bnd2");
3517 asm ("bnd call foo\n"
3524 AC_MSG_RESULT([yes])
3530 AM_CONDITIONAL(BUILD_MPX_TESTS, test x$ac_have_as_mpx = xyes)
3533 # does the amd64 assembler understand ADX instructions?
3534 # Note, this doesn't generate a C-level symbol. It generates a
3535 # automake-level symbol (BUILD_ADX_TESTS), used in test Makefile.am's
3536 AC_MSG_CHECKING([if amd64 assembler knows the ADX instructions])
3538 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3540 asm ("adcxq %r14,%r8");
3544 AC_MSG_RESULT([yes])
3550 AM_CONDITIONAL(BUILD_ADX_TESTS, test x$ac_have_as_adx = xyes)
3553 # does the amd64 assembler understand the RDRAND instruction?
3554 # Note, this doesn't generate a C-level symbol. It generates a
3555 # automake-level symbol (BUILD_RDRAND_TESTS), used in test Makefile.am's
3556 AC_MSG_CHECKING([if amd64 assembler knows the RDRAND instruction])
3558 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3560 asm ("rdrand %r14");
3561 asm ("rdrand %r14d");
3562 asm ("rdrand %r14w");
3565 ac_have_as_rdrand=yes
3566 AC_MSG_RESULT([yes])
3568 ac_have_as_rdrand=no
3572 AM_CONDITIONAL(BUILD_RDRAND_TESTS, test x$ac_have_as_rdrand = xyes)
3574 # does the amd64 assembler understand the RDSEED instruction?
3575 # Note, this doesn't generate a C-level symbol. It generates a
3576 # automake-level symbol (BUILD_RDSEED_TESTS), used in test Makefile.am's
3577 AC_MSG_CHECKING([if amd64 assembler knows the RDSEED instruction])
3579 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3581 asm ("rdseed %r14");
3582 asm ("rdseed %r14d");
3583 asm ("rdseed %r14w");
3586 ac_have_as_rdseed=yes
3587 AC_MSG_RESULT([yes])
3589 ac_have_as_rdseed=no
3593 AM_CONDITIONAL(BUILD_RDSEED_TESTS, test x$ac_have_as_rdseed = xyes)
3595 # does the amd64 assembler understand the F16C instructions (VCVTPH2PS and
3597 # Note, this doesn't generate a C-level symbol. It generates a
3598 # automake-level symbol (BUILD_F16C_TESTS), used in test Makefile.am's
3599 AC_MSG_CHECKING([if amd64 assembler knows the F16C instructions])
3601 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3603 asm ("vcvtph2ps %xmm5, %ymm10");
3604 // If we put the dollar sign and zero together, the shell processing
3605 // this configure.ac script substitutes the command name in. Sigh.
3606 asm ("vcvtps2ph $" "0, %ymm10, %xmm5");
3610 AC_MSG_RESULT([yes])
3616 AM_CONDITIONAL(BUILD_F16C_TESTS, test x$ac_have_as_f16c = xyes)
3619 # does the x86/amd64 assembler understand MOVBE?
3620 # Note, this doesn't generate a C-level symbol. It generates a
3621 # automake-level symbol (BUILD_MOVBE_TESTS), used in test Makefile.am's
3622 AC_MSG_CHECKING([if x86/amd64 assembler knows the MOVBE insn])
3624 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3625 do { long long int x;
3626 __asm__ __volatile__(
3627 "movbe (%%rsp), %%r15" : : : "memory", "r15" ); }
3630 ac_have_as_movbe=yes
3631 AC_MSG_RESULT([yes])
3637 AM_CONDITIONAL(BUILD_MOVBE_TESTS, test x$ac_have_as_movbe = xyes)
3640 # Does the C compiler support the "ifunc" attribute
3641 # Note, this doesn't generate a C-level symbol. It generates a
3642 # automake-level symbol (BUILD_IFUNC_TESTS), used in test Makefile.am's
3643 AC_MSG_CHECKING([if gcc supports the ifunc attribute])
3645 AC_LINK_IFELSE([AC_LANG_SOURCE([[
3646 static void mytest(void) {}
3648 static void (*resolve_test(void))(void)
3650 return (void (*)(void))&mytest;
3653 void test(void) __attribute__((ifunc("resolve_test")));
3661 ac_have_ifunc_attr=yes
3662 AC_MSG_RESULT([yes])
3664 ac_have_ifunc_attr=no
3668 AM_CONDITIONAL(BUILD_IFUNC_TESTS, test x$ac_have_ifunc_attr = xyes)
3670 # Does the C compiler support the armv8 crc feature flag
3671 # Note, this doesn't generate a C-level symbol. It generates a
3672 # automake-level symbol (BUILD_ARMV8_CRC_TESTS), used in test Makefile.am's
3673 AC_MSG_CHECKING([if gcc supports the armv8 crc feature flag])
3675 save_CFLAGS="$CFLAGS"
3676 CFLAGS="$CFLAGS -march=armv8-a+crc -Werror"
3677 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3683 ac_have_armv8_crc_feature=yes
3684 AC_MSG_RESULT([yes])
3686 ac_have_armv8_crc_feature=no
3689 CFLAGS="$save_CFLAGS"
3691 AM_CONDITIONAL(BUILD_ARMV8_CRC_TESTS, test x$ac_have_armv8_crc_feature = xyes)
3694 # Does the C compiler support the armv81 flag and the assembler v8.1 instructions
3695 # Note, this doesn't generate a C-level symbol. It generates a
3696 # automake-level symbol (BUILD_ARMV81_TESTS), used in test Makefile.am's
3697 AC_MSG_CHECKING([if gcc supports the armv81 feature flag and assembler supports v8.1 instructions])
3699 save_CFLAGS="$CFLAGS"
3700 CFLAGS="$CFLAGS -march=armv8.1-a -Werror"
3701 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3704 __asm__ __volatile__("ldadd x0, x1, [x2]" ::: "memory");
3708 ac_have_armv81_feature=yes
3709 AC_MSG_RESULT([yes])
3711 ac_have_armv81_feature=no
3714 CFLAGS="$save_CFLAGS"
3716 AM_CONDITIONAL(BUILD_ARMV81_TESTS, test x$ac_have_armv81_feature = xyes)
3719 # Does the C compiler support the armv82 flag and the assembler v8.2 instructions
3720 # Note, this doesn't generate a C-level symbol. It generates a
3721 # automake-level symbol (BUILD_ARMV82_TESTS), used in test Makefile.am's
3722 AC_MSG_CHECKING([if gcc supports the armv82 feature flag and assembler supports v8.2 instructions])
3724 save_CFLAGS="$CFLAGS"
3725 CFLAGS="$CFLAGS -march=armv8.2-a+fp16 -Werror"
3726 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3729 __asm__ __volatile__("faddp h0, v1.2h");
3733 ac_have_armv82_feature=yes
3734 AC_MSG_RESULT([yes])
3736 ac_have_armv82_feature=no
3739 CFLAGS="$save_CFLAGS"
3741 AM_CONDITIONAL(BUILD_ARMV82_TESTS, test x$ac_have_armv82_feature = xyes)
3744 # XXX JRS 2010 Oct 13: what is this for? For sure, we don't need this
3745 # when building the tool executables. I think we should get rid of it.
3747 # Check for TLS support in the compiler and linker
3748 AC_LINK_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
3750 [vg_cv_linktime_tls=yes],
3751 [vg_cv_linktime_tls=no])
3752 # Native compilation: check whether running a program using TLS succeeds.
3753 # Linking only is not sufficient -- e.g. on Red Hat 7.3 linking TLS programs
3754 # succeeds but running programs using TLS fails.
3755 # Cross-compiling: check whether linking a program using TLS succeeds.
3756 AC_CACHE_CHECK([for TLS support], vg_cv_tls,
3757 [AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS],
3758 [vg_cv_tls=$enableval],
3759 [AC_RUN_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
3763 [vg_cv_tls=$vg_cv_linktime_tls])])])
3765 if test "$vg_cv_tls" = yes -a $is_clang != applellvm; then
3766 AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variables])
3770 #----------------------------------------------------------------------------
3771 # Solaris-specific checks.
3772 #----------------------------------------------------------------------------
3774 if test "$VGCONF_OS" = "solaris" ; then
3775 AC_CHECK_HEADERS([sys/lgrp_user_impl.h])
3777 # Solaris-specific check determining if the Sun Studio Assembler is used to
3778 # build Valgrind. The test checks if the x86/amd64 assembler understands the
3779 # cmovl.l instruction, if yes then it's Sun Assembler.
3781 # C-level symbol: none
3782 # Automake-level symbol: SOLARIS_SUN_STUDIO_AS
3784 AC_MSG_CHECKING([if x86/amd64 assembler speaks cmovl.l (Solaris-specific)])
3785 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3787 __asm__ __volatile__("cmovl.l %edx, %eax");
3789 solaris_have_sun_studio_as=yes
3790 AC_MSG_RESULT([yes])
3792 solaris_have_sun_studio_as=no
3795 AM_CONDITIONAL(SOLARIS_SUN_STUDIO_AS, test x$solaris_have_sun_studio_as = xyes)
3797 # Solaris-specific check determining if symbols __xpg4 and __xpg6
3798 # are present in linked shared libraries when gcc is invoked with -std=gnu99.
3799 # See solaris/vgpreload-solaris.mapfile for details.
3800 # gcc on older Solaris instructs linker to include these symbols,
3801 # gcc on illumos and newer Solaris does not.
3803 # C-level symbol: none
3804 # Automake-level symbol: SOLARIS_XPG_SYMBOLS_PRESENT
3806 save_CFLAGS="$CFLAGS"
3807 CFLAGS="$CFLAGS -std=gnu99"
3808 AC_MSG_CHECKING([if xpg symbols are present with -std=gnu99 (Solaris-specific)])
3809 temp_dir=$( /usr/bin/mktemp -d )
3810 cat <<_ACEOF >${temp_dir}/mylib.c
3812 int myfunc(void) { printf("LaPutyka\n"); }
3814 ${CC} ${CFLAGS} -fpic -shared -o ${temp_dir}/mylib.so ${temp_dir}/mylib.c
3815 xpg_present=$( /usr/bin/nm ${temp_dir}/mylib.so | ${EGREP} '(__xpg4|__xpg6)' )
3816 if test "x${xpg_present}" = "x" ; then
3817 solaris_xpg_symbols_present=no
3820 solaris_xpg_symbols_present=yes
3821 AC_MSG_RESULT([yes])
3824 AM_CONDITIONAL(SOLARIS_XPG_SYMBOLS_PRESENT, test x$solaris_xpg_symbols_present = xyes)
3825 CFLAGS="$save_CFLAGS"
3828 # Solaris-specific check determining if gcc enables largefile support by
3829 # default for 32-bit executables. If it does, then set SOLARIS_UNDEF_LARGESOURCE
3830 # variable with gcc flags which disable it.
3832 AC_MSG_CHECKING([if gcc enables largefile support for 32-bit apps (Solaris-specific)])
3833 save_CFLAGS="$CFLAGS"
3834 CFLAGS="$CFLAGS -m32"
3835 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3836 return _LARGEFILE_SOURCE;
3838 SOLARIS_UNDEF_LARGESOURCE="-U_LARGEFILE_SOURCE -U_LARGEFILE64_SOURCE -U_FILE_OFFSET_BITS"
3839 AC_MSG_RESULT([yes])
3841 SOLARIS_UNDEF_LARGESOURCE=""
3845 AC_SUBST(SOLARIS_UNDEF_LARGESOURCE)
3848 # Solaris-specific check determining if /proc/self/cmdline
3849 # or /proc/<pid>/cmdline is supported.
3851 # C-level symbol: SOLARIS_PROC_CMDLINE
3852 # Automake-level symbol: SOLARIS_PROC_CMDLINE
3854 AC_CHECK_FILE([/proc/self/cmdline],
3856 solaris_proc_cmdline=yes
3857 AC_DEFINE([SOLARIS_PROC_CMDLINE], 1,
3858 [Define to 1 if you have /proc/self/cmdline.])
3860 solaris_proc_cmdline=no
3862 AM_CONDITIONAL(SOLARIS_PROC_CMDLINE, test x$solaris_proc_cmdline = xyes)
3865 # Solaris-specific check determining default platform for the Valgrind launcher.
3866 # Used in case the launcher cannot select platform by looking at the client
3867 # image (for example because the executable is a shell script).
3869 # C-level symbol: SOLARIS_LAUNCHER_DEFAULT_PLATFORM
3870 # Automake-level symbol: none
3872 AC_MSG_CHECKING([for default platform of Valgrind launcher (Solaris-specific)])
3873 # Get the ELF class of /bin/sh first.
3874 if ! test -f /bin/sh; then
3875 AC_MSG_ERROR([Shell interpreter `/bin/sh' not found.])
3877 elf_class=$( /usr/bin/file /bin/sh | sed -n 's/.*ELF \(..\)-bit.*/\1/p' )
3878 case "$elf_class" in
3880 default_arch="$VGCONF_ARCH_PRI";
3883 if test "x$VGCONF_ARCH_SEC" != "x"; then
3884 default_arch="$VGCONF_ARCH_SEC"
3886 default_arch="$VGCONF_ARCH_PRI";
3890 AC_MSG_ERROR([Cannot determine ELF class of `/bin/sh'.])
3893 default_platform="$default_arch-$VGCONF_OS"
3894 AC_MSG_RESULT([$default_platform])
3895 AC_DEFINE_UNQUOTED([SOLARIS_LAUNCHER_DEFAULT_PLATFORM], ["$default_platform"],
3896 [Default platform for Valgrind launcher.])
3899 # Solaris-specific check determining if the old syscalls are available.
3901 # C-level symbol: SOLARIS_OLD_SYSCALLS
3902 # Automake-level symbol: SOLARIS_OLD_SYSCALLS
3904 AC_MSG_CHECKING([for the old Solaris syscalls (Solaris-specific)])
3905 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3906 #include <sys/syscall.h>
3910 solaris_old_syscalls=yes
3911 AC_MSG_RESULT([yes])
3912 AC_DEFINE([SOLARIS_OLD_SYSCALLS], 1,
3913 [Define to 1 if you have the old Solaris syscalls.])
3915 solaris_old_syscalls=no
3918 AM_CONDITIONAL(SOLARIS_OLD_SYSCALLS, test x$solaris_old_syscalls = xyes)
3921 # Solaris-specific check determining if the new accept() syscall is available.
3924 # int accept(int sock, struct sockaddr *name, socklen_t *namelenp,
3927 # New syscall (available on illumos):
3928 # int accept(int sock, struct sockaddr *name, socklen_t *namelenp,
3929 # int version, int flags);
3931 # If the old syscall is present then the following syscall will fail with
3932 # ENOTSOCK (because file descriptor 0 is not a socket), if the new syscall is
3933 # available then it will fail with EINVAL (because the flags parameter is
3936 # C-level symbol: SOLARIS_NEW_ACCEPT_SYSCALL
3937 # Automake-level symbol: none
3939 AC_MSG_CHECKING([for the new `accept' syscall (Solaris-specific)])
3940 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
3941 #include <sys/syscall.h>
3945 syscall(SYS_accept, 0, 0, 0, 0, -1);
3946 return !(errno == EINVAL);
3948 AC_MSG_RESULT([yes])
3949 AC_DEFINE([SOLARIS_NEW_ACCEPT_SYSCALL], 1,
3950 [Define to 1 if you have the new `accept' syscall.])
3956 # Solaris-specific check determining if the new illumos pipe() syscall is
3960 # longlong_t pipe();
3962 # New syscall (available on illumos):
3963 # int pipe(intptr_t arg, int flags);
3965 # If the old syscall is present then the following call will succeed, if the
3966 # new syscall is available then it will fail with EFAULT (because address 0
3967 # cannot be accessed).
3969 # C-level symbol: SOLARIS_NEW_PIPE_SYSCALL
3970 # Automake-level symbol: none
3972 AC_MSG_CHECKING([for the new `pipe' syscall (Solaris-specific)])
3973 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
3974 #include <sys/syscall.h>
3978 syscall(SYS_pipe, 0, 0);
3979 return !(errno == EFAULT);
3981 AC_MSG_RESULT([yes])
3982 AC_DEFINE([SOLARIS_NEW_PIPE_SYSCALL], 1,
3983 [Define to 1 if you have the new `pipe' syscall.])
3989 # Solaris-specific check determining if the new lwp_sigqueue() syscall is
3993 # int lwp_kill(id_t lwpid, int sig);
3995 # New syscall (available on Solaris 11):
3996 # int lwp_sigqueue(id_t lwpid, int sig, void *value,
3997 # int si_code, timespec_t *timeout);
3999 # C-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL
4000 # Automake-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL
4002 AC_MSG_CHECKING([for the new `lwp_sigqueue' syscall (Solaris-specific)])
4003 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4004 #include <sys/syscall.h>
4006 return !SYS_lwp_sigqueue;
4008 solaris_lwp_sigqueue_syscall=yes
4009 AC_MSG_RESULT([yes])
4010 AC_DEFINE([SOLARIS_LWP_SIGQUEUE_SYSCALL], 1,
4011 [Define to 1 if you have the new `lwp_sigqueue' syscall.])
4013 solaris_lwp_sigqueue_syscall=no
4016 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL, test x$solaris_lwp_sigqueue_syscall = xyes)
4019 # Solaris-specific check determining if the lwp_sigqueue() syscall
4020 # takes both pid and thread id arguments or just thread id.
4022 # Old syscall (available up to Solaris 11.3):
4023 # int lwp_sigqueue(id_t lwpid, int sig, void *value,
4024 # int si_code, timespec_t *timeout);
4026 # New syscall (available since Solaris 11.4):
4027 # int lwp_sigqueue(pid_t pid, id_t lwpid, int sig, void *value,
4028 # int si_code, timespec_t *timeout);
4030 # If the old syscall is present then the following syscall will fail with
4031 # EINVAL (because signal is out of range); if the new syscall is available
4032 # then it will fail with ESRCH (because it would not find such thread in the
4035 # C-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID
4036 # Automake-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID
4038 AM_COND_IF(SOLARIS_LWP_SIGQUEUE_SYSCALL,
4039 AC_MSG_CHECKING([if the `lwp_sigqueue' syscall accepts pid (Solaris-specific)])
4040 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
4041 #include <sys/syscall.h>
4045 syscall(SYS_lwp_sigqueue, 0, 101, 0, 0, 0, 0);
4046 return !(errno == ESRCH);
4048 solaris_lwp_sigqueue_syscall_takes_pid=yes
4049 AC_MSG_RESULT([yes])
4050 AC_DEFINE([SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID], 1,
4051 [Define to 1 if you have the new `lwp_sigqueue' syscall which accepts pid.])
4053 solaris_lwp_sigqueue_syscall_takes_pid=no
4056 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID,
4057 test x$solaris_lwp_sigqueue_syscall_takes_pid = xyes)
4059 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID, test x = y)
4063 # Solaris-specific check determining if the new lwp_name() syscall is
4066 # New syscall (available on Solaris 11):
4067 # int lwp_name(int opcode, id_t lwpid, char *name, size_t len);
4069 # C-level symbol: SOLARIS_LWP_NAME_SYSCALL
4070 # Automake-level symbol: SOLARIS_LWP_NAME_SYSCALL
4072 AC_MSG_CHECKING([for the new `lwp_name' syscall (Solaris-specific)])
4073 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4074 #include <sys/syscall.h>
4076 return !SYS_lwp_name;
4078 solaris_lwp_name_syscall=yes
4079 AC_MSG_RESULT([yes])
4080 AC_DEFINE([SOLARIS_LWP_NAME_SYSCALL], 1,
4081 [Define to 1 if you have the new `lwp_name' syscall.])
4083 solaris_lwp_name_syscall=no
4086 AM_CONDITIONAL(SOLARIS_LWP_NAME_SYSCALL, test x$solaris_lwp_name_syscall = xyes)
4089 # Solaris-specific check determining if the new getrandom() syscall is
4092 # New syscall (available on Solaris 11):
4093 # int getrandom(void *buf, size_t buflen, uint_t flags);
4095 # C-level symbol: SOLARIS_GETRANDOM_SYSCALL
4096 # Automake-level symbol: SOLARIS_GETRANDOM_SYSCALL
4098 AC_MSG_CHECKING([for the new `getrandom' syscall (Solaris-specific)])
4099 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4100 #include <sys/syscall.h>
4102 return !SYS_getrandom;
4104 solaris_getrandom_syscall=yes
4105 AC_MSG_RESULT([yes])
4106 AC_DEFINE([SOLARIS_GETRANDOM_SYSCALL], 1,
4107 [Define to 1 if you have the new `getrandom' syscall.])
4109 solaris_getrandom_syscall=no
4112 AM_CONDITIONAL(SOLARIS_GETRANDOM_SYSCALL, test x$solaris_getrandom_syscall = xyes)
4115 # Solaris-specific check determining if the new zone() syscall subcodes
4116 # ZONE_LIST_DEFUNCT and ZONE_GETATTR_DEFUNCT are available. These subcodes
4117 # were added in Solaris 11 but are missing on illumos.
4119 # C-level symbol: SOLARIS_ZONE_DEFUNCT
4120 # Automake-level symbol: SOLARIS_ZONE_DEFUNCT
4122 AC_MSG_CHECKING([for ZONE_LIST_DEFUNCT and ZONE_GETATTR_DEFUNCT (Solaris-specific)])
4123 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4124 #include <sys/zone.h>
4126 return !(ZONE_LIST_DEFUNCT && ZONE_GETATTR_DEFUNCT);
4128 solaris_zone_defunct=yes
4129 AC_MSG_RESULT([yes])
4130 AC_DEFINE([SOLARIS_ZONE_DEFUNCT], 1,
4131 [Define to 1 if you have the `ZONE_LIST_DEFUNCT' and `ZONE_GETATTR_DEFUNC' constants.])
4133 solaris_zone_defunct=no
4136 AM_CONDITIONAL(SOLARIS_ZONE_DEFUNCT, test x$solaris_zone_defunct = xyes)
4139 # Solaris-specific check determining if commands A_GETSTAT and A_SETSTAT
4140 # for auditon(2) subcode of the auditsys() syscall are available.
4141 # These commands are available in Solaris 11 and illumos but were removed
4144 # C-level symbol: SOLARIS_AUDITON_STAT
4145 # Automake-level symbol: SOLARIS_AUDITON_STAT
4147 AC_MSG_CHECKING([for A_GETSTAT and A_SETSTAT auditon(2) commands (Solaris-specific)])
4148 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4149 #include <bsm/audit.h>
4151 return !(A_GETSTAT && A_SETSTAT);
4153 solaris_auditon_stat=yes
4154 AC_MSG_RESULT([yes])
4155 AC_DEFINE([SOLARIS_AUDITON_STAT], 1,
4156 [Define to 1 if you have the `A_GETSTAT' and `A_SETSTAT' constants.])
4158 solaris_auditon_stat=no
4161 AM_CONDITIONAL(SOLARIS_AUDITON_STAT, test x$solaris_auditon_stat = xyes)
4164 # Solaris-specific check determining if the new shmsys() syscall subcodes
4165 # IPC_XSTAT64, SHMADV, SHM_ADV_GET, SHM_ADV_SET and SHMGET_OSM are available.
4166 # These subcodes were added in Solaris 11 but are missing on illumos.
4168 # C-level symbol: SOLARIS_SHM_NEW
4169 # Automake-level symbol: SOLARIS_SHM_NEW
4171 AC_MSG_CHECKING([for SHMADV, SHM_ADV_GET, SHM_ADV_SET and SHMGET_OSM (Solaris-specific)])
4172 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4173 #include <sys/ipc_impl.h>
4174 #include <sys/shm.h>
4175 #include <sys/shm_impl.h>
4177 return !(IPC_XSTAT64 && SHMADV && SHM_ADV_GET && SHM_ADV_SET && SHMGET_OSM);
4180 AC_MSG_RESULT([yes])
4181 AC_DEFINE([SOLARIS_SHM_NEW], 1,
4182 [Define to 1 if you have the `IPC_XSTAT64', `SHMADV', `SHM_ADV_GET', `SHM_ADV_SET' and `SHMGET_OSM' constants.])
4187 AM_CONDITIONAL(SOLARIS_SHM_NEW, test x$solaris_shm_new = xyes)
4190 # Solaris-specific check determining if prxregset_t is available. Illumos
4191 # currently does not define it on the x86 platform.
4193 # C-level symbol: SOLARIS_PRXREGSET_T
4194 # Automake-level symbol: SOLARIS_PRXREGSET_T
4196 AC_MSG_CHECKING([for the `prxregset_t' type (Solaris-specific)])
4197 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4198 #include <sys/procfs_isa.h>
4200 return !sizeof(prxregset_t);
4202 solaris_prxregset_t=yes
4203 AC_MSG_RESULT([yes])
4204 AC_DEFINE([SOLARIS_PRXREGSET_T], 1,
4205 [Define to 1 if you have the `prxregset_t' type.])
4207 solaris_prxregset_t=no
4210 AM_CONDITIONAL(SOLARIS_PRXREGSET_T, test x$solaris_prxregset_t = xyes)
4213 # Solaris-specific check determining if the new frealpathat() syscall is
4216 # New syscall (available on Solaris 11.1):
4217 # int frealpathat(int fd, char *path, char *buf, size_t buflen);
4219 # C-level symbol: SOLARIS_FREALPATHAT_SYSCALL
4220 # Automake-level symbol: SOLARIS_FREALPATHAT_SYSCALL
4222 AC_MSG_CHECKING([for the new `frealpathat' syscall (Solaris-specific)])
4223 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4224 #include <sys/syscall.h>
4226 return !SYS_frealpathat;
4228 solaris_frealpathat_syscall=yes
4229 AC_MSG_RESULT([yes])
4230 AC_DEFINE([SOLARIS_FREALPATHAT_SYSCALL], 1,
4231 [Define to 1 if you have the new `frealpathat' syscall.])
4233 solaris_frealpathat_syscall=no
4236 AM_CONDITIONAL(SOLARIS_FREALPATHAT_SYSCALL, test x$solaris_frealpathat_syscall = xyes)
4239 # Solaris-specific check determining if the new uuidsys() syscall is
4242 # New syscall (available on newer Solaris):
4243 # int uuidsys(struct uuid *uuid);
4245 # C-level symbol: SOLARIS_UUIDSYS_SYSCALL
4246 # Automake-level symbol: SOLARIS_UUIDSYS_SYSCALL
4248 AC_MSG_CHECKING([for the new `uuidsys' syscall (Solaris-specific)])
4249 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4250 #include <sys/syscall.h>
4252 return !SYS_uuidsys;
4254 solaris_uuidsys_syscall=yes
4255 AC_MSG_RESULT([yes])
4256 AC_DEFINE([SOLARIS_UUIDSYS_SYSCALL], 1,
4257 [Define to 1 if you have the new `uuidsys' syscall.])
4259 solaris_uuidsys_syscall=no
4262 AM_CONDITIONAL(SOLARIS_UUIDSYS_SYSCALL, test x$solaris_uuidsys_syscall = xyes)
4265 # Solaris-specific check determining if the new labelsys() syscall subcode
4266 # TNDB_GET_TNIP is available. This subcode was added in Solaris 11 but is
4267 # missing on illumos.
4269 # C-level symbol: SOLARIS_TNDB_GET_TNIP
4270 # Automake-level symbol: SOLARIS_TNDB_GET_TNIP
4272 AC_MSG_CHECKING([for TNDB_GET_TNIP (Solaris-specific)])
4273 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4274 #include <sys/tsol/tndb.h>
4276 return !TNDB_GET_TNIP;
4278 solaris_tndb_get_tnip=yes
4279 AC_MSG_RESULT([yes])
4280 AC_DEFINE([SOLARIS_TNDB_GET_TNIP], 1,
4281 [Define to 1 if you have the `TNDB_GET_TNIP' constant.])
4283 solaris_tndb_get_tnip=no
4286 AM_CONDITIONAL(SOLARIS_TNDB_GET_TNIP, test x$solaris_tndb_get_tnip = xyes)
4289 # Solaris-specific check determining if the new labelsys() syscall opcodes
4290 # TSOL_GETCLEARANCE and TSOL_SETCLEARANCE are available. These opcodes were
4291 # added in Solaris 11 but are missing on illumos.
4293 # C-level symbol: SOLARIS_TSOL_CLEARANCE
4294 # Automake-level symbol: SOLARIS_TSOL_CLEARANCE
4296 AC_MSG_CHECKING([for TSOL_GETCLEARANCE and TSOL_SETCLEARANCE (Solaris-specific)])
4297 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4298 #include <sys/tsol/tsyscall.h>
4300 return !(TSOL_GETCLEARANCE && TSOL_SETCLEARANCE);
4302 solaris_tsol_clearance=yes
4303 AC_MSG_RESULT([yes])
4304 AC_DEFINE([SOLARIS_TSOL_CLEARANCE], 1,
4305 [Define to 1 if you have the `TSOL_GETCLEARANCE' and `TSOL_SETCLEARANCE' constants.])
4307 solaris_tsol_clearance=no
4310 AM_CONDITIONAL(SOLARIS_TSOL_CLEARANCE, test x$solaris_tsol_clearance = xyes)
4313 # Solaris-specific check determining if the new pset() syscall subcode
4314 # PSET_GET_NAME is available. This subcode was added in Solaris 11.4 but
4315 # is missing on illumos and Solaris 11.3.
4317 # C-level symbol: SOLARIS_PSET_GET_NAME
4318 # Automake-level symbol: SOLARIS_PSET_GET_NAME
4320 AC_MSG_CHECKING([for PSET_GET_NAME (Solaris-specific)])
4321 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4322 #include <sys/pset.h>
4324 return !(PSET_GET_NAME);
4326 solaris_pset_get_name=yes
4327 AC_MSG_RESULT([yes])
4328 AC_DEFINE([SOLARIS_PSET_GET_NAME], 1,
4329 [Define to 1 if you have the `PSET_GET_NAME' constants.])
4331 solaris_pset_get_name=no
4334 AM_CONDITIONAL(SOLARIS_PSET_GET_NAME, test x$solaris_pset_get_name = xyes)
4337 # Solaris-specific check determining if the utimesys() syscall is
4338 # available (on illumos and older Solaris).
4340 # C-level symbol: SOLARIS_UTIMESYS_SYSCALL
4341 # Automake-level symbol: SOLARIS_UTIMESYS_SYSCALL
4343 AC_MSG_CHECKING([for the `utimesys' syscall (Solaris-specific)])
4344 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4345 #include <sys/syscall.h>
4347 return !SYS_utimesys;
4349 solaris_utimesys_syscall=yes
4350 AC_MSG_RESULT([yes])
4351 AC_DEFINE([SOLARIS_UTIMESYS_SYSCALL], 1,
4352 [Define to 1 if you have the `utimesys' syscall.])
4354 solaris_utimesys_syscall=no
4357 AM_CONDITIONAL(SOLARIS_UTIMESYS_SYSCALL, test x$solaris_utimesys_syscall = xyes)
4360 # Solaris-specific check determining if the utimensat() syscall is
4361 # available (on newer Solaris).
4363 # C-level symbol: SOLARIS_UTIMENSAT_SYSCALL
4364 # Automake-level symbol: SOLARIS_UTIMENSAT_SYSCALL
4366 AC_MSG_CHECKING([for the `utimensat' syscall (Solaris-specific)])
4367 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4368 #include <sys/syscall.h>
4370 return !SYS_utimensat;
4372 solaris_utimensat_syscall=yes
4373 AC_MSG_RESULT([yes])
4374 AC_DEFINE([SOLARIS_UTIMENSAT_SYSCALL], 1,
4375 [Define to 1 if you have the `utimensat' syscall.])
4377 solaris_utimensat_syscall=no
4380 AM_CONDITIONAL(SOLARIS_UTIMENSAT_SYSCALL, test x$solaris_utimensat_syscall = xyes)
4383 # Solaris-specific check determining if the spawn() syscall is available
4384 # (on newer Solaris).
4386 # C-level symbol: SOLARIS_SPAWN_SYSCALL
4387 # Automake-level symbol: SOLARIS_SPAWN_SYSCALL
4389 AC_MSG_CHECKING([for the `spawn' syscall (Solaris-specific)])
4390 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4391 #include <sys/syscall.h>
4395 solaris_spawn_syscall=yes
4396 AC_MSG_RESULT([yes])
4397 AC_DEFINE([SOLARIS_SPAWN_SYSCALL], 1,
4398 [Define to 1 if you have the `spawn' syscall.])
4400 solaris_spawn_syscall=no
4403 AM_CONDITIONAL(SOLARIS_SPAWN_SYSCALL, test x$solaris_spawn_syscall = xyes)
4406 # Solaris-specific check determining if commands MODNVL_CTRLMAP through
4407 # MODDEVINFO_CACHE_TS for modctl() syscall are available (on newer Solaris).
4409 # C-level symbol: SOLARIS_MODCTL_MODNVL
4410 # Automake-level symbol: SOLARIS_MODCTL_MODNVL
4412 AC_MSG_CHECKING([for MODNVL_CTRLMAP through MODDEVINFO_CACHE_TS modctl(2) commands (Solaris-specific)])
4413 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4414 #include <sys/modctl.h>
4416 return !(MODNVL_CTRLMAP && MODDEVINFO_CACHE_TS);
4418 solaris_modctl_modnvl=yes
4419 AC_MSG_RESULT([yes])
4420 AC_DEFINE([SOLARIS_MODCTL_MODNVL], 1,
4421 [Define to 1 if you have the `MODNVL_CTRLMAP' through `MODDEVINFO_CACHE_TS' constants.])
4423 solaris_modctl_modnvl=no
4426 AM_CONDITIONAL(SOLARIS_MODCTL_MODNVL, test x$solaris_modctl_modnvl = xyes)
4429 # Solaris-specific check determining whether nscd (name switch cache daemon)
4430 # attaches its door at /system/volatile/name_service_door (Solaris)
4431 # or at /var/run/name_service_door (illumos).
4433 # Note that /var/run is a symlink to /system/volatile on Solaris
4434 # but not vice versa on illumos.
4436 # C-level symbol: SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE
4437 # Automake-level symbol: SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE
4439 AC_MSG_CHECKING([for nscd door location (Solaris-specific)])
4440 if test -e /system/volatile/name_service_door; then
4441 solaris_nscd_door_system_volatile=yes
4442 AC_MSG_RESULT([/system/volatile/name_service_door])
4443 AC_DEFINE([SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE], 1,
4444 [Define to 1 if nscd attaches to /system/volatile/name_service_door.])
4446 solaris_nscd_door_system_volatile=no
4447 AC_MSG_RESULT([/var/run/name_service_door])
4449 AM_CONDITIONAL(SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE, test x$solaris_nscd_door_system_volatile = xyes)
4452 # Solaris-specific check determining if the new gethrt() fasttrap is available.
4454 # New fasttrap (available on Solaris 11):
4455 # hrt_t *gethrt(void);
4457 # C-level symbol: SOLARIS_GETHRT_FASTTRAP
4458 # Automake-level symbol: SOLARIS_GETHRT_FASTTRAP
4460 AC_MSG_CHECKING([for the new `gethrt' fasttrap (Solaris-specific)])
4461 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4462 #include <sys/trap.h>
4466 solaris_gethrt_fasttrap=yes
4467 AC_MSG_RESULT([yes])
4468 AC_DEFINE([SOLARIS_GETHRT_FASTTRAP], 1,
4469 [Define to 1 if you have the new `gethrt' fasttrap.])
4471 solaris_gethrt_fasttrap=no
4474 AM_CONDITIONAL(SOLARIS_GETHRT_FASTTRAP, test x$solaris_gethrt_fasttrap = xyes)
4477 # Solaris-specific check determining if the new get_zone_offset() fasttrap
4480 # New fasttrap (available on Solaris 11):
4481 # zonehrtoffset_t *get_zone_offset(void);
4483 # C-level symbol: SOLARIS_GETZONEOFFSET_FASTTRAP
4484 # Automake-level symbol: SOLARIS_GETZONEOFFSET_FASTTRAP
4486 AC_MSG_CHECKING([for the new `get_zone_offset' fasttrap (Solaris-specific)])
4487 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4488 #include <sys/trap.h>
4490 return !T_GETZONEOFFSET;
4492 solaris_getzoneoffset_fasttrap=yes
4493 AC_MSG_RESULT([yes])
4494 AC_DEFINE([SOLARIS_GETZONEOFFSET_FASTTRAP], 1,
4495 [Define to 1 if you have the new `get_zone_offset' fasttrap.])
4497 solaris_getzoneoffset_fasttrap=no
4500 AM_CONDITIONAL(SOLARIS_GETZONEOFFSET_FASTTRAP, test x$solaris_getzoneoffset_fasttrap = xyes)
4503 # Solaris-specific check determining if the execve() syscall
4504 # takes fourth argument (flags) or not.
4506 # Old syscall (available on illumos):
4507 # int execve(const char *fname, const char **argv, const char **envp);
4509 # New syscall (available on Solaris):
4510 # int execve(uintptr_t file, const char **argv, const char **envp, int flags);
4512 # If the new syscall is present then it will fail with EINVAL (because flags
4513 # are invalid); if the old syscall is available then it will fail with ENOENT
4514 # (because the file could not be found).
4516 # C-level symbol: SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS
4517 # Automake-level symbol: SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS
4519 AC_MSG_CHECKING([if the `execve' syscall accepts flags (Solaris-specific)])
4520 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
4521 #include <sys/syscall.h>
4525 syscall(SYS_execve, "/no/existing/path", 0, 0, 0xdeadbeef, 0, 0);
4526 return !(errno == EINVAL);
4528 solaris_execve_syscall_takes_flags=yes
4529 AC_MSG_RESULT([yes])
4530 AC_DEFINE([SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS], 1,
4531 [Define to 1 if you have the new `execve' syscall which accepts flags.])
4533 solaris_execve_syscall_takes_flags=no
4536 AM_CONDITIONAL(SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS,
4537 test x$solaris_execve_syscall_takes_flags = xyes)
4540 # Solaris-specific check determining version of the repository cache protocol.
4541 # Every Solaris version uses a different one, ranging from 21 to current 25.
4542 # The check is very ugly, though.
4544 # C-level symbol: SOLARIS_REPCACHE_PROTOCOL_VERSION vv
4545 # Automake-level symbol: none
4547 AC_PATH_PROG(DIS_PATH, dis, false)
4548 if test "x$DIS_PATH" = "xfalse"; then
4549 AC_MSG_FAILURE([Object code disassembler (`dis') not found.])
4551 # The illumos source is (or was) here
4552 # https://github.com/illumos/illumos-gate/blob/master/usr/src/lib/libscf/common/lowlevel.c#L1148
4553 # specifically the line
4555 # request.rdr_version = REPOSITORY_DOOR_VERSION;
4557 # rdr_version is a 32bit unsigned int
4558 # The macro REPOSITORY_DOOR_VERSION contains the ascii letters "Rep" in the top 3
4559 # bytes and the door version in the lowest byte. Hence we look for Rep which is 526570
4560 # in hex and then extrace the following byte.
4561 AC_CHECK_LIB(scf, scf_handle_bind, [], [
4562 AC_MSG_WARN([Function `scf_handle_bind' was not found in `libscf'.])
4563 AC_MSG_ERROR([Cannot determine version of the repository cache protocol.])
4566 AC_MSG_CHECKING([for version of the repository cache protocol (Solaris-specific)])
4567 if test "X$VGCONF_ARCH_PRI" = "Xamd64"; then
4568 libscf=/usr/lib/64/libscf.so.1
4570 libscf=/usr/lib/libscf.so.1
4572 if ! $DIS_PATH -F scf_handle_bind $libscf | grep -q -E '0x(4d01)?526570'; then
4573 AC_MSG_WARN([Function `scf_handle_bind' does not contain repository cache protocol version.])
4574 AC_MSG_ERROR([Cannot determine version of the repository cache protocol.])
4576 hex=$( $DIS_PATH -F scf_handle_bind $libscf | grep 526570 | sed 's/.*526570//;s/,.*//' )
4577 if test -z "$hex"; then
4578 AC_MSG_WARN([Version of the repository cache protocol is empty?!])
4579 AC_MSG_ERROR([Cannot determine version of the repository cache protocol.])
4581 version=$( printf "%d\n" 0x$hex )
4582 AC_MSG_RESULT([$version])
4583 AC_DEFINE_UNQUOTED([SOLARIS_REPCACHE_PROTOCOL_VERSION], [$version],
4584 [Version number of the repository door cache protocol.])
4587 # Solaris-specific check determining if "sysstat" segment reservation type
4590 # New "sysstat" segment reservation (available on Solaris 11.4):
4591 # - program header type: PT_SUNW_SYSSTAT
4592 # - auxiliary vector entry: AT_SUN_SYSSTAT_ADDR
4594 # C-level symbol: SOLARIS_RESERVE_SYSSTAT_ADDR
4595 # Automake-level symbol: SOLARIS_RESERVE_SYSSTAT_ADDR
4597 AC_MSG_CHECKING([for the new `sysstat' segment reservation (Solaris-specific)])
4598 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4599 #include <sys/auxv.h>
4601 return !AT_SUN_SYSSTAT_ADDR;
4603 solaris_reserve_sysstat_addr=yes
4604 AC_MSG_RESULT([yes])
4605 AC_DEFINE([SOLARIS_RESERVE_SYSSTAT_ADDR], 1,
4606 [Define to 1 if you have the new `sysstat' segment reservation.])
4608 solaris_reserve_sysstat_addr=no
4611 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ADDR, test x$solaris_reserve_sysstat_addr = xyes)
4614 # Solaris-specific check determining if "sysstat_zone" segment reservation type
4617 # New "sysstat_zone" segment reservation (available on Solaris 11.4):
4618 # - program header type: PT_SUNW_SYSSTAT_ZONE
4619 # - auxiliary vector entry: AT_SUN_SYSSTAT_ZONE_ADDR
4621 # C-level symbol: SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR
4622 # Automake-level symbol: SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR
4624 AC_MSG_CHECKING([for the new `sysstat_zone' segment reservation (Solaris-specific)])
4625 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4626 #include <sys/auxv.h>
4628 return !AT_SUN_SYSSTAT_ZONE_ADDR;
4630 solaris_reserve_sysstat_zone_addr=yes
4631 AC_MSG_RESULT([yes])
4632 AC_DEFINE([SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR], 1,
4633 [Define to 1 if you have the new `sysstat_zone' segment reservation.])
4635 solaris_reserve_sysstat_zone_addr=no
4638 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR, test x$solaris_reserve_sysstat_zone_addr = xyes)
4641 # Solaris-specific check determining if the system_stats() syscall is available
4642 # (on newer Solaris).
4644 # C-level symbol: SOLARIS_SYSTEM_STATS_SYSCALL
4645 # Automake-level symbol: SOLARIS_SYSTEM_STATS_SYSCALL
4647 AC_MSG_CHECKING([for the `system_stats' syscall (Solaris-specific)])
4648 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4649 #include <sys/syscall.h>
4651 return !SYS_system_stats;
4653 solaris_system_stats_syscall=yes
4654 AC_MSG_RESULT([yes])
4655 AC_DEFINE([SOLARIS_SYSTEM_STATS_SYSCALL], 1,
4656 [Define to 1 if you have the `system_stats' syscall.])
4658 solaris_system_stats_syscall=no
4661 AM_CONDITIONAL(SOLARIS_SYSTEM_STATS_SYSCALL, test x$solaris_system_stats_syscall = xyes)
4664 # Solaris-specific check determining if fpregset_t defines struct _fpchip_state
4665 # (on newer illumos) or struct fpchip_state (Solaris, older illumos).
4667 # C-level symbol: SOLARIS_FPCHIP_STATE_TAKES_UNDERSCORE
4668 # Automake-level symbol: none
4670 AC_CHECK_TYPE([struct _fpchip_state],
4671 [solaris_fpchip_state_takes_underscore=yes],
4672 [solaris_fpchip_state_takes_underscore=no],
4673 [[#include <sys/regset.h>]])
4674 if test "$solaris_fpchip_state_takes_underscore" = "yes"; then
4675 AC_DEFINE(SOLARIS_FPCHIP_STATE_TAKES_UNDERSCORE, 1,
4676 [Define to 1 if fpregset_t defines struct _fpchip_state])
4680 # Solaris-specific check determining if schedctl page shared between kernel
4681 # and userspace program is executable (illumos, older Solaris) or not (newer
4684 # C-level symbol: SOLARIS_SCHEDCTL_PAGE_EXEC
4685 # Automake-level symbol: none
4687 AC_MSG_CHECKING([if schedctl page is executable (Solaris-specific)])
4688 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
4692 #include <schedctl.h>
4696 schedctl_t *scp = schedctl_init();
4700 int fd = open("/proc/self/map", O_RDONLY);
4705 while ((rd = read(fd, &map, sizeof(map))) == sizeof(map)) {
4706 if (map.pr_vaddr == ((uintptr_t) scp & PAGEMASK)) {
4707 fprintf(stderr, "%#lx [%zu] %s\n", map.pr_vaddr, map.pr_size,
4708 (map.pr_mflags & MA_EXEC) ? "x" : "no-x");
4709 return (map.pr_mflags & MA_EXEC);
4715 solaris_schedctl_page_exec=no
4718 solaris_schedctl_page_exec=yes
4719 AC_MSG_RESULT([yes])
4720 AC_DEFINE([SOLARIS_SCHEDCTL_PAGE_EXEC], 1,
4721 [Define to 1 if you have the schedctl page executable.])
4725 # Solaris-specific check determining if PT_SUNWDTRACE program header provides
4726 # scratch space for DTrace fasttrap provider (illumos, older Solaris) or just
4727 # an initial thread pointer for libc (newer Solaris).
4729 # C-level symbol: SOLARIS_PT_SUNDWTRACE_THRP
4730 # Automake-level symbol: none
4732 AC_MSG_CHECKING([if PT_SUNWDTRACE serves for initial thread pointer (Solaris-specific)])
4733 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
4734 #include <sys/fasttrap_isa.h>
4736 return !FT_SCRATCHSIZE;
4738 solaris_pt_sunwdtrace_thrp=yes
4739 AC_MSG_RESULT([yes])
4740 AC_DEFINE([SOLARIS_PT_SUNDWTRACE_THRP], 1,
4741 [Define to 1 if PT_SUNWDTRACE program header provides just an initial thread pointer for libc.])
4743 solaris_pt_sunwdtrace_thrp=no
4748 AM_CONDITIONAL(SOLARIS_SUN_STUDIO_AS, false)
4749 AM_CONDITIONAL(SOLARIS_XPG_SYMBOLS_PRESENT, false)
4750 AM_CONDITIONAL(SOLARIS_PROC_CMDLINE, false)
4751 AM_CONDITIONAL(SOLARIS_OLD_SYSCALLS, false)
4752 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL, false)
4753 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID, false)
4754 AM_CONDITIONAL(SOLARIS_LWP_NAME_SYSCALL, false)
4755 AM_CONDITIONAL(SOLARIS_GETRANDOM_SYSCALL, false)
4756 AM_CONDITIONAL(SOLARIS_ZONE_DEFUNCT, false)
4757 AM_CONDITIONAL(SOLARIS_AUDITON_STAT, false)
4758 AM_CONDITIONAL(SOLARIS_SHM_NEW, false)
4759 AM_CONDITIONAL(SOLARIS_PRXREGSET_T, false)
4760 AM_CONDITIONAL(SOLARIS_FREALPATHAT_SYSCALL, false)
4761 AM_CONDITIONAL(SOLARIS_UUIDSYS_SYSCALL, false)
4762 AM_CONDITIONAL(SOLARIS_TNDB_GET_TNIP, false)
4763 AM_CONDITIONAL(SOLARIS_TSOL_CLEARANCE, false)
4764 AM_CONDITIONAL(SOLARIS_PSET_GET_NAME, false)
4765 AM_CONDITIONAL(SOLARIS_UTIMESYS_SYSCALL, false)
4766 AM_CONDITIONAL(SOLARIS_UTIMENSAT_SYSCALL, false)
4767 AM_CONDITIONAL(SOLARIS_SPAWN_SYSCALL, false)
4768 AM_CONDITIONAL(SOLARIS_MODCTL_MODNVL, false)
4769 AM_CONDITIONAL(SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE, false)
4770 AM_CONDITIONAL(SOLARIS_GETHRT_FASTTRAP, false)
4771 AM_CONDITIONAL(SOLARIS_GETZONEOFFSET_FASTTRAP, false)
4772 AM_CONDITIONAL(SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS, false)
4773 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ADDR, false)
4774 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR, false)
4775 AM_CONDITIONAL(SOLARIS_SYSTEM_STATS_SYSCALL, false)
4776 fi # test "$VGCONF_OS" = "solaris"
4778 #----------------------------------------------------------------------------
4779 # FreeBSD-specific checks.
4780 #----------------------------------------------------------------------------
4782 # Rather than having a large number of feature test as above with Solaris
4783 # these tests are per-version. This may not be entirely reliable for
4784 # FreeBSD development branches (XX.Y-CURRENT) or pre-release branches
4785 # (XX.Y-STABLE) but it should work for XX-Y-RELEASE
4787 if test "$VGCONF_OS" = "freebsd" ; then
4789 AM_CONDITIONAL(FREEBSD_VERS_13_PLUS, test $freebsd_vers -ge $freebsd_13_0)
4790 AM_CONDITIONAL(FREEBSD_VERS_15_PLUS, test $freebsd_vers -ge $freebsd_15)
4794 AM_CONDITIONAL(FREEBSD_VERS_13_PLUS, false)
4795 AM_CONDITIONAL(FREEBSD_VERS_15_PLUS, false)
4797 fi # test "$VGCONF_OS" = "freebsd"
4800 #----------------------------------------------------------------------------
4801 # Checks for C header files.
4802 #----------------------------------------------------------------------------
4804 AC_CHECK_HEADERS([ \
4822 # Verify whether the <linux/futex.h> header is usable.
4823 AC_MSG_CHECKING([if <linux/futex.h> is usable])
4825 save_CFLAGS="$CFLAGS"
4826 CFLAGS="$CFLAGS -D__user="
4827 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4828 #include <linux/futex.h>
4832 ac_have_usable_linux_futex_h=yes
4833 AC_DEFINE([HAVE_USABLE_LINUX_FUTEX_H], 1,
4834 [Define to 1 if you have a usable <linux/futex.h> header file.])
4835 AC_MSG_RESULT([yes])
4837 ac_have_usable_linux_futex_h=no
4840 CFLAGS="$save_CFLAGS"
4843 #----------------------------------------------------------------------------
4844 # Checks for typedefs, structures, and compiler characteristics.
4845 #----------------------------------------------------------------------------
4849 AC_CHECK_HEADERS_ONCE([sys/time.h])
4851 AC_CHECK_TYPE([struct statx], [
4852 AC_DEFINE([HAVE_STRUCT_STATX_IN_SYS_STAT_H], 1,
4853 [Define to 1 if <sys/stat.h> declares struct statx.])
4856 #include <sys/stat.h>
4860 #----------------------------------------------------------------------------
4861 # Checks for library functions.
4862 #----------------------------------------------------------------------------
4866 AC_CHECK_LIB([pthread], [pthread_create])
4867 AC_CHECK_LIB([rt], [clock_gettime])
4889 pthread_barrier_init \
4890 pthread_condattr_setclock \
4891 pthread_mutex_timedlock \
4892 pthread_rwlock_timedrdlock \
4893 pthread_rwlock_timedwrlock \
4894 pthread_setname_np \
4922 # AC_CHECK_LIB adds any library found to the variable LIBS, and links these
4923 # libraries with any shared object and/or executable. This is NOT what we
4924 # want for e.g. vgpreload_core-x86-linux.so
4927 AM_CONDITIONAL([HAVE_PTHREAD_BARRIER],
4928 [test x$ac_cv_func_pthread_barrier_init = xyes])
4929 AM_CONDITIONAL([HAVE_PTHREAD_MUTEX_TIMEDLOCK],
4930 [test x$ac_cv_func_pthread_mutex_timedlock = xyes])
4931 AM_CONDITIONAL([HAVE_PTHREAD_SPINLOCK],
4932 [test x$ac_cv_func_pthread_spin_lock = xyes])
4933 AM_CONDITIONAL([HAVE_PTHREAD_SETNAME_NP],
4934 [test x$ac_cv_func_pthread_setname_np = xyes])
4935 AM_CONDITIONAL([HAVE_COPY_FILE_RANGE],
4936 [test x$ac_cv_func_copy_file_range = xyes])
4937 AM_CONDITIONAL([HAVE_PREADV_PWRITEV],
4938 [test x$ac_cv_func_preadv = xyes && test x$ac_cv_func_pwritev = xyes])
4939 AM_CONDITIONAL([HAVE_PREADV2_PWRITEV2],
4940 [test x$ac_cv_func_preadv2 = xyes && test x$ac_cv_func_pwritev2 = xyes])
4941 AM_CONDITIONAL([HAVE_SETCONTEXT], [test x$ac_cv_func_setcontext = xyes])
4942 AM_CONDITIONAL([HAVE_SWAPCONTEXT], [test x$ac_cv_func_swapcontext = xyes])
4943 AM_CONDITIONAL([HAVE_MEMFD_CREATE],
4944 [test x$ac_cv_func_memfd_create = xyes])
4945 AM_CONDITIONAL([HAVE_GETADDRINFO],
4946 [test x$ac_cv_func_getaddrinfo = xyes])
4947 AM_CONDITIONAL([HAVE_CLOSE_RANGE],
4948 [test x$ac_cv_func_close_range = xyes])
4949 AM_CONDITIONAL([HAVE_WCSNCPY],
4950 [test x$ac_cv_func_wcsncpy = xyes])
4952 if test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
4953 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \
4954 -o x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX; then
4955 AC_DEFINE([DISABLE_PTHREAD_SPINLOCK_INTERCEPT], 1,
4956 [Disable intercept pthread_spin_lock() on MIPS32, MIPS64 and nanoMIPS.])
4959 #----------------------------------------------------------------------------
4961 #----------------------------------------------------------------------------
4962 # Do we have a useable MPI setup on the primary and/or secondary targets?
4963 # On Linux, by default, assumes mpicc and -m32/-m64
4964 # Note: this is a kludge in that it assumes the specified mpicc
4965 # understands -m32/-m64 regardless of what is specified using
4967 AC_PATH_PROG([MPI_CC], [mpicc], [mpicc],
4968 [$PATH:/usr/lib/openmpi/bin:/usr/lib64/openmpi/bin])
4971 if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
4972 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_FREEBSD \
4973 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
4974 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
4975 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
4976 -o x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX \
4977 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS ; then
4978 mflag_primary=$FLAG_M32
4979 elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
4980 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD \
4981 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
4982 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX \
4983 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \
4984 -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX ; then
4985 mflag_primary=$FLAG_M64
4986 elif test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN ; then
4987 mflag_primary="$FLAG_M32 -arch i386"
4988 elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN ; then
4989 mflag_primary="$FLAG_M64 -arch x86_64"
4993 if test x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
4994 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX \
4995 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_SOLARIS \
4996 -o x$VGCONF_PLATFORM_SEC_CAPS = xMIPS32_LINUX \
4997 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_FREEBSD ; then
4998 mflag_secondary=$FLAG_M32
4999 elif test x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN ; then
5000 mflag_secondary="$FLAG_M32 -arch i386"
5005 [ --with-mpicc= Specify name of MPI2-ised C compiler],
5010 ## We AM_COND_IF here instead of automake "if" in mpi/Makefile.am so that we can
5011 ## use these values in the check for a functioning mpicc.
5013 ## We leave the MPI_FLAG_M3264_ logic in mpi/Makefile.am and assume that
5014 ## mflag_primary/mflag_secondary are sufficient approximations of that behavior
5015 AM_COND_IF([VGCONF_OS_IS_LINUX],
5016 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic"
5017 LDFLAGS_MPI="-fpic -shared"])
5018 AM_COND_IF([VGCONF_OS_IS_FREEBSD],
5019 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic"
5020 LDFLAGS_MPI="-fpic -shared"])
5021 AM_COND_IF([VGCONF_OS_IS_DARWIN],
5022 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -dynamic"
5023 LDFLAGS_MPI="-dynamic -dynamiclib -all_load"])
5024 AM_COND_IF([VGCONF_OS_IS_SOLARIS],
5025 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic"
5026 LDFLAGS_MPI="-fpic -shared"])
5028 AC_SUBST([CFLAGS_MPI])
5029 AC_SUBST([LDFLAGS_MPI])
5032 ## See if MPI_CC works for the primary target
5034 AC_MSG_CHECKING([primary target for usable MPI2-compliant C compiler and mpi.h])
5036 saved_CFLAGS=$CFLAGS
5038 CFLAGS="$CFLAGS_MPI $mflag_primary"
5039 saved_LDFLAGS="$LDFLAGS"
5040 LDFLAGS="$LDFLAGS_MPI $mflag_primary"
5041 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5045 int ni, na, nd, comb;
5046 int r = MPI_Init(NULL,NULL);
5047 r |= MPI_Type_get_envelope( MPI_INT, &ni, &na, &nd, &comb );
5048 r |= MPI_Finalize();
5051 ac_have_mpi2_pri=yes
5052 AC_MSG_RESULT([yes, $MPI_CC])
5058 CFLAGS=$saved_CFLAGS
5059 LDFLAGS="$saved_LDFLAGS"
5060 AM_CONDITIONAL(BUILD_MPIWRAP_PRI, test x$ac_have_mpi2_pri = xyes)
5062 ## See if MPI_CC works for the secondary target. Complication: what if
5063 ## there is no secondary target? We need this to then fail.
5064 ## Kludge this by making MPI_CC something which will surely fail in
5067 AC_MSG_CHECKING([secondary target for usable MPI2-compliant C compiler and mpi.h])
5069 saved_CFLAGS=$CFLAGS
5070 saved_LDFLAGS="$LDFLAGS"
5071 LDFLAGS="$LDFLAGS_MPI $mflag_secondary"
5072 if test x$VGCONF_PLATFORM_SEC_CAPS = x ; then
5073 CC="$MPI_CC this will surely fail"
5077 CFLAGS="$CFLAGS_MPI $mflag_secondary"
5078 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5082 int ni, na, nd, comb;
5083 int r = MPI_Init(NULL,NULL);
5084 r |= MPI_Type_get_envelope( MPI_INT, &ni, &na, &nd, &comb );
5085 r |= MPI_Finalize();
5088 ac_have_mpi2_sec=yes
5089 AC_MSG_RESULT([yes, $MPI_CC])
5095 CFLAGS=$saved_CFLAGS
5096 LDFLAGS="$saved_LDFLAGS"
5097 AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec = xyes)
5100 #----------------------------------------------------------------------------
5101 # Other library checks
5102 #----------------------------------------------------------------------------
5103 # There now follow some tests for Boost, and OpenMP. These
5104 # tests are present because Drd has some regression tests that use
5105 # these packages. All regression test programs all compiled only
5106 # for the primary target. And so it is important that the configure
5107 # checks that follow, use the correct -m32 or -m64 flag for the
5108 # primary target (called $mflag_primary). Otherwise, we can end up
5109 # in a situation (eg) where, on amd64-linux, the test for Boost checks
5110 # for usable 64-bit Boost facilities, but because we are doing a 32-bit
5111 # only build (meaning, the primary target is x86-linux), the build
5112 # of the regtest programs that use Boost fails, because they are
5113 # build as 32-bit (IN THIS EXAMPLE).
5115 # Hence: ALWAYS USE $mflag_primary FOR CONFIGURE TESTS FOR FACILITIES
5116 # NEEDED BY THE REGRESSION TEST PROGRAMS.
5119 # Check whether the boost library 1.35 or later has been installed.
5120 # The Boost.Threads library has undergone a major rewrite in version 1.35.0.
5122 AC_MSG_CHECKING([for boost])
5125 safe_CXXFLAGS=$CXXFLAGS
5126 CXXFLAGS="$mflag_primary"
5128 LIBS="-lboost_thread-mt -lboost_system-mt $LIBS"
5130 AC_LINK_IFELSE([AC_LANG_SOURCE([
5131 #include <boost/thread.hpp>
5132 static void thread_func(void)
5134 int main(int argc, char** argv)
5136 boost::thread t(thread_func);
5141 ac_have_boost_1_35=yes
5142 AC_SUBST([BOOST_CFLAGS], [])
5143 AC_SUBST([BOOST_LIBS], ["-lboost_thread-mt -lboost_system-mt"])
5144 AC_MSG_RESULT([yes])
5146 ac_have_boost_1_35=no
5151 CXXFLAGS=$safe_CXXFLAGS
5154 AM_CONDITIONAL([HAVE_BOOST_1_35], [test x$ac_have_boost_1_35 = xyes])
5157 # does this compiler support -fopenmp, does it have the include file
5158 # <omp.h> and does it have libgomp ?
5160 AC_MSG_CHECKING([for OpenMP])
5163 CFLAGS="-fopenmp $mflag_primary -Werror"
5165 AC_LINK_IFELSE([AC_LANG_SOURCE([
5167 int main(int argc, char** argv)
5175 AC_MSG_RESULT([yes])
5182 AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes])
5185 # Check for __builtin_popcount
5186 AC_MSG_CHECKING([for __builtin_popcount()])
5187 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5189 __builtin_popcount(2);
5192 AC_MSG_RESULT([yes])
5193 AC_DEFINE([HAVE_BUILTIN_POPCOUT], 1,
5194 [Define to 1 if compiler provides __builtin_popcount().])
5199 # Check for __builtin_clz
5200 AC_MSG_CHECKING([for __builtin_clz()])
5201 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5206 AC_MSG_RESULT([yes])
5207 AC_DEFINE([HAVE_BUILTIN_CLZ], 1,
5208 [Define to 1 if compiler provides __builtin_clz().])
5213 # Check for __builtin_ctz
5214 AC_MSG_CHECKING([for __builtin_ctz()])
5215 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5220 AC_MSG_RESULT([yes])
5221 AC_DEFINE([HAVE_BUILTIN_CTZ], 1,
5222 [Define to 1 if compiler provides __builtin_ctz().])
5227 # does this compiler have built-in functions for atomic memory access for the
5229 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the primary target])
5232 CFLAGS="$mflag_primary"
5234 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
5236 return (__sync_bool_compare_and_swap(&variable, 1, 2)
5237 && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
5239 ac_have_builtin_atomic_primary=yes
5240 AC_MSG_RESULT([yes])
5241 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])
5243 ac_have_builtin_atomic_primary=no
5249 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC],
5250 [test x$ac_have_builtin_atomic_primary = xyes])
5253 # does this compiler have built-in functions for atomic memory access for the
5254 # secondary target ?
5256 if test x$VGCONF_PLATFORM_SEC_CAPS != x; then
5258 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the secondary target])
5261 CFLAGS="$mflag_secondary"
5263 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
5265 return (__sync_add_and_fetch(&variable, 1) ? 1 : 0)
5267 ac_have_builtin_atomic_secondary=yes
5268 AC_MSG_RESULT([yes])
5270 ac_have_builtin_atomic_secondary=no
5278 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_SECONDARY],
5279 [test x$ac_have_builtin_atomic_secondary = xyes])
5281 # does this compiler have built-in functions for atomic memory access on
5282 # 64-bit integers for all targets ?
5284 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch on uint64_t for all targets])
5286 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5289 uint64_t variable = 1;
5290 return __sync_add_and_fetch(&variable, 1)
5292 ac_have_builtin_atomic64_primary=yes
5294 ac_have_builtin_atomic64_primary=no
5297 if test x$VGCONF_PLATFORM_SEC_CAPS != x; then
5300 CFLAGS="$mflag_secondary"
5302 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5305 uint64_t variable = 1;
5306 return __sync_add_and_fetch(&variable, 1)
5308 ac_have_builtin_atomic64_secondary=yes
5310 ac_have_builtin_atomic64_secondary=no
5317 if test x$ac_have_builtin_atomic64_primary = xyes && \
5318 test x$VGCONF_PLATFORM_SEC_CAPS = x \
5319 -o x$ac_have_builtin_atomic64_secondary = xyes; then
5320 AC_MSG_RESULT([yes])
5321 ac_have_builtin_atomic64=yes
5324 ac_have_builtin_atomic64=no
5327 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC64],
5328 [test x$ac_have_builtin_atomic64 = xyes])
5331 AC_MSG_CHECKING([if platform has openat2 syscall])
5333 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5334 #include <sys/syscall.h>
5343 AM_CONDITIONAL([HAVE_OPENAT2],
5344 [test x$ac_have_openat2 = xyes])
5346 # does g++ have built-in functions for atomic memory access ?
5347 AC_MSG_CHECKING([if g++ supports __sync_add_and_fetch])
5349 safe_CXXFLAGS=$CXXFLAGS
5350 CXXFLAGS="$mflag_primary"
5353 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
5355 return (__sync_bool_compare_and_swap(&variable, 1, 2)
5356 && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
5358 ac_have_builtin_atomic_cxx=yes
5359 AC_MSG_RESULT([yes])
5360 AC_DEFINE(HAVE_BUILTIN_ATOMIC_CXX, 1, [Define to 1 if g++ supports __sync_bool_compare_and_swap() and __sync_add_and_fetch()])
5362 ac_have_builtin_atomic_cxx=no
5367 CXXFLAGS=$safe_CXXFLAGS
5369 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_CXX], [test x$ac_have_builtin_atomic_cxx = xyes])
5372 if test x$ac_have_usable_linux_futex_h = xyes \
5373 -a x$ac_have_builtin_atomic_primary = xyes; then
5374 ac_enable_linux_ticket_lock_primary=yes
5376 AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_PRIMARY],
5377 [test x$ac_enable_linux_ticket_lock_primary = xyes])
5379 if test x$VGCONF_PLATFORM_SEC_CAPS != x \
5380 -a x$ac_have_usable_linux_futex_h = xyes \
5381 -a x$ac_have_builtin_atomic_secondary = xyes; then
5382 ac_enable_linux_ticket_lock_secondary=yes
5384 AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_SECONDARY],
5385 [test x$ac_enable_linux_ticket_lock_secondary = xyes])
5388 # does libstdc++ support annotating shared pointers ?
5389 AC_MSG_CHECKING([if libstdc++ supports annotating shared pointers])
5391 safe_CXXFLAGS=$CXXFLAGS
5392 CXXFLAGS="-std=c++0x"
5395 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5398 std::shared_ptr<int> p
5400 ac_have_shared_ptr=yes
5402 ac_have_shared_ptr=no
5404 if test x$ac_have_shared_ptr = xyes; then
5405 # If compilation of the program below fails because of a syntax error
5406 # triggered by substituting one of the annotation macros then that
5407 # means that libstdc++ supports these macros.
5408 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5409 #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(a) (a)----
5410 #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(a) (a)----
5413 std::shared_ptr<int> p
5415 ac_have_shared_pointer_annotation=no
5418 ac_have_shared_pointer_annotation=yes
5419 AC_MSG_RESULT([yes])
5420 AC_DEFINE(HAVE_SHARED_POINTER_ANNOTATION, 1,
5421 [Define to 1 if libstd++ supports annotating shared pointers])
5424 ac_have_shared_pointer_annotation=no
5429 CXXFLAGS=$safe_CXXFLAGS
5431 AM_CONDITIONAL([HAVE_SHARED_POINTER_ANNOTATION],
5432 [test x$ac_have_shared_pointer_annotation = xyes])
5434 # checking for GNU libc C17 aligned_alloc
5435 # just check glibc version rather than trying to muck around
5436 # checking the runtime behaviour or seeing if it is a weak alias
5437 AC_MSG_CHECKING([for AT_GNU_LIBC_C17_ALIGNED_ALLOC])
5438 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
5439 #include <features.h>
5441 #if !defined(__GLIBC__) || __GLIBC__ != 2 || !defined(__GLIBC_MINOR__) || __GLIBC_MINOR__ < 38
5442 #error "not GNU libc 2.38 or later"
5445 AC_MSG_RESULT([yes])
5446 AC_DEFINE([HAVE_GNU_LIBC_C17_ALIGNED_ALLOC], 1,
5447 [Define to 1 if you have GNU libc C17 aligned_alloc.])
5453 # Check for C11 thrd_create()
5454 AC_MSG_CHECKING([for thrd_create()])
5455 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
5456 #include <threads.h>
5457 int thrd_entry(void *arg) { return 0; }
5458 ], [[thrd_t thr; return thrd_create(&thr, thrd_entry, NULL);]])],
5460 ac_cxx_have_thrd_create=yes
5461 AC_MSG_RESULT([yes])
5463 ac_cxx_have_thrd_create=no
5467 AM_CONDITIONAL(HAVE_THRD_CREATE, test x$ac_cxx_have_thrd_create = xyes)
5471 #----------------------------------------------------------------------------
5472 # Ok. We're done checking.
5473 #----------------------------------------------------------------------------
5475 # Nb: VEX/Makefile is generated from Makefile.vex.in.
5478 VEX/Makefile:Makefile.vex.in
5482 glibc-2.X-helgrind.supp
5486 docs/xml/vg-entities.xml
5491 gdbserver_tests/Makefile
5492 gdbserver_tests/solaris/Makefile
5498 memcheck/tests/Makefile
5499 memcheck/tests/common/Makefile
5500 memcheck/tests/amd64/Makefile
5501 memcheck/tests/x86/Makefile
5502 memcheck/tests/linux/Makefile
5503 memcheck/tests/linux/debuginfod-check.vgtest
5504 memcheck/tests/darwin/Makefile
5505 memcheck/tests/solaris/Makefile
5506 memcheck/tests/freebsd/Makefile
5507 memcheck/tests/amd64-linux/Makefile
5508 memcheck/tests/arm64-linux/Makefile
5509 memcheck/tests/x86-linux/Makefile
5510 memcheck/tests/amd64-solaris/Makefile
5511 memcheck/tests/x86-solaris/Makefile
5512 memcheck/tests/amd64-freebsd/Makefile
5513 memcheck/tests/x86-freebsd/Makefile
5514 memcheck/tests/ppc32/Makefile
5515 memcheck/tests/ppc64/Makefile
5516 memcheck/tests/s390x/Makefile
5517 memcheck/tests/mips32/Makefile
5518 memcheck/tests/mips64/Makefile
5519 memcheck/tests/vbit-test/Makefile
5521 cachegrind/tests/Makefile
5522 cachegrind/tests/x86/Makefile
5523 cachegrind/cg_annotate
5527 callgrind/callgrind_annotate
5528 callgrind/callgrind_control
5529 callgrind/tests/Makefile
5531 helgrind/tests/Makefile
5533 drd/scripts/download-and-build-splash2
5536 massif/tests/Makefile
5541 lackey/tests/Makefile
5544 none/tests/scripts/Makefile
5545 none/tests/amd64/Makefile
5546 none/tests/ppc32/Makefile
5547 none/tests/ppc64/Makefile
5548 none/tests/x86/Makefile
5549 none/tests/arm/Makefile
5550 none/tests/arm64/Makefile
5551 none/tests/s390x/Makefile
5552 none/tests/mips32/Makefile
5553 none/tests/mips64/Makefile
5554 none/tests/nanomips/Makefile
5555 none/tests/linux/Makefile
5556 none/tests/darwin/Makefile
5557 none/tests/solaris/Makefile
5558 none/tests/freebsd/Makefile
5559 none/tests/amd64-linux/Makefile
5560 none/tests/x86-linux/Makefile
5561 none/tests/amd64-darwin/Makefile
5562 none/tests/x86-darwin/Makefile
5563 none/tests/amd64-solaris/Makefile
5564 none/tests/x86-solaris/Makefile
5565 none/tests/x86-freebsd/Makefile
5567 exp-bbv/tests/Makefile
5568 exp-bbv/tests/x86/Makefile
5569 exp-bbv/tests/x86-linux/Makefile
5570 exp-bbv/tests/amd64-linux/Makefile
5571 exp-bbv/tests/ppc32-linux/Makefile
5572 exp-bbv/tests/arm-linux/Makefile
5576 AC_CONFIG_FILES([coregrind/link_tool_exe_linux],
5577 [chmod +x coregrind/link_tool_exe_linux])
5578 AC_CONFIG_FILES([coregrind/link_tool_exe_freebsd],
5579 [chmod +x coregrind/link_tool_exe_freebsd])
5580 AC_CONFIG_FILES([coregrind/link_tool_exe_darwin],
5581 [chmod +x coregrind/link_tool_exe_darwin])
5582 AC_CONFIG_FILES([coregrind/link_tool_exe_solaris],
5583 [chmod +x coregrind/link_tool_exe_solaris])
5584 AC_CONFIG_FILES([tests/filter_stderr_basic],
5585 [chmod +x tests/filter_stderr_basic])
5586 AC_CONFIG_FILES([tests/filter_discards],
5587 [chmod +x tests/filter_discards])
5588 AC_CONFIG_FILES([memcheck/tests/filter_stderr],
5589 [chmod +x memcheck/tests/filter_stderr])
5590 AC_CONFIG_FILES([memcheck/tests/filter_dw4],
5591 [chmod +x memcheck/tests/filter_dw4])
5592 AC_CONFIG_FILES([memcheck/tests/filter_overlaperror],
5593 [chmod +x memcheck/tests/filter_overlaperror])
5594 AC_CONFIG_FILES([memcheck/tests/x86/filter_pushfpopf],
5595 [chmod +x memcheck/tests/x86/filter_pushfpopf])
5596 AC_CONFIG_FILES([gdbserver_tests/filter_gdb],
5597 [chmod +x gdbserver_tests/filter_gdb])
5598 AC_CONFIG_FILES([gdbserver_tests/filter_memcheck_monitor],
5599 [chmod +x gdbserver_tests/filter_memcheck_monitor])
5600 AC_CONFIG_FILES([gdbserver_tests/filter_stderr],
5601 [chmod +x gdbserver_tests/filter_stderr])
5602 AC_CONFIG_FILES([gdbserver_tests/filter_vgdb],
5603 [chmod +x gdbserver_tests/filter_vgdb])
5604 AC_CONFIG_FILES([drd/tests/filter_stderr],
5605 [chmod +x drd/tests/filter_stderr])
5606 AC_CONFIG_FILES([drd/tests/filter_error_count],
5607 [chmod +x drd/tests/filter_error_count])
5608 AC_CONFIG_FILES([drd/tests/filter_error_summary],
5609 [chmod +x drd/tests/filter_error_summary])
5610 AC_CONFIG_FILES([drd/tests/filter_stderr_and_thread_no_and_offset],
5611 [chmod +x drd/tests/filter_stderr_and_thread_no_and_offset])
5612 AC_CONFIG_FILES([drd/tests/filter_thread_no],
5613 [chmod +x drd/tests/filter_thread_no])
5614 AC_CONFIG_FILES([drd/tests/filter_xml_and_thread_no],
5615 [chmod +x drd/tests/filter_xml_and_thread_no])
5616 AC_CONFIG_FILES([helgrind/tests/filter_stderr],
5617 [chmod +x helgrind/tests/filter_stderr])
5623 Maximum build arch: ${ARCH_MAX}
5624 Primary build arch: ${VGCONF_ARCH_PRI}
5625 Secondary build arch: ${VGCONF_ARCH_SEC}
5626 Build OS: ${VGCONF_OS}
5627 Link Time Optimisation: ${vg_cv_lto}
5628 Primary build target: ${VGCONF_PLATFORM_PRI_CAPS}
5629 Secondary build target: ${VGCONF_PLATFORM_SEC_CAPS}
5630 Platform variant: ${VGCONF_PLATVARIANT}
5631 Primary -DVGPV string: -DVGPV_${VGCONF_ARCH_PRI}_${VGCONF_OS}_${VGCONF_PLATVARIANT}=1
5632 Default supp files: ${DEFAULT_SUPP}