2 ##------------------------------------------------------------##
4 # The multiple-architecture stuff in this file is pretty
5 # cryptic. Read docs/internals/multiple-architectures.txt
6 # for at least a partial explanation of what is going on.
8 ##------------------------------------------------------------##
10 # Process this file with autoconf to produce a configure script.
12 # Define major, minor, micro and suffix here once, then reuse them
13 # for version number in valgrind.h and vg-entities (documentation).
14 # suffix must be empty for a release, otherwise it is GIT or RC1, etc.
15 # Also set the (expected/last) release date here.
16 # Do not forget to rerun ./autogen.sh
17 m4_define([v_major_ver], [3])
18 m4_define([v_minor_ver], [21])
19 m4_define([v_micro_ver], [0])
20 m4_define([v_suffix_ver], [GIT])
21 m4_define([v_rel_date], ["?? Apr 2023"])
22 m4_define([v_version],
23 m4_if(v_suffix_ver, [],
24 [v_major_ver.v_minor_ver.v_micro_ver],
25 [v_major_ver.v_minor_ver.v_micro_ver.v_suffix_ver]))
26 AC_INIT([Valgrind],[v_version],[valgrind-users@lists.sourceforge.net])
29 AC_SUBST(VG_VER_MAJOR, v_major_ver)
30 AC_SUBST(VG_VER_MINOR, v_minor_ver)
32 # For docs/xml/vg-entities.xml
33 AC_SUBST(VG_DATE, v_rel_date)
35 AC_CONFIG_SRCDIR(coregrind/m_main.c)
36 AC_CONFIG_HEADERS([config.h])
37 AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects])
41 #----------------------------------------------------------------------------
42 # Do NOT modify these flags here. Except in feature tests in which case
43 # the original values must be properly restored.
44 #----------------------------------------------------------------------------
48 #----------------------------------------------------------------------------
49 # Checks for various programs.
50 #----------------------------------------------------------------------------
53 m4_version_prereq([2.70], [AC_PROG_CC], [AC_PROG_CC_C99])
54 # Make sure we can compile in C99 mode.
55 if test "$ac_cv_prog_cc_c99" = "no"; then
56 AC_MSG_ERROR([Valgrind relies on a C compiler supporting C99])
60 # AC_PROG_OBJC apparently causes problems on older Linux distros (eg. with
61 # autoconf 2.59). If we ever have any Objective-C code in the Valgrind code
62 # base (eg. most likely as Darwin-specific tests) we'll need one of the
64 # - put AC_PROG_OBJC in a Darwin-specific part of this file
65 # - Use AC_PROG_OBJC here and up the minimum autoconf version
66 # - Use the following, which is apparently equivalent:
67 # m4_ifdef([AC_PROG_OBJC],
69 # [AC_CHECK_TOOL([OBJC], [gcc])
71 # AC_SUBST([OBJCFLAGS])
74 # Set LTO_RANLIB variable to an lto enabled ranlib
75 if test "x$LTO_RANLIB" = "x"; then
76 AC_PATH_PROGS([LTO_RANLIB], [gcc-ranlib])
78 AC_ARG_VAR([LTO_RANLIB],[Library indexer command for link time optimisation])
80 # provide a very basic definition for AC_PROG_SED if it's not provided by
81 # autoconf (as e.g. in autoconf 2.59).
82 m4_ifndef([AC_PROG_SED],
83 [AC_DEFUN([AC_PROG_SED],
85 AC_CHECK_PROGS([SED],[gsed sed])])])
88 AC_DEFUN([AC_PROG_SHA256SUM],
89 [AC_ARG_VAR([SHA256SUM])
90 AC_CHECK_PROGS([SHA256SUM],[gsha256sum sha256sum])])
93 # If no AR variable was specified, look up the name of the archiver. Otherwise
94 # do not touch the AR variable.
95 if test "x$AR" = "x"; then
96 AC_PATH_PROGS([AR], [`echo $LD | $SED 's/ld$/ar/'` "ar"], [ar])
98 AC_ARG_VAR([AR],[Archiver command])
100 # same for LTO_AR variable for lto enabled archiver
101 if test "x$LTO_AR" = "x"; then
102 AC_PATH_PROGS([LTO_AR], [gcc-ar])
104 AC_ARG_VAR([LTO_AR],[Archiver command for link time optimisation])
107 # Check for the compiler support
108 if test "${GCC}" != "yes" ; then
109 AC_MSG_ERROR([Valgrind relies on GCC to be compiled])
112 # figure out where perl lives
113 AC_PATH_PROG(PERL, perl)
115 # figure out where gdb lives
116 AC_PATH_PROG(GDB, gdb, "/no/gdb/was/found/at/configure/time")
117 AC_DEFINE_UNQUOTED(GDB_PATH, "$GDB", [path to GDB])
119 # some older automake's don't have it so try something on our own
120 ifdef([AM_PROG_AS],[AM_PROG_AS],
130 # Check if 'diff' supports -u (universal diffs) and use it if possible.
132 AC_MSG_CHECKING([for diff -u])
135 # Comparing two identical files results in 0.
136 tmpfile="tmp-xxx-yyy-zzz"
138 if diff -u $tmpfile $tmpfile ; then
147 # We don't want gcc < 3.0
148 AC_MSG_CHECKING([for a supported version of gcc])
150 # Obtain the compiler version.
152 # A few examples of how the ${CC} --version output looks like:
154 # ######## gcc variants ########
155 # Arch Linux: i686-pc-linux-gnu-gcc (GCC) 4.6.2
156 # Debian Linux: gcc (Debian 4.3.2-1.1) 4.3.2
157 # openSUSE: gcc (SUSE Linux) 4.5.1 20101208 [gcc-4_5-branch revision 167585]
158 # Exherbo Linux: x86_64-pc-linux-gnu-gcc (Exherbo gcc-4.6.2) 4.6.2
159 # MontaVista Linux for ARM: arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q1-203) 4.3.3
160 # OS/X 10.6: i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
161 # 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)
163 # ######## clang variants ########
164 # Clang: clang version 2.9 (tags/RELEASE_29/final)
165 # Apple clang: Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
166 # FreeBSD clang: FreeBSD clang version 3.1 (branches/release_31 156863) 20120523
168 # ######## Apple LLVM variants ########
169 # Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
170 # Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
173 if test "x`${CC} --version | $SED -n -e 's/.*\Apple \(LLVM\) version.*clang.*/\1/p'`" = "xLLVM" ;
176 gcc_version=`${CC} --version | $SED -n -e 's/.*LLVM version \([0-9.]*\).*$/\1/p'`
177 elif test "x`${CC} --version | $SED -n -e 's/.*\(clang\) version.*/\1/p'`" = "xclang" ;
180 # Don't use -dumpversion with clang: it will always produce "4.2.1".
181 gcc_version=`${CC} --version | $SED -n -e 's/.*clang version \([0-9.]*\).*$/\1/p'`
182 elif test "x`${CC} --version | $SED -n -e 's/icc.*\(ICC\).*/\1/p'`" = "xICC" ;
185 gcc_version=`${CC} -dumpversion 2>/dev/null`
188 gcc_version=`${CC} -dumpversion 2>/dev/null`
189 if test "x$gcc_version" = x; then
190 gcc_version=`${CC} --version | $SED -n -e 's/[^ ]*gcc[^ ]* ([^)]*) \([0-9.]*\).*$/\1/p'`
194 AM_CONDITIONAL(COMPILER_IS_CLANG, test $is_clang = clang -o $is_clang = applellvm)
195 AM_CONDITIONAL(COMPILER_IS_ICC, test $is_clang = icc)
197 # Note: m4 arguments are quoted with [ and ] so square brackets in shell
198 # statements have to be quoted.
199 case "${is_clang}-${gcc_version}" in
200 applellvm-5.1|applellvm-[[6-9]].*|applellvm-[[1-9][0-9]]*)
201 AC_MSG_RESULT([ok (Apple LLVM version ${gcc_version})])
203 icc-1[[3-9]].*|icc-202[[0-9]].*)
204 AC_MSG_RESULT([ok (ICC version ${gcc_version})])
206 notclang-[[3-9]]|notclang-[[3-9]].*|notclang-[[1-9][0-9]]*)
207 AC_MSG_RESULT([ok (${gcc_version})])
209 clang-2.9|clang-[[3-9]].*|clang-[[1-9][0-9]]*)
210 AC_MSG_RESULT([ok (clang-${gcc_version})])
213 AC_MSG_RESULT([no (${is_clang}-${gcc_version})])
214 AC_MSG_ERROR([please use gcc >= 3.0 or clang >= 2.9 or icc >= 13.0 or Apple LLVM >= 5.1])
218 #----------------------------------------------------------------------------
219 # Arch/OS/platform tests.
220 #----------------------------------------------------------------------------
221 # We create a number of arch/OS/platform-related variables. We prefix them
222 # all with "VGCONF_" which indicates that they are defined at
223 # configure-time, and distinguishes them from the VGA_*/VGO_*/VGP_*
224 # variables used when compiling C files.
228 AC_MSG_CHECKING([for a supported CPU])
230 # ARCH_MAX reflects the most that this CPU can do: for example if it
231 # is a 64-bit capable PowerPC, then it must be set to ppc64 and not ppc32.
232 # Ditto for amd64. It is used for more configuration below, but is not used
235 # Power PC returns powerpc for Big Endian. This was not changed when Little
236 # Endian support was added to the 64-bit architecture. The 64-bit Little
237 # Endian systems explicitly state le in the host_cpu. For clarity in the
238 # Valgrind code, the ARCH_MAX name will state LE or BE for the endianness of
239 # the 64-bit system. Big Endian is the only mode supported on 32-bit Power PC.
240 # The abreviation PPC or ppc refers to 32-bit and 64-bit systems with either
241 # Endianness. The name PPC64 or ppc64 to 64-bit systems of either Endianness.
242 # The names ppc64be or PPC64BE refer to only 64-bit systems that are Big
243 # Endian. Similarly, ppc64le or PPC64LE refer to only 64-bit systems that are
246 case "${host_cpu}" in
248 AC_MSG_RESULT([ok (${host_cpu})])
253 AC_MSG_RESULT([ok (${host_cpu})])
258 # this only referrs to 64-bit Big Endian
259 AC_MSG_RESULT([ok (${host_cpu})])
264 # this only referrs to 64-bit Little Endian
265 AC_MSG_RESULT([ok (${host_cpu})])
270 # On Linux this means only a 32-bit capable CPU.
271 AC_MSG_RESULT([ok (${host_cpu})])
276 AC_MSG_RESULT([ok (${host_cpu})])
281 AC_MSG_RESULT([ok (${host_cpu})])
286 AC_MSG_RESULT([ok (${host_cpu})])
291 AC_MSG_RESULT([ok (${host_cpu})])
296 AC_MSG_RESULT([ok (${host_cpu})])
301 AC_MSG_RESULT([ok (${host_cpu})])
306 AC_MSG_RESULT([ok (${host_cpu})])
311 AC_MSG_RESULT([ok (${host_cpu})])
315 AC_MSG_RESULT([ok (${host_cpu})])
320 AC_MSG_RESULT([no (${host_cpu})])
321 AC_MSG_ERROR([Unsupported host architecture. Sorry])
325 #----------------------------------------------------------------------------
327 # Sometimes it's convenient to subvert the bi-arch build system and
328 # just have a single build even though the underlying platform is
329 # capable of both. Hence handle --enable-only64bit and
330 # --enable-only32bit. Complain if both are issued :-)
331 # [Actually, if either of these options are used, I think both get built,
332 # but only one gets installed. So if you use an in-place build, both can be
335 # Check if a 64-bit only build has been requested
336 AC_CACHE_CHECK([for a 64-bit only build], vg_cv_only64bit,
337 [AC_ARG_ENABLE(only64bit,
338 [ --enable-only64bit do a 64-bit only build],
339 [vg_cv_only64bit=$enableval],
340 [vg_cv_only64bit=no])])
342 # Check if a 32-bit only build has been requested
343 AC_CACHE_CHECK([for a 32-bit only build], vg_cv_only32bit,
344 [AC_ARG_ENABLE(only32bit,
345 [ --enable-only32bit do a 32-bit only build],
346 [vg_cv_only32bit=$enableval],
347 [vg_cv_only32bit=no])])
350 if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
352 [Nonsensical: both --enable-only64bit and --enable-only32bit.])
355 #----------------------------------------------------------------------------
357 # VGCONF_OS is the primary build OS, eg. "linux". It is passed in to
358 # compilation of many C files via -VGO_$(VGCONF_OS) and
359 # -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS).
360 AC_MSG_CHECKING([for a supported OS])
367 AC_MSG_RESULT([ok (${host_os})])
370 # Ok, this is linux. Check the kernel version
371 AC_MSG_CHECKING([for the kernel version])
376 0.*|1.*|2.0.*|2.1.*|2.2.*|2.3.*|2.4.*|2.5.*)
377 AC_MSG_RESULT([unsupported (${kernel})])
378 AC_MSG_ERROR([Valgrind needs a Linux kernel >= 2.6])
382 AC_MSG_RESULT([2.6 or later (${kernel})])
389 AC_MSG_RESULT([ok (${host_os})])
391 AC_DEFINE([FREEBSD_10], 1000, [FREEBSD_VERS value for FreeBSD 10.x])
393 AC_DEFINE([FREEBSD_11], 1100, [FREEBSD_VERS value for FreeBSD 11.x])
395 AC_DEFINE([FREEBSD_12], 1200, [FREEBSD_VERS value for FreeBSD 12.0 to 12.1])
397 AC_DEFINE([FREEBSD_12_2], 1220, [FREEBSD_VERS value for FreeBSD 12.2])
399 AC_DEFINE([FREEBSD_13_0], 1300, [FREEBSD_VERS value for FreeBSD 13.0])
401 AC_DEFINE([FREEBSD_13_1], 1310, [FREEBSD_VERS value for FreeBSD 13.1+])
403 AC_DEFINE([FREEBSD_14], 1400, [FREEBSD_VERS value for FreeBSD 14.x])
406 AC_MSG_CHECKING([for the kernel version])
411 AC_MSG_RESULT([FreeBSD 10.x (${kernel})])
412 AC_DEFINE([FREEBSD_VERS], FREEBSD_10, [FreeBSD version])
413 freebsd_vers=$freebsd_10
416 AC_MSG_RESULT([FreeBSD 11.x (${kernel})])
417 AC_DEFINE([FREEBSD_VERS], FREEBSD_11, [FreeBSD version])
418 freebsd_vers=$freebsd_11
423 AC_MSG_RESULT([FreeBSD 12.x (${kernel})])
424 AC_DEFINE([FREEBSD_VERS], FREEBSD_12, [FreeBSD version])
425 freebsd_vers=$freebsd_12
428 AC_MSG_RESULT([FreeBSD 12.x (${kernel})])
429 AC_DEFINE([FREEBSD_VERS], FREEBSD_12_2, [FreeBSD version])
430 freebsd_vers=$freebsd_12_2
437 AC_MSG_RESULT([FreeBSD 13.0 (${kernel})])
438 AC_DEFINE([FREEBSD_VERS], FREEBSD_13_0, [FreeBSD version])
439 freebsd_vers=$freebsd_13_0
442 AC_MSG_RESULT([FreeBSD 13.1+ (${kernel})])
443 AC_DEFINE([FREEBSD_VERS], FREEBSD_13_1, [FreeBSD version])
444 freebsd_vers=$freebsd_13_1
449 AC_MSG_RESULT([FreeBSD 14.x (${kernel})])
450 AC_DEFINE([FREEBSD_VERS], FREEBSD_14, [FreeBSD version])
451 freebsd_vers=$freebsd_14
454 AC_MSG_RESULT([unsupported (${kernel})])
455 AC_MSG_ERROR([Valgrind works on FreeBSD 10.x to 14.x])
459 DEFAULT_SUPP="$srcdir/freebsd.supp $srcdir/freebsd-helgrind.supp $srcdir/freebsd-drd.supp ${DEFAULT_SUPP}"
463 AC_MSG_RESULT([ok (${host_os})])
465 AC_DEFINE([DARWIN_10_5], 100500, [DARWIN_VERS value for Mac OS X 10.5])
466 AC_DEFINE([DARWIN_10_6], 100600, [DARWIN_VERS value for Mac OS X 10.6])
467 AC_DEFINE([DARWIN_10_7], 100700, [DARWIN_VERS value for Mac OS X 10.7])
468 AC_DEFINE([DARWIN_10_8], 100800, [DARWIN_VERS value for Mac OS X 10.8])
469 AC_DEFINE([DARWIN_10_9], 100900, [DARWIN_VERS value for Mac OS X 10.9])
470 AC_DEFINE([DARWIN_10_10], 101000, [DARWIN_VERS value for Mac OS X 10.10])
471 AC_DEFINE([DARWIN_10_11], 101100, [DARWIN_VERS value for Mac OS X 10.11])
472 AC_DEFINE([DARWIN_10_12], 101200, [DARWIN_VERS value for macOS 10.12])
473 AC_DEFINE([DARWIN_10_13], 101300, [DARWIN_VERS value for macOS 10.13])
475 AC_MSG_CHECKING([for the kernel version])
478 # Nb: for Darwin we set DEFAULT_SUPP here. That's because Darwin
479 # has only one relevant version, the OS version. The `uname` check
480 # is a good way to get that version (i.e. "Darwin 9.6.0" is Mac OS
481 # X 10.5.6, and "Darwin 10.x" is Mac OS X 10.6.x Snow Leopard,
482 # and possibly "Darwin 11.x" is Mac OS X 10.7.x Lion),
483 # and we don't know of an macros similar to __GLIBC__ to get that info.
485 # XXX: `uname -r` won't do the right thing for cross-compiles, but
486 # that's not a problem yet.
488 # jseward 21 Sept 2011: I seriously doubt whether V 3.7.0 will work
489 # on OS X 10.5.x; I haven't tested yet, and only plan to test 3.7.0
490 # on 10.6.8 and 10.7.1. Although tempted to delete the configure
491 # time support for 10.5 (the 9.* pattern just below), I'll leave it
492 # in for now, just in case anybody wants to give it a try. But I'm
493 # assuming that 3.7.0 is a Snow Leopard and Lion-only release.
496 AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard])
497 AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version])
498 DEFAULT_SUPP="$srcdir/darwin9.supp ${DEFAULT_SUPP}"
499 DEFAULT_SUPP="$srcdir/darwin9-drd.supp ${DEFAULT_SUPP}"
502 AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard])
503 AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version])
504 DEFAULT_SUPP="$srcdir/darwin10.supp ${DEFAULT_SUPP}"
505 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
508 AC_MSG_RESULT([Darwin 11.x (${kernel}) / Mac OS X 10.7 Lion])
509 AC_DEFINE([DARWIN_VERS], DARWIN_10_7, [Darwin / Mac OS X version])
510 DEFAULT_SUPP="$srcdir/darwin11.supp ${DEFAULT_SUPP}"
511 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
514 AC_MSG_RESULT([Darwin 12.x (${kernel}) / Mac OS X 10.8 Mountain Lion])
515 AC_DEFINE([DARWIN_VERS], DARWIN_10_8, [Darwin / Mac OS X version])
516 DEFAULT_SUPP="$srcdir/darwin12.supp ${DEFAULT_SUPP}"
517 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
520 AC_MSG_RESULT([Darwin 13.x (${kernel}) / Mac OS X 10.9 Mavericks])
521 AC_DEFINE([DARWIN_VERS], DARWIN_10_9, [Darwin / Mac OS X version])
522 DEFAULT_SUPP="$srcdir/darwin13.supp ${DEFAULT_SUPP}"
523 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
526 AC_MSG_RESULT([Darwin 14.x (${kernel}) / Mac OS X 10.10 Yosemite])
527 AC_DEFINE([DARWIN_VERS], DARWIN_10_10, [Darwin / Mac OS X version])
528 DEFAULT_SUPP="$srcdir/darwin14.supp ${DEFAULT_SUPP}"
529 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
532 AC_MSG_RESULT([Darwin 15.x (${kernel}) / Mac OS X 10.11 El Capitan])
533 AC_DEFINE([DARWIN_VERS], DARWIN_10_11, [Darwin / Mac OS X version])
534 DEFAULT_SUPP="$srcdir/darwin15.supp ${DEFAULT_SUPP}"
535 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
538 AC_MSG_RESULT([Darwin 16.x (${kernel}) / macOS 10.12 Sierra])
539 AC_DEFINE([DARWIN_VERS], DARWIN_10_12, [Darwin / Mac OS X version])
540 DEFAULT_SUPP="$srcdir/darwin16.supp ${DEFAULT_SUPP}"
541 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
544 AC_MSG_RESULT([Darwin 17.x (${kernel}) / macOS 10.13 High Sierra])
545 AC_DEFINE([DARWIN_VERS], DARWIN_10_13, [Darwin / Mac OS X version])
546 DEFAULT_SUPP="$srcdir/darwin17.supp ${DEFAULT_SUPP}"
547 DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
550 AC_MSG_RESULT([unsupported (${kernel})])
551 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)])
557 AC_MSG_RESULT([ok (${host_os})])
560 uname_v=$( uname -v )
563 DEFAULT_SUPP="$srcdir/solaris12.supp ${DEFAULT_SUPP}"
566 DEFAULT_SUPP="$srcdir/solaris11.supp ${DEFAULT_SUPP}"
572 AC_MSG_RESULT([ok (${host_os})])
574 DEFAULT_SUPP="$srcdir/solaris12.supp ${DEFAULT_SUPP}"
578 AC_MSG_RESULT([no (${host_os})])
579 AC_MSG_ERROR([Valgrind is operating system specific. Sorry.])
583 #----------------------------------------------------------------------------
585 # If we are building on a 64 bit platform test to see if the system
586 # supports building 32 bit programs and disable 32 bit support if it
587 # does not support building 32 bit programs
589 case "$ARCH_MAX-$VGCONF_OS" in
590 amd64-linux|ppc64be-linux|arm64-linux|amd64-solaris)
591 AC_MSG_CHECKING([for 32 bit build support])
594 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
599 vg_cv_only64bit="yes"
602 CFLAGS=$safe_CFLAGS;;
604 AC_MSG_CHECKING([for 32 bit build support])
606 CFLAGS="$CFLAGS -mips32 -mabi=32"
607 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
608 #include <sys/prctl.h>
612 vg_cv_only64bit="yes"
615 CFLAGS=$safe_CFLAGS;;
618 if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
620 [--enable-only32bit was specified but system does not support 32 bit builds])
623 #----------------------------------------------------------------------------
625 # VGCONF_ARCH_PRI is the arch for the primary build target, eg. "amd64". By
626 # default it's the same as ARCH_MAX. But if, say, we do a build on an amd64
627 # machine, but --enable-only32bit has been requested, then ARCH_MAX (see
628 # above) will be "amd64" since that reflects the most that this cpu can do,
629 # but VGCONF_ARCH_PRI will be downgraded to "x86", since that reflects the
630 # arch corresponding to the primary build (VGCONF_PLATFORM_PRI_CAPS). It is
631 # passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_PRI) and
632 # -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS).
633 AC_SUBST(VGCONF_ARCH_PRI)
635 # VGCONF_ARCH_SEC is the arch for the secondary build target, eg. "x86".
636 # It is passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_SEC)
637 # and -VGP_$(VGCONF_ARCH_SEC)_$(VGCONF_OS), if there is a secondary target.
638 # It is empty if there is no secondary target.
639 AC_SUBST(VGCONF_ARCH_SEC)
641 # VGCONF_PLATFORM_PRI_CAPS is the primary build target, eg. "AMD64_LINUX".
642 # The entire system, including regression and performance tests, will be
643 # built for this target. The "_CAPS" indicates that the name is in capital
644 # letters, and it also uses '_' rather than '-' as a separator, because it's
645 # used to create various Makefile variables, which are all in caps by
646 # convention and cannot contain '-' characters. This is in contrast to
647 # VGCONF_ARCH_PRI and VGCONF_OS which are not in caps.
648 AC_SUBST(VGCONF_PLATFORM_PRI_CAPS)
650 # VGCONF_PLATFORM_SEC_CAPS is the secondary build target, if there is one.
651 # Valgrind and tools will also be built for this target, but not the
652 # regression or performance tests.
654 # By default, the primary arch is the same as the "max" arch, as commented
655 # above (at the definition of ARCH_MAX). We may choose to downgrade it in
656 # the big case statement just below here, in the case where we're building
657 # on a 64 bit machine but have been requested only to do a 32 bit build.
658 AC_SUBST(VGCONF_PLATFORM_SEC_CAPS)
660 AC_MSG_CHECKING([for a supported CPU/OS combination])
662 # NB. The load address for a given platform may be specified in more
663 # than one place, in some cases, depending on whether we're doing a biarch,
664 # 32-bit only or 64-bit only build. eg see case for amd64-linux below.
665 # Be careful to give consistent values in all subcases. Also, all four
666 # valt_load_addres_{pri,sec}_{norml,inner} values must always be set,
667 # even if it is to "0xUNSET".
669 case "$ARCH_MAX-$VGCONF_OS" in
671 VGCONF_ARCH_PRI="x86"
673 VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
674 VGCONF_PLATFORM_SEC_CAPS=""
675 valt_load_address_pri_norml="0x58000000"
676 valt_load_address_pri_inner="0x38000000"
677 valt_load_address_sec_norml="0xUNSET"
678 valt_load_address_sec_inner="0xUNSET"
679 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
682 valt_load_address_sec_norml="0xUNSET"
683 valt_load_address_sec_inner="0xUNSET"
684 if test x$vg_cv_only64bit = xyes; then
685 VGCONF_ARCH_PRI="amd64"
687 VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
688 VGCONF_PLATFORM_SEC_CAPS=""
689 valt_load_address_pri_norml="0x58000000"
690 valt_load_address_pri_inner="0x38000000"
691 elif test x$vg_cv_only32bit = xyes; then
692 VGCONF_ARCH_PRI="x86"
694 VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
695 VGCONF_PLATFORM_SEC_CAPS=""
696 valt_load_address_pri_norml="0x58000000"
697 valt_load_address_pri_inner="0x38000000"
699 VGCONF_ARCH_PRI="amd64"
700 VGCONF_ARCH_SEC="x86"
701 VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
702 VGCONF_PLATFORM_SEC_CAPS="X86_LINUX"
703 valt_load_address_pri_norml="0x58000000"
704 valt_load_address_pri_inner="0x38000000"
705 valt_load_address_sec_norml="0x58000000"
706 valt_load_address_sec_inner="0x38000000"
708 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
711 VGCONF_ARCH_PRI="ppc32"
713 VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
714 VGCONF_PLATFORM_SEC_CAPS=""
715 valt_load_address_pri_norml="0x58000000"
716 valt_load_address_pri_inner="0x38000000"
717 valt_load_address_sec_norml="0xUNSET"
718 valt_load_address_sec_inner="0xUNSET"
719 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
722 valt_load_address_sec_norml="0xUNSET"
723 valt_load_address_sec_inner="0xUNSET"
724 if test x$vg_cv_only64bit = xyes; then
725 VGCONF_ARCH_PRI="ppc64be"
727 VGCONF_PLATFORM_PRI_CAPS="PPC64BE_LINUX"
728 VGCONF_PLATFORM_SEC_CAPS=""
729 valt_load_address_pri_norml="0x58000000"
730 valt_load_address_pri_inner="0x38000000"
731 elif test x$vg_cv_only32bit = xyes; then
732 VGCONF_ARCH_PRI="ppc32"
734 VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
735 VGCONF_PLATFORM_SEC_CAPS=""
736 valt_load_address_pri_norml="0x58000000"
737 valt_load_address_pri_inner="0x38000000"
739 VGCONF_ARCH_PRI="ppc64be"
740 VGCONF_ARCH_SEC="ppc32"
741 VGCONF_PLATFORM_PRI_CAPS="PPC64BE_LINUX"
742 VGCONF_PLATFORM_SEC_CAPS="PPC32_LINUX"
743 valt_load_address_pri_norml="0x58000000"
744 valt_load_address_pri_inner="0x38000000"
745 valt_load_address_sec_norml="0x58000000"
746 valt_load_address_sec_inner="0x38000000"
748 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
751 # Little Endian is only supported on PPC64
752 valt_load_address_sec_norml="0xUNSET"
753 valt_load_address_sec_inner="0xUNSET"
754 VGCONF_ARCH_PRI="ppc64le"
756 VGCONF_PLATFORM_PRI_CAPS="PPC64LE_LINUX"
757 VGCONF_PLATFORM_SEC_CAPS=""
758 valt_load_address_pri_norml="0x58000000"
759 valt_load_address_pri_inner="0x38000000"
760 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
763 VGCONF_ARCH_PRI="x86"
765 VGCONF_PLATFORM_PRI_CAPS="X86_FREEBSD"
766 VGCONF_PLATFORM_SEC_CAPS=""
767 valt_load_address_pri_norml="0x38000000"
768 valt_load_address_pri_inner="0x28000000"
769 valt_load_address_sec_norml="0xUNSET"
770 valt_load_address_sec_inner="0xUNSET"
771 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
774 if test x$vg_cv_only64bit = xyes; then
775 VGCONF_ARCH_PRI="amd64"
777 VGCONF_PLATFORM_PRI_CAPS="AMD64_FREEBSD"
778 VGCONF_PLATFORM_SEC_CAPS=""
779 elif test x$vg_cv_only32bit = xyes; then
780 VGCONF_ARCH_PRI="x86"
782 VGCONF_PLATFORM_PRI_CAPS="X86_FREEBSD"
783 VGCONF_PLATFORM_SEC_CAPS=""
785 VGCONF_ARCH_PRI="amd64"
786 VGCONF_ARCH_SEC="x86"
787 VGCONF_PLATFORM_PRI_CAPS="AMD64_FREEBSD"
788 VGCONF_PLATFORM_SEC_CAPS="X86_FREEBSD"
790 # These work with either base clang or ports installed gcc
791 # Hand rolled compilers probably need INSTALL_DIR/lib (at least for gcc)
792 if test x$is_clang = xclang ; then
793 FLAG_32ON64="-B/usr/lib32"
795 GCC_MAJOR_VERSION=`${CC} -dumpversion | $SED 's/\..*//' 2>/dev/null`
796 FLAG_32ON64="-B/usr/local/lib32/gcc${GCC_MAJOR_VERSION} -Wl,-rpath,/usr/local/lib32/gcc${GCC_MAJOR_VERSION}/"
798 valt_load_address_pri_norml="0x38000000"
799 valt_load_address_pri_inner="0x28000000"
800 valt_load_address_sec_norml="0x38000000"
801 valt_load_address_sec_inner="0x28000000"
802 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
804 # Darwin gets identified as 32-bit even when it supports 64-bit.
805 # (Not sure why, possibly because 'uname' returns "i386"?) Just about
806 # all Macs support both 32-bit and 64-bit, so we just build both. If
807 # someone has a really old 32-bit only machine they can (hopefully?)
808 # build with --enable-only32bit. See bug 243362.
809 x86-darwin|amd64-darwin)
811 valt_load_address_sec_norml="0xUNSET"
812 valt_load_address_sec_inner="0xUNSET"
813 if test x$vg_cv_only64bit = xyes; then
814 VGCONF_ARCH_PRI="amd64"
816 VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
817 VGCONF_PLATFORM_SEC_CAPS=""
818 valt_load_address_pri_norml="0x158000000"
819 valt_load_address_pri_inner="0x138000000"
820 elif test x$vg_cv_only32bit = xyes; then
821 VGCONF_ARCH_PRI="x86"
823 VGCONF_PLATFORM_PRI_CAPS="X86_DARWIN"
824 VGCONF_PLATFORM_SEC_CAPS=""
825 VGCONF_ARCH_PRI_CAPS="x86"
826 valt_load_address_pri_norml="0x58000000"
827 valt_load_address_pri_inner="0x38000000"
829 VGCONF_ARCH_PRI="amd64"
830 VGCONF_ARCH_SEC="x86"
831 VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
832 VGCONF_PLATFORM_SEC_CAPS="X86_DARWIN"
833 valt_load_address_pri_norml="0x158000000"
834 valt_load_address_pri_inner="0x138000000"
835 valt_load_address_sec_norml="0x58000000"
836 valt_load_address_sec_inner="0x38000000"
838 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
841 VGCONF_ARCH_PRI="arm"
842 VGCONF_PLATFORM_PRI_CAPS="ARM_LINUX"
843 VGCONF_PLATFORM_SEC_CAPS=""
844 valt_load_address_pri_norml="0x58000000"
845 valt_load_address_pri_inner="0x38000000"
846 valt_load_address_sec_norml="0xUNSET"
847 valt_load_address_sec_inner="0xUNSET"
848 AC_MSG_RESULT([ok (${host_cpu}-${host_os})])
851 valt_load_address_sec_norml="0xUNSET"
852 valt_load_address_sec_inner="0xUNSET"
853 if test x$vg_cv_only64bit = xyes; then
854 VGCONF_ARCH_PRI="arm64"
856 VGCONF_PLATFORM_PRI_CAPS="ARM64_LINUX"
857 VGCONF_PLATFORM_SEC_CAPS=""
858 valt_load_address_pri_norml="0x58000000"
859 valt_load_address_pri_inner="0x38000000"
860 elif test x$vg_cv_only32bit = xyes; then
861 VGCONF_ARCH_PRI="arm"
863 VGCONF_PLATFORM_PRI_CAPS="ARM_LINUX"
864 VGCONF_PLATFORM_SEC_CAPS=""
865 valt_load_address_pri_norml="0x58000000"
866 valt_load_address_pri_inner="0x38000000"
868 VGCONF_ARCH_PRI="arm64"
869 VGCONF_ARCH_SEC="arm"
870 VGCONF_PLATFORM_PRI_CAPS="ARM64_LINUX"
871 VGCONF_PLATFORM_SEC_CAPS="ARM_LINUX"
872 valt_load_address_pri_norml="0x58000000"
873 valt_load_address_pri_inner="0x38000000"
874 valt_load_address_sec_norml="0x58000000"
875 valt_load_address_sec_inner="0x38000000"
877 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
880 VGCONF_ARCH_PRI="s390x"
882 VGCONF_PLATFORM_PRI_CAPS="S390X_LINUX"
883 VGCONF_PLATFORM_SEC_CAPS=""
884 # To improve branch prediction hit rate we want to have
885 # the generated code close to valgrind (host) code
886 valt_load_address_pri_norml="0x800000000"
887 valt_load_address_pri_inner="0x810000000"
888 valt_load_address_sec_norml="0xUNSET"
889 valt_load_address_sec_inner="0xUNSET"
890 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
893 VGCONF_ARCH_PRI="mips32"
895 VGCONF_PLATFORM_PRI_CAPS="MIPS32_LINUX"
896 VGCONF_PLATFORM_SEC_CAPS=""
897 valt_load_address_pri_norml="0x58000000"
898 valt_load_address_pri_inner="0x38000000"
899 valt_load_address_sec_norml="0xUNSET"
900 valt_load_address_sec_inner="0xUNSET"
901 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
904 valt_load_address_sec_norml="0xUNSET"
905 valt_load_address_sec_inner="0xUNSET"
906 if test x$vg_cv_only64bit = xyes; then
907 VGCONF_ARCH_PRI="mips64"
908 VGCONF_PLATFORM_SEC_CAPS=""
909 VGCONF_PLATFORM_PRI_CAPS="MIPS64_LINUX"
910 VGCONF_PLATFORM_SEC_CAPS=""
911 valt_load_address_pri_norml="0x58000000"
912 valt_load_address_pri_inner="0x38000000"
913 elif test x$vg_cv_only32bit = xyes; then
914 VGCONF_ARCH_PRI="mips32"
916 VGCONF_PLATFORM_PRI_CAPS="MIPS32_LINUX"
917 VGCONF_PLATFORM_SEC_CAPS=""
918 valt_load_address_pri_norml="0x58000000"
919 valt_load_address_pri_inner="0x38000000"
921 VGCONF_ARCH_PRI="mips64"
922 VGCONF_ARCH_SEC="mips32"
923 VGCONF_PLATFORM_PRI_CAPS="MIPS64_LINUX"
924 VGCONF_PLATFORM_SEC_CAPS="MIPS32_LINUX"
925 valt_load_address_pri_norml="0x58000000"
926 valt_load_address_pri_inner="0x38000000"
927 valt_load_address_sec_norml="0x58000000"
928 valt_load_address_sec_inner="0x38000000"
930 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
933 VGCONF_ARCH_PRI="nanomips"
935 VGCONF_PLATFORM_PRI_CAPS="NANOMIPS_LINUX"
936 VGCONF_PLATFORM_SEC_CAPS=""
937 valt_load_address_pri_norml="0x58000000"
938 valt_load_address_pri_inner="0x38000000"
939 valt_load_address_sec_norml="0xUNSET"
940 valt_load_address_sec_inner="0xUNSET"
941 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
944 VGCONF_ARCH_PRI="x86"
946 VGCONF_PLATFORM_PRI_CAPS="X86_SOLARIS"
947 VGCONF_PLATFORM_SEC_CAPS=""
948 valt_load_address_pri_norml="0x58000000"
949 valt_load_address_pri_inner="0x38000000"
950 valt_load_address_sec_norml="0xUNSET"
951 valt_load_address_sec_inner="0xUNSET"
952 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
955 valt_load_address_sec_norml="0xUNSET"
956 valt_load_address_sec_inner="0xUNSET"
957 if test x$vg_cv_only64bit = xyes; then
958 VGCONF_ARCH_PRI="amd64"
960 VGCONF_PLATFORM_PRI_CAPS="AMD64_SOLARIS"
961 VGCONF_PLATFORM_SEC_CAPS=""
962 valt_load_address_pri_norml="0x58000000"
963 valt_load_address_pri_inner="0x38000000"
964 elif test x$vg_cv_only32bit = xyes; then
965 VGCONF_ARCH_PRI="x86"
967 VGCONF_PLATFORM_PRI_CAPS="X86_SOLARIS"
968 VGCONF_PLATFORM_SEC_CAPS=""
969 valt_load_address_pri_norml="0x58000000"
970 valt_load_address_pri_inner="0x38000000"
972 VGCONF_ARCH_PRI="amd64"
973 VGCONF_ARCH_SEC="x86"
974 VGCONF_PLATFORM_PRI_CAPS="AMD64_SOLARIS"
975 VGCONF_PLATFORM_SEC_CAPS="X86_SOLARIS"
976 valt_load_address_pri_norml="0x58000000"
977 valt_load_address_pri_inner="0x38000000"
978 valt_load_address_sec_norml="0x58000000"
979 valt_load_address_sec_inner="0x38000000"
981 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
984 VGCONF_ARCH_PRI="unknown"
985 VGCONF_ARCH_SEC="unknown"
986 VGCONF_PLATFORM_PRI_CAPS="UNKNOWN"
987 VGCONF_PLATFORM_SEC_CAPS="UNKNOWN"
988 valt_load_address_pri_norml="0xUNSET"
989 valt_load_address_pri_inner="0xUNSET"
990 valt_load_address_sec_norml="0xUNSET"
991 valt_load_address_sec_inner="0xUNSET"
992 AC_MSG_RESULT([no (${ARCH_MAX}-${VGCONF_OS})])
993 AC_MSG_ERROR([Valgrind is platform specific. Sorry. Please consider doing a port.])
997 #----------------------------------------------------------------------------
999 # Set up VGCONF_ARCHS_INCLUDE_<arch>. Either one or two of these become
1001 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_X86,
1002 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
1003 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
1004 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_FREEBSD \
1005 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_FREEBSD \
1006 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
1007 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN \
1008 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \
1009 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_SOLARIS )
1010 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_AMD64,
1011 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
1012 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD \
1013 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN \
1014 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS )
1015 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC32,
1016 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
1017 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX )
1018 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC64,
1019 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64BE_LINUX \
1020 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64LE_LINUX )
1021 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM,
1022 test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
1023 -o x$VGCONF_PLATFORM_SEC_CAPS = xARM_LINUX )
1024 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM64,
1025 test x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX )
1026 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_S390X,
1027 test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX )
1028 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_MIPS32,
1029 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
1030 -o x$VGCONF_PLATFORM_SEC_CAPS = xMIPS32_LINUX )
1031 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_MIPS64,
1032 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX )
1033 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_NANOMIPS,
1034 test x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX )
1036 # Set up VGCONF_PLATFORMS_INCLUDE_<platform>. Either one or two of these
1038 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_LINUX,
1039 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
1040 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX)
1041 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX,
1042 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX)
1043 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX,
1044 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
1045 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX)
1046 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64BE_LINUX,
1047 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64BE_LINUX)
1048 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64LE_LINUX,
1049 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64LE_LINUX)
1050 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_ARM_LINUX,
1051 test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
1052 -o x$VGCONF_PLATFORM_SEC_CAPS = xARM_LINUX)
1053 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_ARM64_LINUX,
1054 test x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX)
1055 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_S390X_LINUX,
1056 test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \
1057 -o x$VGCONF_PLATFORM_SEC_CAPS = xS390X_LINUX)
1058 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_MIPS32_LINUX,
1059 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
1060 -o x$VGCONF_PLATFORM_SEC_CAPS = xMIPS32_LINUX)
1061 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_MIPS64_LINUX,
1062 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX)
1063 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_NANOMIPS_LINUX,
1064 test x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX)
1065 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_FREEBSD,
1066 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_FREEBSD \
1067 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_FREEBSD)
1068 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_FREEBSD,
1069 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD)
1070 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_DARWIN,
1071 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
1072 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN)
1073 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN,
1074 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
1075 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_SOLARIS,
1076 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \
1077 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_SOLARIS)
1078 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_SOLARIS,
1079 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS)
1082 # Similarly, set up VGCONF_OS_IS_<os>. Exactly one of these becomes defined.
1083 # Relies on the assumption that the primary and secondary targets are
1084 # for the same OS, so therefore only necessary to test the primary.
1085 AM_CONDITIONAL(VGCONF_OS_IS_LINUX,
1086 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
1087 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
1088 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
1089 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64BE_LINUX \
1090 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64LE_LINUX \
1091 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
1092 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX \
1093 -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \
1094 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
1095 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \
1096 -o x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX)
1097 AM_CONDITIONAL(VGCONF_OS_IS_FREEBSD,
1098 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_FREEBSD \
1099 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD)
1100 AM_CONDITIONAL(VGCONF_OS_IS_DARWIN,
1101 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
1102 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
1103 AM_CONDITIONAL(VGCONF_OS_IS_SOLARIS,
1104 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \
1105 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS)
1106 AM_CONDITIONAL(VGCONF_OS_IS_DARWIN_OR_FREEBSD,
1107 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_FREEBSD \
1108 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD \
1109 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
1110 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
1113 # Sometimes, in the Makefile.am files, it's useful to know whether or not
1114 # there is a secondary target.
1115 AM_CONDITIONAL(VGCONF_HAVE_PLATFORM_SEC,
1116 test x$VGCONF_PLATFORM_SEC_CAPS != x)
1118 dnl automake-1.10 does not have AM_COND_IF (added in 1.11), so we supply a
1119 dnl fallback definition
1120 dnl The macro is courtesy of Dave Hart:
1121 dnl https://lists.gnu.org/archive/html/automake/2010-12/msg00045.html
1122 m4_ifndef([AM_COND_IF], [AC_DEFUN([AM_COND_IF], [
1123 if test -z "$$1_TRUE"; then :
1132 #----------------------------------------------------------------------------
1134 #----------------------------------------------------------------------------
1136 # Check if this should be built as an inner Valgrind, to be run within
1137 # another Valgrind. Choose the load address accordingly.
1138 AC_SUBST(VALT_LOAD_ADDRESS_PRI)
1139 AC_SUBST(VALT_LOAD_ADDRESS_SEC)
1140 AC_CACHE_CHECK([for use as an inner Valgrind], vg_cv_inner,
1141 [AC_ARG_ENABLE(inner,
1142 [ --enable-inner enables self-hosting],
1143 [vg_cv_inner=$enableval],
1145 if test "$vg_cv_inner" = yes; then
1146 AC_DEFINE([ENABLE_INNER], 1, [configured to run as an inner Valgrind])
1147 VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_inner
1148 VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_inner
1150 VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_norml
1151 VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_norml
1154 #----------------------------------------------------------------------------
1155 # Undefined behaviour sanitiser
1156 #----------------------------------------------------------------------------
1157 # Check whether we should build with the undefined beahviour sanitiser.
1159 AC_CACHE_CHECK([for using the undefined behaviour sanitiser], vg_cv_ubsan,
1160 [AC_ARG_ENABLE(ubsan,
1161 [ --enable-ubsan enables the undefined behaviour sanitiser],
1162 [vg_cv_ubsan=$enableval],
1165 #----------------------------------------------------------------------------
1166 # Extra fine-tuning of installation directories
1167 #----------------------------------------------------------------------------
1169 [ --with-tmpdir=PATH Specify path for temporary files],
1172 AC_DEFINE_UNQUOTED(VG_TMPDIR, "$tmpdir", [Temporary files directory])
1173 AC_SUBST(VG_TMPDIR, [$tmpdir])
1175 #----------------------------------------------------------------------------
1177 #----------------------------------------------------------------------------
1178 AM_COND_IF([VGCONF_OS_IS_DARWIN],
1179 [AC_CHECK_PROG([XCRUN], [xcrun], [yes], [no])
1180 AC_MSG_CHECKING([for xcode sdk include path])
1181 AC_ARG_WITH(xcodedir,
1182 [ --with-xcode-path=PATH Specify path for xcode sdk includes],
1183 [xcodedir="$withval"],
1185 if test "x$XCRUN" != "xno" -a ! -d /usr/include; then
1186 xcrundir=`xcrun --sdk macosx --show-sdk-path`
1187 if test -z "$xcrundir"; then
1188 xcodedir="/usr/include"
1190 xcodedir="$xcrundir/usr/include"
1193 xcodedir="/usr/include"
1196 AC_MSG_RESULT([$xcodedir])
1197 AC_DEFINE_UNQUOTED(XCODE_DIR, "$xcodedir", [xcode sdk include directory])
1198 AC_SUBST(XCODE_DIR, [$xcodedir])])
1200 #----------------------------------------------------------------------------
1201 # Libc and suppressions
1202 #----------------------------------------------------------------------------
1203 # This variable will collect the suppression files to be used.
1204 AC_SUBST(DEFAULT_SUPP)
1206 AC_CHECK_HEADER([features.h])
1208 if test x$ac_cv_header_features_h = xyes; then
1209 AC_DEFINE([HAVE_HEADER_FEATURES_H], 1,
1210 [Define to 1 if you have the `features.h' header.])
1211 rm -f conftest.$ac_ext
1212 cat <<_ACEOF >conftest.$ac_ext
1213 #include <features.h>
1214 #if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__)
1215 glibc version is: __GLIBC__ __GLIBC_MINOR__
1218 GLIBC_VERSION="`$CPP -P conftest.$ac_ext | $SED -n 's/^glibc version is: //p' | $SED 's/ /./g'`"
1221 # not really a version check
1222 AC_EGREP_CPP([DARWIN_LIBC], [
1223 #include <sys/cdefs.h>
1224 #if defined(__DARWIN_VERS_1050)
1228 GLIBC_VERSION="darwin")
1230 AC_EGREP_CPP([FREEBSD_LIBC], [
1231 #include <sys/cdefs.h>
1232 #if defined(__FreeBSD__)
1236 GLIBC_VERSION="freebsd")
1238 # not really a version check
1239 AC_EGREP_CPP([BIONIC_LIBC], [
1240 #if defined(__ANDROID__)
1244 GLIBC_VERSION="bionic")
1246 # there is only one version of libc on Solaris
1247 if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \
1248 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS; then
1249 GLIBC_VERSION="solaris"
1252 # GLIBC_VERSION is empty if a musl libc is used, so use the toolchain tuple
1254 if test x$GLIBC_VERSION = x; then
1255 if $CC -dumpmachine | grep -q musl; then
1260 # If this is glibc then figure out the generic (in file) libc.so and
1261 # libpthread.so file paths to use in suppressions. Before 2.34 libpthread
1262 # was a separate library, afterwards it was merged into libc.so and
1263 # the library is called libc.so.6 (before it was libc-2.[0-9]+.so).
1264 # Use this fact to set GLIBC_LIBC_PATH and GLIBC_LIBPTHREAD_PATH.
1265 case ${GLIBC_VERSION} in
1267 AC_MSG_CHECKING([whether pthread_create needs libpthread])
1268 AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_create])],
1271 GLIBC_LIBC_PATH="*/lib*/libc.so.6"
1272 GLIBC_LIBPTHREAD_PATH="$GLIBC_LIBC_PATH"
1274 AC_MSG_RESULT([yes])
1275 GLIBC_LIBC_PATH="*/lib*/libc-2.*so*"
1276 GLIBC_LIBPTHREAD_PATH="*/lib*/libpthread-2.*so*"
1280 AC_MSG_CHECKING([not glibc...])
1281 AC_MSG_RESULT([${GLIBC_VERSION}])
1285 AC_MSG_CHECKING([the glibc version])
1287 case "${GLIBC_VERSION}" in
1289 AC_MSG_RESULT(${GLIBC_VERSION} family)
1290 DEFAULT_SUPP="$srcdir/glibc-2.2.supp ${DEFAULT_SUPP}"
1291 DEFAULT_SUPP="$srcdir/glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
1292 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1295 AC_MSG_RESULT(${GLIBC_VERSION} family)
1296 DEFAULT_SUPP="$srcdir/glibc-${GLIBC_VERSION}.supp ${DEFAULT_SUPP}"
1297 DEFAULT_SUPP="glibc-2.X-helgrind.supp ${DEFAULT_SUPP}"
1298 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1301 AC_MSG_RESULT(${GLIBC_VERSION} family)
1302 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
1303 DEFAULT_SUPP="glibc-2.X-helgrind.supp ${DEFAULT_SUPP}"
1304 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1307 AC_MSG_RESULT(${GLIBC_VERSION} family)
1308 AC_DEFINE([GLIBC_MANDATORY_STRLEN_REDIRECT], 1,
1309 [Define to 1 if strlen() has been optimized heavily (amd64 glibc >= 2.10)])
1310 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
1311 DEFAULT_SUPP="glibc-2.X-helgrind.supp ${DEFAULT_SUPP}"
1312 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1315 AC_MSG_RESULT(${GLIBC_VERSION} family)
1316 AC_DEFINE([GLIBC_MANDATORY_STRLEN_REDIRECT], 1,
1317 [Define to 1 if strlen() has been optimized heavily (amd64 glibc >= 2.10)])
1318 AC_DEFINE([GLIBC_MANDATORY_INDEX_AND_STRLEN_REDIRECT], 1,
1319 [Define to 1 if index() and strlen() have been optimized heavily (x86 glibc >= 2.12)])
1320 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
1321 DEFAULT_SUPP="glibc-2.X-helgrind.supp ${DEFAULT_SUPP}"
1322 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1325 AC_MSG_RESULT(Darwin)
1326 AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
1327 # DEFAULT_SUPP set by kernel version check above.
1330 AC_MSG_RESULT(FreeBSD)
1331 AC_DEFINE([FREEBSD_LIBC], 1, [Define to 1 if you're using FreeBSD])
1332 # DEFAULT_SUPP set by kernel version check above.
1335 AC_MSG_RESULT(Bionic)
1336 AC_DEFINE([BIONIC_LIBC], 1, [Define to 1 if you're using Bionic])
1337 DEFAULT_SUPP="$srcdir/bionic.supp ${DEFAULT_SUPP}"
1340 AC_MSG_RESULT(Solaris)
1341 # DEFAULT_SUPP set in host_os switch-case above.
1342 # No other suppression file is used.
1346 AC_DEFINE([MUSL_LIBC], 1, [Define to 1 if you're using Musl libc])
1347 DEFAULT_SUPP="$srcdir/musl.supp ${DEFAULT_SUPP}"
1350 AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
1351 AC_MSG_ERROR([Valgrind requires glibc version 2.2 or later, uClibc,])
1352 AC_MSG_ERROR([musl libc, Darwin libc, Bionic libc or Solaris libc])
1356 AC_SUBST(GLIBC_VERSION)
1357 AC_SUBST(GLIBC_LIBC_PATH)
1358 AC_SUBST(GLIBC_LIBPTHREAD_PATH)
1361 if test "$VGCONF_OS" != "solaris"; then
1362 # Add default suppressions for the X client libraries. Make no
1363 # attempt to detect whether such libraries are installed on the
1364 # build machine (or even if any X facilities are present); just
1365 # add the suppressions antidisirregardless.
1366 DEFAULT_SUPP="$srcdir/xfree-4.supp ${DEFAULT_SUPP}"
1367 DEFAULT_SUPP="$srcdir/xfree-3.supp ${DEFAULT_SUPP}"
1371 #----------------------------------------------------------------------------
1372 # Platform variants?
1373 #----------------------------------------------------------------------------
1375 # Normally the PLAT = (ARCH, OS) characterisation of the platform is enough.
1376 # But there are times where we need a bit more control. The motivating
1377 # and currently only case is Android: this is almost identical to
1378 # {x86,arm,mips}-linux, but not quite. So this introduces the concept of
1379 # platform variant tags, which get passed in the compile as
1380 # -DVGPV_<arch>_<os>_<variant> along with the main -DVGP_<arch>_<os> definition.
1382 # In almost all cases, the <variant> bit is "vanilla". But for Android
1383 # it is "android" instead.
1385 # Consequently (eg), plain arm-linux would build with
1387 # -DVGP_arm_linux -DVGPV_arm_linux_vanilla
1389 # whilst an Android build would have
1391 # -DVGP_arm_linux -DVGPV_arm_linux_android
1393 # Same for x86. The setup of the platform variant is pushed relatively far
1394 # down this file in order that we can inspect any of the variables set above.
1396 # In the normal case ..
1397 VGCONF_PLATVARIANT="vanilla"
1400 if test "$GLIBC_VERSION" = "bionic";
1402 VGCONF_PLATVARIANT="android"
1405 AC_SUBST(VGCONF_PLATVARIANT)
1408 # FIXME: do we also want to define automake variables
1409 # VGCONF_PLATVARIANT_IS_<WHATEVER>, where WHATEVER is (currently)
1410 # VANILLA or ANDROID ? This would be in the style of VGCONF_ARCHS_INCLUDE,
1411 # VGCONF_PLATFORMS_INCLUDE and VGCONF_OS_IS above? Could easily enough
1412 # do that. Problem is that we can't do and-ing in Makefile.am's, but
1413 # that's what we'd need to do to use this, since what we'd want to write
1416 # VGCONF_PLATFORMS_INCLUDE_ARM_LINUX && VGCONF_PLATVARIANT_IS_ANDROID
1418 # Hmm. Can't think of a nice clean solution to this.
1420 AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_VANILLA,
1421 test x$VGCONF_PLATVARIANT = xvanilla)
1422 AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_ANDROID,
1423 test x$VGCONF_PLATVARIANT = xandroid)
1426 #----------------------------------------------------------------------------
1427 # Checking for various library functions and other definitions
1428 #----------------------------------------------------------------------------
1430 # Check for AT_FDCWD
1432 AC_MSG_CHECKING([for AT_FDCWD])
1433 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1440 ac_have_at_fdcwd=yes
1441 AC_MSG_RESULT([yes])
1447 AM_CONDITIONAL([HAVE_AT_FDCWD], [test x$ac_have_at_fdcwd = xyes])
1449 # Check for stpncpy function definition in string.h
1450 # This explicitly checks with _GNU_SOURCE defined since that is also
1451 # used in the test case (some systems might define it without anyway
1452 # since stpncpy is part of The Open Group Base Specifications Issue 7
1453 # IEEE Std 1003.1-2008.
1454 AC_MSG_CHECKING([for stpncpy])
1455 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1462 char *r = stpncpy(d, s, n);
1464 ac_have_gnu_stpncpy=yes
1465 AC_MSG_RESULT([yes])
1467 ac_have_gnu_stpncpy=no
1471 AM_CONDITIONAL([HAVE_GNU_STPNCPY], [test x$ac_have_gnu_stpncpy = xyes])
1473 # Check for PTRACE_GETREGS
1475 AC_MSG_CHECKING([for PTRACE_GETREGS])
1476 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1479 #include <sys/ptrace.h>
1480 #include <sys/user.h>
1483 long res = ptrace (PTRACE_GETREGS, 0, p, p);
1485 AC_MSG_RESULT([yes])
1486 AC_DEFINE([HAVE_PTRACE_GETREGS], 1,
1487 [Define to 1 if you have the `PTRACE_GETREGS' ptrace request.])
1493 # Check for CLOCK_MONOTONIC
1495 AC_MSG_CHECKING([for CLOCK_MONOTONIC])
1497 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1501 clock_gettime(CLOCK_MONOTONIC, &t);
1504 AC_MSG_RESULT([yes])
1505 AC_DEFINE([HAVE_CLOCK_MONOTONIC], 1,
1506 [Define to 1 if you have the `CLOCK_MONOTONIC' constant.])
1512 # Check for ELF32/64_CHDR
1514 AC_CHECK_TYPES([Elf32_Chdr, Elf64_Chdr], [], [], [[#include <elf.h>]])
1517 # Check for PTHREAD_RWLOCK_T
1519 AC_MSG_CHECKING([for pthread_rwlock_t])
1521 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1523 #include <pthread.h>
1525 pthread_rwlock_t rwl;
1527 AC_MSG_RESULT([yes])
1528 AC_DEFINE([HAVE_PTHREAD_RWLOCK_T], 1,
1529 [Define to 1 if you have the `pthread_rwlock_t' type.])
1534 # Check for CLOCKID_T
1536 AC_MSG_CHECKING([for clockid_t])
1538 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1543 AC_MSG_RESULT([yes])
1544 AC_DEFINE([HAVE_CLOCKID_T], 1,
1545 [Define to 1 if you have the `clockid_t' type.])
1550 # Check for PTHREAD_MUTEX_ADAPTIVE_NP
1552 AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP])
1554 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1556 #include <pthread.h>
1558 return (PTHREAD_MUTEX_ADAPTIVE_NP);
1560 AC_MSG_RESULT([yes])
1561 AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1,
1562 [Define to 1 if you have the `PTHREAD_MUTEX_ADAPTIVE_NP' constant.])
1568 # Check for PTHREAD_MUTEX_ERRORCHECK_NP
1570 AC_MSG_CHECKING([for PTHREAD_MUTEX_ERRORCHECK_NP])
1572 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1574 #include <pthread.h>
1576 return (PTHREAD_MUTEX_ERRORCHECK_NP);
1578 AC_MSG_RESULT([yes])
1579 AC_DEFINE([HAVE_PTHREAD_MUTEX_ERRORCHECK_NP], 1,
1580 [Define to 1 if you have the `PTHREAD_MUTEX_ERRORCHECK_NP' constant.])
1586 # Check for PTHREAD_MUTEX_RECURSIVE_NP
1588 AC_MSG_CHECKING([for PTHREAD_MUTEX_RECURSIVE_NP])
1590 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1592 #include <pthread.h>
1594 return (PTHREAD_MUTEX_RECURSIVE_NP);
1596 AC_MSG_RESULT([yes])
1597 AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], 1,
1598 [Define to 1 if you have the `PTHREAD_MUTEX_RECURSIVE_NP' constant.])
1604 # Check for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
1606 AC_MSG_CHECKING([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP])
1608 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1610 #include <pthread.h>
1612 pthread_mutex_t m = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
1615 AC_MSG_RESULT([yes])
1616 AC_DEFINE([HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], 1,
1617 [Define to 1 if you have the `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' constant.])
1623 # Check whether pthread_mutex_t has a member called __m_kind.
1625 AC_CHECK_MEMBER([pthread_mutex_t.__m_kind],
1626 [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__M_KIND],
1628 [Define to 1 if pthread_mutex_t has a member called __m_kind.])
1631 [#include <pthread.h>])
1634 # Check whether pthread_mutex_t has a member called __data.__kind.
1636 AC_CHECK_MEMBER([pthread_mutex_t.__data.__kind],
1637 [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__DATA__KIND],
1639 [Define to 1 if pthread_mutex_t has a member __data.__kind.])
1642 [#include <pthread.h>])
1644 # Convenience function. Set flags based on the existing HWCAP entries.
1645 # The AT_HWCAP entries are generated by glibc, and are based on
1646 # functions supported by the hardware/system/libc.
1647 # Subsequent support for whether the capability will actually be utilized
1648 # will also be checked against the compiler capabilities.
1650 # AC_HWCAP_CONTAINS_FLAG[hwcap_string_to_match],[VARIABLE_TO_SET]
1651 AC_DEFUN([AC_HWCAP_CONTAINS_FLAG],[
1653 AC_MSG_CHECKING([if AT_HWCAP contains the $AUXV_CHECK_FOR indicator])
1654 if env LD_SHOW_AUXV=1 true | grep ^AT_HWCAP | grep -q -w ${AUXV_CHECK_FOR}
1656 AC_MSG_RESULT([yes])
1657 AC_SUBST([$2],[yes])
1664 # gather hardware capabilities. (hardware/kernel/libc)
1665 AC_HWCAP_CONTAINS_FLAG([altivec],[HWCAP_HAS_ALTIVEC])
1666 AC_HWCAP_CONTAINS_FLAG([vsx],[HWCAP_HAS_VSX])
1667 AC_HWCAP_CONTAINS_FLAG([dfp],[HWCAP_HAS_DFP])
1668 AC_HWCAP_CONTAINS_FLAG([arch_2_05],[HWCAP_HAS_ISA_2_05])
1669 AC_HWCAP_CONTAINS_FLAG([arch_2_06],[HWCAP_HAS_ISA_2_06])
1670 AC_HWCAP_CONTAINS_FLAG([arch_2_07],[HWCAP_HAS_ISA_2_07])
1671 AC_HWCAP_CONTAINS_FLAG([arch_3_00],[HWCAP_HAS_ISA_3_00])
1672 AC_HWCAP_CONTAINS_FLAG([arch_3_1],[HWCAP_HAS_ISA_3_1])
1673 AC_HWCAP_CONTAINS_FLAG([htm],[HWCAP_HAS_HTM])
1674 AC_HWCAP_CONTAINS_FLAG([mma],[HWCAP_HAS_MMA])
1677 AM_CONDITIONAL(HAS_ISA_2_05, [test x$HWCAP_HAS_ISA_2_05 = xyes])
1678 AM_CONDITIONAL(HAS_ISA_2_06, [test x$HWCAP_HAS_ISA_2_06 = xyes])
1679 # compiler support for isa 2.07 level instructions
1680 AC_MSG_CHECKING([that assembler knows ISA 2.07 instructions ])
1681 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1683 __asm__ __volatile__("mtvsrd 1,2 ");
1685 ac_asm_have_isa_2_07=yes
1686 AC_MSG_RESULT([yes])
1688 ac_asm_have_isa_2_07=no
1691 AM_CONDITIONAL(HAS_ISA_2_07, [test x$ac_asm_have_isa_2_07 = xyes \
1692 -a x$HWCAP_HAS_ISA_2_07 = xyes])
1694 # altivec (vsx) support.
1695 # does this compiler support -maltivec and does it have the include file
1697 AC_MSG_CHECKING([for Altivec support in the compiler ])
1699 CFLAGS="-maltivec -Werror"
1700 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1701 #include <altivec.h>
1703 vector unsigned int v;
1706 AC_MSG_RESULT([yes])
1712 AM_CONDITIONAL([HAS_ALTIVEC], [test x$ac_have_altivec = xyes \
1713 -a x$HWCAP_HAS_ALTIVEC = xyes])
1715 # Check that both: the compiler supports -mvsx and that the assembler
1716 # understands VSX instructions. If either of those doesn't work,
1717 # conclude that we can't do VSX.
1718 AC_MSG_CHECKING([for VSX compiler flag support])
1720 CFLAGS="-mvsx -Werror"
1721 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1724 ac_compiler_supports_vsx_flag=yes
1725 AC_MSG_RESULT([yes])
1727 ac_compiler_supports_vsx_flag=no
1732 AC_MSG_CHECKING([for VSX support in the assembler ])
1734 CFLAGS="-mvsx -Werror"
1735 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1736 #include <altivec.h>
1738 vector unsigned int v;
1739 __asm__ __volatile__("xsmaddadp 32, 32, 33" ::: "memory","cc");
1741 ac_compiler_supports_vsx=yes
1742 AC_MSG_RESULT([yes])
1744 ac_compiler_supports_vsx=no
1748 AM_CONDITIONAL([HAS_VSX], [test x$ac_compiler_supports_vsx_flag = xyes \
1749 -a x$ac_compiler_supports_vsx = xyes \
1750 -a x$HWCAP_HAS_VSX = xyes ])
1752 # DFP (Decimal Float)
1753 # The initial DFP support was added in Power 6. The dcffix instruction
1754 # support was added in Power 7.
1755 AC_MSG_CHECKING([that assembler knows DFP])
1756 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1759 __asm__ __volatile__("adtr 1, 2, 3")
1761 __asm__ __volatile__(".machine power7;\n" \
1767 AC_MSG_RESULT([yes])
1772 AC_MSG_CHECKING([that compiler knows -mhard-dfp switch])
1774 CFLAGS="-mhard-dfp -Werror"
1776 # The dcffix instruction is Power 7
1777 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1780 __asm__ __volatile__("adtr 1, 2, 3")
1782 __asm__ __volatile__(".machine power7;\n" \
1787 ac_compiler_have_dfp=yes
1788 AC_MSG_RESULT([yes])
1790 ac_compiler_have_dfp=no
1794 AM_CONDITIONAL(HAS_DFP, test x$ac_asm_have_dfp = xyes \
1795 -a x$ac_compiler_have_dfp = xyes \
1796 -a x$HWCAP_HAS_DFP = xyes )
1798 AC_MSG_CHECKING([that compiler knows DFP datatypes])
1799 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1801 _Decimal64 x = 0.0DD;
1803 ac_compiler_have_dfp_type=yes
1804 AC_MSG_RESULT([yes])
1806 ac_compiler_have_dfp_type=no
1809 AM_CONDITIONAL(BUILD_DFP_TESTS, test x$ac_compiler_have_dfp_type = xyes \
1810 -a x$HWCAP_HAS_DFP = xyes )
1813 # HTM (Hardware Transactional Memory)
1814 AC_MSG_CHECKING([if compiler accepts the -mhtm flag])
1816 CFLAGS="-mhtm -Werror"
1817 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1821 AC_MSG_RESULT([yes])
1822 ac_compiler_supports_htm=yes
1825 ac_compiler_supports_htm=no
1829 AC_MSG_CHECKING([if compiler can find the htm builtins])
1831 CFLAGS="-mhtm -Werror"
1832 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1834 if (__builtin_tbegin (0))
1837 AC_MSG_RESULT([yes])
1838 ac_compiler_sees_htm_builtins=yes
1841 ac_compiler_sees_htm_builtins=no
1845 AM_CONDITIONAL(SUPPORTS_HTM, test x$ac_compiler_supports_htm = xyes \
1846 -a x$ac_compiler_sees_htm_builtins = xyes \
1847 -a x$HWCAP_HAS_HTM = xyes )
1849 # isa 3.0 checking. (actually 3.0 or newer)
1850 AC_MSG_CHECKING([that assembler knows ISA 3.00 ])
1852 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1854 __asm__ __volatile__ (".machine power9;\n" \
1857 # guest_ppc_helpers.c needs the HAS_ISA_3_OO to enable copy, paste,
1860 CFLAGS="-DHAS_ISA_3_00"
1861 ac_asm_have_isa_3_00=yes
1862 AC_MSG_RESULT([yes])
1864 ac_asm_have_isa_3_00=no
1870 AC_MSG_CHECKING([that assembler knows xscvhpdp ])
1872 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1874 __asm__ __volatile__ (".machine power9;\n" \
1875 "xscvhpdp 1,2;\n" );
1877 ac_asm_have_xscvhpdp=yes
1878 AC_MSG_RESULT([yes])
1880 ac_asm_have_xscvhpdp=no
1884 # darn instruction checking
1885 AC_MSG_CHECKING([that assembler knows darn instruction ])
1887 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1889 __asm__ __volatile__(".machine power9; darn 1,0 ");
1891 ac_asm_have_darn_inst=yes
1892 AC_MSG_RESULT([yes])
1894 ac_asm_have_darn_inst=no
1899 AC_MSG_CHECKING([that assembler knows ISA 3.1 ])
1900 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1902 __asm__ __volatile__ (".machine power10;\n" \
1905 ac_asm_have_isa_3_1=yes
1906 AC_MSG_RESULT([yes])
1908 ac_asm_have_isa_3_1=no
1913 AM_CONDITIONAL(HAS_ISA_3_00, [test x$ac_asm_have_isa_3_00 = xyes \
1914 -a x$HWCAP_HAS_ISA_3_00 = xyes])
1916 AM_CONDITIONAL(HAS_XSCVHPDP, [test x$ac_asm_have_xscvhpdp = xyes])
1917 AM_CONDITIONAL(HAS_DARN, [test x$ac_asm_have_darn_inst = xyes])
1919 AM_CONDITIONAL(HAS_ISA_3_1, [test x$ac_asm_have_isa_3_1 = xyes \
1920 -a x$HWCAP_HAS_ISA_3_1 = xyes])
1922 # Check for pthread_create@GLIBC2.0
1923 AC_MSG_CHECKING([for pthread_create@GLIBC2.0()])
1926 CFLAGS="-lpthread -Werror"
1927 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1928 extern int pthread_create_glibc_2_0(void*, const void*,
1929 void *(*)(void*), void*);
1930 __asm__(".symver pthread_create_glibc_2_0, pthread_create@GLIBC_2.0");
1934 * Apparently on PowerPC linking this program succeeds and generates an
1935 * executable with the undefined symbol pthread_create@GLIBC_2.0.
1937 #error This test does not work properly on PowerPC.
1939 pthread_create_glibc_2_0(0, 0, 0, 0);
1943 ac_have_pthread_create_glibc_2_0=yes
1944 AC_MSG_RESULT([yes])
1945 AC_DEFINE([HAVE_PTHREAD_CREATE_GLIBC_2_0], 1,
1946 [Define to 1 if you have the `pthread_create@glibc2.0' function.])
1948 ac_have_pthread_create_glibc_2_0=no
1953 AM_CONDITIONAL(HAVE_PTHREAD_CREATE_GLIBC_2_0,
1954 test x$ac_have_pthread_create_glibc_2_0 = xyes)
1957 # Check for dlinfo RTLD_DI_TLS_MODID
1958 AC_MSG_CHECKING([for dlinfo RTLD_DI_TLS_MODID])
1962 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1969 size_t sizes[10000];
1970 size_t modid_offset;
1971 (void) dlinfo ((void*)sizes, RTLD_DI_TLS_MODID, &modid_offset);
1974 ac_have_dlinfo_rtld_di_tls_modid=yes
1975 AC_MSG_RESULT([yes])
1976 AC_DEFINE([HAVE_DLINFO_RTLD_DI_TLS_MODID], 1,
1977 [Define to 1 if you have a dlinfo that can do RTLD_DI_TLS_MODID.])
1979 ac_have_dlinfo_rtld_di_tls_modid=no
1984 AM_CONDITIONAL(HAVE_DLINFO_RTLD_DI_TLS_MODID,
1985 test x$ac_have_dlinfo_rtld_di_tls_modid = xyes)
1988 # Check for eventfd_t, eventfd() and eventfd_read()
1989 AC_MSG_CHECKING([for eventfd()])
1991 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1992 #include <sys/eventfd.h>
1998 eventfd_read(fd, &ev);
2001 AC_MSG_RESULT([yes])
2002 AC_DEFINE([HAVE_EVENTFD], 1,
2003 [Define to 1 if you have the `eventfd' function.])
2004 AC_DEFINE([HAVE_EVENTFD_READ], 1,
2005 [Define to 1 if you have the `eventfd_read' function.])
2010 # Check whether compiler can process #include <thread> without errors
2011 # clang 3.3 cannot process <thread> from e.g.
2012 # gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
2014 AC_MSG_CHECKING([that C++ compiler can compile C++17 code])
2016 safe_CXXFLAGS=$CXXFLAGS
2019 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
2024 AC_MSG_RESULT([yes])
2029 CXXFLAGS=$safe_CXXFLAGS
2032 AM_CONDITIONAL(HAVE_CXX17, test x$ac_have_cxx_17 = xyes)
2034 AC_MSG_CHECKING([that C++ compiler can include <thread> header file])
2036 safe_CXXFLAGS=$CXXFLAGS
2039 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
2043 ac_cxx_can_include_thread_header=yes
2044 AC_MSG_RESULT([yes])
2046 ac_cxx_can_include_thread_header=no
2049 CXXFLAGS=$safe_CXXFLAGS
2052 AM_CONDITIONAL(CXX_CAN_INCLUDE_THREAD_HEADER, test x$ac_cxx_can_include_thread_header = xyes)
2054 # Check whether compiler can process #include <condition_variable> without errors
2056 AC_MSG_CHECKING([that C++ compiler can include <condition_variable> header file])
2058 safe_CXXFLAGS=$CXXFLAGS
2061 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
2062 #include <condition_variable>
2065 ac_cxx_can_include_condition_variable_header=yes
2066 AC_MSG_RESULT([yes])
2068 ac_cxx_can_include_condition_variable_header=no
2071 CXXFLAGS=$safe_CXXFLAGS
2074 AM_CONDITIONAL(CXX_CAN_INCLUDE_CONDITION_VARIABLE_HEADER, test x$ac_cxx_can_include_condition_variable_header = xyes)
2076 # check for std::shared_timed_mutex, this is a C++ 14 feature
2078 AC_MSG_CHECKING([that C++ compiler can use std::shared_timed_mutex])
2080 safe_CXXFLAGS=$CXXFLAGS
2081 CXXFLAGS="-std=c++1y -pthread"
2083 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
2084 #include <shared_mutex>
2085 std::shared_timed_mutex test_mutex;
2088 ac_cxx_can_use_shared_timed_mutex=yes
2089 AC_MSG_RESULT([yes])
2091 ac_cxx_can_use_shared_timed_mutex=no
2094 CXXFLAGS=$safe_CXXFLAGS
2097 AM_CONDITIONAL(CXX_CAN_USE_SHARED_TIMED_MUTEX, test x$ac_cxx_can_use_shared_timed_mutex = xyes)
2099 # check for std::shared_mutex, this is a C++ 11 feature
2101 AC_MSG_CHECKING([that C++ compiler can use std::timed_mutex])
2103 safe_CXXFLAGS=$CXXFLAGS
2104 CXXFLAGS="-std=c++0x -pthread"
2106 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
2108 std::timed_mutex test_mutex;
2111 ac_cxx_can_use_timed_mutex=yes
2112 AC_MSG_RESULT([yes])
2114 ac_cxx_can_use_timed_mutex=no
2117 CXXFLAGS=$safe_CXXFLAGS
2120 AM_CONDITIONAL(CXX_CAN_USE_TIMED_MUTEX, test x$ac_cxx_can_use_timed_mutex = xyes)
2122 # On aarch64 before glibc 2.20 we would get the kernel user_pt_regs instead
2123 # of the user_regs_struct from sys/user.h. They are structurally the same
2124 # but we get either one or the other.
2126 AC_CHECK_TYPE([struct user_regs_struct],
2127 [sys_user_has_user_regs=yes], [sys_user_has_user_regs=no],
2128 [[#include <sys/ptrace.h>]
2129 [#include <sys/time.h>]
2130 [#include <sys/user.h>]])
2131 if test "$sys_user_has_user_regs" = "yes"; then
2132 AC_DEFINE(HAVE_SYS_USER_REGS, 1,
2133 [Define to 1 if <sys/user.h> defines struct user_regs_struct])
2136 AC_MSG_CHECKING([for __NR_membarrier])
2137 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2138 #include <linux/unistd.h>
2140 return __NR_membarrier
2142 ac_have_nr_membarrier=yes
2143 AC_MSG_RESULT([yes])
2145 ac_have_nr_membarrier=no
2149 AM_CONDITIONAL(HAVE_NR_MEMBARRIER, [test x$ac_have_nr_membarrier = xyes])
2151 #----------------------------------------------------------------------------
2152 # Checking for supported compiler flags.
2153 #----------------------------------------------------------------------------
2155 case "${host_cpu}" in
2157 ARCH=$(echo "$CFLAGS" | grep -E -e '-march=@<:@^ @:>@+' -e '\B-mips@<:@^ +@:>@')
2158 if test -z "$ARCH"; then
2159 # does this compiler support -march=mips32 (mips32 default) ?
2160 AC_MSG_CHECKING([if gcc accepts -march=mips32 -mabi=32])
2163 CFLAGS="$CFLAGS -mips32 -mabi=32 -Werror"
2165 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2168 FLAG_M32="-mips32 -mabi=32"
2169 AC_MSG_RESULT([yes])
2179 # does this compiler support -march=mips64r2 (mips64r2 default) ?
2180 AC_MSG_CHECKING([if gcc accepts -march=mips64r2 -mabi=64])
2183 CFLAGS="$CFLAGS -march=mips64r2 -mabi=64 -Werror"
2185 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2188 FLAG_M64="-march=mips64r2 -mabi=64"
2189 AC_MSG_RESULT([yes])
2202 # does this compiler support -m32 ?
2203 AC_MSG_CHECKING([if gcc accepts -m32])
2206 CFLAGS="${FLAG_32ON64} -m32 -Werror"
2208 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2211 FLAG_M32="${FLAG_32ON64} -m32"
2212 AC_MSG_RESULT([yes])
2222 # does this compiler support -m64 ?
2223 AC_MSG_CHECKING([if gcc accepts -m64])
2226 CFLAGS="-m64 -Werror"
2228 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2232 AC_MSG_RESULT([yes])
2244 ARCH=$(echo "$CFLAGS" | grep -E -e '-march=@<:@^ @:>@+' -e '\B-mips@<:@^ +@:>@')
2245 if test -z "$ARCH"; then
2246 # does this compiler support -march=octeon (Cavium OCTEON I Specific) ?
2247 AC_MSG_CHECKING([if gcc accepts -march=octeon])
2250 CFLAGS="$CFLAGS $FLAG_M64 -march=octeon -Werror"
2252 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2255 FLAG_OCTEON="-march=octeon"
2256 AC_MSG_RESULT([yes])
2263 AC_SUBST(FLAG_OCTEON)
2266 # does this compiler support -march=octeon2 (Cavium OCTEON II Specific) ?
2267 AC_MSG_CHECKING([if gcc accepts -march=octeon2])
2270 CFLAGS="$CFLAGS $FLAG_M64 -march=octeon2 -Werror"
2272 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2275 FLAG_OCTEON2="-march=octeon2"
2276 AC_MSG_RESULT([yes])
2283 AC_SUBST(FLAG_OCTEON2)
2287 # does this compiler support -mmsa (MIPS MSA ASE) ?
2288 AC_MSG_CHECKING([if gcc accepts -mmsa])
2291 CFLAGS="$CFLAGS -mmsa -Werror"
2293 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2297 AC_MSG_RESULT([yes])
2306 # Are we compiling for the MIPS64 n32 ABI?
2307 AC_MSG_CHECKING([if gcc is producing mips n32 binaries])
2308 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
2309 #if !defined(_MIPS_SIM) || (defined(_MIPS_SIM) && (_MIPS_SIM != _ABIN32))
2314 FLAG_M64="-march=mips64r2 -mabi=n32"
2315 AC_MSG_RESULT([yes])
2320 # Are we compiling for the MIPS64 n64 ABI?
2321 AC_MSG_CHECKING([if gcc is producing mips n64 binaries])
2322 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
2323 #if !defined(_MIPS_SIM) || (defined(_MIPS_SIM) && (_MIPS_SIM != _ABI64))
2328 AC_MSG_RESULT([yes])
2333 # We enter the code block below in the following case:
2334 # Target architecture is set to mips64, the desired abi
2335 # was not specified and the compiler's default abi setting
2336 # is neither n32 nor n64.
2337 # Probe for and set the abi to either n64 or n32, in that order,
2338 # which is required for a mips64 build of valgrind.
2339 if test "$ARCH_MAX" = "mips64" -a "x$VGCONF_ABI" = "x"; then
2341 CFLAGS="$CFLAGS -mabi=64 -Werror"
2342 AC_MSG_CHECKING([if gcc is n64 capable])
2343 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
2347 AC_MSG_RESULT([yes])
2353 if test "x$VGCONF_ABI" = "x"; then
2355 CFLAGS="$CFLAGS -mabi=n32 -Werror"
2356 AC_MSG_CHECKING([if gcc is n32 capable])
2357 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
2361 FLAG_M64="-march=mips64r2 -mabi=n32"
2362 AC_MSG_RESULT([yes])
2370 AM_CONDITIONAL([VGCONF_HAVE_ABI],
2371 [test x$VGCONF_ABI != x])
2372 AC_SUBST(VGCONF_ABI)
2375 # does this compiler support -mmmx ?
2376 AC_MSG_CHECKING([if gcc accepts -mmmx])
2379 CFLAGS="-mmmx -Werror"
2381 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2385 AC_MSG_RESULT([yes])
2395 # does this compiler support -msse ?
2396 AC_MSG_CHECKING([if gcc accepts -msse])
2399 CFLAGS="-msse -Werror"
2401 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2405 AC_MSG_RESULT([yes])
2415 # does this compiler support -mpreferred-stack-boundary=2 when
2416 # generating code for a 32-bit target? Note that we only care about
2417 # this when generating code for (32-bit) x86, so if the compiler
2418 # doesn't recognise -m32 it's no big deal. We'll just get code for
2419 # the Memcheck and other helper functions, that is a bit slower than
2420 # it could be, on x86; and no difference at all on any other platform.
2421 AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary=2 -m32])
2424 CFLAGS="-mpreferred-stack-boundary=2 -m32 -Werror"
2426 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2429 PREFERRED_STACK_BOUNDARY_2="-mpreferred-stack-boundary=2"
2430 AC_MSG_RESULT([yes])
2432 PREFERRED_STACK_BOUNDARY_2=""
2437 AC_SUBST(PREFERRED_STACK_BOUNDARY_2)
2440 # does this compiler support -mlong-double-128 ?
2441 AC_MSG_CHECKING([if gcc accepts -mlong-double-128])
2443 CFLAGS="-mlong-double-128 -Werror"
2444 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2447 ac_compiler_supports_mlong_double_128=yes
2448 AC_MSG_RESULT([yes])
2450 ac_compiler_supports_mlong_double_128=no
2454 AM_CONDITIONAL(HAS_MLONG_DOUBLE_128, test x$ac_compiler_supports_mlong_double_128 = xyes)
2455 FLAG_MLONG_DOUBLE_128="-mlong-double-128"
2456 AC_SUBST(FLAG_MLONG_DOUBLE_128)
2458 # does this toolchain support lto ?
2459 # Not checked for if --enable-lto=no was given, or if LTO_AR or LTO_RANLIG
2461 # If not enable-lto=* arg is provided, default to no, as lto builds are
2462 # a lot slower, and so not appropriate for Valgrind developments.
2463 # --enable-lto=yes should be used by distro packagers.
2464 AC_CACHE_CHECK([for using the link time optimisation], vg_cv_lto,
2466 [ --enable-lto enables building with link time optimisation],
2467 [vg_cv_lto=$enableval],
2470 if test "x${vg_cv_lto}" != "xno" -a "x${LTO_AR}" != "x" -a "x${LTO_RANLIB}" != "x"; then
2471 AC_MSG_CHECKING([if toolchain accepts lto])
2473 TEST_LTO_CFLAGS="-flto -flto-partition=one -fuse-linker-plugin"
2474 # Note : using 'one' partition is giving a slightly smaller/faster memcheck
2475 # and ld/lto-trans1 still needs a reasonable memory (about 0.5GB) when linking.
2476 CFLAGS="$TEST_LTO_CFLAGS -Werror"
2478 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2479 extern void somefun(void);
2483 LTO_CFLAGS=$TEST_LTO_CFLAGS
2484 AC_MSG_RESULT([yes])
2492 AC_SUBST(LTO_CFLAGS)
2494 # if we could not compile with lto args, or lto was disabled,
2495 # then set LTO_AR/LTO_RANLIB to the non lto values
2496 # define in config.h ENABLE_LTO (not needed by the code currently, but
2497 # this guarantees we recompile everything if we re-configure and rebuild
2498 # in a build dir previously build with another value of --enable-lto
2499 if test "x${LTO_CFLAGS}" = "x"; then
2501 LTO_RANLIB=${RANLIB}
2505 AC_DEFINE([ENABLE_LTO], 1, [configured to build with lto link time optimisation])
2508 # Convenience function to check whether GCC supports a particular
2509 # warning option. Takes two arguments,
2510 # first the warning flag name to check (without -W), then the
2511 # substitution name to set with -Wno-warning-flag if the flag exists,
2512 # or the empty string if the compiler doesn't accept the flag. Note
2513 # that checking is done against the warning flag itself, but the
2514 # substitution is then done to cancel the warning flag.
2515 AC_DEFUN([AC_GCC_WARNING_SUBST_NO],[
2516 AC_MSG_CHECKING([if gcc accepts -W$1])
2518 CFLAGS="-W$1 -Werror"
2519 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [
2520 AC_SUBST([$2], [-Wno-$1])
2521 AC_MSG_RESULT([yes])], [
2523 AC_MSG_RESULT([no])])
2527 # A variation of the above for arguments that
2529 AC_DEFUN([AC_GCC_WARNING_SUBST_NO_VAL],[
2530 AC_MSG_CHECKING([if gcc accepts -W$1=$2])
2532 CFLAGS="-W$1=$2 -Werror"
2533 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [
2534 AC_SUBST([$3], [-Wno-$1])
2535 AC_MSG_RESULT([yes])], [
2537 AC_MSG_RESULT([no])])
2541 # Convenience function. Like AC_GCC_WARNING_SUBST_NO, except it substitutes
2542 # -W$1 (instead of -Wno-$1).
2543 AC_DEFUN([AC_GCC_WARNING_SUBST],[
2544 AC_MSG_CHECKING([if gcc accepts -W$1])
2546 CFLAGS="-W$1 -Werror"
2547 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [
2548 AC_SUBST([$2], [-W$1])
2549 AC_MSG_RESULT([yes])], [
2551 AC_MSG_RESULT([no])])
2555 AC_GCC_WARNING_SUBST_NO([memset-transposed-args], [FLAG_W_NO_MEMSET_TRANSPOSED_ARGS])
2556 AC_GCC_WARNING_SUBST_NO([nonnull], [FLAG_W_NO_NONNULL])
2557 AC_GCC_WARNING_SUBST_NO([overflow], [FLAG_W_NO_OVERFLOW])
2558 AC_GCC_WARNING_SUBST_NO([pointer-sign], [FLAG_W_NO_POINTER_SIGN])
2559 AC_GCC_WARNING_SUBST_NO([uninitialized], [FLAG_W_NO_UNINITIALIZED])
2560 AC_GCC_WARNING_SUBST_NO([maybe-uninitialized], [FLAG_W_NO_MAYBE_UNINITIALIZED])
2561 AC_GCC_WARNING_SUBST_NO([unused-function], [FLAG_W_NO_UNUSED_FUNCTION])
2562 AC_GCC_WARNING_SUBST_NO([static-local-in-inline], [FLAG_W_NO_STATIC_LOCAL_IN_INLINE])
2563 AC_GCC_WARNING_SUBST_NO([mismatched-new-delete], [FLAG_W_NO_MISMATCHED_NEW_DELETE])
2564 AC_GCC_WARNING_SUBST_NO([infinite-recursion], [FLAG_W_NO_INFINITE_RECURSION])
2565 AC_GCC_WARNING_SUBST_NO([expansion-to-defined], [FLAG_W_NO_EXPANSION_TO_DEFINED])
2566 AC_GCC_WARNING_SUBST_NO([unused-but-set-variable], [FLAG_W_NO_UNUSED_BUT_SET_VARIABLE])
2567 AC_GCC_WARNING_SUBST_NO([non-power-of-two-alignment], [FLAG_W_NO_NON_POWER_OF_TWO_ALIGNMENT])
2568 AC_GCC_WARNING_SUBST_NO([sign-compare], [FLAG_W_NO_SIGN_COMPARE])
2569 AC_GCC_WARNING_SUBST_NO([stringop-overflow], [FLAG_W_NO_STRINGOP_OVERFLOW])
2570 AC_GCC_WARNING_SUBST_NO([stringop-overread], [FLAG_W_NO_STRINGOP_OVERREAD])
2571 AC_GCC_WARNING_SUBST_NO([stringop-truncation], [FLAG_W_NO_STRINGOP_TRUNCATION])
2572 AC_GCC_WARNING_SUBST_NO([format-overflow], [FLAG_W_NO_FORMAT_OVERFLOW])
2573 AC_GCC_WARNING_SUBST_NO([use-after-free], [FLAG_W_NO_USE_AFTER_FREE])
2574 AC_GCC_WARNING_SUBST_NO([free-nonheap-object], [FLAG_W_NO_FREE_NONHEAP_OBJECT])
2575 AC_GCC_WARNING_SUBST_NO([fortify-source], [FLAG_W_NO_FORTIFY_SOURCE])
2576 AC_GCC_WARNING_SUBST_NO([builtin-memcpy-chk-size], [FLAG_W_NO_BUILTIN_MEMCPY_CHK_SIZE])
2577 AC_GCC_WARNING_SUBST_NO([incompatible-pointer-types-discards-qualifiers], [FLAG_W_NO_INCOMPATIBLE_POINTER_TYPES_DISCARDS_QUALIFIERS])
2578 AC_GCC_WARNING_SUBST_NO([suspicious-bzero], [FLAG_W_NO_SUSPICIOUS_BZERO])
2580 AC_GCC_WARNING_SUBST_NO_VAL([alloc-size-larger-than], [1677216], [FLAG_W_NO_ALLOC_SIZE_LARGER_THAN])
2582 AC_GCC_WARNING_SUBST([write-strings], [FLAG_W_WRITE_STRINGS])
2583 AC_GCC_WARNING_SUBST([empty-body], [FLAG_W_EMPTY_BODY])
2584 AC_GCC_WARNING_SUBST([format], [FLAG_W_FORMAT])
2585 AC_GCC_WARNING_SUBST([format-signedness], [FLAG_W_FORMAT_SIGNEDNESS])
2586 AC_GCC_WARNING_SUBST([cast-qual], [FLAG_W_CAST_QUAL])
2587 AC_GCC_WARNING_SUBST([old-style-declaration], [FLAG_W_OLD_STYLE_DECLARATION])
2588 AC_GCC_WARNING_SUBST([ignored-qualifiers], [FLAG_W_IGNORED_QUALIFIERS])
2589 AC_GCC_WARNING_SUBST([missing-parameter-type], [FLAG_W_MISSING_PARAMETER_TYPE])
2590 AC_GCC_WARNING_SUBST([logical-op], [FLAG_W_LOGICAL_OP])
2591 AC_GCC_WARNING_SUBST([enum-conversion], [FLAG_W_ENUM_CONVERSION])
2592 AC_GCC_WARNING_SUBST([implicit-fallthrough=2], [FLAG_W_IMPLICIT_FALLTHROUGH])
2594 # Does this compiler support -Wformat-security ?
2595 # Special handling is needed, because certain GCC versions require -Wformat
2596 # being present if -Wformat-security is given. Otherwise a warning is issued.
2597 # However, AC_GCC_WARNING_SUBST will stick in -Werror (see r15323 for rationale).
2598 # And with that the warning will be turned into an error with the result
2599 # that -Wformat-security is believed to be unsupported when in fact it is.
2600 AC_MSG_CHECKING([if gcc accepts -Wformat-security])
2602 CFLAGS="-Wformat -Wformat-security -Werror"
2603 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [
2604 AC_SUBST([FLAG_W_FORMAT_SECURITY], [-Wformat-security])
2605 AC_MSG_RESULT([yes])], [
2606 AC_SUBST([FLAG_W_FORMAT_SECURITY], [])
2607 AC_MSG_RESULT([no])])
2610 # does this compiler support -Wextra or the older -W ?
2612 AC_MSG_CHECKING([if gcc accepts -Wextra or -W])
2615 CFLAGS="-Wextra -Werror"
2617 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2620 AC_SUBST([FLAG_W_EXTRA], [-Wextra])
2621 AC_MSG_RESULT([-Wextra])
2624 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2627 AC_SUBST([FLAG_W_EXTRA], [-W])
2630 AC_SUBST([FLAG_W_EXTRA], [])
2631 AC_MSG_RESULT([not supported])
2636 # On ARM we do not want to pass -Wcast-align as that produces loads
2637 # of warnings. GCC is just being conservative. See here:
2638 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65459#c4
2639 if test "X$VGCONF_ARCH_PRI" = "Xarm"; then
2640 AC_SUBST([FLAG_W_CAST_ALIGN], [""])
2642 AC_SUBST([FLAG_W_CAST_ALIGN], [-Wcast-align])
2645 # does this compiler support -faligned-new ?
2646 AC_MSG_CHECKING([if g++ accepts -faligned-new])
2648 safe_CXXFLAGS=$CXXFLAGS
2649 CXXFLAGS="-faligned-new -Werror"
2652 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2655 FLAG_FALIGNED_NEW="-faligned-new"
2656 AC_MSG_RESULT([yes])
2658 FLAG_FALIGNED_NEW=""
2661 CXXFLAGS=$safe_CXXFLAGS
2664 AC_SUBST(FLAG_FALIGNED_NEW)
2666 # does this compiler support -fsized-deallocation ?
2667 AC_MSG_CHECKING([if g++ accepts -fsized-deallocation])
2669 safe_CXXFLAGS=$CXXFLAGS
2670 CXXFLAGS="-fsized-deallocation -Werror"
2673 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2676 FLAG_FSIZED_DEALLOCATION="-fsized-deallocation"
2677 ac_have_sized_deallocation=yes
2678 AC_MSG_RESULT([yes])
2680 FLAG_FSIZED_DEALLOCATION=""
2681 ac_have_sized_deallocation=no
2684 CXXFLAGS=$safe_CXXFLAGS
2687 AC_SUBST(FLAG_FSIZED_DEALLOCATION)
2688 AM_CONDITIONAL([HAVE_FSIZED_DEALLOCATION], [test x$ac_have_sized_deallocation = xyes])
2690 # does this compiler support C++17 aligned new/delete?
2691 AC_MSG_CHECKING([if g++ supports aligned new and delete])
2693 safe_CXXFLAGS=$CXXFLAGS
2694 CXXFLAGS="-std=c++17"
2697 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2701 operator delete(nullptr, std::align_val_t(64U));
2703 ac_have_aligned_cxx_alloc=yes
2704 AC_MSG_RESULT([yes])
2706 ac_have_aligned_cxx_alloc=no
2709 CXXFLAGS=$safe_CXXFLAGS
2712 AM_CONDITIONAL([HAVE_ALIGNED_CXX_ALLOC], [test x$ac_have_aligned_cxx_alloc = xyes])
2714 # does this compiler support -fno-stack-protector ?
2715 AC_MSG_CHECKING([if gcc accepts -fno-stack-protector])
2718 CFLAGS="-fno-stack-protector -Werror"
2720 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2723 no_stack_protector=yes
2724 FLAG_FNO_STACK_PROTECTOR="-fno-stack-protector"
2725 AC_MSG_RESULT([yes])
2727 no_stack_protector=no
2728 FLAG_FNO_STACK_PROTECTOR=""
2733 AC_SUBST(FLAG_FNO_STACK_PROTECTOR)
2735 # does this compiler support -finline-functions ?
2736 AC_MSG_CHECKING([if gcc accepts -finline-functions])
2739 CFLAGS="-finline-functions -Werror"
2741 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2744 inline_functions=yes
2745 FLAG_FINLINE_FUNCTIONS="-finline-functions"
2746 AC_MSG_RESULT([yes])
2749 FLAG_FINLINE_FUNCTIONS=""
2754 AC_SUBST(FLAG_FINLINE_FUNCTIONS)
2756 # Does GCC support disabling Identical Code Folding?
2757 # We want to disabled Identical Code Folding for the
2758 # tools preload shared objects to get better backraces.
2759 # For GCC 5.1+ -fipa-icf is enabled by default at -O2.
2760 # "The optimization reduces code size and may disturb
2761 # unwind stacks by replacing a function by equivalent
2762 # one with a different name."
2763 AC_MSG_CHECKING([if gcc accepts -fno-ipa-icf])
2766 CFLAGS="-fno-ipa-icf -Werror"
2768 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2772 FLAG_FNO_IPA_ICF="-fno-ipa-icf"
2773 AC_MSG_RESULT([yes])
2781 AC_SUBST(FLAG_FNO_IPA_ICF)
2784 # Does this compiler support -fsanitize=undefined. This is true for
2785 # GCC 4.9 and newer. However, the undefined behaviour sanitiser in GCC 5.1
2786 # also checks for alignment violations on memory accesses which the valgrind
2787 # code base is sprinkled (if not littered) with. As those alignment issues
2788 # don't pose a problem we want to suppress warnings about them.
2789 # In GCC 5.1 this can be done by passing -fno-sanitize=alignment. Earlier
2790 # GCCs do not support that.
2792 # Only checked for if --enable-ubsan was given.
2793 if test "x${vg_cv_ubsan}" = "xyes"; then
2794 AC_MSG_CHECKING([if gcc accepts -fsanitize=undefined -fno-sanitize=alignment])
2796 CFLAGS="-fsanitize=undefined -fno-sanitize=alignment -Werror"
2797 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2800 FLAG_FSANITIZE="-fsanitize=undefined -fno-sanitize=alignment"
2801 LIB_UBSAN="-static-libubsan"
2802 AC_MSG_RESULT([yes])
2804 CFLAGS="-fsanitize=undefined -Werror"
2805 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2808 FLAG_FSANITIZE="-fsanitize=undefined"
2809 LIB_UBSAN="-static-libubsan"
2810 AC_MSG_RESULT([yes])
2818 AC_SUBST(FLAG_FSANITIZE)
2821 # does this compiler support --param inline-unit-growth=... ?
2823 AC_MSG_CHECKING([if gcc accepts --param inline-unit-growth])
2826 CFLAGS="--param inline-unit-growth=900 -Werror"
2828 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2831 AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH],
2832 ["--param inline-unit-growth=900"])
2833 AC_MSG_RESULT([yes])
2835 AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH], [""])
2841 # does this compiler support -gdwarf-4 -fdebug-types-section ?
2843 AC_MSG_CHECKING([if gcc accepts -gdwarf-4 -fdebug-types-section])
2846 CFLAGS="-gdwarf-4 -fdebug-types-section -Werror"
2848 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2852 AC_MSG_RESULT([yes])
2857 AM_CONDITIONAL(DWARF4, test x$ac_have_dwarf4 = xyes)
2861 # does this compiler support -g -gz=zlib ?
2863 AC_MSG_CHECKING([if gcc accepts -g -gz=zlib])
2866 CFLAGS="-g -gz=zlib"
2868 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2872 AC_MSG_RESULT([yes])
2877 AM_CONDITIONAL(GZ_ZLIB, test x$ac_have_gz_zlib = xyes)
2881 # does this compiler support -g -gz=zlib-gnu ?
2883 AC_MSG_CHECKING([if gcc accepts -g -gz=zlib-gnu])
2886 CFLAGS="-g -gz=zlib-gnu"
2888 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2891 ac_have_gz_zlib_gnu=yes
2892 AC_MSG_RESULT([yes])
2894 ac_have_gz_zlib_gnu=no
2897 AM_CONDITIONAL(GZ_ZLIB_GNU, test x$ac_have_gz_zlib_gnu = xyes)
2901 # does this compiler support nested functions ?
2903 AC_MSG_CHECKING([if gcc accepts nested functions])
2905 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2906 int foo() { return 1; }
2909 ac_have_nested_functions=yes
2910 AC_MSG_RESULT([yes])
2912 ac_have_nested_functions=no
2915 AM_CONDITIONAL([HAVE_NESTED_FUNCTIONS], [test x$ac_have_nested_functions = xyes])
2918 # does this compiler support the 'p' constraint in ASM statements ?
2920 AC_MSG_CHECKING([if gcc accepts the 'p' constraint in asm statements])
2922 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2924 __asm__ __volatile__ ("movdqa (%0),%%xmm6\n" : "=p" (p));
2926 ac_have_asm_constraint_p=yes
2927 AC_MSG_RESULT([yes])
2929 ac_have_asm_constraint_p=no
2932 AM_CONDITIONAL([HAVE_ASM_CONSTRAINT_P], [test x$ac_have_asm_constraint_p = xyes])
2935 # Does this compiler and linker support -pie?
2936 # Some compilers actually do not support -pie and report its usage
2937 # as an error. We need to check if it is safe to use it first.
2939 AC_MSG_CHECKING([if gcc accepts -pie])
2944 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2947 AC_SUBST([FLAG_PIE], ["-pie"])
2948 AC_MSG_RESULT([yes])
2950 AC_SUBST([FLAG_PIE], [""])
2955 AC_MSG_CHECKING([if gcc accepts -ansi])
2960 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2964 AC_MSG_RESULT([yes])
2969 AM_CONDITIONAL([HAVE_ANSI], [test x$ac_have_ansi = xyes])
2974 # Does this compiler support -no-pie?
2975 # On Ubuntu 16.10+, gcc produces position independent executables (PIE) by
2976 # default. However this gets in the way with some tests, we use -no-pie
2979 AC_MSG_CHECKING([if gcc accepts -no-pie])
2982 CFLAGS="-no-pie -Werror"
2984 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2987 AC_SUBST([FLAG_NO_PIE], ["-no-pie"])
2988 AC_MSG_RESULT([yes])
2990 AC_SUBST([FLAG_NO_PIE], [""])
2996 # We want to use use the -Ttext-segment option to the linker.
2997 # GNU (bfd) ld supports this directly. Newer GNU gold linkers
2998 # support it as an alias of -Ttext. Sadly GNU (bfd) ld's -Ttext
2999 # semantics are NOT what we want (GNU gold -Ttext is fine).
3001 # For GNU (bfd) ld -Ttext-segment chooses the base at which ELF headers
3002 # will reside. -Ttext aligns just the .text section start (but not any
3005 # LLVM ld.lld 10.0 changed the semantics of its -Ttext. See "Breaking changes"
3006 # in https://releases.llvm.org/10.0.0/tools/lld/docs/ReleaseNotes.html
3007 # The --image-base option (since version 6.0?) provides the semantics needed.
3008 # -Ttext-segment generates an error, but -Ttext now more closely
3009 # follows the GNU (bfd) ld's -Ttext.
3011 # So test first for --image-base support, and if that fails then
3012 # for -Ttext-segment which is supported by all bfd ld versions
3013 # and use that if it exists. If it doesn't exist it must be an older
3014 # version of gold and we can fall back to using -Ttext which has the
3018 AC_MSG_CHECKING([if the linker accepts -Wl,--image-base])
3020 CFLAGS="-static -nodefaultlibs -nostartfiles -Wl,--image-base=$valt_load_address_pri_norml -Werror"
3023 [AC_LANG_SOURCE([int _start () { return 0; }])],
3025 linker_using_t_text="no"
3026 AC_SUBST([FLAG_T_TEXT], ["--image-base"])
3027 AC_MSG_RESULT([yes])
3031 AC_MSG_CHECKING([if the linker accepts -Wl,-Ttext-segment])
3033 CFLAGS="-static -nodefaultlibs -nostartfiles -Wl,-Ttext-segment=$valt_load_address_pri_norml -Werror"
3036 [AC_LANG_SOURCE([int _start () { return 0; }])],
3038 linker_using_t_text="no"
3039 AC_SUBST([FLAG_T_TEXT], ["-Ttext-segment"])
3040 AC_MSG_RESULT([yes])
3042 linker_using_t_text="yes"
3043 AC_SUBST([FLAG_T_TEXT], ["-Ttext"])
3050 # If the linker only supports -Ttext (not -Ttext-segment or --image-base) then we will
3051 # have to strip any build-id ELF NOTEs from the statically linked tools.
3052 # Otherwise the build-id NOTE might end up at the default load address.
3053 # (Pedantically if the linker is gold then -Ttext is fine, but newer
3054 # gold versions also support -Ttext-segment. So just assume that unless
3055 # we can use -Ttext-segment we need to strip the build-id NOTEs.
3056 if test "x${linker_using_t_text}" = "xyes"; then
3057 AC_MSG_NOTICE([ld -Ttext used, need to strip build-id NOTEs.])
3058 # does the linker support -Wl,--build-id=none ? Note, it's
3059 # important that we test indirectly via whichever C compiler
3060 # is selected, rather than testing /usr/bin/ld or whatever
3062 AC_MSG_CHECKING([if the linker accepts -Wl,--build-id=none])
3064 CFLAGS="-Wl,--build-id=none -Werror"
3067 [AC_LANG_PROGRAM([ ], [return 0;])],
3069 AC_SUBST([FLAG_NO_BUILD_ID], ["-Wl,--build-id=none"])
3070 AC_MSG_RESULT([yes])
3072 AC_SUBST([FLAG_NO_BUILD_ID], [""])
3076 AC_MSG_NOTICE([ld --image-base or -Ttext-segment used, no need to strip build-id NOTEs.])
3077 AC_SUBST([FLAG_NO_BUILD_ID], [""])
3081 # does the ppc assembler support "mtocrf" et al?
3082 AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf])
3084 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3085 __asm__ __volatile__("mtocrf 4,0");
3086 __asm__ __volatile__("mfocrf 0,4");
3088 ac_have_as_ppc_mftocrf=yes
3089 AC_MSG_RESULT([yes])
3091 ac_have_as_ppc_mftocrf=no
3094 if test x$ac_have_as_ppc_mftocrf = xyes ; then
3095 AC_DEFINE(HAVE_AS_PPC_MFTOCRF, 1, [Define to 1 if as supports mtocrf/mfocrf.])
3099 # does the ppc assembler support "lfdp" and other phased out floating point insns?
3100 AC_MSG_CHECKING([if ppc32/64 asm supports phased out floating point instructions])
3102 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3103 do { typedef struct {
3107 dbl_pair_t dbl_pair[3];
3108 __asm__ volatile ("lfdp 10, %0"::"m" (dbl_pair[0]));
3111 ac_have_as_ppc_fpPO=yes
3112 AC_MSG_RESULT([yes])
3114 ac_have_as_ppc_fpPO=no
3117 if test x$ac_have_as_ppc_fpPO = xyes ; then
3118 AC_DEFINE(HAVE_AS_PPC_FPPO, 1, [Define to 1 if as supports floating point phased out category.])
3122 # does the amd64 assembler understand "fxsave64" and "fxrstor64"?
3123 AC_MSG_CHECKING([if amd64 assembler supports fxsave64/fxrstor64])
3125 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3127 asm __volatile__("fxsave64 (%0)" : : "r" (p) : "memory" );
3128 asm __volatile__("fxrstor64 (%0)" : : "r" (p) : "memory" );
3130 ac_have_as_amd64_fxsave64=yes
3131 AC_MSG_RESULT([yes])
3133 ac_have_as_amd64_fxsave64=no
3136 if test x$ac_have_as_amd64_fxsave64 = xyes ; then
3137 AC_DEFINE(HAVE_AS_AMD64_FXSAVE64, 1, [Define to 1 if as supports fxsave64/fxrstor64.])
3140 # does the x86/amd64 assembler understand SSE3 instructions?
3141 # Note, this doesn't generate a C-level symbol. It generates a
3142 # automake-level symbol (BUILD_SSE3_TESTS), used in test Makefile.am's
3143 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE3])
3145 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3146 do { long long int x;
3147 __asm__ __volatile__("fisttpq (%0)" : :"r"(&x) ); }
3151 AC_MSG_RESULT([yes])
3157 AM_CONDITIONAL(BUILD_SSE3_TESTS, test x$ac_have_as_sse3 = xyes)
3160 # Ditto for SSSE3 instructions (note extra S)
3161 # Note, this doesn't generate a C-level symbol. It generates a
3162 # automake-level symbol (BUILD_SSSE3_TESTS), used in test Makefile.am's
3163 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSSE3])
3165 save_CFLAGS="$CFLAGS"
3166 CFLAGS="$CFLAGS -msse -Werror"
3167 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3168 do { long long int x;
3169 __asm__ __volatile__(
3170 "pabsb (%0),%%xmm7" : : "r"(&x) : "xmm7" ); }
3173 ac_have_as_ssse3=yes
3174 AC_MSG_RESULT([yes])
3179 CFLAGS="$save_CFLAGS"
3181 AM_CONDITIONAL(BUILD_SSSE3_TESTS, test x$ac_have_as_ssse3 = xyes)
3184 # does the x86/amd64 assembler understand the PCLMULQDQ instruction?
3185 # Note, this doesn't generate a C-level symbol. It generates a
3186 # automake-level symbol (BUILD_PCLMULQDQ_TESTS), used in test Makefile.am's
3187 AC_MSG_CHECKING([if x86/amd64 assembler supports 'pclmulqdq'])
3188 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3190 __asm__ __volatile__(
3191 "pclmulqdq \$17,%%xmm6,%%xmm7" : : : "xmm6", "xmm7" ); }
3194 ac_have_as_pclmulqdq=yes
3195 AC_MSG_RESULT([yes])
3197 ac_have_as_pclmulqdq=no
3201 AM_CONDITIONAL(BUILD_PCLMULQDQ_TESTS, test x$ac_have_as_pclmulqdq = xyes)
3204 # does the x86/amd64 assembler understand the VPCLMULQDQ instruction?
3205 # Note, this doesn't generate a C-level symbol. It generates a
3206 # automake-level symbol (BUILD_VPCLMULQDQ_TESTS), used in test Makefile.am's
3207 AC_MSG_CHECKING([if x86/amd64 assembler supports 'vpclmulqdq'])
3208 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3211 * Carry-less multiplication of xmm1 with xmm2 and store the result in
3212 * xmm3. The immediate is used to determine which quadwords of xmm1 and
3213 * xmm2 should be used.
3215 __asm__ __volatile__(
3216 "vpclmulqdq \$0,%%xmm1,%%xmm2,%%xmm3" : : : );
3219 ac_have_as_vpclmulqdq=yes
3220 AC_MSG_RESULT([yes])
3222 ac_have_as_vpclmulqdq=no
3226 AM_CONDITIONAL(BUILD_VPCLMULQDQ_TESTS, test x$ac_have_as_vpclmulqdq = xyes)
3229 # does the x86/amd64 assembler understand FMA4 instructions?
3230 # Note, this doesn't generate a C-level symbol. It generates a
3231 # automake-level symbol (BUILD_AFM4_TESTS), used in test Makefile.am's
3232 AC_MSG_CHECKING([if x86/amd64 assembler supports FMA4 'vfmaddpd'])
3233 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3235 __asm__ __volatile__(
3236 "vfmaddpd %%xmm7,%%xmm8,%%xmm6,%%xmm9" : : : );
3239 ac_have_as_vfmaddpd=yes
3240 AC_MSG_RESULT([yes])
3242 ac_have_as_vfmaddpd=no
3246 AM_CONDITIONAL(BUILD_FMA4_TESTS, test x$ac_have_as_vfmaddpd = xyes)
3249 # does the x86/amd64 assembler understand the LZCNT instruction?
3250 # Note, this doesn't generate a C-level symbol. It generates a
3251 # automake-level symbol (BUILD_LZCNT_TESTS), used in test Makefile.am's
3252 AC_MSG_CHECKING([if x86/amd64 assembler supports 'lzcnt'])
3254 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3256 __asm__ __volatile__("lzcnt %%rax,%%rax" : : : "rax");
3259 ac_have_as_lzcnt=yes
3260 AC_MSG_RESULT([yes])
3266 AM_CONDITIONAL([BUILD_LZCNT_TESTS], [test x$ac_have_as_lzcnt = xyes])
3269 # does the x86/amd64 assembler understand the LOOPNEL instruction?
3270 # Note, this doesn't generate a C-level symbol. It generates a
3271 # automake-level symbol (BUILD_LOOPNEL_TESTS), used in test Makefile.am's
3272 AC_MSG_CHECKING([if x86/amd64 assembler supports 'loopnel'])
3274 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3276 __asm__ __volatile__("1: loopnel 1b\n");
3279 ac_have_as_loopnel=yes
3280 AC_MSG_RESULT([yes])
3282 ac_have_as_loopnel=no
3286 AM_CONDITIONAL([BUILD_LOOPNEL_TESTS], [test x$ac_have_as_loopnel = xyes])
3289 # does the x86/amd64 assembler understand ADDR32 ?
3290 # Note, this doesn't generate a C-level symbol. It generates a
3291 # automake-level symbol (BUILD_ADDR32_TESTS), used in test Makefile.am's
3292 AC_MSG_CHECKING([if x86/amd64 assembler supports 'addr32'])
3294 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3296 asm volatile ("addr32 rep movsb");
3299 ac_have_as_addr32=yes
3300 AC_MSG_RESULT([yes])
3302 ac_have_as_addr32=no
3306 AM_CONDITIONAL([BUILD_ADDR32_TESTS], [test x$ac_have_as_addr32 = xyes])
3309 # does the x86/amd64 assembler understand SSE 4.2 instructions?
3310 # Note, this doesn't generate a C-level symbol. It generates a
3311 # automake-level symbol (BUILD_SSE42_TESTS), used in test Makefile.am's
3312 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE4.2])
3314 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3315 do { long long int x;
3316 __asm__ __volatile__(
3317 "crc32q %%r15,%%r15" : : : "r15" );
3318 __asm__ __volatile__(
3319 "pblendvb (%%rcx), %%xmm11" : : : "memory", "xmm11");
3320 __asm__ __volatile__(
3321 "aesdec %%xmm2, %%xmm1" : : : "xmm2", "xmm1"); }
3324 ac_have_as_sse42=yes
3325 AC_MSG_RESULT([yes])
3331 AM_CONDITIONAL(BUILD_SSE42_TESTS, test x$ac_have_as_sse42 = xyes)
3334 # does the x86/amd64 assembler understand AVX instructions?
3335 # Note, this doesn't generate a C-level symbol. It generates a
3336 # automake-level symbol (BUILD_AVX_TESTS), used in test Makefile.am's
3337 AC_MSG_CHECKING([if x86/amd64 assembler speaks AVX])
3339 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3340 do { long long int x;
3341 __asm__ __volatile__(
3342 "vmovupd (%%rsp), %%ymm7" : : : "xmm7" );
3343 __asm__ __volatile__(
3344 "vaddpd %%ymm6,%%ymm7,%%ymm8" : : : "xmm6","xmm7","xmm8"); }
3348 AC_MSG_RESULT([yes])
3354 AM_CONDITIONAL(BUILD_AVX_TESTS, test x$ac_have_as_avx = xyes)
3357 # does the x86/amd64 assembler understand AVX2 instructions?
3358 # Note, this doesn't generate a C-level symbol. It generates a
3359 # automake-level symbol (BUILD_AVX2_TESTS), used in test Makefile.am's
3360 AC_MSG_CHECKING([if x86/amd64 assembler speaks AVX2])
3362 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3363 do { long long int x;
3364 __asm__ __volatile__(
3365 "vpsravd (%%rsp), %%ymm8, %%ymm7" : : : "xmm7", "xmm8" );
3366 __asm__ __volatile__(
3367 "vpaddb %%ymm6,%%ymm7,%%ymm8" : : : "xmm6","xmm7","xmm8"); }
3371 AC_MSG_RESULT([yes])
3377 AM_CONDITIONAL(BUILD_AVX2_TESTS, test x$ac_have_as_avx2 = xyes)
3380 # does the x86/amd64 assembler understand TSX instructions and
3381 # the XACQUIRE/XRELEASE prefixes?
3382 # Note, this doesn't generate a C-level symbol. It generates a
3383 # automake-level symbol (BUILD_TSX_TESTS), used in test Makefile.am's
3384 AC_MSG_CHECKING([if x86/amd64 assembler speaks TSX])
3386 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3388 __asm__ __volatile__(
3391 " xacquire lock incq 0(%rsp) \n\t"
3392 " xrelease lock incq 0(%rsp) \n"
3397 AC_MSG_RESULT([yes])
3403 AM_CONDITIONAL(BUILD_TSX_TESTS, test x$ac_have_as_tsx = xyes)
3406 # does the x86/amd64 assembler understand BMI1 and BMI2 instructions?
3407 # Note, this doesn't generate a C-level symbol. It generates a
3408 # automake-level symbol (BUILD_BMI_TESTS), used in test Makefile.am's
3409 AC_MSG_CHECKING([if x86/amd64 assembler speaks BMI1 and BMI2])
3411 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3412 do { unsigned int h, l;
3413 __asm__ __volatile__( "mulx %rax,%rcx,%r8" );
3414 __asm__ __volatile__(
3415 "andn %2, %1, %0" : "=r" (h) : "r" (0x1234567), "r" (0x7654321) );
3416 __asm__ __volatile__(
3417 "movl %2, %%edx; mulx %3, %1, %0" : "=r" (h), "=r" (l) : "g" (0x1234567), "rm" (0x7654321) : "edx" ); }
3421 AC_MSG_RESULT([yes])
3427 AM_CONDITIONAL(BUILD_BMI_TESTS, test x$ac_have_as_bmi = xyes)
3430 # does the x86/amd64 assembler understand FMA instructions?
3431 # Note, this doesn't generate a C-level symbol. It generates a
3432 # automake-level symbol (BUILD_FMA_TESTS), used in test Makefile.am's
3433 AC_MSG_CHECKING([if x86/amd64 assembler speaks FMA])
3435 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3436 do { unsigned int h, l;
3437 __asm__ __volatile__(
3438 "vfmadd132ps (%%rsp), %%ymm8, %%ymm7" : : : "xmm7", "xmm8" );
3439 __asm__ __volatile__(
3440 "vfnmsub231sd (%%rsp), %%xmm8, %%xmm7" : : : "xmm7", "xmm8" );
3441 __asm__ __volatile__(
3442 "vfmsubadd213pd (%%rsp), %%xmm8, %%xmm7" : : : "xmm7", "xmm8" ); }
3446 AC_MSG_RESULT([yes])
3452 AM_CONDITIONAL(BUILD_FMA_TESTS, test x$ac_have_as_fma = xyes)
3455 # does the amd64 assembler understand MPX instructions?
3456 # Note, this doesn't generate a C-level symbol. It generates a
3457 # automake-level symbol (BUILD_MPX_TESTS), used in test Makefile.am's
3458 AC_MSG_CHECKING([if amd64 assembler knows the MPX instructions])
3460 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3462 asm ("bndmov %bnd0,(%rsp)");
3463 asm ("bndldx 3(%rbx,%rdx), %bnd2");
3464 asm ("bnd call foo\n"
3471 AC_MSG_RESULT([yes])
3477 AM_CONDITIONAL(BUILD_MPX_TESTS, test x$ac_have_as_mpx = xyes)
3480 # does the amd64 assembler understand ADX instructions?
3481 # Note, this doesn't generate a C-level symbol. It generates a
3482 # automake-level symbol (BUILD_ADX_TESTS), used in test Makefile.am's
3483 AC_MSG_CHECKING([if amd64 assembler knows the ADX instructions])
3485 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3487 asm ("adcxq %r14,%r8");
3491 AC_MSG_RESULT([yes])
3497 AM_CONDITIONAL(BUILD_ADX_TESTS, test x$ac_have_as_adx = xyes)
3500 # does the amd64 assembler understand the RDRAND instruction?
3501 # Note, this doesn't generate a C-level symbol. It generates a
3502 # automake-level symbol (BUILD_RDRAND_TESTS), used in test Makefile.am's
3503 AC_MSG_CHECKING([if amd64 assembler knows the RDRAND instruction])
3505 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3507 asm ("rdrand %r14");
3508 asm ("rdrand %r14d");
3509 asm ("rdrand %r14w");
3512 ac_have_as_rdrand=yes
3513 AC_MSG_RESULT([yes])
3515 ac_have_as_rdrand=no
3519 AM_CONDITIONAL(BUILD_RDRAND_TESTS, test x$ac_have_as_rdrand = xyes)
3521 # does the amd64 assembler understand the RDSEED instruction?
3522 # Note, this doesn't generate a C-level symbol. It generates a
3523 # automake-level symbol (BUILD_RDSEED_TESTS), used in test Makefile.am's
3524 AC_MSG_CHECKING([if amd64 assembler knows the RDSEED instruction])
3526 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3528 asm ("rdseed %r14");
3529 asm ("rdseed %r14d");
3530 asm ("rdseed %r14w");
3533 ac_have_as_rdseed=yes
3534 AC_MSG_RESULT([yes])
3536 ac_have_as_rdseed=no
3540 AM_CONDITIONAL(BUILD_RDSEED_TESTS, test x$ac_have_as_rdseed = xyes)
3542 # does the amd64 assembler understand the F16C instructions (VCVTPH2PS and
3544 # Note, this doesn't generate a C-level symbol. It generates a
3545 # automake-level symbol (BUILD_F16C_TESTS), used in test Makefile.am's
3546 AC_MSG_CHECKING([if amd64 assembler knows the F16C instructions])
3548 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3550 asm ("vcvtph2ps %xmm5, %ymm10");
3551 // If we put the dollar sign and zero together, the shell processing
3552 // this configure.ac script substitutes the command name in. Sigh.
3553 asm ("vcvtps2ph $" "0, %ymm10, %xmm5");
3557 AC_MSG_RESULT([yes])
3563 AM_CONDITIONAL(BUILD_F16C_TESTS, test x$ac_have_as_f16c = xyes)
3566 # does the x86/amd64 assembler understand MOVBE?
3567 # Note, this doesn't generate a C-level symbol. It generates a
3568 # automake-level symbol (BUILD_MOVBE_TESTS), used in test Makefile.am's
3569 AC_MSG_CHECKING([if x86/amd64 assembler knows the MOVBE insn])
3571 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3572 do { long long int x;
3573 __asm__ __volatile__(
3574 "movbe (%%rsp), %%r15" : : : "memory", "r15" ); }
3577 ac_have_as_movbe=yes
3578 AC_MSG_RESULT([yes])
3584 AM_CONDITIONAL(BUILD_MOVBE_TESTS, test x$ac_have_as_movbe = xyes)
3587 # Does the C compiler support the "ifunc" attribute
3588 # Note, this doesn't generate a C-level symbol. It generates a
3589 # automake-level symbol (BUILD_IFUNC_TESTS), used in test Makefile.am's
3590 AC_MSG_CHECKING([if gcc supports the ifunc attribute])
3592 AC_LINK_IFELSE([AC_LANG_SOURCE([[
3593 static void mytest(void) {}
3595 static void (*resolve_test(void))(void)
3597 return (void (*)(void))&mytest;
3600 void test(void) __attribute__((ifunc("resolve_test")));
3608 ac_have_ifunc_attr=yes
3609 AC_MSG_RESULT([yes])
3611 ac_have_ifunc_attr=no
3615 AM_CONDITIONAL(BUILD_IFUNC_TESTS, test x$ac_have_ifunc_attr = xyes)
3617 # Does the C compiler support the armv8 crc feature flag
3618 # Note, this doesn't generate a C-level symbol. It generates a
3619 # automake-level symbol (BUILD_ARMV8_CRC_TESTS), used in test Makefile.am's
3620 AC_MSG_CHECKING([if gcc supports the armv8 crc feature flag])
3622 save_CFLAGS="$CFLAGS"
3623 CFLAGS="$CFLAGS -march=armv8-a+crc -Werror"
3624 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3630 ac_have_armv8_crc_feature=yes
3631 AC_MSG_RESULT([yes])
3633 ac_have_armv8_crc_feature=no
3636 CFLAGS="$save_CFLAGS"
3638 AM_CONDITIONAL(BUILD_ARMV8_CRC_TESTS, test x$ac_have_armv8_crc_feature = xyes)
3641 # Does the C compiler support the armv81 flag and the assembler v8.1 instructions
3642 # Note, this doesn't generate a C-level symbol. It generates a
3643 # automake-level symbol (BUILD_ARMV81_TESTS), used in test Makefile.am's
3644 AC_MSG_CHECKING([if gcc supports the armv81 feature flag and assembler supports v8.1 instructions])
3646 save_CFLAGS="$CFLAGS"
3647 CFLAGS="$CFLAGS -march=armv8.1-a -Werror"
3648 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3651 __asm__ __volatile__("ldadd x0, x1, [x2]" ::: "memory");
3655 ac_have_armv81_feature=yes
3656 AC_MSG_RESULT([yes])
3658 ac_have_armv81_feature=no
3661 CFLAGS="$save_CFLAGS"
3663 AM_CONDITIONAL(BUILD_ARMV81_TESTS, test x$ac_have_armv81_feature = xyes)
3666 # Does the C compiler support the armv82 flag and the assembler v8.2 instructions
3667 # Note, this doesn't generate a C-level symbol. It generates a
3668 # automake-level symbol (BUILD_ARMV82_TESTS), used in test Makefile.am's
3669 AC_MSG_CHECKING([if gcc supports the armv82 feature flag and assembler supports v8.2 instructions])
3671 save_CFLAGS="$CFLAGS"
3672 CFLAGS="$CFLAGS -march=armv8.2-a+fp16 -Werror"
3673 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3676 __asm__ __volatile__("faddp h0, v1.2h");
3680 ac_have_armv82_feature=yes
3681 AC_MSG_RESULT([yes])
3683 ac_have_armv82_feature=no
3686 CFLAGS="$save_CFLAGS"
3688 AM_CONDITIONAL(BUILD_ARMV82_TESTS, test x$ac_have_armv82_feature = xyes)
3691 # XXX JRS 2010 Oct 13: what is this for? For sure, we don't need this
3692 # when building the tool executables. I think we should get rid of it.
3694 # Check for TLS support in the compiler and linker
3695 AC_LINK_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
3697 [vg_cv_linktime_tls=yes],
3698 [vg_cv_linktime_tls=no])
3699 # Native compilation: check whether running a program using TLS succeeds.
3700 # Linking only is not sufficient -- e.g. on Red Hat 7.3 linking TLS programs
3701 # succeeds but running programs using TLS fails.
3702 # Cross-compiling: check whether linking a program using TLS succeeds.
3703 AC_CACHE_CHECK([for TLS support], vg_cv_tls,
3704 [AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS],
3705 [vg_cv_tls=$enableval],
3706 [AC_RUN_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
3710 [vg_cv_tls=$vg_cv_linktime_tls])])])
3712 if test "$vg_cv_tls" = yes -a $is_clang != applellvm; then
3713 AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variables])
3717 #----------------------------------------------------------------------------
3718 # Solaris-specific checks.
3719 #----------------------------------------------------------------------------
3721 if test "$VGCONF_OS" = "solaris" ; then
3722 AC_CHECK_HEADERS([sys/lgrp_user_impl.h])
3724 # Solaris-specific check determining if the Sun Studio Assembler is used to
3725 # build Valgrind. The test checks if the x86/amd64 assembler understands the
3726 # cmovl.l instruction, if yes then it's Sun Assembler.
3728 # C-level symbol: none
3729 # Automake-level symbol: SOLARIS_SUN_STUDIO_AS
3731 AC_MSG_CHECKING([if x86/amd64 assembler speaks cmovl.l (Solaris-specific)])
3732 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3734 __asm__ __volatile__("cmovl.l %edx, %eax");
3736 solaris_have_sun_studio_as=yes
3737 AC_MSG_RESULT([yes])
3739 solaris_have_sun_studio_as=no
3742 AM_CONDITIONAL(SOLARIS_SUN_STUDIO_AS, test x$solaris_have_sun_studio_as = xyes)
3744 # Solaris-specific check determining if symbols __xpg4 and __xpg6
3745 # are present in linked shared libraries when gcc is invoked with -std=gnu99.
3746 # See solaris/vgpreload-solaris.mapfile for details.
3747 # gcc on older Solaris instructs linker to include these symbols,
3748 # gcc on illumos and newer Solaris does not.
3750 # C-level symbol: none
3751 # Automake-level symbol: SOLARIS_XPG_SYMBOLS_PRESENT
3753 save_CFLAGS="$CFLAGS"
3754 CFLAGS="$CFLAGS -std=gnu99"
3755 AC_MSG_CHECKING([if xpg symbols are present with -std=gnu99 (Solaris-specific)])
3756 temp_dir=$( /usr/bin/mktemp -d )
3757 cat <<_ACEOF >${temp_dir}/mylib.c
3759 int myfunc(void) { printf("LaPutyka\n"); }
3761 ${CC} ${CFLAGS} -fpic -shared -o ${temp_dir}/mylib.so ${temp_dir}/mylib.c
3762 xpg_present=$( /usr/bin/nm ${temp_dir}/mylib.so | ${EGREP} '(__xpg4|__xpg6)' )
3763 if test "x${xpg_present}" = "x" ; then
3764 solaris_xpg_symbols_present=no
3767 solaris_xpg_symbols_present=yes
3768 AC_MSG_RESULT([yes])
3771 AM_CONDITIONAL(SOLARIS_XPG_SYMBOLS_PRESENT, test x$solaris_xpg_symbols_present = xyes)
3772 CFLAGS="$save_CFLAGS"
3775 # Solaris-specific check determining if gcc enables largefile support by
3776 # default for 32-bit executables. If it does, then set SOLARIS_UNDEF_LARGESOURCE
3777 # variable with gcc flags which disable it.
3779 AC_MSG_CHECKING([if gcc enables largefile support for 32-bit apps (Solaris-specific)])
3780 save_CFLAGS="$CFLAGS"
3781 CFLAGS="$CFLAGS -m32"
3782 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3783 return _LARGEFILE_SOURCE;
3785 SOLARIS_UNDEF_LARGESOURCE="-U_LARGEFILE_SOURCE -U_LARGEFILE64_SOURCE -U_FILE_OFFSET_BITS"
3786 AC_MSG_RESULT([yes])
3788 SOLARIS_UNDEF_LARGESOURCE=""
3792 AC_SUBST(SOLARIS_UNDEF_LARGESOURCE)
3795 # Solaris-specific check determining if /proc/self/cmdline
3796 # or /proc/<pid>/cmdline is supported.
3798 # C-level symbol: SOLARIS_PROC_CMDLINE
3799 # Automake-level symbol: SOLARIS_PROC_CMDLINE
3801 AC_CHECK_FILE([/proc/self/cmdline],
3803 solaris_proc_cmdline=yes
3804 AC_DEFINE([SOLARIS_PROC_CMDLINE], 1,
3805 [Define to 1 if you have /proc/self/cmdline.])
3807 solaris_proc_cmdline=no
3809 AM_CONDITIONAL(SOLARIS_PROC_CMDLINE, test x$solaris_proc_cmdline = xyes)
3812 # Solaris-specific check determining default platform for the Valgrind launcher.
3813 # Used in case the launcher cannot select platform by looking at the client
3814 # image (for example because the executable is a shell script).
3816 # C-level symbol: SOLARIS_LAUNCHER_DEFAULT_PLATFORM
3817 # Automake-level symbol: none
3819 AC_MSG_CHECKING([for default platform of Valgrind launcher (Solaris-specific)])
3820 # Get the ELF class of /bin/sh first.
3821 if ! test -f /bin/sh; then
3822 AC_MSG_ERROR([Shell interpreter `/bin/sh' not found.])
3824 elf_class=$( /usr/bin/file /bin/sh | sed -n 's/.*ELF \(..\)-bit.*/\1/p' )
3825 case "$elf_class" in
3827 default_arch="$VGCONF_ARCH_PRI";
3830 if test "x$VGCONF_ARCH_SEC" != "x"; then
3831 default_arch="$VGCONF_ARCH_SEC"
3833 default_arch="$VGCONF_ARCH_PRI";
3837 AC_MSG_ERROR([Cannot determine ELF class of `/bin/sh'.])
3840 default_platform="$default_arch-$VGCONF_OS"
3841 AC_MSG_RESULT([$default_platform])
3842 AC_DEFINE_UNQUOTED([SOLARIS_LAUNCHER_DEFAULT_PLATFORM], ["$default_platform"],
3843 [Default platform for Valgrind launcher.])
3846 # Solaris-specific check determining if the old syscalls are available.
3848 # C-level symbol: SOLARIS_OLD_SYSCALLS
3849 # Automake-level symbol: SOLARIS_OLD_SYSCALLS
3851 AC_MSG_CHECKING([for the old Solaris syscalls (Solaris-specific)])
3852 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3853 #include <sys/syscall.h>
3857 solaris_old_syscalls=yes
3858 AC_MSG_RESULT([yes])
3859 AC_DEFINE([SOLARIS_OLD_SYSCALLS], 1,
3860 [Define to 1 if you have the old Solaris syscalls.])
3862 solaris_old_syscalls=no
3865 AM_CONDITIONAL(SOLARIS_OLD_SYSCALLS, test x$solaris_old_syscalls = xyes)
3868 # Solaris-specific check determining if the new accept() syscall is available.
3871 # int accept(int sock, struct sockaddr *name, socklen_t *namelenp,
3874 # New syscall (available on illumos):
3875 # int accept(int sock, struct sockaddr *name, socklen_t *namelenp,
3876 # int version, int flags);
3878 # If the old syscall is present then the following syscall will fail with
3879 # ENOTSOCK (because file descriptor 0 is not a socket), if the new syscall is
3880 # available then it will fail with EINVAL (because the flags parameter is
3883 # C-level symbol: SOLARIS_NEW_ACCEPT_SYSCALL
3884 # Automake-level symbol: none
3886 AC_MSG_CHECKING([for the new `accept' syscall (Solaris-specific)])
3887 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
3888 #include <sys/syscall.h>
3892 syscall(SYS_accept, 0, 0, 0, 0, -1);
3893 return !(errno == EINVAL);
3895 AC_MSG_RESULT([yes])
3896 AC_DEFINE([SOLARIS_NEW_ACCEPT_SYSCALL], 1,
3897 [Define to 1 if you have the new `accept' syscall.])
3903 # Solaris-specific check determining if the new illumos pipe() syscall is
3907 # longlong_t pipe();
3909 # New syscall (available on illumos):
3910 # int pipe(intptr_t arg, int flags);
3912 # If the old syscall is present then the following call will succeed, if the
3913 # new syscall is available then it will fail with EFAULT (because address 0
3914 # cannot be accessed).
3916 # C-level symbol: SOLARIS_NEW_PIPE_SYSCALL
3917 # Automake-level symbol: none
3919 AC_MSG_CHECKING([for the new `pipe' syscall (Solaris-specific)])
3920 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
3921 #include <sys/syscall.h>
3925 syscall(SYS_pipe, 0, 0);
3926 return !(errno == EFAULT);
3928 AC_MSG_RESULT([yes])
3929 AC_DEFINE([SOLARIS_NEW_PIPE_SYSCALL], 1,
3930 [Define to 1 if you have the new `pipe' syscall.])
3936 # Solaris-specific check determining if the new lwp_sigqueue() syscall is
3940 # int lwp_kill(id_t lwpid, int sig);
3942 # New syscall (available on Solaris 11):
3943 # int lwp_sigqueue(id_t lwpid, int sig, void *value,
3944 # int si_code, timespec_t *timeout);
3946 # C-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL
3947 # Automake-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL
3949 AC_MSG_CHECKING([for the new `lwp_sigqueue' syscall (Solaris-specific)])
3950 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3951 #include <sys/syscall.h>
3953 return !SYS_lwp_sigqueue;
3955 solaris_lwp_sigqueue_syscall=yes
3956 AC_MSG_RESULT([yes])
3957 AC_DEFINE([SOLARIS_LWP_SIGQUEUE_SYSCALL], 1,
3958 [Define to 1 if you have the new `lwp_sigqueue' syscall.])
3960 solaris_lwp_sigqueue_syscall=no
3963 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL, test x$solaris_lwp_sigqueue_syscall = xyes)
3966 # Solaris-specific check determining if the lwp_sigqueue() syscall
3967 # takes both pid and thread id arguments or just thread id.
3969 # Old syscall (available up to Solaris 11.3):
3970 # int lwp_sigqueue(id_t lwpid, int sig, void *value,
3971 # int si_code, timespec_t *timeout);
3973 # New syscall (available since Solaris 11.4):
3974 # int lwp_sigqueue(pid_t pid, id_t lwpid, int sig, void *value,
3975 # int si_code, timespec_t *timeout);
3977 # If the old syscall is present then the following syscall will fail with
3978 # EINVAL (because signal is out of range); if the new syscall is available
3979 # then it will fail with ESRCH (because it would not find such thread in the
3982 # C-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID
3983 # Automake-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID
3985 AM_COND_IF(SOLARIS_LWP_SIGQUEUE_SYSCALL,
3986 AC_MSG_CHECKING([if the `lwp_sigqueue' syscall accepts pid (Solaris-specific)])
3987 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
3988 #include <sys/syscall.h>
3992 syscall(SYS_lwp_sigqueue, 0, 101, 0, 0, 0, 0);
3993 return !(errno == ESRCH);
3995 solaris_lwp_sigqueue_syscall_takes_pid=yes
3996 AC_MSG_RESULT([yes])
3997 AC_DEFINE([SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID], 1,
3998 [Define to 1 if you have the new `lwp_sigqueue' syscall which accepts pid.])
4000 solaris_lwp_sigqueue_syscall_takes_pid=no
4003 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID,
4004 test x$solaris_lwp_sigqueue_syscall_takes_pid = xyes)
4006 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID, test x = y)
4010 # Solaris-specific check determining if the new lwp_name() syscall is
4013 # New syscall (available on Solaris 11):
4014 # int lwp_name(int opcode, id_t lwpid, char *name, size_t len);
4016 # C-level symbol: SOLARIS_LWP_NAME_SYSCALL
4017 # Automake-level symbol: SOLARIS_LWP_NAME_SYSCALL
4019 AC_MSG_CHECKING([for the new `lwp_name' syscall (Solaris-specific)])
4020 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4021 #include <sys/syscall.h>
4023 return !SYS_lwp_name;
4025 solaris_lwp_name_syscall=yes
4026 AC_MSG_RESULT([yes])
4027 AC_DEFINE([SOLARIS_LWP_NAME_SYSCALL], 1,
4028 [Define to 1 if you have the new `lwp_name' syscall.])
4030 solaris_lwp_name_syscall=no
4033 AM_CONDITIONAL(SOLARIS_LWP_NAME_SYSCALL, test x$solaris_lwp_name_syscall = xyes)
4036 # Solaris-specific check determining if the new getrandom() syscall is
4039 # New syscall (available on Solaris 11):
4040 # int getrandom(void *buf, size_t buflen, uint_t flags);
4042 # C-level symbol: SOLARIS_GETRANDOM_SYSCALL
4043 # Automake-level symbol: SOLARIS_GETRANDOM_SYSCALL
4045 AC_MSG_CHECKING([for the new `getrandom' syscall (Solaris-specific)])
4046 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4047 #include <sys/syscall.h>
4049 return !SYS_getrandom;
4051 solaris_getrandom_syscall=yes
4052 AC_MSG_RESULT([yes])
4053 AC_DEFINE([SOLARIS_GETRANDOM_SYSCALL], 1,
4054 [Define to 1 if you have the new `getrandom' syscall.])
4056 solaris_getrandom_syscall=no
4059 AM_CONDITIONAL(SOLARIS_GETRANDOM_SYSCALL, test x$solaris_getrandom_syscall = xyes)
4062 # Solaris-specific check determining if the new zone() syscall subcodes
4063 # ZONE_LIST_DEFUNCT and ZONE_GETATTR_DEFUNCT are available. These subcodes
4064 # were added in Solaris 11 but are missing on illumos.
4066 # C-level symbol: SOLARIS_ZONE_DEFUNCT
4067 # Automake-level symbol: SOLARIS_ZONE_DEFUNCT
4069 AC_MSG_CHECKING([for ZONE_LIST_DEFUNCT and ZONE_GETATTR_DEFUNCT (Solaris-specific)])
4070 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4071 #include <sys/zone.h>
4073 return !(ZONE_LIST_DEFUNCT && ZONE_GETATTR_DEFUNCT);
4075 solaris_zone_defunct=yes
4076 AC_MSG_RESULT([yes])
4077 AC_DEFINE([SOLARIS_ZONE_DEFUNCT], 1,
4078 [Define to 1 if you have the `ZONE_LIST_DEFUNCT' and `ZONE_GETATTR_DEFUNC' constants.])
4080 solaris_zone_defunct=no
4083 AM_CONDITIONAL(SOLARIS_ZONE_DEFUNCT, test x$solaris_zone_defunct = xyes)
4086 # Solaris-specific check determining if commands A_GETSTAT and A_SETSTAT
4087 # for auditon(2) subcode of the auditsys() syscall are available.
4088 # These commands are available in Solaris 11 and illumos but were removed
4091 # C-level symbol: SOLARIS_AUDITON_STAT
4092 # Automake-level symbol: SOLARIS_AUDITON_STAT
4094 AC_MSG_CHECKING([for A_GETSTAT and A_SETSTAT auditon(2) commands (Solaris-specific)])
4095 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4096 #include <bsm/audit.h>
4098 return !(A_GETSTAT && A_SETSTAT);
4100 solaris_auditon_stat=yes
4101 AC_MSG_RESULT([yes])
4102 AC_DEFINE([SOLARIS_AUDITON_STAT], 1,
4103 [Define to 1 if you have the `A_GETSTAT' and `A_SETSTAT' constants.])
4105 solaris_auditon_stat=no
4108 AM_CONDITIONAL(SOLARIS_AUDITON_STAT, test x$solaris_auditon_stat = xyes)
4111 # Solaris-specific check determining if the new shmsys() syscall subcodes
4112 # IPC_XSTAT64, SHMADV, SHM_ADV_GET, SHM_ADV_SET and SHMGET_OSM are available.
4113 # These subcodes were added in Solaris 11 but are missing on illumos.
4115 # C-level symbol: SOLARIS_SHM_NEW
4116 # Automake-level symbol: SOLARIS_SHM_NEW
4118 AC_MSG_CHECKING([for SHMADV, SHM_ADV_GET, SHM_ADV_SET and SHMGET_OSM (Solaris-specific)])
4119 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4120 #include <sys/ipc_impl.h>
4121 #include <sys/shm.h>
4122 #include <sys/shm_impl.h>
4124 return !(IPC_XSTAT64 && SHMADV && SHM_ADV_GET && SHM_ADV_SET && SHMGET_OSM);
4127 AC_MSG_RESULT([yes])
4128 AC_DEFINE([SOLARIS_SHM_NEW], 1,
4129 [Define to 1 if you have the `IPC_XSTAT64', `SHMADV', `SHM_ADV_GET', `SHM_ADV_SET' and `SHMGET_OSM' constants.])
4134 AM_CONDITIONAL(SOLARIS_SHM_NEW, test x$solaris_shm_new = xyes)
4137 # Solaris-specific check determining if prxregset_t is available. Illumos
4138 # currently does not define it on the x86 platform.
4140 # C-level symbol: SOLARIS_PRXREGSET_T
4141 # Automake-level symbol: SOLARIS_PRXREGSET_T
4143 AC_MSG_CHECKING([for the `prxregset_t' type (Solaris-specific)])
4144 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4145 #include <sys/procfs_isa.h>
4147 return !sizeof(prxregset_t);
4149 solaris_prxregset_t=yes
4150 AC_MSG_RESULT([yes])
4151 AC_DEFINE([SOLARIS_PRXREGSET_T], 1,
4152 [Define to 1 if you have the `prxregset_t' type.])
4154 solaris_prxregset_t=no
4157 AM_CONDITIONAL(SOLARIS_PRXREGSET_T, test x$solaris_prxregset_t = xyes)
4160 # Solaris-specific check determining if the new frealpathat() syscall is
4163 # New syscall (available on Solaris 11.1):
4164 # int frealpathat(int fd, char *path, char *buf, size_t buflen);
4166 # C-level symbol: SOLARIS_FREALPATHAT_SYSCALL
4167 # Automake-level symbol: SOLARIS_FREALPATHAT_SYSCALL
4169 AC_MSG_CHECKING([for the new `frealpathat' syscall (Solaris-specific)])
4170 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4171 #include <sys/syscall.h>
4173 return !SYS_frealpathat;
4175 solaris_frealpathat_syscall=yes
4176 AC_MSG_RESULT([yes])
4177 AC_DEFINE([SOLARIS_FREALPATHAT_SYSCALL], 1,
4178 [Define to 1 if you have the new `frealpathat' syscall.])
4180 solaris_frealpathat_syscall=no
4183 AM_CONDITIONAL(SOLARIS_FREALPATHAT_SYSCALL, test x$solaris_frealpathat_syscall = xyes)
4186 # Solaris-specific check determining if the new uuidsys() syscall is
4189 # New syscall (available on newer Solaris):
4190 # int uuidsys(struct uuid *uuid);
4192 # C-level symbol: SOLARIS_UUIDSYS_SYSCALL
4193 # Automake-level symbol: SOLARIS_UUIDSYS_SYSCALL
4195 AC_MSG_CHECKING([for the new `uuidsys' syscall (Solaris-specific)])
4196 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4197 #include <sys/syscall.h>
4199 return !SYS_uuidsys;
4201 solaris_uuidsys_syscall=yes
4202 AC_MSG_RESULT([yes])
4203 AC_DEFINE([SOLARIS_UUIDSYS_SYSCALL], 1,
4204 [Define to 1 if you have the new `uuidsys' syscall.])
4206 solaris_uuidsys_syscall=no
4209 AM_CONDITIONAL(SOLARIS_UUIDSYS_SYSCALL, test x$solaris_uuidsys_syscall = xyes)
4212 # Solaris-specific check determining if the new labelsys() syscall subcode
4213 # TNDB_GET_TNIP is available. This subcode was added in Solaris 11 but is
4214 # missing on illumos.
4216 # C-level symbol: SOLARIS_TNDB_GET_TNIP
4217 # Automake-level symbol: SOLARIS_TNDB_GET_TNIP
4219 AC_MSG_CHECKING([for TNDB_GET_TNIP (Solaris-specific)])
4220 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4221 #include <sys/tsol/tndb.h>
4223 return !TNDB_GET_TNIP;
4225 solaris_tndb_get_tnip=yes
4226 AC_MSG_RESULT([yes])
4227 AC_DEFINE([SOLARIS_TNDB_GET_TNIP], 1,
4228 [Define to 1 if you have the `TNDB_GET_TNIP' constant.])
4230 solaris_tndb_get_tnip=no
4233 AM_CONDITIONAL(SOLARIS_TNDB_GET_TNIP, test x$solaris_tndb_get_tnip = xyes)
4236 # Solaris-specific check determining if the new labelsys() syscall opcodes
4237 # TSOL_GETCLEARANCE and TSOL_SETCLEARANCE are available. These opcodes were
4238 # added in Solaris 11 but are missing on illumos.
4240 # C-level symbol: SOLARIS_TSOL_CLEARANCE
4241 # Automake-level symbol: SOLARIS_TSOL_CLEARANCE
4243 AC_MSG_CHECKING([for TSOL_GETCLEARANCE and TSOL_SETCLEARANCE (Solaris-specific)])
4244 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4245 #include <sys/tsol/tsyscall.h>
4247 return !(TSOL_GETCLEARANCE && TSOL_SETCLEARANCE);
4249 solaris_tsol_clearance=yes
4250 AC_MSG_RESULT([yes])
4251 AC_DEFINE([SOLARIS_TSOL_CLEARANCE], 1,
4252 [Define to 1 if you have the `TSOL_GETCLEARANCE' and `TSOL_SETCLEARANCE' constants.])
4254 solaris_tsol_clearance=no
4257 AM_CONDITIONAL(SOLARIS_TSOL_CLEARANCE, test x$solaris_tsol_clearance = xyes)
4260 # Solaris-specific check determining if the new pset() syscall subcode
4261 # PSET_GET_NAME is available. This subcode was added in Solaris 11.4 but
4262 # is missing on illumos and Solaris 11.3.
4264 # C-level symbol: SOLARIS_PSET_GET_NAME
4265 # Automake-level symbol: SOLARIS_PSET_GET_NAME
4267 AC_MSG_CHECKING([for PSET_GET_NAME (Solaris-specific)])
4268 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4269 #include <sys/pset.h>
4271 return !(PSET_GET_NAME);
4273 solaris_pset_get_name=yes
4274 AC_MSG_RESULT([yes])
4275 AC_DEFINE([SOLARIS_PSET_GET_NAME], 1,
4276 [Define to 1 if you have the `PSET_GET_NAME' constants.])
4278 solaris_pset_get_name=no
4281 AM_CONDITIONAL(SOLARIS_PSET_GET_NAME, test x$solaris_pset_get_name = xyes)
4284 # Solaris-specific check determining if the utimesys() syscall is
4285 # available (on illumos and older Solaris).
4287 # C-level symbol: SOLARIS_UTIMESYS_SYSCALL
4288 # Automake-level symbol: SOLARIS_UTIMESYS_SYSCALL
4290 AC_MSG_CHECKING([for the `utimesys' syscall (Solaris-specific)])
4291 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4292 #include <sys/syscall.h>
4294 return !SYS_utimesys;
4296 solaris_utimesys_syscall=yes
4297 AC_MSG_RESULT([yes])
4298 AC_DEFINE([SOLARIS_UTIMESYS_SYSCALL], 1,
4299 [Define to 1 if you have the `utimesys' syscall.])
4301 solaris_utimesys_syscall=no
4304 AM_CONDITIONAL(SOLARIS_UTIMESYS_SYSCALL, test x$solaris_utimesys_syscall = xyes)
4307 # Solaris-specific check determining if the utimensat() syscall is
4308 # available (on newer Solaris).
4310 # C-level symbol: SOLARIS_UTIMENSAT_SYSCALL
4311 # Automake-level symbol: SOLARIS_UTIMENSAT_SYSCALL
4313 AC_MSG_CHECKING([for the `utimensat' syscall (Solaris-specific)])
4314 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4315 #include <sys/syscall.h>
4317 return !SYS_utimensat;
4319 solaris_utimensat_syscall=yes
4320 AC_MSG_RESULT([yes])
4321 AC_DEFINE([SOLARIS_UTIMENSAT_SYSCALL], 1,
4322 [Define to 1 if you have the `utimensat' syscall.])
4324 solaris_utimensat_syscall=no
4327 AM_CONDITIONAL(SOLARIS_UTIMENSAT_SYSCALL, test x$solaris_utimensat_syscall = xyes)
4330 # Solaris-specific check determining if the spawn() syscall is available
4331 # (on newer Solaris).
4333 # C-level symbol: SOLARIS_SPAWN_SYSCALL
4334 # Automake-level symbol: SOLARIS_SPAWN_SYSCALL
4336 AC_MSG_CHECKING([for the `spawn' syscall (Solaris-specific)])
4337 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4338 #include <sys/syscall.h>
4342 solaris_spawn_syscall=yes
4343 AC_MSG_RESULT([yes])
4344 AC_DEFINE([SOLARIS_SPAWN_SYSCALL], 1,
4345 [Define to 1 if you have the `spawn' syscall.])
4347 solaris_spawn_syscall=no
4350 AM_CONDITIONAL(SOLARIS_SPAWN_SYSCALL, test x$solaris_spawn_syscall = xyes)
4353 # Solaris-specific check determining if commands MODNVL_CTRLMAP through
4354 # MODDEVINFO_CACHE_TS for modctl() syscall are available (on newer Solaris).
4356 # C-level symbol: SOLARIS_MODCTL_MODNVL
4357 # Automake-level symbol: SOLARIS_MODCTL_MODNVL
4359 AC_MSG_CHECKING([for MODNVL_CTRLMAP through MODDEVINFO_CACHE_TS modctl(2) commands (Solaris-specific)])
4360 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4361 #include <sys/modctl.h>
4363 return !(MODNVL_CTRLMAP && MODDEVINFO_CACHE_TS);
4365 solaris_modctl_modnvl=yes
4366 AC_MSG_RESULT([yes])
4367 AC_DEFINE([SOLARIS_MODCTL_MODNVL], 1,
4368 [Define to 1 if you have the `MODNVL_CTRLMAP' through `MODDEVINFO_CACHE_TS' constants.])
4370 solaris_modctl_modnvl=no
4373 AM_CONDITIONAL(SOLARIS_MODCTL_MODNVL, test x$solaris_modctl_modnvl = xyes)
4376 # Solaris-specific check determining whether nscd (name switch cache daemon)
4377 # attaches its door at /system/volatile/name_service_door (Solaris)
4378 # or at /var/run/name_service_door (illumos).
4380 # Note that /var/run is a symlink to /system/volatile on Solaris
4381 # but not vice versa on illumos.
4383 # C-level symbol: SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE
4384 # Automake-level symbol: SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE
4386 AC_MSG_CHECKING([for nscd door location (Solaris-specific)])
4387 if test -e /system/volatile/name_service_door; then
4388 solaris_nscd_door_system_volatile=yes
4389 AC_MSG_RESULT([/system/volatile/name_service_door])
4390 AC_DEFINE([SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE], 1,
4391 [Define to 1 if nscd attaches to /system/volatile/name_service_door.])
4393 solaris_nscd_door_system_volatile=no
4394 AC_MSG_RESULT([/var/run/name_service_door])
4396 AM_CONDITIONAL(SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE, test x$solaris_nscd_door_system_volatile = xyes)
4399 # Solaris-specific check determining if the new gethrt() fasttrap is available.
4401 # New fasttrap (available on Solaris 11):
4402 # hrt_t *gethrt(void);
4404 # C-level symbol: SOLARIS_GETHRT_FASTTRAP
4405 # Automake-level symbol: SOLARIS_GETHRT_FASTTRAP
4407 AC_MSG_CHECKING([for the new `gethrt' fasttrap (Solaris-specific)])
4408 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4409 #include <sys/trap.h>
4413 solaris_gethrt_fasttrap=yes
4414 AC_MSG_RESULT([yes])
4415 AC_DEFINE([SOLARIS_GETHRT_FASTTRAP], 1,
4416 [Define to 1 if you have the new `gethrt' fasttrap.])
4418 solaris_gethrt_fasttrap=no
4421 AM_CONDITIONAL(SOLARIS_GETHRT_FASTTRAP, test x$solaris_gethrt_fasttrap = xyes)
4424 # Solaris-specific check determining if the new get_zone_offset() fasttrap
4427 # New fasttrap (available on Solaris 11):
4428 # zonehrtoffset_t *get_zone_offset(void);
4430 # C-level symbol: SOLARIS_GETZONEOFFSET_FASTTRAP
4431 # Automake-level symbol: SOLARIS_GETZONEOFFSET_FASTTRAP
4433 AC_MSG_CHECKING([for the new `get_zone_offset' fasttrap (Solaris-specific)])
4434 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4435 #include <sys/trap.h>
4437 return !T_GETZONEOFFSET;
4439 solaris_getzoneoffset_fasttrap=yes
4440 AC_MSG_RESULT([yes])
4441 AC_DEFINE([SOLARIS_GETZONEOFFSET_FASTTRAP], 1,
4442 [Define to 1 if you have the new `get_zone_offset' fasttrap.])
4444 solaris_getzoneoffset_fasttrap=no
4447 AM_CONDITIONAL(SOLARIS_GETZONEOFFSET_FASTTRAP, test x$solaris_getzoneoffset_fasttrap = xyes)
4450 # Solaris-specific check determining if the execve() syscall
4451 # takes fourth argument (flags) or not.
4453 # Old syscall (available on illumos):
4454 # int execve(const char *fname, const char **argv, const char **envp);
4456 # New syscall (available on Solaris):
4457 # int execve(uintptr_t file, const char **argv, const char **envp, int flags);
4459 # If the new syscall is present then it will fail with EINVAL (because flags
4460 # are invalid); if the old syscall is available then it will fail with ENOENT
4461 # (because the file could not be found).
4463 # C-level symbol: SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS
4464 # Automake-level symbol: SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS
4466 AC_MSG_CHECKING([if the `execve' syscall accepts flags (Solaris-specific)])
4467 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
4468 #include <sys/syscall.h>
4472 syscall(SYS_execve, "/no/existing/path", 0, 0, 0xdeadbeef, 0, 0);
4473 return !(errno == EINVAL);
4475 solaris_execve_syscall_takes_flags=yes
4476 AC_MSG_RESULT([yes])
4477 AC_DEFINE([SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS], 1,
4478 [Define to 1 if you have the new `execve' syscall which accepts flags.])
4480 solaris_execve_syscall_takes_flags=no
4483 AM_CONDITIONAL(SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS,
4484 test x$solaris_execve_syscall_takes_flags = xyes)
4487 # Solaris-specific check determining version of the repository cache protocol.
4488 # Every Solaris version uses a different one, ranging from 21 to current 25.
4489 # The check is very ugly, though.
4491 # C-level symbol: SOLARIS_REPCACHE_PROTOCOL_VERSION vv
4492 # Automake-level symbol: none
4494 AC_PATH_PROG(DIS_PATH, dis, false)
4495 if test "x$DIS_PATH" = "xfalse"; then
4496 AC_MSG_FAILURE([Object code disassembler (`dis') not found.])
4498 AC_CHECK_LIB(scf, scf_handle_bind, [], [
4499 AC_MSG_WARN([Function `scf_handle_bind' was not found in `libscf'.])
4500 AC_MSG_ERROR([Cannot determine version of the repository cache protocol.])
4503 AC_MSG_CHECKING([for version of the repository cache protocol (Solaris-specific)])
4504 if test "X$VGCONF_ARCH_PRI" = "Xamd64"; then
4505 libscf=/usr/lib/64/libscf.so.1
4507 libscf=/usr/lib/libscf.so.1
4509 if ! $DIS_PATH -F scf_handle_bind $libscf | grep -q 0x526570; then
4510 AC_MSG_WARN([Function `scf_handle_bind' does not contain repository cache protocol version.])
4511 AC_MSG_ERROR([Cannot determine version of the repository cache protocol.])
4513 hex=$( $DIS_PATH -F scf_handle_bind $libscf | sed -n 's/.*0x526570\(..\).*/\1/p' )
4514 if test -z "$hex"; then
4515 AC_MSG_WARN([Version of the repository cache protocol is empty?!])
4516 AC_MSG_ERROR([Cannot determine version of the repository cache protocol.])
4518 version=$( printf "%d\n" 0x$hex )
4519 AC_MSG_RESULT([$version])
4520 AC_DEFINE_UNQUOTED([SOLARIS_REPCACHE_PROTOCOL_VERSION], [$version],
4521 [Version number of the repository door cache protocol.])
4524 # Solaris-specific check determining if "sysstat" segment reservation type
4527 # New "sysstat" segment reservation (available on Solaris 11.4):
4528 # - program header type: PT_SUNW_SYSSTAT
4529 # - auxiliary vector entry: AT_SUN_SYSSTAT_ADDR
4531 # C-level symbol: SOLARIS_RESERVE_SYSSTAT_ADDR
4532 # Automake-level symbol: SOLARIS_RESERVE_SYSSTAT_ADDR
4534 AC_MSG_CHECKING([for the new `sysstat' segment reservation (Solaris-specific)])
4535 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4536 #include <sys/auxv.h>
4538 return !AT_SUN_SYSSTAT_ADDR;
4540 solaris_reserve_sysstat_addr=yes
4541 AC_MSG_RESULT([yes])
4542 AC_DEFINE([SOLARIS_RESERVE_SYSSTAT_ADDR], 1,
4543 [Define to 1 if you have the new `sysstat' segment reservation.])
4545 solaris_reserve_sysstat_addr=no
4548 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ADDR, test x$solaris_reserve_sysstat_addr = xyes)
4551 # Solaris-specific check determining if "sysstat_zone" segment reservation type
4554 # New "sysstat_zone" segment reservation (available on Solaris 11.4):
4555 # - program header type: PT_SUNW_SYSSTAT_ZONE
4556 # - auxiliary vector entry: AT_SUN_SYSSTAT_ZONE_ADDR
4558 # C-level symbol: SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR
4559 # Automake-level symbol: SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR
4561 AC_MSG_CHECKING([for the new `sysstat_zone' segment reservation (Solaris-specific)])
4562 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4563 #include <sys/auxv.h>
4565 return !AT_SUN_SYSSTAT_ZONE_ADDR;
4567 solaris_reserve_sysstat_zone_addr=yes
4568 AC_MSG_RESULT([yes])
4569 AC_DEFINE([SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR], 1,
4570 [Define to 1 if you have the new `sysstat_zone' segment reservation.])
4572 solaris_reserve_sysstat_zone_addr=no
4575 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR, test x$solaris_reserve_sysstat_zone_addr = xyes)
4578 # Solaris-specific check determining if the system_stats() syscall is available
4579 # (on newer Solaris).
4581 # C-level symbol: SOLARIS_SYSTEM_STATS_SYSCALL
4582 # Automake-level symbol: SOLARIS_SYSTEM_STATS_SYSCALL
4584 AC_MSG_CHECKING([for the `system_stats' syscall (Solaris-specific)])
4585 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4586 #include <sys/syscall.h>
4588 return !SYS_system_stats;
4590 solaris_system_stats_syscall=yes
4591 AC_MSG_RESULT([yes])
4592 AC_DEFINE([SOLARIS_SYSTEM_STATS_SYSCALL], 1,
4593 [Define to 1 if you have the `system_stats' syscall.])
4595 solaris_system_stats_syscall=no
4598 AM_CONDITIONAL(SOLARIS_SYSTEM_STATS_SYSCALL, test x$solaris_system_stats_syscall = xyes)
4601 # Solaris-specific check determining if fpregset_t defines struct _fpchip_state
4602 # (on newer illumos) or struct fpchip_state (Solaris, older illumos).
4604 # C-level symbol: SOLARIS_FPCHIP_STATE_TAKES_UNDERSCORE
4605 # Automake-level symbol: none
4607 AC_CHECK_TYPE([struct _fpchip_state],
4608 [solaris_fpchip_state_takes_underscore=yes],
4609 [solaris_fpchip_state_takes_underscore=no],
4610 [[#include <sys/regset.h>]])
4611 if test "$solaris_fpchip_state_takes_underscore" = "yes"; then
4612 AC_DEFINE(SOLARIS_FPCHIP_STATE_TAKES_UNDERSCORE, 1,
4613 [Define to 1 if fpregset_t defines struct _fpchip_state])
4617 # Solaris-specific check determining if schedctl page shared between kernel
4618 # and userspace program is executable (illumos, older Solaris) or not (newer
4621 # C-level symbol: SOLARIS_SCHEDCTL_PAGE_EXEC
4622 # Automake-level symbol: none
4624 AC_MSG_CHECKING([if schedctl page is executable (Solaris-specific)])
4625 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
4629 #include <schedctl.h>
4633 schedctl_t *scp = schedctl_init();
4637 int fd = open("/proc/self/map", O_RDONLY);
4642 while ((rd = read(fd, &map, sizeof(map))) == sizeof(map)) {
4643 if (map.pr_vaddr == ((uintptr_t) scp & PAGEMASK)) {
4644 fprintf(stderr, "%#lx [%zu] %s\n", map.pr_vaddr, map.pr_size,
4645 (map.pr_mflags & MA_EXEC) ? "x" : "no-x");
4646 return (map.pr_mflags & MA_EXEC);
4652 solaris_schedctl_page_exec=no
4655 solaris_schedctl_page_exec=yes
4656 AC_MSG_RESULT([yes])
4657 AC_DEFINE([SOLARIS_SCHEDCTL_PAGE_EXEC], 1,
4658 [Define to 1 if you have the schedctl page executable.])
4662 # Solaris-specific check determining if PT_SUNWDTRACE program header provides
4663 # scratch space for DTrace fasttrap provider (illumos, older Solaris) or just
4664 # an initial thread pointer for libc (newer Solaris).
4666 # C-level symbol: SOLARIS_PT_SUNDWTRACE_THRP
4667 # Automake-level symbol: none
4669 AC_MSG_CHECKING([if PT_SUNWDTRACE serves for initial thread pointer (Solaris-specific)])
4670 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
4671 #include <sys/fasttrap_isa.h>
4673 return !FT_SCRATCHSIZE;
4675 solaris_pt_sunwdtrace_thrp=yes
4676 AC_MSG_RESULT([yes])
4677 AC_DEFINE([SOLARIS_PT_SUNDWTRACE_THRP], 1,
4678 [Define to 1 if PT_SUNWDTRACE program header provides just an initial thread pointer for libc.])
4680 solaris_pt_sunwdtrace_thrp=no
4685 AM_CONDITIONAL(SOLARIS_SUN_STUDIO_AS, false)
4686 AM_CONDITIONAL(SOLARIS_XPG_SYMBOLS_PRESENT, false)
4687 AM_CONDITIONAL(SOLARIS_PROC_CMDLINE, false)
4688 AM_CONDITIONAL(SOLARIS_OLD_SYSCALLS, false)
4689 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL, false)
4690 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID, false)
4691 AM_CONDITIONAL(SOLARIS_LWP_NAME_SYSCALL, false)
4692 AM_CONDITIONAL(SOLARIS_GETRANDOM_SYSCALL, false)
4693 AM_CONDITIONAL(SOLARIS_ZONE_DEFUNCT, false)
4694 AM_CONDITIONAL(SOLARIS_AUDITON_STAT, false)
4695 AM_CONDITIONAL(SOLARIS_SHM_NEW, false)
4696 AM_CONDITIONAL(SOLARIS_PRXREGSET_T, false)
4697 AM_CONDITIONAL(SOLARIS_FREALPATHAT_SYSCALL, false)
4698 AM_CONDITIONAL(SOLARIS_UUIDSYS_SYSCALL, false)
4699 AM_CONDITIONAL(SOLARIS_TNDB_GET_TNIP, false)
4700 AM_CONDITIONAL(SOLARIS_TSOL_CLEARANCE, false)
4701 AM_CONDITIONAL(SOLARIS_PSET_GET_NAME, false)
4702 AM_CONDITIONAL(SOLARIS_UTIMESYS_SYSCALL, false)
4703 AM_CONDITIONAL(SOLARIS_UTIMENSAT_SYSCALL, false)
4704 AM_CONDITIONAL(SOLARIS_SPAWN_SYSCALL, false)
4705 AM_CONDITIONAL(SOLARIS_MODCTL_MODNVL, false)
4706 AM_CONDITIONAL(SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE, false)
4707 AM_CONDITIONAL(SOLARIS_GETHRT_FASTTRAP, false)
4708 AM_CONDITIONAL(SOLARIS_GETZONEOFFSET_FASTTRAP, false)
4709 AM_CONDITIONAL(SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS, false)
4710 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ADDR, false)
4711 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR, false)
4712 AM_CONDITIONAL(SOLARIS_SYSTEM_STATS_SYSCALL, false)
4713 fi # test "$VGCONF_OS" = "solaris"
4715 #----------------------------------------------------------------------------
4716 # FreeBSD-specific checks.
4717 #----------------------------------------------------------------------------
4719 # Rather than having a large number of feature test as above with Solaris
4720 # these tests are per-version. This may not be entirely relialable for
4721 # FreeBSD development branches (XX.Y-CURRENT) or pre-release branches
4722 # (XX.Y-STABLE) but it should work for XX-Y-RELEASE
4724 if test "$VGCONF_OS" = "freebsd" ; then
4726 AM_CONDITIONAL(FREEBSD_VERS_13_PLUS, test $freebsd_vers -ge $freebsd_13_0)
4730 AM_CONDITIONAL(FREEBSD_VERS_13_PLUS, false)
4732 fi # test "$VGCONF_OS" = "freebsd"
4735 #----------------------------------------------------------------------------
4736 # Checks for C header files.
4737 #----------------------------------------------------------------------------
4739 AC_CHECK_HEADERS([ \
4757 # Verify whether the <linux/futex.h> header is usable.
4758 AC_MSG_CHECKING([if <linux/futex.h> is usable])
4760 save_CFLAGS="$CFLAGS"
4761 CFLAGS="$CFLAGS -D__user="
4762 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4763 #include <linux/futex.h>
4767 ac_have_usable_linux_futex_h=yes
4768 AC_DEFINE([HAVE_USABLE_LINUX_FUTEX_H], 1,
4769 [Define to 1 if you have a usable <linux/futex.h> header file.])
4770 AC_MSG_RESULT([yes])
4772 ac_have_usable_linux_futex_h=no
4775 CFLAGS="$save_CFLAGS"
4778 #----------------------------------------------------------------------------
4779 # Checks for typedefs, structures, and compiler characteristics.
4780 #----------------------------------------------------------------------------
4784 AC_CHECK_HEADERS_ONCE([sys/time.h])
4786 AC_CHECK_TYPE([struct statx], [
4787 AC_DEFINE([HAVE_STRUCT_STATX_IN_SYS_STAT_H], 1,
4788 [Define to 1 if <sys/stat.h> declares struct statx.])
4791 #include <sys/stat.h>
4795 #----------------------------------------------------------------------------
4796 # Checks for library functions.
4797 #----------------------------------------------------------------------------
4801 AC_CHECK_LIB([pthread], [pthread_create])
4802 AC_CHECK_LIB([rt], [clock_gettime])
4821 pthread_barrier_init \
4822 pthread_condattr_setclock \
4823 pthread_mutex_timedlock \
4824 pthread_rwlock_timedrdlock \
4825 pthread_rwlock_timedwrlock \
4826 pthread_setname_np \
4852 # AC_CHECK_LIB adds any library found to the variable LIBS, and links these
4853 # libraries with any shared object and/or executable. This is NOT what we
4854 # want for e.g. vgpreload_core-x86-linux.so
4857 AM_CONDITIONAL([HAVE_PTHREAD_BARRIER],
4858 [test x$ac_cv_func_pthread_barrier_init = xyes])
4859 AM_CONDITIONAL([HAVE_PTHREAD_MUTEX_TIMEDLOCK],
4860 [test x$ac_cv_func_pthread_mutex_timedlock = xyes])
4861 AM_CONDITIONAL([HAVE_PTHREAD_SPINLOCK],
4862 [test x$ac_cv_func_pthread_spin_lock = xyes])
4863 AM_CONDITIONAL([HAVE_PTHREAD_SETNAME_NP],
4864 [test x$ac_cv_func_pthread_setname_np = xyes])
4865 AM_CONDITIONAL([HAVE_COPY_FILE_RANGE],
4866 [test x$ac_cv_func_copy_file_range = xyes])
4867 AM_CONDITIONAL([HAVE_PREADV_PWRITEV],
4868 [test x$ac_cv_func_preadv = xyes && test x$ac_cv_func_pwritev = xyes])
4869 AM_CONDITIONAL([HAVE_PREADV2_PWRITEV2],
4870 [test x$ac_cv_func_preadv2 = xyes && test x$ac_cv_func_pwritev2 = xyes])
4871 AM_CONDITIONAL([HAVE_SETCONTEXT], [test x$ac_cv_func_setcontext = xyes])
4872 AM_CONDITIONAL([HAVE_SWAPCONTEXT], [test x$ac_cv_func_swapcontext = xyes])
4873 AM_CONDITIONAL([HAVE_MEMFD_CREATE],
4874 [test x$ac_cv_func_memfd_create = xyes])
4876 if test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
4877 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \
4878 -o x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX; then
4879 AC_DEFINE([DISABLE_PTHREAD_SPINLOCK_INTERCEPT], 1,
4880 [Disable intercept pthread_spin_lock() on MIPS32, MIPS64 and nanoMIPS.])
4883 #----------------------------------------------------------------------------
4885 #----------------------------------------------------------------------------
4886 # Do we have a useable MPI setup on the primary and/or secondary targets?
4887 # On Linux, by default, assumes mpicc and -m32/-m64
4888 # Note: this is a kludge in that it assumes the specified mpicc
4889 # understands -m32/-m64 regardless of what is specified using
4891 AC_PATH_PROG([MPI_CC], [mpicc], [mpicc],
4892 [$PATH:/usr/lib/openmpi/bin:/usr/lib64/openmpi/bin])
4895 if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
4896 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_FREEBSD \
4897 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
4898 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
4899 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
4900 -o x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX \
4901 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS ; then
4902 mflag_primary=$FLAG_M32
4903 elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
4904 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD \
4905 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
4906 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX \
4907 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \
4908 -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX ; then
4909 mflag_primary=$FLAG_M64
4910 elif test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN ; then
4911 mflag_primary="$FLAG_M32 -arch i386"
4912 elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN ; then
4913 mflag_primary="$FLAG_M64 -arch x86_64"
4917 if test x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
4918 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX \
4919 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_SOLARIS \
4920 -o x$VGCONF_PLATFORM_SEC_CAPS = xMIPS32_LINUX \
4921 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_FREEBSD ; then
4922 mflag_secondary=$FLAG_M32
4923 elif test x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN ; then
4924 mflag_secondary="$FLAG_M32 -arch i386"
4929 [ --with-mpicc= Specify name of MPI2-ised C compiler],
4934 ## We AM_COND_IF here instead of automake "if" in mpi/Makefile.am so that we can
4935 ## use these values in the check for a functioning mpicc.
4937 ## We leave the MPI_FLAG_M3264_ logic in mpi/Makefile.am and assume that
4938 ## mflag_primary/mflag_secondary are sufficient approximations of that behavior
4939 AM_COND_IF([VGCONF_OS_IS_LINUX],
4940 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic"
4941 LDFLAGS_MPI="-fpic -shared"])
4942 AM_COND_IF([VGCONF_OS_IS_FREEBSD],
4943 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic"
4944 LDFLAGS_MPI="-fpic -shared"])
4945 AM_COND_IF([VGCONF_OS_IS_DARWIN],
4946 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -dynamic"
4947 LDFLAGS_MPI="-dynamic -dynamiclib -all_load"])
4948 AM_COND_IF([VGCONF_OS_IS_SOLARIS],
4949 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic"
4950 LDFLAGS_MPI="-fpic -shared"])
4952 AC_SUBST([CFLAGS_MPI])
4953 AC_SUBST([LDFLAGS_MPI])
4956 ## See if MPI_CC works for the primary target
4958 AC_MSG_CHECKING([primary target for usable MPI2-compliant C compiler and mpi.h])
4960 saved_CFLAGS=$CFLAGS
4962 CFLAGS="$CFLAGS_MPI $mflag_primary"
4963 saved_LDFLAGS="$LDFLAGS"
4964 LDFLAGS="$LDFLAGS_MPI $mflag_primary"
4965 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4969 int ni, na, nd, comb;
4970 int r = MPI_Init(NULL,NULL);
4971 r |= MPI_Type_get_envelope( MPI_INT, &ni, &na, &nd, &comb );
4972 r |= MPI_Finalize();
4975 ac_have_mpi2_pri=yes
4976 AC_MSG_RESULT([yes, $MPI_CC])
4982 CFLAGS=$saved_CFLAGS
4983 LDFLAGS="$saved_LDFLAGS"
4984 AM_CONDITIONAL(BUILD_MPIWRAP_PRI, test x$ac_have_mpi2_pri = xyes)
4986 ## See if MPI_CC works for the secondary target. Complication: what if
4987 ## there is no secondary target? We need this to then fail.
4988 ## Kludge this by making MPI_CC something which will surely fail in
4991 AC_MSG_CHECKING([secondary target for usable MPI2-compliant C compiler and mpi.h])
4993 saved_CFLAGS=$CFLAGS
4994 saved_LDFLAGS="$LDFLAGS"
4995 LDFLAGS="$LDFLAGS_MPI $mflag_secondary"
4996 if test x$VGCONF_PLATFORM_SEC_CAPS = x ; then
4997 CC="$MPI_CC this will surely fail"
5001 CFLAGS="$CFLAGS_MPI $mflag_secondary"
5002 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5006 int ni, na, nd, comb;
5007 int r = MPI_Init(NULL,NULL);
5008 r |= MPI_Type_get_envelope( MPI_INT, &ni, &na, &nd, &comb );
5009 r |= MPI_Finalize();
5012 ac_have_mpi2_sec=yes
5013 AC_MSG_RESULT([yes, $MPI_CC])
5019 CFLAGS=$saved_CFLAGS
5020 LDFLAGS="$saved_LDFLAGS"
5021 AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec = xyes)
5024 #----------------------------------------------------------------------------
5025 # Other library checks
5026 #----------------------------------------------------------------------------
5027 # There now follow some tests for Boost, and OpenMP. These
5028 # tests are present because Drd has some regression tests that use
5029 # these packages. All regression test programs all compiled only
5030 # for the primary target. And so it is important that the configure
5031 # checks that follow, use the correct -m32 or -m64 flag for the
5032 # primary target (called $mflag_primary). Otherwise, we can end up
5033 # in a situation (eg) where, on amd64-linux, the test for Boost checks
5034 # for usable 64-bit Boost facilities, but because we are doing a 32-bit
5035 # only build (meaning, the primary target is x86-linux), the build
5036 # of the regtest programs that use Boost fails, because they are
5037 # build as 32-bit (IN THIS EXAMPLE).
5039 # Hence: ALWAYS USE $mflag_primary FOR CONFIGURE TESTS FOR FACILITIES
5040 # NEEDED BY THE REGRESSION TEST PROGRAMS.
5043 # Check whether the boost library 1.35 or later has been installed.
5044 # The Boost.Threads library has undergone a major rewrite in version 1.35.0.
5046 AC_MSG_CHECKING([for boost])
5049 safe_CXXFLAGS=$CXXFLAGS
5050 CXXFLAGS="$mflag_primary"
5052 LIBS="-lboost_thread-mt -lboost_system-mt $LIBS"
5054 AC_LINK_IFELSE([AC_LANG_SOURCE([
5055 #include <boost/thread.hpp>
5056 static void thread_func(void)
5058 int main(int argc, char** argv)
5060 boost::thread t(thread_func);
5065 ac_have_boost_1_35=yes
5066 AC_SUBST([BOOST_CFLAGS], [])
5067 AC_SUBST([BOOST_LIBS], ["-lboost_thread-mt -lboost_system-mt"])
5068 AC_MSG_RESULT([yes])
5070 ac_have_boost_1_35=no
5075 CXXFLAGS=$safe_CXXFLAGS
5078 AM_CONDITIONAL([HAVE_BOOST_1_35], [test x$ac_have_boost_1_35 = xyes])
5081 # does this compiler support -fopenmp, does it have the include file
5082 # <omp.h> and does it have libgomp ?
5084 AC_MSG_CHECKING([for OpenMP])
5087 CFLAGS="-fopenmp $mflag_primary -Werror"
5089 AC_LINK_IFELSE([AC_LANG_SOURCE([
5091 int main(int argc, char** argv)
5099 AC_MSG_RESULT([yes])
5106 AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes])
5109 # Check for __builtin_popcount
5110 AC_MSG_CHECKING([for __builtin_popcount()])
5111 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5113 __builtin_popcount(2);
5116 AC_MSG_RESULT([yes])
5117 AC_DEFINE([HAVE_BUILTIN_POPCOUT], 1,
5118 [Define to 1 if compiler provides __builtin_popcount().])
5123 # Check for __builtin_clz
5124 AC_MSG_CHECKING([for __builtin_clz()])
5125 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5130 AC_MSG_RESULT([yes])
5131 AC_DEFINE([HAVE_BUILTIN_CLZ], 1,
5132 [Define to 1 if compiler provides __builtin_clz().])
5137 # Check for __builtin_ctz
5138 AC_MSG_CHECKING([for __builtin_ctz()])
5139 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5144 AC_MSG_RESULT([yes])
5145 AC_DEFINE([HAVE_BUILTIN_CTZ], 1,
5146 [Define to 1 if compiler provides __builtin_ctz().])
5151 # does this compiler have built-in functions for atomic memory access for the
5153 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the primary target])
5156 CFLAGS="$mflag_primary"
5158 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
5160 return (__sync_bool_compare_and_swap(&variable, 1, 2)
5161 && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
5163 ac_have_builtin_atomic_primary=yes
5164 AC_MSG_RESULT([yes])
5165 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])
5167 ac_have_builtin_atomic_primary=no
5173 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC],
5174 [test x$ac_have_builtin_atomic_primary = xyes])
5177 # does this compiler have built-in functions for atomic memory access for the
5178 # secondary target ?
5180 if test x$VGCONF_PLATFORM_SEC_CAPS != x; then
5182 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the secondary target])
5185 CFLAGS="$mflag_secondary"
5187 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
5189 return (__sync_add_and_fetch(&variable, 1) ? 1 : 0)
5191 ac_have_builtin_atomic_secondary=yes
5192 AC_MSG_RESULT([yes])
5194 ac_have_builtin_atomic_secondary=no
5202 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_SECONDARY],
5203 [test x$ac_have_builtin_atomic_secondary = xyes])
5205 # does this compiler have built-in functions for atomic memory access on
5206 # 64-bit integers for all targets ?
5208 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch on uint64_t for all targets])
5210 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5213 uint64_t variable = 1;
5214 return __sync_add_and_fetch(&variable, 1)
5216 ac_have_builtin_atomic64_primary=yes
5218 ac_have_builtin_atomic64_primary=no
5221 if test x$VGCONF_PLATFORM_SEC_CAPS != x; then
5224 CFLAGS="$mflag_secondary"
5226 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5229 uint64_t variable = 1;
5230 return __sync_add_and_fetch(&variable, 1)
5232 ac_have_builtin_atomic64_secondary=yes
5234 ac_have_builtin_atomic64_secondary=no
5241 if test x$ac_have_builtin_atomic64_primary = xyes && \
5242 test x$VGCONF_PLATFORM_SEC_CAPS = x \
5243 -o x$ac_have_builtin_atomic64_secondary = xyes; then
5244 AC_MSG_RESULT([yes])
5245 ac_have_builtin_atomic64=yes
5248 ac_have_builtin_atomic64=no
5251 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC64],
5252 [test x$ac_have_builtin_atomic64 = xyes])
5255 AC_MSG_CHECKING([if platform has openat2 syscall])
5257 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5258 #include <sys/syscall.h>
5267 AM_CONDITIONAL([HAVE_OPENAT2],
5268 [test x$ac_have_openat2 = xyes])
5270 # does g++ have built-in functions for atomic memory access ?
5271 AC_MSG_CHECKING([if g++ supports __sync_add_and_fetch])
5273 safe_CXXFLAGS=$CXXFLAGS
5274 CXXFLAGS="$mflag_primary"
5277 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
5279 return (__sync_bool_compare_and_swap(&variable, 1, 2)
5280 && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
5282 ac_have_builtin_atomic_cxx=yes
5283 AC_MSG_RESULT([yes])
5284 AC_DEFINE(HAVE_BUILTIN_ATOMIC_CXX, 1, [Define to 1 if g++ supports __sync_bool_compare_and_swap() and __sync_add_and_fetch()])
5286 ac_have_builtin_atomic_cxx=no
5291 CXXFLAGS=$safe_CXXFLAGS
5293 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_CXX], [test x$ac_have_builtin_atomic_cxx = xyes])
5296 if test x$ac_have_usable_linux_futex_h = xyes \
5297 -a x$ac_have_builtin_atomic_primary = xyes; then
5298 ac_enable_linux_ticket_lock_primary=yes
5300 AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_PRIMARY],
5301 [test x$ac_enable_linux_ticket_lock_primary = xyes])
5303 if test x$VGCONF_PLATFORM_SEC_CAPS != x \
5304 -a x$ac_have_usable_linux_futex_h = xyes \
5305 -a x$ac_have_builtin_atomic_secondary = xyes; then
5306 ac_enable_linux_ticket_lock_secondary=yes
5308 AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_SECONDARY],
5309 [test x$ac_enable_linux_ticket_lock_secondary = xyes])
5312 # does libstdc++ support annotating shared pointers ?
5313 AC_MSG_CHECKING([if libstdc++ supports annotating shared pointers])
5315 safe_CXXFLAGS=$CXXFLAGS
5316 CXXFLAGS="-std=c++0x"
5319 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5322 std::shared_ptr<int> p
5324 ac_have_shared_ptr=yes
5326 ac_have_shared_ptr=no
5328 if test x$ac_have_shared_ptr = xyes; then
5329 # If compilation of the program below fails because of a syntax error
5330 # triggered by substituting one of the annotation macros then that
5331 # means that libstdc++ supports these macros.
5332 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5333 #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(a) (a)----
5334 #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(a) (a)----
5337 std::shared_ptr<int> p
5339 ac_have_shared_pointer_annotation=no
5342 ac_have_shared_pointer_annotation=yes
5343 AC_MSG_RESULT([yes])
5344 AC_DEFINE(HAVE_SHARED_POINTER_ANNOTATION, 1,
5345 [Define to 1 if libstd++ supports annotating shared pointers])
5348 ac_have_shared_pointer_annotation=no
5353 CXXFLAGS=$safe_CXXFLAGS
5355 AM_CONDITIONAL([HAVE_SHARED_POINTER_ANNOTATION],
5356 [test x$ac_have_shared_pointer_annotation = xyes])
5359 #----------------------------------------------------------------------------
5360 # Ok. We're done checking.
5361 #----------------------------------------------------------------------------
5363 # Nb: VEX/Makefile is generated from Makefile.vex.in.
5366 VEX/Makefile:Makefile.vex.in
5370 glibc-2.X-helgrind.supp
5374 docs/xml/vg-entities.xml
5379 gdbserver_tests/Makefile
5380 gdbserver_tests/solaris/Makefile
5386 memcheck/tests/Makefile
5387 memcheck/tests/common/Makefile
5388 memcheck/tests/amd64/Makefile
5389 memcheck/tests/x86/Makefile
5390 memcheck/tests/linux/Makefile
5391 memcheck/tests/linux/debuginfod-check.vgtest
5392 memcheck/tests/darwin/Makefile
5393 memcheck/tests/solaris/Makefile
5394 memcheck/tests/freebsd/Makefile
5395 memcheck/tests/amd64-linux/Makefile
5396 memcheck/tests/arm64-linux/Makefile
5397 memcheck/tests/x86-linux/Makefile
5398 memcheck/tests/amd64-solaris/Makefile
5399 memcheck/tests/x86-solaris/Makefile
5400 memcheck/tests/amd64-freebsd/Makefile
5401 memcheck/tests/x86-freebsd/Makefile
5402 memcheck/tests/ppc32/Makefile
5403 memcheck/tests/ppc64/Makefile
5404 memcheck/tests/s390x/Makefile
5405 memcheck/tests/mips32/Makefile
5406 memcheck/tests/mips64/Makefile
5407 memcheck/tests/vbit-test/Makefile
5409 cachegrind/tests/Makefile
5410 cachegrind/tests/x86/Makefile
5411 cachegrind/cg_annotate
5415 callgrind/callgrind_annotate
5416 callgrind/callgrind_control
5417 callgrind/tests/Makefile
5419 helgrind/tests/Makefile
5421 drd/scripts/download-and-build-splash2
5424 massif/tests/Makefile
5429 lackey/tests/Makefile
5432 none/tests/scripts/Makefile
5433 none/tests/amd64/Makefile
5434 none/tests/ppc32/Makefile
5435 none/tests/ppc64/Makefile
5436 none/tests/x86/Makefile
5437 none/tests/arm/Makefile
5438 none/tests/arm64/Makefile
5439 none/tests/s390x/Makefile
5440 none/tests/mips32/Makefile
5441 none/tests/mips64/Makefile
5442 none/tests/nanomips/Makefile
5443 none/tests/linux/Makefile
5444 none/tests/darwin/Makefile
5445 none/tests/solaris/Makefile
5446 none/tests/freebsd/Makefile
5447 none/tests/amd64-linux/Makefile
5448 none/tests/x86-linux/Makefile
5449 none/tests/amd64-darwin/Makefile
5450 none/tests/x86-darwin/Makefile
5451 none/tests/amd64-solaris/Makefile
5452 none/tests/x86-solaris/Makefile
5453 none/tests/x86-freebsd/Makefile
5455 exp-bbv/tests/Makefile
5456 exp-bbv/tests/x86/Makefile
5457 exp-bbv/tests/x86-linux/Makefile
5458 exp-bbv/tests/amd64-linux/Makefile
5459 exp-bbv/tests/ppc32-linux/Makefile
5460 exp-bbv/tests/arm-linux/Makefile
5464 AC_CONFIG_FILES([coregrind/link_tool_exe_linux],
5465 [chmod +x coregrind/link_tool_exe_linux])
5466 AC_CONFIG_FILES([coregrind/link_tool_exe_freebsd],
5467 [chmod +x coregrind/link_tool_exe_freebsd])
5468 AC_CONFIG_FILES([coregrind/link_tool_exe_darwin],
5469 [chmod +x coregrind/link_tool_exe_darwin])
5470 AC_CONFIG_FILES([coregrind/link_tool_exe_solaris],
5471 [chmod +x coregrind/link_tool_exe_solaris])
5472 AC_CONFIG_FILES([tests/filter_stderr_basic],
5473 [chmod +x tests/filter_stderr_basic])
5474 AC_CONFIG_FILES([tests/filter_discards],
5475 [chmod +x tests/filter_discards])
5476 AC_CONFIG_FILES([memcheck/tests/filter_stderr],
5477 [chmod +x memcheck/tests/filter_stderr])
5478 AC_CONFIG_FILES([memcheck/tests/filter_dw4],
5479 [chmod +x memcheck/tests/filter_dw4])
5480 AC_CONFIG_FILES([memcheck/tests/filter_overlaperror],
5481 [chmod +x memcheck/tests/filter_overlaperror])
5482 AC_CONFIG_FILES([memcheck/tests/x86/filter_pushfpopf],
5483 [chmod +x memcheck/tests/x86/filter_pushfpopf])
5484 AC_CONFIG_FILES([gdbserver_tests/filter_gdb],
5485 [chmod +x gdbserver_tests/filter_gdb])
5486 AC_CONFIG_FILES([gdbserver_tests/filter_memcheck_monitor],
5487 [chmod +x gdbserver_tests/filter_memcheck_monitor])
5488 AC_CONFIG_FILES([gdbserver_tests/filter_stderr],
5489 [chmod +x gdbserver_tests/filter_stderr])
5490 AC_CONFIG_FILES([gdbserver_tests/filter_vgdb],
5491 [chmod +x gdbserver_tests/filter_vgdb])
5492 AC_CONFIG_FILES([drd/tests/filter_stderr],
5493 [chmod +x drd/tests/filter_stderr])
5494 AC_CONFIG_FILES([drd/tests/filter_error_count],
5495 [chmod +x drd/tests/filter_error_count])
5496 AC_CONFIG_FILES([drd/tests/filter_error_summary],
5497 [chmod +x drd/tests/filter_error_summary])
5498 AC_CONFIG_FILES([drd/tests/filter_stderr_and_thread_no_and_offset],
5499 [chmod +x drd/tests/filter_stderr_and_thread_no_and_offset])
5500 AC_CONFIG_FILES([drd/tests/filter_thread_no],
5501 [chmod +x drd/tests/filter_thread_no])
5502 AC_CONFIG_FILES([drd/tests/filter_xml_and_thread_no],
5503 [chmod +x drd/tests/filter_xml_and_thread_no])
5504 AC_CONFIG_FILES([helgrind/tests/filter_stderr],
5505 [chmod +x helgrind/tests/filter_stderr])
5511 Maximum build arch: ${ARCH_MAX}
5512 Primary build arch: ${VGCONF_ARCH_PRI}
5513 Secondary build arch: ${VGCONF_ARCH_SEC}
5514 Build OS: ${VGCONF_OS}
5515 Link Time Optimisation: ${vg_cv_lto}
5516 Primary build target: ${VGCONF_PLATFORM_PRI_CAPS}
5517 Secondary build target: ${VGCONF_PLATFORM_SEC_CAPS}
5518 Platform variant: ${VGCONF_PLATVARIANT}
5519 Primary -DVGPV string: -DVGPV_${VGCONF_ARCH_PRI}_${VGCONF_OS}_${VGCONF_PLATVARIANT}=1
5520 Default supp files: ${DEFAULT_SUPP}