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.
11 AC_INIT([Valgrind],[3.12.0.SVN],[valgrind-users@lists.sourceforge.net])
12 AC_CONFIG_SRCDIR(coregrind/m_main.c)
13 AC_CONFIG_HEADERS([config.h])
14 AM_INIT_AUTOMAKE([foreign subdir-objects])
18 #----------------------------------------------------------------------------
19 # Do NOT modify these flags here. Except in feature tests in which case
20 # the original values must be properly restored.
21 #----------------------------------------------------------------------------
25 #----------------------------------------------------------------------------
26 # Checks for various programs.
27 #----------------------------------------------------------------------------
34 # AC_PROG_OBJC apparently causes problems on older Linux distros (eg. with
35 # autoconf 2.59). If we ever have any Objective-C code in the Valgrind code
36 # base (eg. most likely as Darwin-specific tests) we'll need one of the
38 # - put AC_PROG_OBJC in a Darwin-specific part of this file
39 # - Use AC_PROG_OBJC here and up the minimum autoconf version
40 # - Use the following, which is apparently equivalent:
41 # m4_ifdef([AC_PROG_OBJC],
43 # [AC_CHECK_TOOL([OBJC], [gcc])
45 # AC_SUBST([OBJCFLAGS])
48 # provide a very basic definition for AC_PROG_SED if it's not provided by
49 # autoconf (as e.g. in autoconf 2.59).
50 m4_ifndef([AC_PROG_SED],
51 [AC_DEFUN([AC_PROG_SED],
53 AC_CHECK_PROGS([SED],[gsed sed])])])
56 # If no AR variable was specified, look up the name of the archiver. Otherwise
57 # do not touch the AR variable.
58 if test "x$AR" = "x"; then
59 AC_PATH_PROGS([AR], [`echo $LD | $SED 's/ld$/ar/'` "ar"], [ar])
61 AC_ARG_VAR([AR],[Archiver command])
63 # Check for the compiler support
64 if test "${GCC}" != "yes" ; then
65 AC_MSG_ERROR([Valgrind relies on GCC to be compiled])
68 # figure out where perl lives
69 AC_PATH_PROG(PERL, perl)
71 # figure out where gdb lives
72 AC_PATH_PROG(GDB, gdb, "/no/gdb/was/found/at/configure/time")
73 AC_DEFINE_UNQUOTED(GDB_PATH, "$GDB", [path to GDB])
75 # some older automake's don't have it so try something on our own
76 ifdef([AM_PROG_AS],[AM_PROG_AS],
86 # Check if 'diff' supports -u (universal diffs) and use it if possible.
88 AC_MSG_CHECKING([for diff -u])
91 # Comparing two identical files results in 0.
92 tmpfile="tmp-xxx-yyy-zzz"
94 if diff -u $tmpfile $tmpfile ; then
104 # We don't want gcc < 3.0
105 AC_MSG_CHECKING([for a supported version of gcc])
107 # Obtain the compiler version.
109 # A few examples of how the ${CC} --version output looks like:
111 # ######## gcc variants ########
112 # Arch Linux: i686-pc-linux-gnu-gcc (GCC) 4.6.2
113 # Debian Linux: gcc (Debian 4.3.2-1.1) 4.3.2
114 # openSUSE: gcc (SUSE Linux) 4.5.1 20101208 [gcc-4_5-branch revision 167585]
115 # Exherbo Linux: x86_64-pc-linux-gnu-gcc (Exherbo gcc-4.6.2) 4.6.2
116 # MontaVista Linux for ARM: arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q1-203) 4.3.3
117 # OS/X 10.6: i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
118 # 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)
120 # ######## clang variants ########
121 # Clang: clang version 2.9 (tags/RELEASE_29/final)
122 # Apple clang: Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
123 # FreeBSD clang: FreeBSD clang version 3.1 (branches/release_31 156863) 20120523
125 # ######## Apple LLVM variants ########
126 # Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
127 # Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
130 if test "x`${CC} --version | $SED -n -e 's/.*\Apple \(LLVM\) version.*clang.*/\1/p'`" = "xLLVM" ;
133 gcc_version=`${CC} --version | $SED -n -e 's/.*LLVM version \([0-9.]*\).*$/\1/p'`
134 elif test "x`${CC} --version | $SED -n -e 's/.*\(clang\) version.*/\1/p'`" = "xclang" ;
137 # Don't use -dumpversion with clang: it will always produce "4.2.1".
138 gcc_version=`${CC} --version | $SED -n -e 's/.*clang version \([0-9.]*\).*$/\1/p'`
139 elif test "x`${CC} --version | $SED -n -e 's/icc.*\(ICC\).*/\1/p'`" = "xICC" ;
142 gcc_version=`${CC} -dumpversion 2>/dev/null`
145 gcc_version=`${CC} -dumpversion 2>/dev/null`
146 if test "x$gcc_version" = x; then
147 gcc_version=`${CC} --version | $SED -n -e 's/[^ ]*gcc[^ ]* ([^)]*) \([0-9.]*\).*$/\1/p'`
151 AM_CONDITIONAL(COMPILER_IS_CLANG, test $is_clang = clang -o $is_clang = applellvm)
152 AM_CONDITIONAL(COMPILER_IS_ICC, test $is_clang = icc)
154 # Note: m4 arguments are quoted with [ and ] so square brackets in shell
155 # statements have to be quoted.
156 case "${is_clang}-${gcc_version}" in
157 applellvm-5.1|applellvm-6.*|applellvm-7.*|applellvm-8.*)
158 AC_MSG_RESULT([ok (Apple LLVM version ${gcc_version})])
161 AC_MSG_RESULT([ok (ICC version ${gcc_version})])
163 notclang-[[3-9]]|notclang-[[3-9]].*|notclang-[[1-9][0-9]]*)
164 AC_MSG_RESULT([ok (${gcc_version})])
166 clang-2.9|clang-[[3-9]].*|clang-[[1-9][0-9]]*)
167 AC_MSG_RESULT([ok (clang-${gcc_version})])
170 AC_MSG_RESULT([no (${is_clang}-${gcc_version})])
171 AC_MSG_ERROR([please use gcc >= 3.0 or clang >= 2.9 or icc >= 13.0])
175 #----------------------------------------------------------------------------
176 # Arch/OS/platform tests.
177 #----------------------------------------------------------------------------
178 # We create a number of arch/OS/platform-related variables. We prefix them
179 # all with "VGCONF_" which indicates that they are defined at
180 # configure-time, and distinguishes them from the VGA_*/VGO_*/VGP_*
181 # variables used when compiling C files.
185 AC_MSG_CHECKING([for a supported CPU])
187 # ARCH_MAX reflects the most that this CPU can do: for example if it
188 # is a 64-bit capable PowerPC, then it must be set to ppc64 and not ppc32.
189 # Ditto for amd64. It is used for more configuration below, but is not used
192 # Power PC returns powerpc for Big Endian. This was not changed when Little
193 # Endian support was added to the 64-bit architecture. The 64-bit Little
194 # Endian systems explicitly state le in the host_cpu. For clarity in the
195 # Valgrind code, the ARCH_MAX name will state LE or BE for the endianess of
196 # the 64-bit system. Big Endian is the only mode supported on 32-bit Power PC.
197 # The abreviation PPC or ppc refers to 32-bit and 64-bit systems with either
198 # Endianess. The name PPC64 or ppc64 to 64-bit systems of either Endianess.
199 # The names ppc64be or PPC64BE refer to only 64-bit systems that are Big
200 # Endian. Similarly, ppc64le or PPC64LE refer to only 64-bit systems that are
203 case "${host_cpu}" in
205 AC_MSG_RESULT([ok (${host_cpu})])
210 AC_MSG_RESULT([ok (${host_cpu})])
215 # this only referrs to 64-bit Big Endian
216 AC_MSG_RESULT([ok (${host_cpu})])
221 # this only referrs to 64-bit Little Endian
222 AC_MSG_RESULT([ok (${host_cpu})])
227 # On Linux this means only a 32-bit capable CPU.
228 AC_MSG_RESULT([ok (${host_cpu})])
233 AC_MSG_RESULT([ok (${host_cpu})])
238 AC_MSG_RESULT([ok (${host_cpu})])
243 AC_MSG_RESULT([ok (${host_cpu})])
248 AC_MSG_RESULT([ok (${host_cpu})])
253 AC_MSG_RESULT([ok (${host_cpu})])
258 AC_MSG_RESULT([ok (${host_cpu})])
263 AC_MSG_RESULT([ok (${host_cpu})])
268 AC_MSG_RESULT([ok (${host_cpu})])
273 AC_MSG_RESULT([ok (${host_cpu})])
278 AC_MSG_RESULT([no (${host_cpu})])
279 AC_MSG_ERROR([Unsupported host architecture. Sorry])
283 #----------------------------------------------------------------------------
285 # Sometimes it's convenient to subvert the bi-arch build system and
286 # just have a single build even though the underlying platform is
287 # capable of both. Hence handle --enable-only64bit and
288 # --enable-only32bit. Complain if both are issued :-)
289 # [Actually, if either of these options are used, I think both get built,
290 # but only one gets installed. So if you use an in-place build, both can be
293 # Check if a 64-bit only build has been requested
294 AC_CACHE_CHECK([for a 64-bit only build], vg_cv_only64bit,
295 [AC_ARG_ENABLE(only64bit,
296 [ --enable-only64bit do a 64-bit only build],
297 [vg_cv_only64bit=$enableval],
298 [vg_cv_only64bit=no])])
300 # Check if a 32-bit only build has been requested
301 AC_CACHE_CHECK([for a 32-bit only build], vg_cv_only32bit,
302 [AC_ARG_ENABLE(only32bit,
303 [ --enable-only32bit do a 32-bit only build],
304 [vg_cv_only32bit=$enableval],
305 [vg_cv_only32bit=no])])
308 if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
310 [Nonsensical: both --enable-only64bit and --enable-only32bit.])
313 #----------------------------------------------------------------------------
315 # VGCONF_OS is the primary build OS, eg. "linux". It is passed in to
316 # compilation of many C files via -VGO_$(VGCONF_OS) and
317 # -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS).
318 AC_MSG_CHECKING([for a supported OS])
325 AC_MSG_RESULT([ok (${host_os})])
328 # Ok, this is linux. Check the kernel version
329 AC_MSG_CHECKING([for the kernel version])
334 0.*|1.*|2.0.*|2.1.*|2.2.*|2.3.*|2.4.*|2.5.*)
335 AC_MSG_RESULT([unsupported (${kernel})])
336 AC_MSG_ERROR([Valgrind needs a Linux kernel >= 2.6])
340 AC_MSG_RESULT([2.6 or later (${kernel})])
347 AC_MSG_RESULT([ok (${host_os})])
349 AC_DEFINE([DARWIN_10_5], 100500, [DARWIN_VERS value for Mac OS X 10.5])
350 AC_DEFINE([DARWIN_10_6], 100600, [DARWIN_VERS value for Mac OS X 10.6])
351 AC_DEFINE([DARWIN_10_7], 100700, [DARWIN_VERS value for Mac OS X 10.7])
352 AC_DEFINE([DARWIN_10_8], 100800, [DARWIN_VERS value for Mac OS X 10.8])
353 AC_DEFINE([DARWIN_10_9], 100900, [DARWIN_VERS value for Mac OS X 10.9])
354 AC_DEFINE([DARWIN_10_10], 101000, [DARWIN_VERS value for Mac OS X 10.10])
355 AC_DEFINE([DARWIN_10_11], 101100, [DARWIN_VERS value for Mac OS X 10.11])
357 AC_MSG_CHECKING([for the kernel version])
360 # Nb: for Darwin we set DEFAULT_SUPP here. That's because Darwin
361 # has only one relevant version, the OS version. The `uname` check
362 # is a good way to get that version (i.e. "Darwin 9.6.0" is Mac OS
363 # X 10.5.6, and "Darwin 10.x" is Mac OS X 10.6.x Snow Leopard,
364 # and possibly "Darwin 11.x" is Mac OS X 10.7.x Lion),
365 # and we don't know of an macros similar to __GLIBC__ to get that info.
367 # XXX: `uname -r` won't do the right thing for cross-compiles, but
368 # that's not a problem yet.
370 # jseward 21 Sept 2011: I seriously doubt whether V 3.7.0 will work
371 # on OS X 10.5.x; I haven't tested yet, and only plan to test 3.7.0
372 # on 10.6.8 and 10.7.1. Although tempted to delete the configure
373 # time support for 10.5 (the 9.* pattern just below), I'll leave it
374 # in for now, just in case anybody wants to give it a try. But I'm
375 # assuming that 3.7.0 is a Snow Leopard and Lion-only release.
378 AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard])
379 AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version])
380 DEFAULT_SUPP="darwin9.supp ${DEFAULT_SUPP}"
381 DEFAULT_SUPP="darwin9-drd.supp ${DEFAULT_SUPP}"
384 AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard])
385 AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version])
386 DEFAULT_SUPP="darwin10.supp ${DEFAULT_SUPP}"
387 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
390 AC_MSG_RESULT([Darwin 11.x (${kernel}) / Mac OS X 10.7 Lion])
391 AC_DEFINE([DARWIN_VERS], DARWIN_10_7, [Darwin / Mac OS X version])
392 DEFAULT_SUPP="darwin11.supp ${DEFAULT_SUPP}"
393 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
396 AC_MSG_RESULT([Darwin 12.x (${kernel}) / Mac OS X 10.8 Mountain Lion])
397 AC_DEFINE([DARWIN_VERS], DARWIN_10_8, [Darwin / Mac OS X version])
398 DEFAULT_SUPP="darwin12.supp ${DEFAULT_SUPP}"
399 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
402 AC_MSG_RESULT([Darwin 13.x (${kernel}) / Mac OS X 10.9 Mavericks])
403 AC_DEFINE([DARWIN_VERS], DARWIN_10_9, [Darwin / Mac OS X version])
404 DEFAULT_SUPP="darwin13.supp ${DEFAULT_SUPP}"
405 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
408 AC_MSG_RESULT([Darwin 14.x (${kernel}) / Mac OS X 10.10 Yosemite])
409 AC_DEFINE([DARWIN_VERS], DARWIN_10_10, [Darwin / Mac OS X version])
410 DEFAULT_SUPP="darwin14.supp ${DEFAULT_SUPP}"
411 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
414 AC_MSG_RESULT([Darwin 15.x (${kernel}) / Mac OS X 10.11 El Capitan])
415 AC_DEFINE([DARWIN_VERS], DARWIN_10_11, [Darwin / Mac OS X version])
416 DEFAULT_SUPP="darwin15.supp ${DEFAULT_SUPP}"
417 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
420 AC_MSG_RESULT([unsupported (${kernel})])
421 AC_MSG_ERROR([Valgrind works on Darwin 10.x, 11.x, 12.x, 13.x, 14.x and 15.x (Mac OS X 10.6/7/8/9/10/11)])
427 AC_MSG_RESULT([ok (${host_os})])
429 DEFAULT_SUPP="solaris11.supp ${DEFAULT_SUPP}"
433 AC_MSG_RESULT([ok (${host_os})])
435 DEFAULT_SUPP="solaris12.supp ${DEFAULT_SUPP}"
439 AC_MSG_RESULT([no (${host_os})])
440 AC_MSG_ERROR([Valgrind is operating system specific. Sorry.])
444 #----------------------------------------------------------------------------
446 # If we are building on a 64 bit platform test to see if the system
447 # supports building 32 bit programs and disable 32 bit support if it
448 # does not support building 32 bit programs
450 case "$ARCH_MAX-$VGCONF_OS" in
451 amd64-linux|ppc64be-linux|arm64-linux|amd64-solaris)
452 AC_MSG_CHECKING([for 32 bit build support])
455 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
460 vg_cv_only64bit="yes"
463 CFLAGS=$safe_CFLAGS;;
466 if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
468 [--enable-only32bit was specified but system does not support 32 bit builds])
471 #----------------------------------------------------------------------------
473 # VGCONF_ARCH_PRI is the arch for the primary build target, eg. "amd64". By
474 # default it's the same as ARCH_MAX. But if, say, we do a build on an amd64
475 # machine, but --enable-only32bit has been requested, then ARCH_MAX (see
476 # above) will be "amd64" since that reflects the most that this cpu can do,
477 # but VGCONF_ARCH_PRI will be downgraded to "x86", since that reflects the
478 # arch corresponding to the primary build (VGCONF_PLATFORM_PRI_CAPS). It is
479 # passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_PRI) and
480 # -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS).
481 AC_SUBST(VGCONF_ARCH_PRI)
483 # VGCONF_ARCH_SEC is the arch for the secondary build target, eg. "x86".
484 # It is passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_SEC)
485 # and -VGP_$(VGCONF_ARCH_SEC)_$(VGCONF_OS), if there is a secondary target.
486 # It is empty if there is no secondary target.
487 AC_SUBST(VGCONF_ARCH_SEC)
489 # VGCONF_PLATFORM_PRI_CAPS is the primary build target, eg. "AMD64_LINUX".
490 # The entire system, including regression and performance tests, will be
491 # built for this target. The "_CAPS" indicates that the name is in capital
492 # letters, and it also uses '_' rather than '-' as a separator, because it's
493 # used to create various Makefile variables, which are all in caps by
494 # convention and cannot contain '-' characters. This is in contrast to
495 # VGCONF_ARCH_PRI and VGCONF_OS which are not in caps.
496 AC_SUBST(VGCONF_PLATFORM_PRI_CAPS)
498 # VGCONF_PLATFORM_SEC_CAPS is the secondary build target, if there is one.
499 # Valgrind and tools will also be built for this target, but not the
500 # regression or performance tests.
502 # By default, the primary arch is the same as the "max" arch, as commented
503 # above (at the definition of ARCH_MAX). We may choose to downgrade it in
504 # the big case statement just below here, in the case where we're building
505 # on a 64 bit machine but have been requested only to do a 32 bit build.
506 AC_SUBST(VGCONF_PLATFORM_SEC_CAPS)
508 AC_MSG_CHECKING([for a supported CPU/OS combination])
510 # NB. The load address for a given platform may be specified in more
511 # than one place, in some cases, depending on whether we're doing a biarch,
512 # 32-bit only or 64-bit only build. eg see case for amd64-linux below.
513 # Be careful to give consistent values in all subcases. Also, all four
514 # valt_load_addres_{pri,sec}_{norml,inner} values must always be set,
515 # even if it is to "0xUNSET".
517 case "$ARCH_MAX-$VGCONF_OS" in
519 VGCONF_ARCH_PRI="x86"
521 VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
522 VGCONF_PLATFORM_SEC_CAPS=""
523 valt_load_address_pri_norml="0x38000000"
524 valt_load_address_pri_inner="0x28000000"
525 valt_load_address_sec_norml="0xUNSET"
526 valt_load_address_sec_inner="0xUNSET"
527 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
530 valt_load_address_sec_norml="0xUNSET"
531 valt_load_address_sec_inner="0xUNSET"
532 if test x$vg_cv_only64bit = xyes; then
533 VGCONF_ARCH_PRI="amd64"
535 VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
536 VGCONF_PLATFORM_SEC_CAPS=""
537 valt_load_address_pri_norml="0x38000000"
538 valt_load_address_pri_inner="0x28000000"
539 elif test x$vg_cv_only32bit = xyes; then
540 VGCONF_ARCH_PRI="x86"
542 VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
543 VGCONF_PLATFORM_SEC_CAPS=""
544 valt_load_address_pri_norml="0x38000000"
545 valt_load_address_pri_inner="0x28000000"
547 VGCONF_ARCH_PRI="amd64"
548 VGCONF_ARCH_SEC="x86"
549 VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
550 VGCONF_PLATFORM_SEC_CAPS="X86_LINUX"
551 valt_load_address_pri_norml="0x38000000"
552 valt_load_address_pri_inner="0x28000000"
553 valt_load_address_sec_norml="0x38000000"
554 valt_load_address_sec_inner="0x28000000"
556 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
559 VGCONF_ARCH_PRI="ppc32"
561 VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
562 VGCONF_PLATFORM_SEC_CAPS=""
563 valt_load_address_pri_norml="0x38000000"
564 valt_load_address_pri_inner="0x28000000"
565 valt_load_address_sec_norml="0xUNSET"
566 valt_load_address_sec_inner="0xUNSET"
567 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
570 valt_load_address_sec_norml="0xUNSET"
571 valt_load_address_sec_inner="0xUNSET"
572 if test x$vg_cv_only64bit = xyes; then
573 VGCONF_ARCH_PRI="ppc64be"
575 VGCONF_PLATFORM_PRI_CAPS="PPC64BE_LINUX"
576 VGCONF_PLATFORM_SEC_CAPS=""
577 valt_load_address_pri_norml="0x38000000"
578 valt_load_address_pri_inner="0x28000000"
579 elif test x$vg_cv_only32bit = xyes; then
580 VGCONF_ARCH_PRI="ppc32"
582 VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
583 VGCONF_PLATFORM_SEC_CAPS=""
584 valt_load_address_pri_norml="0x38000000"
585 valt_load_address_pri_inner="0x28000000"
587 VGCONF_ARCH_PRI="ppc64be"
588 VGCONF_ARCH_SEC="ppc32"
589 VGCONF_PLATFORM_PRI_CAPS="PPC64BE_LINUX"
590 VGCONF_PLATFORM_SEC_CAPS="PPC32_LINUX"
591 valt_load_address_pri_norml="0x38000000"
592 valt_load_address_pri_inner="0x28000000"
593 valt_load_address_sec_norml="0x38000000"
594 valt_load_address_sec_inner="0x28000000"
596 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
599 # Little Endian is only supported on PPC64
600 valt_load_address_sec_norml="0xUNSET"
601 valt_load_address_sec_inner="0xUNSET"
602 VGCONF_ARCH_PRI="ppc64le"
604 VGCONF_PLATFORM_PRI_CAPS="PPC64LE_LINUX"
605 VGCONF_PLATFORM_SEC_CAPS=""
606 valt_load_address_pri_norml="0x38000000"
607 valt_load_address_pri_inner="0x28000000"
608 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
610 # Darwin gets identified as 32-bit even when it supports 64-bit.
611 # (Not sure why, possibly because 'uname' returns "i386"?) Just about
612 # all Macs support both 32-bit and 64-bit, so we just build both. If
613 # someone has a really old 32-bit only machine they can (hopefully?)
614 # build with --enable-only32bit. See bug 243362.
615 x86-darwin|amd64-darwin)
617 valt_load_address_sec_norml="0xUNSET"
618 valt_load_address_sec_inner="0xUNSET"
619 if test x$vg_cv_only64bit = xyes; then
620 VGCONF_ARCH_PRI="amd64"
622 VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
623 VGCONF_PLATFORM_SEC_CAPS=""
624 valt_load_address_pri_norml="0x138000000"
625 valt_load_address_pri_inner="0x128000000"
626 elif test x$vg_cv_only32bit = xyes; then
627 VGCONF_ARCH_PRI="x86"
629 VGCONF_PLATFORM_PRI_CAPS="X86_DARWIN"
630 VGCONF_PLATFORM_SEC_CAPS=""
631 VGCONF_ARCH_PRI_CAPS="x86"
632 valt_load_address_pri_norml="0x38000000"
633 valt_load_address_pri_inner="0x28000000"
635 VGCONF_ARCH_PRI="amd64"
636 VGCONF_ARCH_SEC="x86"
637 VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
638 VGCONF_PLATFORM_SEC_CAPS="X86_DARWIN"
639 valt_load_address_pri_norml="0x138000000"
640 valt_load_address_pri_inner="0x128000000"
641 valt_load_address_sec_norml="0x38000000"
642 valt_load_address_sec_inner="0x28000000"
644 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
647 VGCONF_ARCH_PRI="arm"
648 VGCONF_PLATFORM_PRI_CAPS="ARM_LINUX"
649 VGCONF_PLATFORM_SEC_CAPS=""
650 valt_load_address_pri_norml="0x38000000"
651 valt_load_address_pri_inner="0x28000000"
652 valt_load_address_sec_norml="0xUNSET"
653 valt_load_address_sec_inner="0xUNSET"
654 AC_MSG_RESULT([ok (${host_cpu}-${host_os})])
657 valt_load_address_sec_norml="0xUNSET"
658 valt_load_address_sec_inner="0xUNSET"
659 if test x$vg_cv_only64bit = xyes; then
660 VGCONF_ARCH_PRI="arm64"
662 VGCONF_PLATFORM_PRI_CAPS="ARM64_LINUX"
663 VGCONF_PLATFORM_SEC_CAPS=""
664 valt_load_address_pri_norml="0x38000000"
665 valt_load_address_pri_inner="0x28000000"
666 elif test x$vg_cv_only32bit = xyes; then
667 VGCONF_ARCH_PRI="arm"
669 VGCONF_PLATFORM_PRI_CAPS="ARM_LINUX"
670 VGCONF_PLATFORM_SEC_CAPS=""
671 valt_load_address_pri_norml="0x38000000"
672 valt_load_address_pri_inner="0x28000000"
674 VGCONF_ARCH_PRI="arm64"
675 VGCONF_ARCH_SEC="arm"
676 VGCONF_PLATFORM_PRI_CAPS="ARM64_LINUX"
677 VGCONF_PLATFORM_SEC_CAPS="ARM_LINUX"
678 valt_load_address_pri_norml="0x38000000"
679 valt_load_address_pri_inner="0x28000000"
680 valt_load_address_sec_norml="0x38000000"
681 valt_load_address_sec_inner="0x28000000"
683 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
686 VGCONF_ARCH_PRI="s390x"
688 VGCONF_PLATFORM_PRI_CAPS="S390X_LINUX"
689 VGCONF_PLATFORM_SEC_CAPS=""
690 # To improve branch prediction hit rate we want to have
691 # the generated code close to valgrind (host) code
692 valt_load_address_pri_norml="0x800000000"
693 valt_load_address_pri_inner="0x810000000"
694 valt_load_address_sec_norml="0xUNSET"
695 valt_load_address_sec_inner="0xUNSET"
696 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
699 VGCONF_ARCH_PRI="mips32"
700 VGCONF_PLATFORM_PRI_CAPS="MIPS32_LINUX"
701 VGCONF_PLATFORM_SEC_CAPS=""
702 valt_load_address_pri_norml="0x38000000"
703 valt_load_address_pri_inner="0x28000000"
704 valt_load_address_sec_norml="0xUNSET"
705 valt_load_address_sec_inner="0xUNSET"
706 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
709 VGCONF_ARCH_PRI="mips64"
710 VGCONF_PLATFORM_PRI_CAPS="MIPS64_LINUX"
711 VGCONF_PLATFORM_SEC_CAPS=""
712 valt_load_address_pri_norml="0x38000000"
713 valt_load_address_pri_inner="0x28000000"
714 valt_load_address_sec_norml="0xUNSET"
715 valt_load_address_sec_inner="0xUNSET"
716 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
719 VGCONF_ARCH_PRI="tilegx"
721 VGCONF_PLATFORM_PRI_CAPS="TILEGX_LINUX"
722 VGCONF_PLATFORM_SEC_CAPS=""
723 valt_load_address_pri_norml="0x38000000"
724 valt_load_address_pri_inner="0x28000000"
725 valt_load_address_sec_norml="0xUNSET"
726 valt_load_address_sec_inner="0xUNSET"
727 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
730 VGCONF_ARCH_PRI="x86"
732 VGCONF_PLATFORM_PRI_CAPS="X86_SOLARIS"
733 VGCONF_PLATFORM_SEC_CAPS=""
734 valt_load_address_pri_norml="0x38000000"
735 valt_load_address_pri_inner="0x28000000"
736 valt_load_address_sec_norml="0xUNSET"
737 valt_load_address_sec_inner="0xUNSET"
738 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
741 valt_load_address_sec_norml="0xUNSET"
742 valt_load_address_sec_inner="0xUNSET"
743 if test x$vg_cv_only64bit = xyes; then
744 VGCONF_ARCH_PRI="amd64"
746 VGCONF_PLATFORM_PRI_CAPS="AMD64_SOLARIS"
747 VGCONF_PLATFORM_SEC_CAPS=""
748 valt_load_address_pri_norml="0x38000000"
749 valt_load_address_pri_inner="0x28000000"
750 elif test x$vg_cv_only32bit = xyes; then
751 VGCONF_ARCH_PRI="x86"
753 VGCONF_PLATFORM_PRI_CAPS="X86_SOLARIS"
754 VGCONF_PLATFORM_SEC_CAPS=""
755 valt_load_address_pri_norml="0x38000000"
756 valt_load_address_pri_inner="0x28000000"
758 VGCONF_ARCH_PRI="amd64"
759 VGCONF_ARCH_SEC="x86"
760 VGCONF_PLATFORM_PRI_CAPS="AMD64_SOLARIS"
761 VGCONF_PLATFORM_SEC_CAPS="X86_SOLARIS"
762 valt_load_address_pri_norml="0x38000000"
763 valt_load_address_pri_inner="0x28000000"
764 valt_load_address_sec_norml="0x38000000"
765 valt_load_address_sec_inner="0x28000000"
767 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
770 VGCONF_ARCH_PRI="unknown"
771 VGCONF_ARCH_SEC="unknown"
772 VGCONF_PLATFORM_PRI_CAPS="UNKNOWN"
773 VGCONF_PLATFORM_SEC_CAPS="UNKNOWN"
774 valt_load_address_pri_norml="0xUNSET"
775 valt_load_address_pri_inner="0xUNSET"
776 valt_load_address_sec_norml="0xUNSET"
777 valt_load_address_sec_inner="0xUNSET"
778 AC_MSG_RESULT([no (${ARCH_MAX}-${VGCONF_OS})])
779 AC_MSG_ERROR([Valgrind is platform specific. Sorry. Please consider doing a port.])
783 #----------------------------------------------------------------------------
785 # Set up VGCONF_ARCHS_INCLUDE_<arch>. Either one or two of these become
787 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_X86,
788 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
789 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
790 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
791 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN \
792 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \
793 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_SOLARIS )
794 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_AMD64,
795 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
796 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN \
797 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS )
798 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC32,
799 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
800 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX )
801 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC64,
802 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64BE_LINUX \
803 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64LE_LINUX )
804 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM,
805 test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
806 -o x$VGCONF_PLATFORM_SEC_CAPS = xARM_LINUX )
807 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM64,
808 test x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX )
809 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_S390X,
810 test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX )
811 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_MIPS32,
812 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX )
813 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_MIPS64,
814 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX )
815 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_TILEGX,
816 test x$VGCONF_PLATFORM_PRI_CAPS = xTILEGX_LINUX )
818 # Set up VGCONF_PLATFORMS_INCLUDE_<platform>. Either one or two of these
820 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_LINUX,
821 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
822 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX)
823 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX,
824 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX)
825 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX,
826 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
827 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX)
828 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64BE_LINUX,
829 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64BE_LINUX)
830 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64LE_LINUX,
831 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64LE_LINUX)
832 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_ARM_LINUX,
833 test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
834 -o x$VGCONF_PLATFORM_SEC_CAPS = xARM_LINUX)
835 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_ARM64_LINUX,
836 test x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX)
837 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_S390X_LINUX,
838 test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \
839 -o x$VGCONF_PLATFORM_SEC_CAPS = xS390X_LINUX)
840 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_MIPS32_LINUX,
841 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX)
842 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_MIPS64_LINUX,
843 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX)
844 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_TILEGX_LINUX,
845 test x$VGCONF_PLATFORM_PRI_CAPS = xTILEGX_LINUX)
846 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_DARWIN,
847 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
848 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN)
849 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN,
850 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
851 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_SOLARIS,
852 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \
853 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_SOLARIS)
854 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_SOLARIS,
855 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS)
858 # Similarly, set up VGCONF_OS_IS_<os>. Exactly one of these becomes defined.
859 # Relies on the assumption that the primary and secondary targets are
860 # for the same OS, so therefore only necessary to test the primary.
861 AM_CONDITIONAL(VGCONF_OS_IS_LINUX,
862 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
863 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
864 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
865 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64BE_LINUX \
866 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64LE_LINUX \
867 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
868 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX \
869 -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \
870 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
871 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \
872 -o x$VGCONF_PLATFORM_PRI_CAPS = xTILEGX_LINUX)
873 AM_CONDITIONAL(VGCONF_OS_IS_DARWIN,
874 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
875 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
876 AM_CONDITIONAL(VGCONF_OS_IS_SOLARIS,
877 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \
878 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS)
881 # Sometimes, in the Makefile.am files, it's useful to know whether or not
882 # there is a secondary target.
883 AM_CONDITIONAL(VGCONF_HAVE_PLATFORM_SEC,
884 test x$VGCONF_PLATFORM_SEC_CAPS != x)
886 dnl automake-1.10 does not have AM_COND_IF (added in 1.11), so we supply a
887 dnl fallback definition
888 dnl The macro is courtesy of Dave Hart:
889 dnl https://lists.gnu.org/archive/html/automake/2010-12/msg00045.html
890 m4_ifndef([AM_COND_IF], [AC_DEFUN([AM_COND_IF], [
891 if test -z "$$1_TRUE"; then :
900 #----------------------------------------------------------------------------
902 #----------------------------------------------------------------------------
904 # Check if this should be built as an inner Valgrind, to be run within
905 # another Valgrind. Choose the load address accordingly.
906 AC_SUBST(VALT_LOAD_ADDRESS_PRI)
907 AC_SUBST(VALT_LOAD_ADDRESS_SEC)
908 AC_CACHE_CHECK([for use as an inner Valgrind], vg_cv_inner,
909 [AC_ARG_ENABLE(inner,
910 [ --enable-inner enables self-hosting],
911 [vg_cv_inner=$enableval],
913 if test "$vg_cv_inner" = yes; then
914 AC_DEFINE([ENABLE_INNER], 1, [configured to run as an inner Valgrind])
915 VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_inner
916 VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_inner
918 VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_norml
919 VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_norml
922 #----------------------------------------------------------------------------
923 # Undefined behaviour sanitiser
924 #----------------------------------------------------------------------------
925 # Check whether we should build with the undefined beahviour sanitiser.
927 AC_CACHE_CHECK([for using the undefined behaviour sanitiser], vg_cv_ubsan,
928 [AC_ARG_ENABLE(ubsan,
929 [ --enable-ubsan enables the undefined behaviour sanitiser],
930 [vg_cv_ubsan=$enableval],
933 #----------------------------------------------------------------------------
934 # Extra fine-tuning of installation directories
935 #----------------------------------------------------------------------------
937 [ --with-tmpdir=PATH Specify path for temporary files],
940 AC_DEFINE_UNQUOTED(VG_TMPDIR, "$tmpdir", [Temporary files directory])
941 AC_SUBST(VG_TMPDIR, [$tmpdir])
944 #----------------------------------------------------------------------------
945 # Libc and suppressions
946 #----------------------------------------------------------------------------
947 # This variable will collect the suppression files to be used.
948 AC_SUBST(DEFAULT_SUPP)
950 AC_CHECK_HEADER([features.h])
952 if test x$ac_cv_header_features_h = xyes; then
953 rm -f conftest.$ac_ext
954 cat <<_ACEOF >conftest.$ac_ext
955 #include <features.h>
956 #if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__)
957 glibc version is: __GLIBC__ __GLIBC_MINOR__
960 GLIBC_VERSION="`$CPP -P conftest.$ac_ext | $SED -n 's/^glibc version is: //p' | $SED 's/ /./g'`"
963 # not really a version check
964 AC_EGREP_CPP([DARWIN_LIBC], [
965 #include <sys/cdefs.h>
966 #if defined(__DARWIN_VERS_1050)
970 GLIBC_VERSION="darwin")
972 # not really a version check
973 AC_EGREP_CPP([BIONIC_LIBC], [
974 #if defined(__ANDROID__)
978 GLIBC_VERSION="bionic")
980 # there is only one version of libc on Solaris
981 if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \
982 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS; then
983 GLIBC_VERSION="solaris"
987 AC_MSG_CHECKING([the glibc version])
989 case "${GLIBC_VERSION}" in
991 AC_MSG_RESULT(${GLIBC_VERSION} family)
992 DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}"
993 DEFAULT_SUPP="glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
994 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
997 AC_MSG_RESULT(${GLIBC_VERSION} family)
998 DEFAULT_SUPP="glibc-${GLIBC_VERSION}.supp ${DEFAULT_SUPP}"
999 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
1000 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1003 AC_MSG_RESULT(${GLIBC_VERSION} family)
1004 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
1005 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
1006 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1009 AC_MSG_RESULT(${GLIBC_VERSION} family)
1010 AC_DEFINE([GLIBC_MANDATORY_STRLEN_REDIRECT], 1,
1011 [Define to 1 if strlen() has been optimized heavily (amd64 glibc >= 2.10)])
1012 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
1013 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
1014 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1017 AC_MSG_RESULT(${GLIBC_VERSION} family)
1018 AC_DEFINE([GLIBC_MANDATORY_STRLEN_REDIRECT], 1,
1019 [Define to 1 if strlen() has been optimized heavily (amd64 glibc >= 2.10)])
1020 AC_DEFINE([GLIBC_MANDATORY_INDEX_AND_STRLEN_REDIRECT], 1,
1021 [Define to 1 if index() and strlen() have been optimized heavily (x86 glibc >= 2.12)])
1022 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
1023 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
1024 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1027 AC_MSG_RESULT(Darwin)
1028 AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
1029 # DEFAULT_SUPP set by kernel version check above.
1032 AC_MSG_RESULT(Bionic)
1033 AC_DEFINE([BIONIC_LIBC], 1, [Define to 1 if you're using Bionic])
1034 DEFAULT_SUPP="bionic.supp ${DEFAULT_SUPP}"
1037 AC_MSG_RESULT(Solaris)
1038 # DEFAULT_SUPP set in host_os switch-case above.
1039 # No other suppression file is used.
1042 AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
1043 AC_MSG_ERROR([Valgrind requires glibc version 2.2 or later,])
1044 AC_MSG_ERROR([Darwin libc, Bionic libc or Solaris libc])
1048 AC_SUBST(GLIBC_VERSION)
1051 if test "$VGCONF_OS" != "solaris"; then
1052 # Add default suppressions for the X client libraries. Make no
1053 # attempt to detect whether such libraries are installed on the
1054 # build machine (or even if any X facilities are present); just
1055 # add the suppressions antidisirregardless.
1056 DEFAULT_SUPP="xfree-4.supp ${DEFAULT_SUPP}"
1057 DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}"
1059 # Add glibc and X11 suppressions for exp-sgcheck
1060 DEFAULT_SUPP="exp-sgcheck.supp ${DEFAULT_SUPP}"
1064 #----------------------------------------------------------------------------
1065 # Platform variants?
1066 #----------------------------------------------------------------------------
1068 # Normally the PLAT = (ARCH, OS) characterisation of the platform is enough.
1069 # But there are times where we need a bit more control. The motivating
1070 # and currently only case is Android: this is almost identical to
1071 # {x86,arm,mips}-linux, but not quite. So this introduces the concept of
1072 # platform variant tags, which get passed in the compile as
1073 # -DVGPV_<arch>_<os>_<variant> along with the main -DVGP_<arch>_<os> definition.
1075 # In almost all cases, the <variant> bit is "vanilla". But for Android
1076 # it is "android" instead.
1078 # Consequently (eg), plain arm-linux would build with
1080 # -DVGP_arm_linux -DVGPV_arm_linux_vanilla
1082 # whilst an Android build would have
1084 # -DVGP_arm_linux -DVGPV_arm_linux_android
1086 # Same for x86. The setup of the platform variant is pushed relatively far
1087 # down this file in order that we can inspect any of the variables set above.
1089 # In the normal case ..
1090 VGCONF_PLATVARIANT="vanilla"
1093 if test "$GLIBC_VERSION" = "bionic";
1095 VGCONF_PLATVARIANT="android"
1098 AC_SUBST(VGCONF_PLATVARIANT)
1101 # FIXME: do we also want to define automake variables
1102 # VGCONF_PLATVARIANT_IS_<WHATEVER>, where WHATEVER is (currently)
1103 # VANILLA or ANDROID ? This would be in the style of VGCONF_ARCHS_INCLUDE,
1104 # VGCONF_PLATFORMS_INCLUDE and VGCONF_OS_IS above? Could easily enough
1105 # do that. Problem is that we can't do and-ing in Makefile.am's, but
1106 # that's what we'd need to do to use this, since what we'd want to write
1109 # VGCONF_PLATFORMS_INCLUDE_ARM_LINUX && VGCONF_PLATVARIANT_IS_ANDROID
1111 # Hmm. Can't think of a nice clean solution to this.
1113 AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_VANILLA,
1114 test x$VGCONF_PLATVARIANT = xvanilla)
1115 AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_ANDROID,
1116 test x$VGCONF_PLATVARIANT = xandroid)
1119 #----------------------------------------------------------------------------
1120 # Checking for various library functions and other definitions
1121 #----------------------------------------------------------------------------
1123 # Check for AT_FDCWD
1125 AC_MSG_CHECKING([for AT_FDCWD])
1126 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1133 ac_have_at_fdcwd=yes
1134 AC_MSG_RESULT([yes])
1140 AM_CONDITIONAL([HAVE_AT_FDCWD], [test x$ac_have_at_fdcwd = xyes])
1142 # Check for stpncpy function definition in string.h
1143 # This explicitly checks with _GNU_SOURCE defined since that is also
1144 # used in the test case (some systems might define it without anyway
1145 # since stpncpy is part of The Open Group Base Specifications Issue 7
1146 # IEEE Std 1003.1-2008.
1147 AC_MSG_CHECKING([for stpncpy])
1148 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1155 char *r = stpncpy(d, s, n);
1157 ac_have_gnu_stpncpy=yes
1158 AC_MSG_RESULT([yes])
1160 ac_have_gnu_stpncpy=no
1164 AM_CONDITIONAL([HAVE_GNU_STPNCPY], [test x$ac_have_gnu_stpncpy = xyes])
1166 # Check for PTRACE_GETREGS
1168 AC_MSG_CHECKING([for PTRACE_GETREGS])
1169 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1172 #include <sys/ptrace.h>
1173 #include <sys/user.h>
1176 long res = ptrace (PTRACE_GETREGS, 0, p, p);
1178 AC_MSG_RESULT([yes])
1179 AC_DEFINE([HAVE_PTRACE_GETREGS], 1,
1180 [Define to 1 if you have the `PTRACE_GETREGS' ptrace request.])
1186 # Check for CLOCK_MONOTONIC
1188 AC_MSG_CHECKING([for CLOCK_MONOTONIC])
1190 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1194 clock_gettime(CLOCK_MONOTONIC, &t);
1197 AC_MSG_RESULT([yes])
1198 AC_DEFINE([HAVE_CLOCK_MONOTONIC], 1,
1199 [Define to 1 if you have the `CLOCK_MONOTONIC' constant.])
1205 # Check for ELF32/64_CHDR
1207 AC_CHECK_TYPES([Elf32_Chdr, Elf64_Chdr], [], [], [[#include <elf.h>]])
1210 # Check for PTHREAD_RWLOCK_T
1212 AC_MSG_CHECKING([for pthread_rwlock_t])
1214 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1216 #include <pthread.h>
1218 pthread_rwlock_t rwl;
1220 AC_MSG_RESULT([yes])
1221 AC_DEFINE([HAVE_PTHREAD_RWLOCK_T], 1,
1222 [Define to 1 if you have the `pthread_rwlock_t' type.])
1228 # Check for PTHREAD_MUTEX_ADAPTIVE_NP
1230 AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP])
1232 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1234 #include <pthread.h>
1236 return (PTHREAD_MUTEX_ADAPTIVE_NP);
1238 AC_MSG_RESULT([yes])
1239 AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1,
1240 [Define to 1 if you have the `PTHREAD_MUTEX_ADAPTIVE_NP' constant.])
1246 # Check for PTHREAD_MUTEX_ERRORCHECK_NP
1248 AC_MSG_CHECKING([for PTHREAD_MUTEX_ERRORCHECK_NP])
1250 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1252 #include <pthread.h>
1254 return (PTHREAD_MUTEX_ERRORCHECK_NP);
1256 AC_MSG_RESULT([yes])
1257 AC_DEFINE([HAVE_PTHREAD_MUTEX_ERRORCHECK_NP], 1,
1258 [Define to 1 if you have the `PTHREAD_MUTEX_ERRORCHECK_NP' constant.])
1264 # Check for PTHREAD_MUTEX_RECURSIVE_NP
1266 AC_MSG_CHECKING([for PTHREAD_MUTEX_RECURSIVE_NP])
1268 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1270 #include <pthread.h>
1272 return (PTHREAD_MUTEX_RECURSIVE_NP);
1274 AC_MSG_RESULT([yes])
1275 AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], 1,
1276 [Define to 1 if you have the `PTHREAD_MUTEX_RECURSIVE_NP' constant.])
1282 # Check for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
1284 AC_MSG_CHECKING([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP])
1286 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1288 #include <pthread.h>
1290 pthread_mutex_t m = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
1293 AC_MSG_RESULT([yes])
1294 AC_DEFINE([HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], 1,
1295 [Define to 1 if you have the `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' constant.])
1301 # Check whether pthread_mutex_t has a member called __m_kind.
1303 AC_CHECK_MEMBER([pthread_mutex_t.__m_kind],
1304 [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__M_KIND],
1306 [Define to 1 if pthread_mutex_t has a member called __m_kind.])
1309 [#include <pthread.h>])
1312 # Check whether pthread_mutex_t has a member called __data.__kind.
1314 AC_CHECK_MEMBER([pthread_mutex_t.__data.__kind],
1315 [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__DATA__KIND],
1317 [Define to 1 if pthread_mutex_t has a member __data.__kind.])
1320 [#include <pthread.h>])
1322 # Convenience function. Set flags based on the existing HWCAP entries.
1323 # The AT_HWCAP entries are generated by glibc, and are based on
1324 # functions supported by the hardware/system/libc.
1325 # Subsequent support for whether the capability will actually be utilized
1326 # will also be checked against the compiler capabilities.
1328 # AC_HWCAP_CONTAINS_FLAG[hwcap_string_to_match],[VARIABLE_TO_SET]
1329 AC_DEFUN([AC_HWCAP_CONTAINS_FLAG],[
1331 AC_MSG_CHECKING([if AT_HWCAP contains the $AUXV_CHECK_FOR indicator])
1332 if LD_SHOW_AUXV=1 `which true` | grep ^AT_HWCAP | grep -q -w ${AUXV_CHECK_FOR}
1334 AC_MSG_RESULT([yes])
1335 AC_SUBST([$2],[yes])
1342 # gather hardware capabilities. (hardware/kernel/libc)
1343 AC_HWCAP_CONTAINS_FLAG([altivec],[HWCAP_HAS_ALTIVEC])
1344 AC_HWCAP_CONTAINS_FLAG([vsx],[HWCAP_HAS_VSX])
1345 AC_HWCAP_CONTAINS_FLAG([dfp],[HWCAP_HAS_DFP])
1346 AC_HWCAP_CONTAINS_FLAG([arch_2_05],[HWCAP_HAS_ISA_2_05])
1347 AC_HWCAP_CONTAINS_FLAG([arch_2_06],[HWCAP_HAS_ISA_2_06])
1348 AC_HWCAP_CONTAINS_FLAG([arch_2_07],[HWCAP_HAS_ISA_2_07])
1349 AC_HWCAP_CONTAINS_FLAG([htm],[HWCAP_HAS_HTM])
1352 AM_CONDITIONAL(HAS_ISA_2_05, [test x$HWCAP_HAS_ISA_2_05 = xyes])
1353 AM_CONDITIONAL(HAS_ISA_2_06, [test x$HWCAP_HAS_ISA_2_06 = xyes])
1354 # compiler support for isa 2.07 level instructions
1355 AC_MSG_CHECKING([that assembler knows ISA 2.07 instructions ])
1356 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1358 __asm__ __volatile__("mtvsrd 1,2 ");
1360 ac_asm_have_isa_2_07=yes
1361 AC_MSG_RESULT([yes])
1363 ac_asm_have_isa_2_07=no
1366 AM_CONDITIONAL(HAS_ISA_2_07, [test x$ac_asm_have_isa_2_07 = xyes \
1367 -a x$HWCAP_HAS_ISA_2_07 = xyes])
1369 # altivec (vsx) support.
1370 # does this compiler support -maltivec and does it have the include file
1372 AC_MSG_CHECKING([for Altivec support in the compiler ])
1374 CFLAGS="-maltivec -Werror"
1375 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1376 #include <altivec.h>
1378 vector unsigned int v;
1381 AC_MSG_RESULT([yes])
1387 AM_CONDITIONAL([HAS_ALTIVEC], [test x$ac_have_altivec = xyes \
1388 -a x$HWCAP_HAS_ALTIVEC = xyes])
1390 # Check that both: the compiler supports -mvsx and that the assembler
1391 # understands VSX instructions. If either of those doesn't work,
1392 # conclude that we can't do VSX.
1393 AC_MSG_CHECKING([for VSX compiler flag support])
1395 CFLAGS="-mvsx -Werror"
1396 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1399 ac_compiler_supports_vsx_flag=yes
1400 AC_MSG_RESULT([yes])
1402 ac_compiler_supports_vsx_flag=no
1407 AC_MSG_CHECKING([for VSX support in the assembler ])
1409 CFLAGS="-mvsx -Werror"
1410 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1411 #include <altivec.h>
1413 vector unsigned int v;
1414 __asm__ __volatile__("xsmaddadp 32, 32, 33" ::: "memory","cc");
1416 ac_compiler_supports_vsx=yes
1417 AC_MSG_RESULT([yes])
1419 ac_compiler_supports_vsx=no
1423 AM_CONDITIONAL([HAS_VSX], [test x$ac_compiler_supports_vsx_flag = xyes \
1424 -a x$ac_compiler_supports_vsx = xyes \
1425 -a x$HWCAP_HAS_VSX = xyes ])
1427 # DFP (Decimal Float)
1428 AC_MSG_CHECKING([that assembler knows DFP])
1429 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1431 __asm__ __volatile__("dadd 1, 2, 3");
1432 __asm__ __volatile__("dcffix 1, 2");
1435 AC_MSG_RESULT([yes])
1440 AC_MSG_CHECKING([that compiler knows -mhard-dfp switch])
1442 CFLAGS="-mhard-dfp -Werror"
1443 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1445 __asm__ __volatile__("dadd 1, 2, 3");
1446 __asm__ __volatile__("dcffix 1, 2");
1448 ac_compiler_have_dfp=yes
1449 AC_MSG_RESULT([yes])
1451 ac_compiler_have_dfp=no
1455 AM_CONDITIONAL(HAS_DFP, test x$ac_asm_have_dfp = xyes \
1456 -a x$ac_compiler_have_dfp = xyes \
1457 -a x$HWCAP_HAS_DFP = xyes )
1459 AC_MSG_CHECKING([that compiler knows DFP datatypes])
1460 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1462 _Decimal64 x = 0.0DD;
1464 ac_compiler_have_dfp_type=yes
1465 AC_MSG_RESULT([yes])
1467 ac_compiler_have_dfp_type=no
1470 AM_CONDITIONAL(BUILD_DFP_TESTS, test x$ac_compiler_have_dfp_type = xyes \
1471 -a xHWCAP_$HAS_DFP = xyes )
1474 # HTM (Hardware Transactional Memory)
1475 AC_MSG_CHECKING([if compiler accepts the -mhtm flag])
1477 CFLAGS="-mhtm -Werror"
1478 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1482 AC_MSG_RESULT([yes])
1483 ac_compiler_supports_htm=yes
1486 ac_compiler_supports_htm=no
1490 AC_MSG_CHECKING([if compiler can find the htm builtins])
1492 CFLAGS="-mhtm -Werror"
1493 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1495 if (__builtin_tbegin (0))
1498 AC_MSG_RESULT([yes])
1499 ac_compiler_sees_htm_builtins=yes
1502 ac_compiler_sees_htm_builtins=no
1506 AM_CONDITIONAL(SUPPORTS_HTM, test x$ac_compiler_supports_htm = xyes \
1507 -a x$ac_compiler_sees_htm_builtins = xyes \
1508 -a x$HWCAP_HAS_HTM = xyes )
1511 AC_MSG_CHECKING([that assembler knows ISA 3.0 ])
1513 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1515 __asm__ __volatile__("cnttzw 1,2 ");
1517 ac_asm_have_isa_3_0=yes
1518 AC_MSG_RESULT([yes])
1520 ac_asm_have_isa_3_0=no
1524 AM_CONDITIONAL(HAS_ISA_3_0, test x$ac_asm_have_isa_3_0 = xyes)
1526 # Check for pthread_create@GLIBC2.0
1527 AC_MSG_CHECKING([for pthread_create@GLIBC2.0()])
1530 CFLAGS="-lpthread -Werror"
1531 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1532 extern int pthread_create_glibc_2_0(void*, const void*,
1533 void *(*)(void*), void*);
1534 __asm__(".symver pthread_create_glibc_2_0, pthread_create@GLIBC_2.0");
1538 * Apparently on PowerPC linking this program succeeds and generates an
1539 * executable with the undefined symbol pthread_create@GLIBC_2.0.
1541 #error This test does not work properly on PowerPC.
1543 pthread_create_glibc_2_0(0, 0, 0, 0);
1547 ac_have_pthread_create_glibc_2_0=yes
1548 AC_MSG_RESULT([yes])
1549 AC_DEFINE([HAVE_PTHREAD_CREATE_GLIBC_2_0], 1,
1550 [Define to 1 if you have the `pthread_create@glibc2.0' function.])
1552 ac_have_pthread_create_glibc_2_0=no
1557 AM_CONDITIONAL(HAVE_PTHREAD_CREATE_GLIBC_2_0,
1558 test x$ac_have_pthread_create_glibc_2_0 = xyes)
1561 # Check for dlinfo RTLD_DI_TLS_MODID
1562 AC_MSG_CHECKING([for dlinfo RTLD_DI_TLS_MODID])
1566 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1573 size_t sizes[10000];
1574 size_t modid_offset;
1575 (void) dlinfo ((void*)sizes, RTLD_DI_TLS_MODID, &modid_offset);
1578 ac_have_dlinfo_rtld_di_tls_modid=yes
1579 AC_MSG_RESULT([yes])
1580 AC_DEFINE([HAVE_DLINFO_RTLD_DI_TLS_MODID], 1,
1581 [Define to 1 if you have a dlinfo that can do RTLD_DI_TLS_MODID.])
1583 ac_have_dlinfo_rtld_di_tls_modid=no
1588 AM_CONDITIONAL(HAVE_DLINFO_RTLD_DI_TLS_MODID,
1589 test x$ac_have_dlinfo_rtld_di_tls_modid = xyes)
1592 # Check for eventfd_t, eventfd() and eventfd_read()
1593 AC_MSG_CHECKING([for eventfd()])
1595 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1596 #include <sys/eventfd.h>
1602 eventfd_read(fd, &ev);
1605 AC_MSG_RESULT([yes])
1606 AC_DEFINE([HAVE_EVENTFD], 1,
1607 [Define to 1 if you have the `eventfd' function.])
1608 AC_DEFINE([HAVE_EVENTFD_READ], 1,
1609 [Define to 1 if you have the `eventfd_read' function.])
1614 # Check whether compiler can process #include <thread> without errors
1615 # clang 3.3 cannot process <thread> from e.g.
1616 # gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
1618 AC_MSG_CHECKING([that C++ compiler can include <thread> header file])
1620 safe_CXXFLAGS=$CXXFLAGS
1623 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
1627 ac_cxx_can_include_thread_header=yes
1628 AC_MSG_RESULT([yes])
1630 ac_cxx_can_include_thread_header=no
1633 CXXFLAGS=$safe_CXXFLAGS
1636 AM_CONDITIONAL(CXX_CAN_INCLUDE_THREAD_HEADER, test x$ac_cxx_can_include_thread_header = xyes)
1639 # On aarch64 before glibc 2.20 we would get the kernel user_pt_regs instead
1640 # of the user_regs_struct from sys/user.h. They are structurally the same
1641 # but we get either one or the other.
1643 AC_CHECK_TYPE([struct user_regs_struct],
1644 [sys_user_has_user_regs=yes], [sys_user_has_user_regs=no],
1645 [[#include <sys/ptrace.h>]
1646 [#include <sys/time.h>]
1647 [#include <sys/user.h>]])
1648 if test "$sys_user_has_user_regs" = "yes"; then
1649 AC_DEFINE(HAVE_SYS_USER_REGS, 1,
1650 [Define to 1 if <sys/user.h> defines struct user_regs_struct])
1654 #----------------------------------------------------------------------------
1655 # Checking for supported compiler flags.
1656 #----------------------------------------------------------------------------
1658 # does this compiler support -m32 ?
1659 AC_MSG_CHECKING([if gcc accepts -m32])
1662 CFLAGS="-m32 -Werror"
1664 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1668 AC_MSG_RESULT([yes])
1678 # does this compiler support -m64 ?
1679 AC_MSG_CHECKING([if gcc accepts -m64])
1682 CFLAGS="-m64 -Werror"
1684 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1688 AC_MSG_RESULT([yes])
1698 # does this compiler support -march=mips32 (mips32 default) ?
1699 AC_MSG_CHECKING([if gcc accepts -march=mips32])
1702 CFLAGS="$CFLAGS -march=mips32 -Werror"
1704 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1707 FLAG_MIPS32="-march=mips32"
1708 AC_MSG_RESULT([yes])
1715 AC_SUBST(FLAG_MIPS32)
1718 # does this compiler support -march=mips64 (mips64 default) ?
1719 AC_MSG_CHECKING([if gcc accepts -march=mips64])
1722 CFLAGS="$CFLAGS -march=mips64 -Werror"
1724 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1727 FLAG_MIPS64="-march=mips64"
1728 AC_MSG_RESULT([yes])
1735 AC_SUBST(FLAG_MIPS64)
1738 # does this compiler support -march=octeon (Cavium OCTEON I Specific) ?
1739 AC_MSG_CHECKING([if gcc accepts -march=octeon])
1742 CFLAGS="$CFLAGS -march=octeon -Werror"
1744 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1747 FLAG_OCTEON="-march=octeon"
1748 AC_MSG_RESULT([yes])
1755 AC_SUBST(FLAG_OCTEON)
1758 # does this compiler support -march=octeon2 (Cavium OCTEON II Specific) ?
1759 AC_MSG_CHECKING([if gcc accepts -march=octeon2])
1762 CFLAGS="$CFLAGS -march=octeon2 -Werror"
1764 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1767 FLAG_OCTEON2="-march=octeon2"
1768 AC_MSG_RESULT([yes])
1775 AC_SUBST(FLAG_OCTEON2)
1778 # does this compiler support -mmmx ?
1779 AC_MSG_CHECKING([if gcc accepts -mmmx])
1782 CFLAGS="-mmmx -Werror"
1784 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1788 AC_MSG_RESULT([yes])
1798 # does this compiler support -msse ?
1799 AC_MSG_CHECKING([if gcc accepts -msse])
1802 CFLAGS="-msse -Werror"
1804 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1808 AC_MSG_RESULT([yes])
1818 # does this compiler support -mpreferred-stack-boundary=2 when
1819 # generating code for a 32-bit target? Note that we only care about
1820 # this when generating code for (32-bit) x86, so if the compiler
1821 # doesn't recognise -m32 it's no big deal. We'll just get code for
1822 # the Memcheck and other helper functions, that is a bit slower than
1823 # it could be, on x86; and no difference at all on any other platform.
1824 AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary=2 -m32])
1827 CFLAGS="-mpreferred-stack-boundary=2 -m32 -Werror"
1829 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1832 PREFERRED_STACK_BOUNDARY_2="-mpreferred-stack-boundary=2"
1833 AC_MSG_RESULT([yes])
1835 PREFERRED_STACK_BOUNDARY_2=""
1840 AC_SUBST(PREFERRED_STACK_BOUNDARY_2)
1843 # does this compiler support -mlong-double-128 ?
1844 AC_MSG_CHECKING([if gcc accepts -mlong-double-128])
1846 CFLAGS="-mlong-double-128 -Werror"
1847 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1850 ac_compiler_supports_mlong_double_128=yes
1851 AC_MSG_RESULT([yes])
1853 ac_compiler_supports_mlong_double_128=no
1857 AM_CONDITIONAL(HAS_MLONG_DOUBLE_128, test x$ac_compiler_supports_mlong_double_128 = xyes)
1858 FLAG_MLONG_DOUBLE_128="-mlong-double-128"
1859 AC_SUBST(FLAG_MLONG_DOUBLE_128)
1862 # Convenience function to check whether GCC supports a particular
1863 # warning option. Takes two arguments,
1864 # first the warning flag name to check (without -W), then the
1865 # substitution name to set with -Wno-warning-flag if the flag exists,
1866 # or the empty string if the compiler doesn't accept the flag. Note
1867 # that checking is done against the warning flag itself, but the
1868 # substitution is then done to cancel the warning flag.
1869 AC_DEFUN([AC_GCC_WARNING_SUBST_NO],[
1870 AC_MSG_CHECKING([if gcc accepts -W$1])
1872 CFLAGS="-W$1 -Werror"
1873 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [
1874 AC_SUBST([$2], [-Wno-$1])
1875 AC_MSG_RESULT([yes])], [
1877 AC_MSG_RESULT([no])])
1881 # Convenience function. Like AC_GCC_WARNING_SUBST_NO, except it substitutes
1882 # -W$1 (instead of -Wno-$1).
1883 AC_DEFUN([AC_GCC_WARNING_SUBST],[
1884 AC_MSG_CHECKING([if gcc accepts -W$1])
1886 CFLAGS="-W$1 -Werror"
1887 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [
1888 AC_SUBST([$2], [-W$1])
1889 AC_MSG_RESULT([yes])], [
1891 AC_MSG_RESULT([no])])
1895 AC_GCC_WARNING_SUBST_NO([memset-transposed-args], [FLAG_W_NO_MEMSET_TRANSPOSED_ARGS])
1896 AC_GCC_WARNING_SUBST_NO([nonnull], [FLAG_W_NO_NONNULL])
1897 AC_GCC_WARNING_SUBST_NO([overflow], [FLAG_W_NO_OVERFLOW])
1898 AC_GCC_WARNING_SUBST_NO([pointer-sign], [FLAG_W_NO_POINTER_SIGN])
1899 AC_GCC_WARNING_SUBST_NO([uninitialized], [FLAG_W_NO_UNINITIALIZED])
1900 AC_GCC_WARNING_SUBST_NO([unused-function], [FLAG_W_NO_UNUSED_FUNCTION])
1901 AC_GCC_WARNING_SUBST_NO([static-local-in-inline], [FLAG_W_NO_STATIC_LOCAL_IN_INLINE])
1902 AC_GCC_WARNING_SUBST_NO([mismatched-new-delete], [FLAG_W_NO_MISMATCHED_NEW_DELETE])
1903 AC_GCC_WARNING_SUBST_NO([infinite-recursion], [FLAG_W_NO_INFINITE_RECURSION])
1904 AC_GCC_WARNING_SUBST([write-strings], [FLAG_W_WRITE_STRINGS])
1905 AC_GCC_WARNING_SUBST([empty-body], [FLAG_W_EMPTY_BODY])
1906 AC_GCC_WARNING_SUBST([format], [FLAG_W_FORMAT])
1907 # Disabled for now until all platforms are clean
1908 format_checking_enabled=no
1909 #format_checking_enabled=yes
1910 if test "$format_checking_enabled" = "yes"; then
1911 AC_GCC_WARNING_SUBST([format-signedness], [FLAG_W_FORMAT_SIGNEDNESS])
1913 dumy_assignment_to_avoid_syntax_errors=1
1914 AC_SUBST([FLAG_W_FORMAT_SIGNEDNESS], [])
1916 AC_GCC_WARNING_SUBST([cast-qual], [FLAG_W_CAST_QUAL])
1917 AC_GCC_WARNING_SUBST([old-style-declaration], [FLAG_W_OLD_STYLE_DECLARATION])
1918 AC_GCC_WARNING_SUBST([ignored-qualifiers], [FLAG_W_IGNORED_QUALIFIERS])
1919 AC_GCC_WARNING_SUBST([missing-parameter-type], [FLAG_W_MISSING_PARAMETER_TYPE])
1921 # Does this compiler support -Wformat-security ?
1922 # Special handling is needed, because certain GCC versions require -Wformat
1923 # being present if -Wformat-security is given. Otherwise a warning is issued.
1924 # However, AC_GCC_WARNING_SUBST will stick in -Werror (see r15323 for rationale).
1925 # And with that the warning will be turned into an error with the result
1926 # that -Wformat-security is believed to be unsupported when in fact it is.
1927 AC_MSG_CHECKING([if gcc accepts -Wformat-security])
1929 CFLAGS="-Wformat -Wformat-security -Werror"
1930 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [
1931 AC_SUBST([FLAG_W_FORMAT_SECURITY], [-Wformat-security])
1932 AC_MSG_RESULT([yes])], [
1933 AC_SUBST([FLAG_W_FORMAT_SECURITY], [])
1934 AC_MSG_RESULT([no])])
1937 # does this compiler support -Wextra or the older -W ?
1939 AC_MSG_CHECKING([if gcc accepts -Wextra or -W])
1942 CFLAGS="-Wextra -Werror"
1944 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1947 AC_SUBST([FLAG_W_EXTRA], [-Wextra])
1948 AC_MSG_RESULT([-Wextra])
1951 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1954 AC_SUBST([FLAG_W_EXTRA], [-W])
1957 AC_SUBST([FLAG_W_EXTRA], [])
1958 AC_MSG_RESULT([not supported])
1963 # On ARM we do not want to pass -Wcast-align as that produces loads
1964 # of warnings. GCC is just being conservative. See here:
1965 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65459#c4
1966 if test "X$VGCONF_ARCH_PRI" = "Xarm"; then
1967 AC_SUBST([FLAG_W_CAST_ALIGN], [""])
1969 AC_SUBST([FLAG_W_CAST_ALIGN], [-Wcast-align])
1972 # does this compiler support -fno-stack-protector ?
1973 AC_MSG_CHECKING([if gcc accepts -fno-stack-protector])
1976 CFLAGS="-fno-stack-protector -Werror"
1978 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1981 no_stack_protector=yes
1982 FLAG_FNO_STACK_PROTECTOR="-fno-stack-protector"
1983 AC_MSG_RESULT([yes])
1985 no_stack_protector=no
1986 FLAG_FNO_STACK_PROTECTOR=""
1991 AC_SUBST(FLAG_FNO_STACK_PROTECTOR)
1993 # Does GCC support disabling Identical Code Folding?
1994 # We want to disabled Identical Code Folding for the
1995 # tools preload shared objects to get better backraces.
1996 # For GCC 5.1+ -fipa-icf is enabled by default at -O2.
1997 # "The optimization reduces code size and may disturb
1998 # unwind stacks by replacing a function by equivalent
1999 # one with a different name."
2000 AC_MSG_CHECKING([if gcc accepts -fno-ipa-icf])
2003 CFLAGS="-fno-ipa-icf -Werror"
2005 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2009 FLAG_FNO_IPA_ICF="-fno-ipa-icf"
2010 AC_MSG_RESULT([yes])
2018 AC_SUBST(FLAG_FNO_IPA_ICF)
2021 # Does this compiler support -fsanitize=undefined. This is true for
2022 # GCC 4.9 and newer. However, the undefined behaviour sanitiser in GCC 5.1
2023 # also checks for alignment violations on memory accesses which the valgrind
2024 # code base is sprinkled (if not littered) with. As those alignment issues
2025 # don't pose a problem we want to suppress warnings about them.
2026 # In GCC 5.1 this can be done by passing -fno-sanitize=alignment. Earlier
2027 # GCCs do not support that.
2029 # Only checked for if --enable-ubsan was given.
2030 if test "x${vg_cv_ubsan}" = "xyes"; then
2031 AC_MSG_CHECKING([if gcc accepts -fsanitize=undefined -fno-sanitize=alignment])
2033 CFLAGS="-fsanitize=undefined -fno-sanitize=alignment -Werror"
2034 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2037 FLAG_FSANITIZE="-fsanitize=undefined -fno-sanitize=alignment"
2038 LIB_UBSAN="-static-libubsan"
2039 AC_MSG_RESULT([yes])
2041 CFLAGS="-fsanitize=undefined -Werror"
2042 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2045 FLAG_FSANITIZE="-fsanitize=undefined"
2046 LIB_UBSAN="-static-libubsan"
2047 AC_MSG_RESULT([yes])
2055 AC_SUBST(FLAG_FSANITIZE)
2058 # does this compiler support --param inline-unit-growth=... ?
2060 AC_MSG_CHECKING([if gcc accepts --param inline-unit-growth])
2063 CFLAGS="--param inline-unit-growth=900 -Werror"
2065 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2068 AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH],
2069 ["--param inline-unit-growth=900"])
2070 AC_MSG_RESULT([yes])
2072 AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH], [""])
2078 # does this compiler support -gdwarf-4 -fdebug-types-section ?
2080 AC_MSG_CHECKING([if gcc accepts -gdwarf-4 -fdebug-types-section])
2083 CFLAGS="-gdwarf-4 -fdebug-types-section -Werror"
2085 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2089 AC_MSG_RESULT([yes])
2094 AM_CONDITIONAL(DWARF4, test x$ac_have_dwarf4 = xyes)
2098 # does this compiler support -g -gz=zlib ?
2100 AC_MSG_CHECKING([if gcc accepts -g -gz=zlib])
2103 CFLAGS="-g -gz=zlib"
2105 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2109 AC_MSG_RESULT([yes])
2114 AM_CONDITIONAL(GZ_ZLIB, test x$ac_have_gz_zlib = xyes)
2118 # does this compiler support -g -gz=zlib-gnu ?
2120 AC_MSG_CHECKING([if gcc accepts -g -gz=zlib-gnu])
2123 CFLAGS="-g -gz=zlib-gnu"
2125 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2128 ac_have_gz_zlib_gnu=yes
2129 AC_MSG_RESULT([yes])
2131 ac_have_gz_zlib_gnu=no
2134 AM_CONDITIONAL(GZ_ZLIB_GNU, test x$ac_have_gz_zlib_gnu = xyes)
2138 # does this compiler support nested functions ?
2140 AC_MSG_CHECKING([if gcc accepts nested functions])
2142 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2143 int foo() { return 1; }
2146 ac_have_nested_functions=yes
2147 AC_MSG_RESULT([yes])
2149 ac_have_nested_functions=no
2152 AM_CONDITIONAL([HAVE_NESTED_FUNCTIONS], [test x$ac_have_nested_functions = xyes])
2155 # does this compiler support the 'p' constraint in ASM statements ?
2157 AC_MSG_CHECKING([if gcc accepts the 'p' constraint in asm statements])
2159 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2161 __asm__ __volatile__ ("movdqa (%0),%%xmm6\n" : "=p" (p));
2163 ac_have_asm_constraint_p=yes
2164 AC_MSG_RESULT([yes])
2166 ac_have_asm_constraint_p=no
2169 AM_CONDITIONAL([HAVE_ASM_CONSTRAINT_P], [test x$ac_have_asm_constraint_p = xyes])
2172 # We want to use use the -Ttext-segment option to the linker.
2173 # GNU (bfd) ld supports this directly. Newer GNU gold linkers
2174 # support it as an alias of -Ttext. Sadly GNU (bfd) ld's -Ttext
2175 # semantics are NOT what we want (GNU gold -Ttext is fine).
2177 # For GNU (bfd) ld -Ttext-segment chooses the base at which ELF headers
2178 # will reside. -Ttext aligns just the .text section start (but not any
2181 # So test for -Ttext-segment which is supported by all bfd ld versions
2182 # and use that if it exists. If it doesn't exist it must be an older
2183 # version of gold and we can fall back to using -Ttext which has the
2186 AC_MSG_CHECKING([if the linker accepts -Wl,-Ttext-segment])
2189 CFLAGS="-static -nodefaultlibs -nostartfiles -Wl,-Ttext-segment=$valt_load_address_pri_norml -Werror"
2192 [AC_LANG_SOURCE([int _start () { return 0; }])],
2194 linker_using_t_text="no"
2195 AC_SUBST([FLAG_T_TEXT], ["-Ttext-segment"])
2196 AC_MSG_RESULT([yes])
2198 linker_using_t_text="yes"
2199 AC_SUBST([FLAG_T_TEXT], ["-Ttext"])
2204 # If the linker only supports -Ttext (not -Ttext-segment) then we will
2205 # have to strip any build-id ELF NOTEs from the staticly linked tools.
2206 # Otherwise the build-id NOTE might end up at the default load address.
2207 # (Pedantically if the linker is gold then -Ttext is fine, but newer
2208 # gold versions also support -Ttext-segment. So just assume that unless
2209 # we can use -Ttext-segment we need to strip the build-id NOTEs.
2210 if test "x${linker_using_t_text}" = "xyes"; then
2211 AC_MSG_NOTICE([ld -Ttext used, need to strip build-id NOTEs.])
2212 # does the linker support -Wl,--build-id=none ? Note, it's
2213 # important that we test indirectly via whichever C compiler
2214 # is selected, rather than testing /usr/bin/ld or whatever
2216 AC_MSG_CHECKING([if the linker accepts -Wl,--build-id=none])
2218 CFLAGS="-Wl,--build-id=none -Werror"
2221 [AC_LANG_PROGRAM([ ], [return 0;])],
2223 AC_SUBST([FLAG_NO_BUILD_ID], ["-Wl,--build-id=none"])
2224 AC_MSG_RESULT([yes])
2226 AC_SUBST([FLAG_NO_BUILD_ID], [""])
2230 AC_MSG_NOTICE([ld -Ttext-segment used, no need to strip build-id NOTEs.])
2231 AC_SUBST([FLAG_NO_BUILD_ID], [""])
2235 # does the ppc assembler support "mtocrf" et al?
2236 AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf])
2238 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2239 __asm__ __volatile__("mtocrf 4,0");
2240 __asm__ __volatile__("mfocrf 0,4");
2242 ac_have_as_ppc_mftocrf=yes
2243 AC_MSG_RESULT([yes])
2245 ac_have_as_ppc_mftocrf=no
2248 if test x$ac_have_as_ppc_mftocrf = xyes ; then
2249 AC_DEFINE(HAVE_AS_PPC_MFTOCRF, 1, [Define to 1 if as supports mtocrf/mfocrf.])
2253 # does the ppc assembler support "lfdp" and other phased out floating point insns?
2254 AC_MSG_CHECKING([if ppc32/64 asm supports phased out floating point instructions])
2256 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2257 do { typedef struct {
2261 dbl_pair_t dbl_pair[3];
2262 __asm__ volatile ("lfdp 10, %0"::"m" (dbl_pair[0]));
2265 ac_have_as_ppc_fpPO=yes
2266 AC_MSG_RESULT([yes])
2268 ac_have_as_ppc_fpPO=no
2271 if test x$ac_have_as_ppc_fpPO = xyes ; then
2272 AC_DEFINE(HAVE_AS_PPC_FPPO, 1, [Define to 1 if as supports floating point phased out category.])
2276 # does the amd64 assembler understand "fxsave64" and "fxrstor64"?
2277 AC_MSG_CHECKING([if amd64 assembler supports fxsave64/fxrstor64])
2279 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2281 asm __volatile__("fxsave64 (%0)" : : "r" (p) : "memory" );
2282 asm __volatile__("fxrstor64 (%0)" : : "r" (p) : "memory" );
2284 ac_have_as_amd64_fxsave64=yes
2285 AC_MSG_RESULT([yes])
2287 ac_have_as_amd64_fxsave64=no
2290 if test x$ac_have_as_amd64_fxsave64 = xyes ; then
2291 AC_DEFINE(HAVE_AS_AMD64_FXSAVE64, 1, [Define to 1 if as supports fxsave64/fxrstor64.])
2294 # does the x86/amd64 assembler understand SSE3 instructions?
2295 # Note, this doesn't generate a C-level symbol. It generates a
2296 # automake-level symbol (BUILD_SSE3_TESTS), used in test Makefile.am's
2297 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE3])
2299 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2300 do { long long int x;
2301 __asm__ __volatile__("fisttpq (%0)" : :"r"(&x) ); }
2305 AC_MSG_RESULT([yes])
2311 AM_CONDITIONAL(BUILD_SSE3_TESTS, test x$ac_have_as_sse3 = xyes)
2314 # Ditto for SSSE3 instructions (note extra S)
2315 # Note, this doesn't generate a C-level symbol. It generates a
2316 # automake-level symbol (BUILD_SSSE3_TESTS), used in test Makefile.am's
2317 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSSE3])
2319 save_CFLAGS="$CFLAGS"
2320 CFLAGS="$CFLAGS -msse -Werror"
2321 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2322 do { long long int x;
2323 __asm__ __volatile__(
2324 "pabsb (%0),%%xmm7" : : "r"(&x) : "xmm7" ); }
2327 ac_have_as_ssse3=yes
2328 AC_MSG_RESULT([yes])
2333 CFLAGS="$save_CFLAGS"
2335 AM_CONDITIONAL(BUILD_SSSE3_TESTS, test x$ac_have_as_ssse3 = xyes)
2338 # does the x86/amd64 assembler understand the PCLMULQDQ instruction?
2339 # Note, this doesn't generate a C-level symbol. It generates a
2340 # automake-level symbol (BUILD_PCLMULQDQ_TESTS), used in test Makefile.am's
2341 AC_MSG_CHECKING([if x86/amd64 assembler supports 'pclmulqdq'])
2342 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2344 __asm__ __volatile__(
2345 "pclmulqdq \$17,%%xmm6,%%xmm7" : : : "xmm6", "xmm7" ); }
2348 ac_have_as_pclmulqdq=yes
2349 AC_MSG_RESULT([yes])
2351 ac_have_as_pclmulqdq=no
2355 AM_CONDITIONAL(BUILD_PCLMULQDQ_TESTS, test x$ac_have_as_pclmulqdq = xyes)
2358 # does the x86/amd64 assembler understand the VPCLMULQDQ instruction?
2359 # Note, this doesn't generate a C-level symbol. It generates a
2360 # automake-level symbol (BUILD_VPCLMULQDQ_TESTS), used in test Makefile.am's
2361 AC_MSG_CHECKING([if x86/amd64 assembler supports 'vpclmulqdq'])
2362 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2365 * Carry-less multiplication of xmm1 with xmm2 and store the result in
2366 * xmm3. The immediate is used to determine which quadwords of xmm1 and
2367 * xmm2 should be used.
2369 __asm__ __volatile__(
2370 "vpclmulqdq \$0,%%xmm1,%%xmm2,%%xmm3" : : : );
2373 ac_have_as_vpclmulqdq=yes
2374 AC_MSG_RESULT([yes])
2376 ac_have_as_vpclmulqdq=no
2380 AM_CONDITIONAL(BUILD_VPCLMULQDQ_TESTS, test x$ac_have_as_vpclmulqdq = xyes)
2383 # does the x86/amd64 assembler understand the LZCNT instruction?
2384 # Note, this doesn't generate a C-level symbol. It generates a
2385 # automake-level symbol (BUILD_LZCNT_TESTS), used in test Makefile.am's
2386 AC_MSG_CHECKING([if x86/amd64 assembler supports 'lzcnt'])
2388 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2390 __asm__ __volatile__("lzcnt %%rax,%%rax" : : : "rax");
2393 ac_have_as_lzcnt=yes
2394 AC_MSG_RESULT([yes])
2400 AM_CONDITIONAL([BUILD_LZCNT_TESTS], [test x$ac_have_as_lzcnt = xyes])
2403 # does the x86/amd64 assembler understand the LOOPNEL instruction?
2404 # Note, this doesn't generate a C-level symbol. It generates a
2405 # automake-level symbol (BUILD_LOOPNEL_TESTS), used in test Makefile.am's
2406 AC_MSG_CHECKING([if x86/amd64 assembler supports 'loopnel'])
2408 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2410 __asm__ __volatile__("1: loopnel 1b\n");
2413 ac_have_as_loopnel=yes
2414 AC_MSG_RESULT([yes])
2416 ac_have_as_loopnel=no
2420 AM_CONDITIONAL([BUILD_LOOPNEL_TESTS], [test x$ac_have_as_loopnel = xyes])
2423 # does the x86/amd64 assembler understand ADDR32 ?
2424 # Note, this doesn't generate a C-level symbol. It generates a
2425 # automake-level symbol (BUILD_ADDR32_TESTS), used in test Makefile.am's
2426 AC_MSG_CHECKING([if x86/amd64 assembler supports 'addr32'])
2428 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2430 asm volatile ("addr32 rep movsb");
2433 ac_have_as_addr32=yes
2434 AC_MSG_RESULT([yes])
2436 ac_have_as_addr32=no
2440 AM_CONDITIONAL([BUILD_ADDR32_TESTS], [test x$ac_have_as_addr32 = xyes])
2443 # does the x86/amd64 assembler understand SSE 4.2 instructions?
2444 # Note, this doesn't generate a C-level symbol. It generates a
2445 # automake-level symbol (BUILD_SSE42_TESTS), used in test Makefile.am's
2446 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE4.2])
2448 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2449 do { long long int x;
2450 __asm__ __volatile__(
2451 "crc32q %%r15,%%r15" : : : "r15" );
2452 __asm__ __volatile__(
2453 "pblendvb (%%rcx), %%xmm11" : : : "memory", "xmm11");
2454 __asm__ __volatile__(
2455 "aesdec %%xmm2, %%xmm1" : : : "xmm2", "xmm1"); }
2458 ac_have_as_sse42=yes
2459 AC_MSG_RESULT([yes])
2465 AM_CONDITIONAL(BUILD_SSE42_TESTS, test x$ac_have_as_sse42 = xyes)
2468 # does the x86/amd64 assembler understand AVX instructions?
2469 # Note, this doesn't generate a C-level symbol. It generates a
2470 # automake-level symbol (BUILD_AVX_TESTS), used in test Makefile.am's
2471 AC_MSG_CHECKING([if x86/amd64 assembler speaks AVX])
2473 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2474 do { long long int x;
2475 __asm__ __volatile__(
2476 "vmovupd (%%rsp), %%ymm7" : : : "xmm7" );
2477 __asm__ __volatile__(
2478 "vaddpd %%ymm6,%%ymm7,%%ymm8" : : : "xmm6","xmm7","xmm8"); }
2482 AC_MSG_RESULT([yes])
2488 AM_CONDITIONAL(BUILD_AVX_TESTS, test x$ac_have_as_avx = xyes)
2491 # does the x86/amd64 assembler understand AVX2 instructions?
2492 # Note, this doesn't generate a C-level symbol. It generates a
2493 # automake-level symbol (BUILD_AVX2_TESTS), used in test Makefile.am's
2494 AC_MSG_CHECKING([if x86/amd64 assembler speaks AVX2])
2496 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2497 do { long long int x;
2498 __asm__ __volatile__(
2499 "vpsravd (%%rsp), %%ymm8, %%ymm7" : : : "xmm7", "xmm8" );
2500 __asm__ __volatile__(
2501 "vpaddb %%ymm6,%%ymm7,%%ymm8" : : : "xmm6","xmm7","xmm8"); }
2505 AC_MSG_RESULT([yes])
2511 AM_CONDITIONAL(BUILD_AVX2_TESTS, test x$ac_have_as_avx2 = xyes)
2514 # does the x86/amd64 assembler understand TSX instructions and
2515 # the XACQUIRE/XRELEASE prefixes?
2516 # Note, this doesn't generate a C-level symbol. It generates a
2517 # automake-level symbol (BUILD_TSX_TESTS), used in test Makefile.am's
2518 AC_MSG_CHECKING([if x86/amd64 assembler speaks TSX])
2520 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2522 __asm__ __volatile__(
2525 " xacquire lock incq 0(%rsp) \n\t"
2526 " xrelease lock incq 0(%rsp) \n"
2531 AC_MSG_RESULT([yes])
2537 AM_CONDITIONAL(BUILD_TSX_TESTS, test x$ac_have_as_tsx = xyes)
2540 # does the x86/amd64 assembler understand BMI1 and BMI2 instructions?
2541 # Note, this doesn't generate a C-level symbol. It generates a
2542 # automake-level symbol (BUILD_BMI_TESTS), used in test Makefile.am's
2543 AC_MSG_CHECKING([if x86/amd64 assembler speaks BMI1 and BMI2])
2545 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2546 do { unsigned int h, l;
2547 __asm__ __volatile__( "mulx %rax,%rcx,%r8" );
2548 __asm__ __volatile__(
2549 "andn %2, %1, %0" : "=r" (h) : "r" (0x1234567), "r" (0x7654321) );
2550 __asm__ __volatile__(
2551 "movl %2, %%edx; mulx %3, %1, %0" : "=r" (h), "=r" (l) : "g" (0x1234567), "rm" (0x7654321) : "edx" ); }
2555 AC_MSG_RESULT([yes])
2561 AM_CONDITIONAL(BUILD_BMI_TESTS, test x$ac_have_as_bmi = xyes)
2564 # does the x86/amd64 assembler understand FMA instructions?
2565 # Note, this doesn't generate a C-level symbol. It generates a
2566 # automake-level symbol (BUILD_FMA_TESTS), used in test Makefile.am's
2567 AC_MSG_CHECKING([if x86/amd64 assembler speaks FMA])
2569 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2570 do { unsigned int h, l;
2571 __asm__ __volatile__(
2572 "vfmadd132ps (%%rsp), %%ymm8, %%ymm7" : : : "xmm7", "xmm8" );
2573 __asm__ __volatile__(
2574 "vfnmsub231sd (%%rsp), %%xmm8, %%xmm7" : : : "xmm7", "xmm8" );
2575 __asm__ __volatile__(
2576 "vfmsubadd213pd (%%rsp), %%xmm8, %%xmm7" : : : "xmm7", "xmm8" ); }
2580 AC_MSG_RESULT([yes])
2586 AM_CONDITIONAL(BUILD_FMA_TESTS, test x$ac_have_as_fma = xyes)
2589 # does the amd64 assembler understand MPX instructions?
2590 # Note, this doesn't generate a C-level symbol. It generates a
2591 # automake-level symbol (BUILD_MPX_TESTS), used in test Makefile.am's
2592 AC_MSG_CHECKING([if amd64 assembler knows the MPX instructions])
2594 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2596 asm ("bndmov %bnd0,(%rsp)");
2597 asm ("bndldx 3(%rbx,%rdx), %bnd2");
2598 asm ("bnd call foo\n"
2605 AC_MSG_RESULT([yes])
2611 AM_CONDITIONAL(BUILD_MPX_TESTS, test x$ac_have_as_mpx = xyes)
2614 # Does the C compiler support the "ifunc" attribute
2615 # Note, this doesn't generate a C-level symbol. It generates a
2616 # automake-level symbol (BUILD_IFUNC_TESTS), used in test Makefile.am's
2617 # does the x86/amd64 assembler understand MOVBE?
2618 # Note, this doesn't generate a C-level symbol. It generates a
2619 # automake-level symbol (BUILD_MOVBE_TESTS), used in test Makefile.am's
2620 AC_MSG_CHECKING([if x86/amd64 assembler knows the MOVBE insn])
2622 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2623 do { long long int x;
2624 __asm__ __volatile__(
2625 "movbe (%%rsp), %%r15" : : : "memory", "r15" ); }
2628 ac_have_as_movbe=yes
2629 AC_MSG_RESULT([yes])
2635 AM_CONDITIONAL(BUILD_MOVBE_TESTS, test x$ac_have_as_movbe = xyes)
2638 # Does the C compiler support the "ifunc" attribute
2639 # Note, this doesn't generate a C-level symbol. It generates a
2640 # automake-level symbol (BUILD_IFUNC_TESTS), used in test Makefile.am's
2641 AC_MSG_CHECKING([if gcc supports the ifunc attribute])
2643 AC_LINK_IFELSE([AC_LANG_SOURCE([[
2644 static void mytest(void) {}
2646 static void (*resolve_test(void))(void)
2648 return (void (*)(void))&mytest;
2651 void test(void) __attribute__((ifunc("resolve_test")));
2659 ac_have_ifunc_attr=yes
2660 AC_MSG_RESULT([yes])
2662 ac_have_ifunc_attr=no
2666 AM_CONDITIONAL(BUILD_IFUNC_TESTS, test x$ac_have_ifunc_attr = xyes)
2669 # XXX JRS 2010 Oct 13: what is this for? For sure, we don't need this
2670 # when building the tool executables. I think we should get rid of it.
2672 # Check for TLS support in the compiler and linker
2673 AC_LINK_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
2675 [vg_cv_linktime_tls=yes],
2676 [vg_cv_linktime_tls=no])
2677 # Native compilation: check whether running a program using TLS succeeds.
2678 # Linking only is not sufficient -- e.g. on Red Hat 7.3 linking TLS programs
2679 # succeeds but running programs using TLS fails.
2680 # Cross-compiling: check whether linking a program using TLS succeeds.
2681 AC_CACHE_CHECK([for TLS support], vg_cv_tls,
2682 [AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS],
2683 [vg_cv_tls=$enableval],
2684 [AC_RUN_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
2688 [vg_cv_tls=$vg_cv_linktime_tls])])])
2690 if test "$vg_cv_tls" = yes -a $is_clang != applellvm; then
2691 AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variables])
2695 #----------------------------------------------------------------------------
2696 # Solaris-specific checks.
2697 #----------------------------------------------------------------------------
2699 if test "$VGCONF_OS" = "solaris" ; then
2700 # Solaris-specific check determining if the Sun Studio Assembler is used to
2701 # build Valgrind. The test checks if the x86/amd64 assembler understands the
2702 # cmovl.l instruction, if yes then it's Sun Assembler.
2704 # C-level symbol: none
2705 # Automake-level symbol: SOLARIS_SUN_STUDIO_AS
2707 AC_MSG_CHECKING([if x86/amd64 assembler speaks cmovl.l (Solaris-specific)])
2708 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2710 __asm__ __volatile__("cmovl.l %edx, %eax");
2712 solaris_have_sun_studio_as=yes
2713 AC_MSG_RESULT([yes])
2715 solaris_have_sun_studio_as=no
2718 AM_CONDITIONAL(SOLARIS_SUN_STUDIO_AS, test x$solaris_have_sun_studio_as = xyes)
2720 # Solaris-specific check determining if symbols __xpg4 and __xpg6
2721 # are present in linked elfs when gcc is invoked with -std=gnu99.
2722 # See solaris/vgpreload-solaris.mapfile for details.
2723 # gcc on Solaris instructs linker to include these symbols,
2724 # gcc on illumos does not.
2726 # C-level symbol: none
2727 # Automake-level symbol: SOLARIS_XPG_SYMBOLS_PRESENT
2729 save_CFLAGS="$CFLAGS"
2730 CFLAGS="$CFLAGS -std=gnu99"
2731 AC_MSG_CHECKING([if xpg symbols are present with -std=gnu99 (Solaris-specific)])
2732 AC_RUN_IFELSE([AC_LANG_SOURCE([[
2737 int main(int argc, const char *argv[]) {
2738 char command[PATH_MAX + 50];
2739 snprintf(command, sizeof(command), "nm %s | egrep '__xpg[4,6]'", argv[0]);
2741 FILE *output = popen(command, "r");
2742 if (output == NULL) return -1;
2745 if (fgets(buf, sizeof(buf), output) != NULL) {
2754 solaris_xpg_symbols_present=yes
2755 AC_MSG_RESULT([yes])
2757 solaris_xpg_symbols_present=no
2760 AM_CONDITIONAL(SOLARIS_XPG_SYMBOLS_PRESENT, test x$solaris_xpg_symbols_present = xyes)
2761 CFLAGS="$save_CFLAGS"
2764 # Solaris-specific check determining if gcc enables largefile support by
2765 # default for 32-bit executables. If it does, then set SOLARIS_UNDEF_LARGESOURCE
2766 # variable with gcc flags which disable it.
2768 AC_MSG_CHECKING([if gcc enables largefile support for 32-bit apps (Solaris-specific)])
2769 save_CFLAGS="$CFLAGS"
2770 CFLAGS="$CFLAGS -m32"
2771 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2772 return _LARGEFILE_SOURCE;
2774 SOLARIS_UNDEF_LARGESOURCE="-U_LARGEFILE_SOURCE -U_LARGEFILE64_SOURCE -U_FILE_OFFSET_BITS"
2775 AC_MSG_RESULT([yes])
2777 SOLARIS_UNDEF_LARGESOURCE=""
2781 AC_SUBST(SOLARIS_UNDEF_LARGESOURCE)
2784 # Solaris-specific check determining if /proc/self/cmdline
2785 # or /proc/<pid>/cmdline is supported.
2787 # C-level symbol: SOLARIS_PROC_CMDLINE
2788 # Automake-level symbol: SOLARIS_PROC_CMDLINE
2790 AC_CHECK_FILE([/proc/self/cmdline],
2792 solaris_proc_cmdline=yes
2793 AC_DEFINE([SOLARIS_PROC_CMDLINE], 1,
2794 [Define to 1 if you have /proc/self/cmdline.])
2796 solaris_proc_cmdline=no
2798 AM_CONDITIONAL(SOLARIS_PROC_CMDLINE, test x$solaris_proc_cmdline = xyes)
2801 # Solaris-specific check determining default platform for the Valgrind launcher.
2802 # Used in case the launcher cannot select platform by looking at the client
2803 # image (for example because the executable is a shell script).
2805 # C-level symbol: SOLARIS_LAUNCHER_DEFAULT_PLATFORM
2806 # Automake-level symbol: none
2808 AC_MSG_CHECKING([for default platform of Valgrind launcher (Solaris-specific)])
2809 # Get the ELF class of /bin/sh first.
2810 if ! test -f /bin/sh; then
2811 AC_MSG_ERROR([Shell interpreter `/bin/sh' not found.])
2813 elf_class=$( /usr/bin/file /bin/sh | sed -n 's/.*ELF \(..\)-bit.*/\1/p' )
2814 case "$elf_class" in
2816 default_arch="$VGCONF_ARCH_PRI";
2819 if test "x$VGCONF_ARCH_SEC" != "x"; then
2820 default_arch="$VGCONF_ARCH_SEC"
2822 default_arch="$VGCONF_ARCH_PRI";
2826 AC_MSG_ERROR([Cannot determine ELF class of `/bin/sh'.])
2829 default_platform="$default_arch-$VGCONF_OS"
2830 AC_MSG_RESULT([$default_platform])
2831 AC_DEFINE_UNQUOTED([SOLARIS_LAUNCHER_DEFAULT_PLATFORM], ["$default_platform"],
2832 [Default platform for Valgrind launcher.])
2835 # Solaris-specific check determining if the old syscalls are available.
2837 # C-level symbol: SOLARIS_OLD_SYSCALLS
2838 # Automake-level symbol: SOLARIS_OLD_SYSCALLS
2840 AC_MSG_CHECKING([for the old Solaris syscalls (Solaris-specific)])
2841 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2842 #include <sys/syscall.h>
2846 solaris_old_syscalls=yes
2847 AC_MSG_RESULT([yes])
2848 AC_DEFINE([SOLARIS_OLD_SYSCALLS], 1,
2849 [Define to 1 if you have the old Solaris syscalls.])
2851 solaris_old_syscalls=no
2854 AM_CONDITIONAL(SOLARIS_OLD_SYSCALLS, test x$solaris_old_syscalls = xyes)
2857 # Solaris-specific check determining if the new accept() syscall is available.
2860 # int accept(int sock, struct sockaddr *name, socklen_t *namelenp,
2863 # New syscall (available on illumos):
2864 # int accept(int sock, struct sockaddr *name, socklen_t *namelenp,
2865 # int version, int flags);
2867 # If the old syscall is present then the following syscall will fail with
2868 # ENOTSOCK (because file descriptor 0 is not a socket), if the new syscall is
2869 # available then it will fail with EINVAL (because the flags parameter is
2872 # C-level symbol: SOLARIS_NEW_ACCEPT_SYSCALL
2873 # Automake-level symbol: none
2875 AC_MSG_CHECKING([for the new `accept' syscall (Solaris-specific)])
2876 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
2877 #include <sys/syscall.h>
2881 syscall(SYS_accept, 0, 0, 0, 0, -1);
2882 return !(errno == EINVAL);
2884 AC_MSG_RESULT([yes])
2885 AC_DEFINE([SOLARIS_NEW_ACCEPT_SYSCALL], 1,
2886 [Define to 1 if you have the new `accept' syscall.])
2892 # Solaris-specific check determining if the new illumos pipe() syscall is
2896 # longlong_t pipe();
2898 # New syscall (available on illumos):
2899 # int pipe(intptr_t arg, int flags);
2901 # If the old syscall is present then the following call will succeed, if the
2902 # new syscall is available then it will fail with EFAULT (because address 0
2903 # cannot be accessed).
2905 # C-level symbol: SOLARIS_NEW_PIPE_SYSCALL
2906 # Automake-level symbol: none
2908 AC_MSG_CHECKING([for the new `pipe' syscall (Solaris-specific)])
2909 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
2910 #include <sys/syscall.h>
2914 syscall(SYS_pipe, 0, 0);
2915 return !(errno == EFAULT);
2917 AC_MSG_RESULT([yes])
2918 AC_DEFINE([SOLARIS_NEW_PIPE_SYSCALL], 1,
2919 [Define to 1 if you have the new `pipe' syscall.])
2925 # Solaris-specific check determining if the new lwp_sigqueue() syscall is
2929 # int lwp_kill(id_t lwpid, int sig);
2931 # New syscall (available on Solaris 11):
2932 # int lwp_sigqueue(id_t lwpid, int sig, void *value,
2933 # int si_code, timespec_t *timeout);
2935 # C-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL
2936 # Automake-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL
2938 AC_MSG_CHECKING([for the new `lwp_sigqueue' syscall (Solaris-specific)])
2939 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2940 #include <sys/syscall.h>
2942 return !SYS_lwp_sigqueue;
2944 solaris_lwp_sigqueue_syscall=yes
2945 AC_MSG_RESULT([yes])
2946 AC_DEFINE([SOLARIS_LWP_SIGQUEUE_SYSCALL], 1,
2947 [Define to 1 if you have the new `lwp_sigqueue' syscall.])
2949 solaris_lwp_sigqueue_syscall=no
2952 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL, test x$solaris_lwp_sigqueue_syscall = xyes)
2955 # Solaris-specific check determining if the lwp_sigqueue() syscall
2956 # takes both pid and thread id arguments or just thread id.
2958 # Old syscall (available on Solaris 11.x):
2959 # int lwp_sigqueue(id_t lwpid, int sig, void *value,
2960 # int si_code, timespec_t *timeout);
2962 # New syscall (available on Solaris 12):
2963 # int lwp_sigqueue(pid_t pid, id_t lwpid, int sig, void *value,
2964 # int si_code, timespec_t *timeout);
2966 # If the old syscall is present then the following syscall will fail with
2967 # EINVAL (because signal is out of range); if the new syscall is available
2968 # then it will fail with ESRCH (because it would not find such thread in the
2971 # C-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID
2972 # Automake-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID
2974 AM_COND_IF(SOLARIS_LWP_SIGQUEUE_SYSCALL,
2975 AC_MSG_CHECKING([if the `lwp_sigqueue' syscall accepts pid (Solaris-specific)])
2976 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
2977 #include <sys/syscall.h>
2981 syscall(SYS_lwp_sigqueue, 0, 101, 0, 0, 0, 0);
2982 return !(errno == ESRCH);
2984 solaris_lwp_sigqueue_syscall_takes_pid=yes
2985 AC_MSG_RESULT([yes])
2986 AC_DEFINE([SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID], 1,
2987 [Define to 1 if you have the new `lwp_sigqueue' syscall which accepts pid.])
2989 solaris_lwp_sigqueue_syscall_takes_pid=no
2992 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID,
2993 test x$solaris_lwp_sigqueue_syscall_takes_pid = xyes)
2995 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID, test x = y)
2999 # Solaris-specific check determining if the new lwp_name() syscall is
3002 # New syscall (available on Solaris 11):
3003 # int lwp_name(int opcode, id_t lwpid, char *name, size_t len);
3005 # C-level symbol: SOLARIS_LWP_NAME_SYSCALL
3006 # Automake-level symbol: SOLARIS_LWP_NAME_SYSCALL
3008 AC_MSG_CHECKING([for the new `lwp_name' syscall (Solaris-specific)])
3009 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3010 #include <sys/syscall.h>
3012 return !SYS_lwp_name;
3014 solaris_lwp_name_syscall=yes
3015 AC_MSG_RESULT([yes])
3016 AC_DEFINE([SOLARIS_LWP_NAME_SYSCALL], 1,
3017 [Define to 1 if you have the new `lwp_name' syscall.])
3019 solaris_lwp_name_syscall=no
3022 AM_CONDITIONAL(SOLARIS_LWP_NAME_SYSCALL, test x$solaris_lwp_name_syscall = xyes)
3025 # Solaris-specific check determining if the new getrandom() syscall is
3028 # New syscall (available on Solaris 11):
3029 # int getrandom(void *buf, size_t buflen, uint_t flags);
3031 # C-level symbol: SOLARIS_GETRANDOM_SYSCALL
3032 # Automake-level symbol: SOLARIS_GETRANDOM_SYSCALL
3034 AC_MSG_CHECKING([for the new `getrandom' syscall (Solaris-specific)])
3035 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3036 #include <sys/syscall.h>
3038 return !SYS_getrandom;
3040 solaris_getrandom_syscall=yes
3041 AC_MSG_RESULT([yes])
3042 AC_DEFINE([SOLARIS_GETRANDOM_SYSCALL], 1,
3043 [Define to 1 if you have the new `getrandom' syscall.])
3045 solaris_getrandom_syscall=no
3048 AM_CONDITIONAL(SOLARIS_GETRANDOM_SYSCALL, test x$solaris_getrandom_syscall = xyes)
3051 # Solaris-specific check determining if the new zone() syscall subcodes
3052 # ZONE_LIST_DEFUNCT and ZONE_GETATTR_DEFUNCT are available. These subcodes
3053 # were added in Solaris 11 but are missing on illumos.
3055 # C-level symbol: SOLARIS_ZONE_DEFUNCT
3056 # Automake-level symbol: SOLARIS_ZONE_DEFUNCT
3058 AC_MSG_CHECKING([for ZONE_LIST_DEFUNCT and ZONE_GETATTR_DEFUNCT (Solaris-specific)])
3059 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3060 #include <sys/zone.h>
3062 return !(ZONE_LIST_DEFUNCT && ZONE_GETATTR_DEFUNCT);
3064 solaris_zone_defunct=yes
3065 AC_MSG_RESULT([yes])
3066 AC_DEFINE([SOLARIS_ZONE_DEFUNCT], 1,
3067 [Define to 1 if you have the `ZONE_LIST_DEFUNCT' and `ZONE_GETATTR_DEFUNC' constants.])
3069 solaris_zone_defunct=no
3072 AM_CONDITIONAL(SOLARIS_ZONE_DEFUNCT, test x$solaris_zone_defunct = xyes)
3075 # Solaris-specific check determining if commands A_GETSTAT and A_SETSTAT
3076 # for auditon(2) subcode of the auditsys() syscall are available.
3077 # These commands are available in Solaris 11 and illumos but were removed
3080 # C-level symbol: SOLARIS_AUDITON_STAT
3081 # Automake-level symbol: SOLARIS_AUDITON_STAT
3083 AC_MSG_CHECKING([for A_GETSTAT and A_SETSTAT auditon(2) commands (Solaris-specific)])
3084 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3085 #include <bsm/audit.h>
3087 return !(A_GETSTAT && A_SETSTAT);
3089 solaris_auditon_stat=yes
3090 AC_MSG_RESULT([yes])
3091 AC_DEFINE([SOLARIS_AUDITON_STAT], 1,
3092 [Define to 1 if you have the `A_GETSTAT' and `A_SETSTAT' constants.])
3094 solaris_auditon_stat=no
3097 AM_CONDITIONAL(SOLARIS_AUDITON_STAT, test x$solaris_auditon_stat = xyes)
3100 # Solaris-specific check determining if the new shmsys() syscall subcodes
3101 # IPC_XSTAT64, SHMADV, SHM_ADV_GET, SHM_ADV_SET and SHMGET_OSM are available.
3102 # These subcodes were added in Solaris 11 but are missing on illumos.
3104 # C-level symbol: SOLARIS_SHM_NEW
3105 # Automake-level symbol: SOLARIS_SHM_NEW
3107 AC_MSG_CHECKING([for SHMADV, SHM_ADV_GET, SHM_ADV_SET and SHMGET_OSM (Solaris-specific)])
3108 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3109 #include <sys/ipc_impl.h>
3110 #include <sys/shm.h>
3111 #include <sys/shm_impl.h>
3113 return !(IPC_XSTAT64 && SHMADV && SHM_ADV_GET && SHM_ADV_SET && SHMGET_OSM);
3116 AC_MSG_RESULT([yes])
3117 AC_DEFINE([SOLARIS_SHM_NEW], 1,
3118 [Define to 1 if you have the `IPC_XSTAT64', `SHMADV', `SHM_ADV_GET', `SHM_ADV_SET' and `SHMGET_OSM' constants.])
3123 AM_CONDITIONAL(SOLARIS_SHM_NEW, test x$solaris_shm_new = xyes)
3126 # Solaris-specific check determining if prxregset_t is available. Illumos
3127 # currently does not define it on the x86 platform.
3129 # C-level symbol: SOLARIS_PRXREGSET_T
3130 # Automake-level symbol: SOLARIS_PRXREGSET_T
3132 AC_MSG_CHECKING([for the `prxregset_t' type (Solaris-specific)])
3133 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3134 #include <sys/procfs_isa.h>
3136 return !sizeof(prxregset_t);
3138 solaris_prxregset_t=yes
3139 AC_MSG_RESULT([yes])
3140 AC_DEFINE([SOLARIS_PRXREGSET_T], 1,
3141 [Define to 1 if you have the `prxregset_t' type.])
3143 solaris_prxregset_t=no
3146 AM_CONDITIONAL(SOLARIS_PRXREGSET_T, test x$solaris_prxregset_t = xyes)
3149 # Solaris-specific check determining if the new frealpathat() syscall is
3152 # New syscall (available on Solaris 11.1):
3153 # int frealpathat(int fd, char *path, char *buf, size_t buflen);
3155 # C-level symbol: SOLARIS_FREALPATHAT_SYSCALL
3156 # Automake-level symbol: SOLARIS_FREALPATHAT_SYSCALL
3158 AC_MSG_CHECKING([for the new `frealpathat' syscall (Solaris-specific)])
3159 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3160 #include <sys/syscall.h>
3162 return !SYS_frealpathat;
3164 solaris_frealpathat_syscall=yes
3165 AC_MSG_RESULT([yes])
3166 AC_DEFINE([SOLARIS_FREALPATHAT_SYSCALL], 1,
3167 [Define to 1 if you have the new `frealpathat' syscall.])
3169 solaris_frealpathat_syscall=no
3172 AM_CONDITIONAL(SOLARIS_FREALPATHAT_SYSCALL, test x$solaris_frealpathat_syscall = xyes)
3175 # Solaris-specific check determining if the new uuidsys() syscall is
3178 # New syscall (available on newer Solaris):
3179 # int uuidsys(struct uuid *uuid);
3181 # C-level symbol: SOLARIS_UUIDSYS_SYSCALL
3182 # Automake-level symbol: SOLARIS_UUIDSYS_SYSCALL
3184 AC_MSG_CHECKING([for the new `uuidsys' syscall (Solaris-specific)])
3185 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3186 #include <sys/syscall.h>
3188 return !SYS_uuidsys;
3190 solaris_uuidsys_syscall=yes
3191 AC_MSG_RESULT([yes])
3192 AC_DEFINE([SOLARIS_UUIDSYS_SYSCALL], 1,
3193 [Define to 1 if you have the new `uuidsys' syscall.])
3195 solaris_uuidsys_syscall=no
3198 AM_CONDITIONAL(SOLARIS_UUIDSYS_SYSCALL, test x$solaris_uuidsys_syscall = xyes)
3201 # Solaris-specific check determining if the new labelsys() syscall subcode
3202 # TNDB_GET_TNIP is available. This subcode was added in Solaris 11 but is
3203 # missing on illumos.
3205 # C-level symbol: SOLARIS_TNDB_GET_TNIP
3206 # Automake-level symbol: SOLARIS_TNDB_GET_TNIP
3208 AC_MSG_CHECKING([for TNDB_GET_TNIP (Solaris-specific)])
3209 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3210 #include <sys/tsol/tndb.h>
3212 return !TNDB_GET_TNIP;
3214 solaris_tndb_get_tnip=yes
3215 AC_MSG_RESULT([yes])
3216 AC_DEFINE([SOLARIS_TNDB_GET_TNIP], 1,
3217 [Define to 1 if you have the `TNDB_GET_TNIP' constant.])
3219 solaris_tndb_get_tnip=no
3222 AM_CONDITIONAL(SOLARIS_TNDB_GET_TNIP, test x$solaris_tndb_get_tnip = xyes)
3225 # Solaris-specific check determining if the new labelsys() syscall opcodes
3226 # TSOL_GETCLEARANCE and TSOL_SETCLEARANCE are available. These opcodes were
3227 # added in Solaris 11 but are missing on illumos.
3229 # C-level symbol: SOLARIS_TSOL_CLEARANCE
3230 # Automake-level symbol: SOLARIS_TSOL_CLEARANCE
3232 AC_MSG_CHECKING([for TSOL_GETCLEARANCE and TSOL_SETCLEARANCE (Solaris-specific)])
3233 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3234 #include <sys/tsol/tsyscall.h>
3236 return !(TSOL_GETCLEARANCE && TSOL_SETCLEARANCE);
3238 solaris_tsol_clearance=yes
3239 AC_MSG_RESULT([yes])
3240 AC_DEFINE([SOLARIS_TSOL_CLEARANCE], 1,
3241 [Define to 1 if you have the `TSOL_GETCLEARANCE' and `TSOL_SETCLEARANCE' constants.])
3243 solaris_tsol_clearance=no
3246 AM_CONDITIONAL(SOLARIS_TSOL_CLEARANCE, test x$solaris_tsol_clearance = xyes)
3249 # Solaris-specific check determining if the new pset() syscall subcode
3250 # PSET_GET_NAME is available. This subcode was added in Solaris 12 but
3251 # is missing on illumos and Solaris 11.
3253 # C-level symbol: SOLARIS_PSET_GET_NAME
3254 # Automake-level symbol: SOLARIS_PSET_GET_NAME
3256 AC_MSG_CHECKING([for PSET_GET_NAME (Solaris-specific)])
3257 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3258 #include <sys/pset.h>
3260 return !(PSET_GET_NAME);
3262 solaris_pset_get_name=yes
3263 AC_MSG_RESULT([yes])
3264 AC_DEFINE([SOLARIS_PSET_GET_NAME], 1,
3265 [Define to 1 if you have the `PSET_GET_NAME' constants.])
3267 solaris_pset_get_name=no
3270 AM_CONDITIONAL(SOLARIS_PSET_GET_NAME, test x$solaris_pset_get_name = xyes)
3273 # Solaris-specific check determining if the utimesys() syscall is
3274 # available (on illumos and older Solaris).
3276 # C-level symbol: SOLARIS_UTIMESYS_SYSCALL
3277 # Automake-level symbol: SOLARIS_UTIMESYS_SYSCALL
3279 AC_MSG_CHECKING([for the `utimesys' syscall (Solaris-specific)])
3280 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3281 #include <sys/syscall.h>
3283 return !SYS_utimesys;
3285 solaris_utimesys_syscall=yes
3286 AC_MSG_RESULT([yes])
3287 AC_DEFINE([SOLARIS_UTIMESYS_SYSCALL], 1,
3288 [Define to 1 if you have the `utimesys' syscall.])
3290 solaris_utimesys_syscall=no
3293 AM_CONDITIONAL(SOLARIS_UTIMESYS_SYSCALL, test x$solaris_utimesys_syscall = xyes)
3296 # Solaris-specific check determining if the utimensat() syscall is
3297 # available (on newer Solaris).
3299 # C-level symbol: SOLARIS_UTIMENSAT_SYSCALL
3300 # Automake-level symbol: SOLARIS_UTIMENSAT_SYSCALL
3302 AC_MSG_CHECKING([for the `utimensat' syscall (Solaris-specific)])
3303 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3304 #include <sys/syscall.h>
3306 return !SYS_utimensat;
3308 solaris_utimensat_syscall=yes
3309 AC_MSG_RESULT([yes])
3310 AC_DEFINE([SOLARIS_UTIMENSAT_SYSCALL], 1,
3311 [Define to 1 if you have the `utimensat' syscall.])
3313 solaris_utimensat_syscall=no
3316 AM_CONDITIONAL(SOLARIS_UTIMENSAT_SYSCALL, test x$solaris_utimensat_syscall = xyes)
3319 # Solaris-specific check determining if the spawn() syscall is available
3320 # (on newer Solaris).
3322 # C-level symbol: SOLARIS_SPAWN_SYSCALL
3323 # Automake-level symbol: SOLARIS_SPAWN_SYSCALL
3325 AC_MSG_CHECKING([for the `spawn' syscall (Solaris-specific)])
3326 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3327 #include <sys/syscall.h>
3331 solaris_spawn_syscall=yes
3332 AC_MSG_RESULT([yes])
3333 AC_DEFINE([SOLARIS_SPAWN_SYSCALL], 1,
3334 [Define to 1 if you have the `spawn' syscall.])
3336 solaris_spawn_syscall=no
3339 AM_CONDITIONAL(SOLARIS_SPAWN_SYSCALL, test x$solaris_spawn_syscall = xyes)
3342 # Solaris-specific check determining if commands MODNVL_CTRLMAP through
3343 # MODDEVINFO_CACHE_TS for modctl() syscall are available (on newer Solaris).
3345 # C-level symbol: SOLARIS_MODCTL_MODNVL
3346 # Automake-level symbol: SOLARIS_MODCTL_MODNVL
3348 AC_MSG_CHECKING([for MODNVL_CTRLMAP through MODDEVINFO_CACHE_TS modctl(2) commands (Solaris-specific)])
3349 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3350 #include <sys/modctl.h>
3352 return !(MODNVL_CTRLMAP && MODDEVINFO_CACHE_TS);
3354 solaris_modctl_modnvl=yes
3355 AC_MSG_RESULT([yes])
3356 AC_DEFINE([SOLARIS_MODCTL_MODNVL], 1,
3357 [Define to 1 if you have the `MODNVL_CTRLMAP' through `MODDEVINFO_CACHE_TS' constants.])
3359 solaris_modctl_modnvl=no
3362 AM_CONDITIONAL(SOLARIS_MODCTL_MODNVL, test x$solaris_modctl_modnvl = xyes)
3365 # Solaris-specific check determining whether nscd (name switch cache daemon)
3366 # attaches its door at /system/volatile/name_service_door (Solaris)
3367 # or at /var/run/name_service_door (illumos).
3369 # Note that /var/run is a symlink to /system/volatile on Solaris
3370 # but not vice versa on illumos.
3372 # C-level symbol: SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE
3373 # Automake-level symbol: SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE
3375 AC_MSG_CHECKING([for nscd door location (Solaris-specific)])
3376 if test -e /system/volatile/name_service_door; then
3377 solaris_nscd_door_system_volatile=yes
3378 AC_MSG_RESULT([/system/volatile/name_service_door])
3379 AC_DEFINE([SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE], 1,
3380 [Define to 1 if nscd attaches to /system/volatile/name_service_door.])
3382 solaris_nscd_door_system_volatile=no
3383 AC_MSG_RESULT([/var/run/name_service_door])
3385 AM_CONDITIONAL(SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE, test x$solaris_nscd_door_system_volatile = xyes)
3388 # Solaris-specific check determining if the new gethrt() fasttrap is available.
3390 # New fasttrap (available on Solaris 11):
3391 # hrt_t *gethrt(void);
3393 # C-level symbol: SOLARIS_GETHRT_FASTTRAP
3394 # Automake-level symbol: SOLARIS_GETHRT_FASTTRAP
3396 AC_MSG_CHECKING([for the new `gethrt' fasttrap (Solaris-specific)])
3397 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3398 #include <sys/trap.h>
3402 solaris_gethrt_fasttrap=yes
3403 AC_MSG_RESULT([yes])
3404 AC_DEFINE([SOLARIS_GETHRT_FASTTRAP], 1,
3405 [Define to 1 if you have the new `gethrt' fasttrap.])
3407 solaris_gethrt_fasttrap=no
3410 AM_CONDITIONAL(SOLARIS_GETHRT_FASTTRAP, test x$solaris_gethrt_fasttrap = xyes)
3413 # Solaris-specific check determining if the new get_zone_offset() fasttrap
3416 # New fasttrap (available on Solaris 11):
3417 # zonehrtoffset_t *get_zone_offset(void);
3419 # C-level symbol: SOLARIS_GETZONEOFFSET_FASTTRAP
3420 # Automake-level symbol: SOLARIS_GETZONEOFFSET_FASTTRAP
3422 AC_MSG_CHECKING([for the new `get_zone_offset' fasttrap (Solaris-specific)])
3423 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3424 #include <sys/trap.h>
3426 return !T_GETZONEOFFSET;
3428 solaris_getzoneoffset_fasttrap=yes
3429 AC_MSG_RESULT([yes])
3430 AC_DEFINE([SOLARIS_GETZONEOFFSET_FASTTRAP], 1,
3431 [Define to 1 if you have the new `get_zone_offset' fasttrap.])
3433 solaris_getzoneoffset_fasttrap=no
3436 AM_CONDITIONAL(SOLARIS_GETZONEOFFSET_FASTTRAP, test x$solaris_getzoneoffset_fasttrap = xyes)
3439 # Solaris-specific check determining if the execve() syscall
3440 # takes fourth argument (flags) or not.
3442 # Old syscall (available on illumos):
3443 # int execve(const char *fname, const char **argv, const char **envp);
3445 # New syscall (available on Solaris):
3446 # int execve(uintptr_t file, const char **argv, const char **envp, int flags);
3448 # If the new syscall is present then it will fail with EINVAL (because flags
3449 # are invalid); if the old syscall is available then it will fail with ENOENT
3450 # (because the file could not be found).
3452 # C-level symbol: SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS
3453 # Automake-level symbol: SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS
3455 AC_MSG_CHECKING([if the `execve' syscall accepts flags (Solaris-specific)])
3456 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
3457 #include <sys/syscall.h>
3461 syscall(SYS_execve, "/no/existing/path", 0, 0, 0xdeadbeef, 0, 0);
3462 return !(errno == EINVAL);
3464 solaris_execve_syscall_takes_flags=yes
3465 AC_MSG_RESULT([yes])
3466 AC_DEFINE([SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS], 1,
3467 [Define to 1 if you have the new `execve' syscall which accepts flags.])
3469 solaris_execve_syscall_takes_flags=no
3472 AM_CONDITIONAL(SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS,
3473 test x$solaris_execve_syscall_takes_flags = xyes)
3476 # Solaris-specific check determining version of the repository cache protocol.
3477 # Every Solaris version uses a different one, ranging from 21 to current 25.
3478 # The check is very ugly, though.
3480 # C-level symbol: SOLARIS_REPCACHE_PROTOCOL_VERSION vv
3481 # Automake-level symbol: none
3483 AC_PATH_PROG(DIS_PATH, dis, false)
3484 if test "x$DIS_PATH" = "xfalse"; then
3485 AC_MSG_FAILURE([Object code disassembler (`dis') not found.])
3487 AC_CHECK_LIB(scf, scf_handle_bind, [], [
3488 AC_MSG_WARN([Function `scf_handle_bind' was not found in `libscf'.])
3489 AC_MSG_ERROR([Cannot determine version of the repository cache protocol.])
3492 AC_MSG_CHECKING([for version of the repository cache protocol (Solaris-specific)])
3493 if test "X$VGCONF_ARCH_PRI" = "Xamd64"; then
3494 libscf=/usr/lib/64/libscf.so.1
3496 libscf=/usr/lib/libscf.so.1
3498 if ! $DIS_PATH -F scf_handle_bind $libscf | grep -q 0x526570; then
3499 AC_MSG_WARN([Function `scf_handle_bind' does not contain repository cache protocol version.])
3500 AC_MSG_ERROR([Cannot determine version of the repository cache protocol.])
3502 hex=$( $DIS_PATH -F scf_handle_bind $libscf | sed -n 's/.*0x526570\(..\).*/\1/p' )
3503 if test -z "$hex"; then
3504 AC_MSG_WARN([Version of the repository cache protocol is empty?!])
3505 AC_MSG_ERROR([Cannot determine version of the repository cache protocol.])
3507 version=$( printf "%d\n" 0x$hex )
3508 AC_MSG_RESULT([$version])
3509 AC_DEFINE_UNQUOTED([SOLARIS_REPCACHE_PROTOCOL_VERSION], [$version],
3510 [Version number of the repository door cache protocol.])
3513 # Solaris-specific check determining if "sysstat" segment reservation type
3516 # New "sysstat" segment reservation (available on Solaris 12):
3517 # - program header type: PT_SUNW_SYSSTAT
3518 # - auxiliary vector entry: AT_SUN_SYSSTAT_ADDR
3520 # C-level symbol: SOLARIS_RESERVE_SYSSTAT_ADDR
3521 # Automake-level symbol: SOLARIS_RESERVE_SYSSTAT_ADDR
3523 AC_MSG_CHECKING([for the new `sysstat' segment reservation (Solaris-specific)])
3524 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3525 #include <sys/auxv.h>
3527 return !AT_SUN_SYSSTAT_ADDR;
3529 solaris_reserve_sysstat_addr=yes
3530 AC_MSG_RESULT([yes])
3531 AC_DEFINE([SOLARIS_RESERVE_SYSSTAT_ADDR], 1,
3532 [Define to 1 if you have the new `sysstat' segment reservation.])
3534 solaris_reserve_sysstat_addr=no
3537 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ADDR, test x$solaris_reserve_sysstat_addr = xyes)
3540 # Solaris-specific check determining if "sysstat_zone" segment reservation type
3543 # New "sysstat_zone" segment reservation (available on Solaris 12):
3544 # - program header type: PT_SUNW_SYSSTAT_ZONE
3545 # - auxiliary vector entry: AT_SUN_SYSSTAT_ZONE_ADDR
3547 # C-level symbol: SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR
3548 # Automake-level symbol: SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR
3550 AC_MSG_CHECKING([for the new `sysstat_zone' segment reservation (Solaris-specific)])
3551 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3552 #include <sys/auxv.h>
3554 return !AT_SUN_SYSSTAT_ZONE_ADDR;
3556 solaris_reserve_sysstat_zone_addr=yes
3557 AC_MSG_RESULT([yes])
3558 AC_DEFINE([SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR], 1,
3559 [Define to 1 if you have the new `sysstat_zone' segment reservation.])
3561 solaris_reserve_sysstat_zone_addr=no
3564 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR, test x$solaris_reserve_sysstat_zone_addr = xyes)
3567 # Solaris-specific check determining if the system_stats() syscall is available
3568 # (on newer Solaris).
3570 # C-level symbol: SOLARIS_SYSTEM_STATS_SYSCALL
3571 # Automake-level symbol: SOLARIS_SYSTEM_STATS_SYSCALL
3573 AC_MSG_CHECKING([for the `system_stats' syscall (Solaris-specific)])
3574 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3575 #include <sys/syscall.h>
3577 return !SYS_system_stats;
3579 solaris_system_stats_syscall=yes
3580 AC_MSG_RESULT([yes])
3581 AC_DEFINE([SOLARIS_SYSTEM_STATS_SYSCALL], 1,
3582 [Define to 1 if you have the `system_stats' syscall.])
3584 solaris_system_stats_syscall=no
3587 AM_CONDITIONAL(SOLARIS_SYSTEM_STATS_SYSCALL, test x$solaris_system_stats_syscall = xyes)
3590 # Solaris-specific check determining if fpregset_t defines struct _fpchip_state
3591 # (on newer illumos) or struct fpchip_state (Solaris, older illumos).
3593 # C-level symbol: SOLARIS_FPCHIP_STATE_TAKES_UNDERSCORE
3594 # Automake-level symbol: none
3596 AC_CHECK_TYPE([struct _fpchip_state],
3597 [solaris_fpchip_state_takes_underscore=yes],
3598 [solaris_fpchip_state_takes_underscore=no],
3599 [[#include <sys/regset.h>]])
3600 if test "$solaris_fpchip_state_takes_underscore" = "yes"; then
3601 AC_DEFINE(SOLARIS_FPCHIP_STATE_TAKES_UNDERSCORE, 1,
3602 [Define to 1 if fpregset_t defines struct _fpchip_state])
3606 # Solaris-specific check determining if schedctl page shared between kernel
3607 # and userspace program is executable (illumos, older Solaris) or not (newer
3610 # C-level symbol: SOLARIS_SCHEDCTL_PAGE_EXEC
3611 # Automake-level symbol: none
3613 AC_MSG_CHECKING([if schedctl page is executable (Solaris-specific)])
3614 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
3618 #include <schedctl.h>
3622 schedctl_t *scp = schedctl_init();
3626 int fd = open("/proc/self/map", O_RDONLY);
3631 while ((rd = read(fd, &map, sizeof(map))) == sizeof(map)) {
3632 if (map.pr_vaddr == ((uintptr_t) scp & PAGEMASK)) {
3633 fprintf(stderr, "%#lx [%zu] %s\n", map.pr_vaddr, map.pr_size,
3634 (map.pr_mflags & MA_EXEC) ? "x" : "no-x");
3635 return (map.pr_mflags & MA_EXEC);
3641 solaris_schedctl_page_exec=no
3644 solaris_schedctl_page_exec=yes
3645 AC_MSG_RESULT([yes])
3646 AC_DEFINE([SOLARIS_SCHEDCTL_PAGE_EXEC], 1,
3647 [Define to 1 if you have the schedctl page executable.])
3651 # Solaris-specific check determining if PT_SUNWDTRACE program header provides
3652 # scratch space for DTrace fasttrap provider (illumos, older Solaris) or just
3653 # an initial thread pointer for libc (newer Solaris).
3655 # C-level symbol: SOLARIS_PT_SUNDWTRACE_THRP
3656 # Automake-level symbol: none
3658 AC_MSG_CHECKING([if PT_SUNWDTRACE serves for initial thread pointer (Solaris-specific)])
3659 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
3660 #include <sys/fasttrap_isa.h>
3662 return !FT_SCRATCHSIZE;
3664 solaris_pt_sunwdtrace_thrp=yes
3665 AC_MSG_RESULT([yes])
3666 AC_DEFINE([SOLARIS_PT_SUNDWTRACE_THRP], 1,
3667 [Define to 1 if PT_SUNWDTRACE program header provides just an initial thread pointer for libc.])
3669 solaris_pt_sunwdtrace_thrp=no
3674 AM_CONDITIONAL(SOLARIS_SUN_STUDIO_AS, false)
3675 AM_CONDITIONAL(SOLARIS_XPG_SYMBOLS_PRESENT, false)
3676 AM_CONDITIONAL(SOLARIS_PROC_CMDLINE, false)
3677 AM_CONDITIONAL(SOLARIS_OLD_SYSCALLS, false)
3678 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL, false)
3679 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID, false)
3680 AM_CONDITIONAL(SOLARIS_LWP_NAME_SYSCALL, false)
3681 AM_CONDITIONAL(SOLARIS_GETRANDOM_SYSCALL, false)
3682 AM_CONDITIONAL(SOLARIS_ZONE_DEFUNCT, false)
3683 AM_CONDITIONAL(SOLARIS_AUDITON_STAT, false)
3684 AM_CONDITIONAL(SOLARIS_SHM_NEW, false)
3685 AM_CONDITIONAL(SOLARIS_PRXREGSET_T, false)
3686 AM_CONDITIONAL(SOLARIS_FREALPATHAT_SYSCALL, false)
3687 AM_CONDITIONAL(SOLARIS_UUIDSYS_SYSCALL, false)
3688 AM_CONDITIONAL(SOLARIS_TNDB_GET_TNIP, false)
3689 AM_CONDITIONAL(SOLARIS_TSOL_CLEARANCE, false)
3690 AM_CONDITIONAL(SOLARIS_PSET_GET_NAME, false)
3691 AM_CONDITIONAL(SOLARIS_UTIMESYS_SYSCALL, false)
3692 AM_CONDITIONAL(SOLARIS_UTIMENSAT_SYSCALL, false)
3693 AM_CONDITIONAL(SOLARIS_SPAWN_SYSCALL, false)
3694 AM_CONDITIONAL(SOLARIS_MODCTL_MODNVL, false)
3695 AM_CONDITIONAL(SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE, false)
3696 AM_CONDITIONAL(SOLARIS_GETHRT_FASTTRAP, false)
3697 AM_CONDITIONAL(SOLARIS_GETZONEOFFSET_FASTTRAP, false)
3698 AM_CONDITIONAL(SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS, false)
3699 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ADDR, false)
3700 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR, false)
3701 AM_CONDITIONAL(SOLARIS_SYSTEM_STATS_SYSCALL, false)
3702 fi # test "$VGCONF_OS" = "solaris"
3705 #----------------------------------------------------------------------------
3706 # Checks for C header files.
3707 #----------------------------------------------------------------------------
3710 AC_CHECK_HEADERS([ \
3728 # Verify whether the <linux/futex.h> header is usable.
3729 AC_MSG_CHECKING([if <linux/futex.h> is usable])
3731 save_CFLAGS="$CFLAGS"
3732 CFLAGS="$CFLAGS -D__user="
3733 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3734 #include <linux/futex.h>
3738 ac_have_usable_linux_futex_h=yes
3739 AC_DEFINE([HAVE_USABLE_LINUX_FUTEX_H], 1,
3740 [Define to 1 if you have a usable <linux/futex.h> header file.])
3741 AC_MSG_RESULT([yes])
3743 ac_have_usable_linux_futex_h=no
3746 CFLAGS="$save_CFLAGS"
3749 #----------------------------------------------------------------------------
3750 # Checks for typedefs, structures, and compiler characteristics.
3751 #----------------------------------------------------------------------------
3758 #----------------------------------------------------------------------------
3759 # Checks for library functions.
3760 #----------------------------------------------------------------------------
3764 AC_CHECK_LIB([pthread], [pthread_create])
3765 AC_CHECK_LIB([rt], [clock_gettime])
3778 pthread_barrier_init \
3779 pthread_condattr_setclock \
3780 pthread_mutex_timedlock \
3781 pthread_rwlock_timedrdlock \
3782 pthread_rwlock_timedwrlock \
3785 pthread_setname_np \
3801 # AC_CHECK_LIB adds any library found to the variable LIBS, and links these
3802 # libraries with any shared object and/or executable. This is NOT what we
3803 # want for e.g. vgpreload_core-x86-linux.so
3806 AM_CONDITIONAL([HAVE_PTHREAD_BARRIER],
3807 [test x$ac_cv_func_pthread_barrier_init = xyes])
3808 AM_CONDITIONAL([HAVE_PTHREAD_MUTEX_TIMEDLOCK],
3809 [test x$ac_cv_func_pthread_mutex_timedlock = xyes])
3810 AM_CONDITIONAL([HAVE_PTHREAD_SPINLOCK],
3811 [test x$ac_cv_func_pthread_spin_lock = xyes])
3812 AM_CONDITIONAL([HAVE_PTHREAD_SETNAME_NP],
3813 [test x$ac_cv_func_pthread_setname_np = xyes])
3815 if test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
3816 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX ; then
3817 AC_DEFINE([DISABLE_PTHREAD_SPINLOCK_INTERCEPT], 1,
3818 [Disable intercept pthread_spin_lock() on MIPS32 and MIPS64.])
3821 #----------------------------------------------------------------------------
3823 #----------------------------------------------------------------------------
3824 # Do we have a useable MPI setup on the primary and/or secondary targets?
3825 # On Linux, by default, assumes mpicc and -m32/-m64
3826 # Note: this is a kludge in that it assumes the specified mpicc
3827 # understands -m32/-m64 regardless of what is specified using
3829 AC_PATH_PROG([MPI_CC], [mpicc], [mpicc],
3830 [$PATH:/usr/lib/openmpi/bin:/usr/lib64/openmpi/bin])
3833 if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
3834 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
3835 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
3836 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
3837 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \
3838 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS ; then
3839 mflag_primary=$FLAG_M32
3840 elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
3841 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
3842 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX \
3843 -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX ; then
3844 mflag_primary=$FLAG_M64
3845 elif test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN ; then
3846 mflag_primary="$FLAG_M32 -arch i386"
3847 elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN ; then
3848 mflag_primary="$FLAG_M64 -arch x86_64"
3852 if test x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
3853 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX \
3854 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_SOLARIS ; then
3855 mflag_secondary=$FLAG_M32
3856 elif test x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN ; then
3857 mflag_secondary="$FLAG_M32 -arch i386"
3862 [ --with-mpicc= Specify name of MPI2-ised C compiler],
3867 ## We AM_COND_IF here instead of automake "if" in mpi/Makefile.am so that we can
3868 ## use these values in the check for a functioning mpicc.
3870 ## We leave the MPI_FLAG_M3264_ logic in mpi/Makefile.am and assume that
3871 ## mflag_primary/mflag_secondary are sufficient approximations of that behavior
3872 AM_COND_IF([VGCONF_OS_IS_LINUX],
3873 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic"
3874 LDFLAGS_MPI="-fpic -shared"])
3875 AM_COND_IF([VGCONF_OS_IS_DARWIN],
3876 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -dynamic"
3877 LDFLAGS_MPI="-dynamic -dynamiclib -all_load"])
3878 AM_COND_IF([VGCONF_OS_IS_SOLARIS],
3879 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic"
3880 LDFLAGS_MPI="-fpic -shared"])
3882 AC_SUBST([CFLAGS_MPI])
3883 AC_SUBST([LDFLAGS_MPI])
3886 ## See if MPI_CC works for the primary target
3888 AC_MSG_CHECKING([primary target for usable MPI2-compliant C compiler and mpi.h])
3890 saved_CFLAGS=$CFLAGS
3892 CFLAGS="$CFLAGS_MPI $mflag_primary"
3893 saved_LDFLAGS="$LDFLAGS"
3894 LDFLAGS="$LDFLAGS_MPI $mflag_primary"
3895 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3899 int ni, na, nd, comb;
3900 int r = MPI_Init(NULL,NULL);
3901 r |= MPI_Type_get_envelope( MPI_INT, &ni, &na, &nd, &comb );
3902 r |= MPI_Finalize();
3905 ac_have_mpi2_pri=yes
3906 AC_MSG_RESULT([yes, $MPI_CC])
3912 CFLAGS=$saved_CFLAGS
3913 LDFLAGS="$saved_LDFLAGS"
3914 AM_CONDITIONAL(BUILD_MPIWRAP_PRI, test x$ac_have_mpi2_pri = xyes)
3916 ## See if MPI_CC works for the secondary target. Complication: what if
3917 ## there is no secondary target? We need this to then fail.
3918 ## Kludge this by making MPI_CC something which will surely fail in
3921 AC_MSG_CHECKING([secondary target for usable MPI2-compliant C compiler and mpi.h])
3923 saved_CFLAGS=$CFLAGS
3924 saved_LDFLAGS="$LDFLAGS"
3925 LDFLAGS="$LDFLAGS_MPI $mflag_secondary"
3926 if test x$VGCONF_PLATFORM_SEC_CAPS = x ; then
3927 CC="$MPI_CC this will surely fail"
3931 CFLAGS="$CFLAGS_MPI $mflag_secondary"
3932 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3936 int ni, na, nd, comb;
3937 int r = MPI_Init(NULL,NULL);
3938 r |= MPI_Type_get_envelope( MPI_INT, &ni, &na, &nd, &comb );
3939 r |= MPI_Finalize();
3942 ac_have_mpi2_sec=yes
3943 AC_MSG_RESULT([yes, $MPI_CC])
3949 CFLAGS=$saved_CFLAGS
3950 LDFLAGS="$saved_LDFLAGS"
3951 AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec = xyes)
3954 #----------------------------------------------------------------------------
3955 # Other library checks
3956 #----------------------------------------------------------------------------
3957 # There now follow some tests for Boost, and OpenMP. These
3958 # tests are present because Drd has some regression tests that use
3959 # these packages. All regression test programs all compiled only
3960 # for the primary target. And so it is important that the configure
3961 # checks that follow, use the correct -m32 or -m64 flag for the
3962 # primary target (called $mflag_primary). Otherwise, we can end up
3963 # in a situation (eg) where, on amd64-linux, the test for Boost checks
3964 # for usable 64-bit Boost facilities, but because we are doing a 32-bit
3965 # only build (meaning, the primary target is x86-linux), the build
3966 # of the regtest programs that use Boost fails, because they are
3967 # build as 32-bit (IN THIS EXAMPLE).
3969 # Hence: ALWAYS USE $mflag_primary FOR CONFIGURE TESTS FOR FACILITIES
3970 # NEEDED BY THE REGRESSION TEST PROGRAMS.
3973 # Check whether the boost library 1.35 or later has been installed.
3974 # The Boost.Threads library has undergone a major rewrite in version 1.35.0.
3976 AC_MSG_CHECKING([for boost])
3979 safe_CXXFLAGS=$CXXFLAGS
3980 CXXFLAGS="$mflag_primary"
3982 LIBS="-lboost_thread-mt -lboost_system-mt $LIBS"
3984 AC_LINK_IFELSE([AC_LANG_SOURCE([
3985 #include <boost/thread.hpp>
3986 static void thread_func(void)
3988 int main(int argc, char** argv)
3990 boost::thread t(thread_func);
3995 ac_have_boost_1_35=yes
3996 AC_SUBST([BOOST_CFLAGS], [])
3997 AC_SUBST([BOOST_LIBS], ["-lboost_thread-mt -lboost_system-mt"])
3998 AC_MSG_RESULT([yes])
4000 ac_have_boost_1_35=no
4005 CXXFLAGS=$safe_CXXFLAGS
4008 AM_CONDITIONAL([HAVE_BOOST_1_35], [test x$ac_have_boost_1_35 = xyes])
4011 # does this compiler support -fopenmp, does it have the include file
4012 # <omp.h> and does it have libgomp ?
4014 AC_MSG_CHECKING([for OpenMP])
4017 CFLAGS="-fopenmp $mflag_primary -Werror"
4019 AC_LINK_IFELSE([AC_LANG_SOURCE([
4021 int main(int argc, char** argv)
4029 AC_MSG_RESULT([yes])
4036 AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes])
4039 # Check for __builtin_popcount
4040 AC_MSG_CHECKING([for __builtin_popcount()])
4041 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4043 __builtin_popcount(2);
4046 AC_MSG_RESULT([yes])
4047 AC_DEFINE([HAVE_BUILTIN_POPCOUT], 1,
4048 [Define to 1 if compiler provides __builtin_popcount().])
4053 # Check for __builtin_clz
4054 AC_MSG_CHECKING([for __builtin_clz()])
4055 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4060 AC_MSG_RESULT([yes])
4061 AC_DEFINE([HAVE_BUILTIN_CLZ], 1,
4062 [Define to 1 if compiler provides __builtin_clz().])
4067 # Check for __builtin_ctz
4068 AC_MSG_CHECKING([for __builtin_ctz()])
4069 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4074 AC_MSG_RESULT([yes])
4075 AC_DEFINE([HAVE_BUILTIN_CTZ], 1,
4076 [Define to 1 if compiler provides __builtin_ctz().])
4081 # does this compiler have built-in functions for atomic memory access for the
4083 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the primary target])
4086 CFLAGS="$mflag_primary"
4088 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
4090 return (__sync_bool_compare_and_swap(&variable, 1, 2)
4091 && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
4093 ac_have_builtin_atomic_primary=yes
4094 AC_MSG_RESULT([yes])
4095 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])
4097 ac_have_builtin_atomic_primary=no
4103 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC],
4104 [test x$ac_have_builtin_atomic_primary = xyes])
4107 # does this compiler have built-in functions for atomic memory access for the
4108 # secondary target ?
4110 if test x$VGCONF_PLATFORM_SEC_CAPS != x; then
4112 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the secondary target])
4115 CFLAGS="$mflag_secondary"
4117 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
4119 return (__sync_add_and_fetch(&variable, 1) ? 1 : 0)
4121 ac_have_builtin_atomic_secondary=yes
4122 AC_MSG_RESULT([yes])
4124 ac_have_builtin_atomic_secondary=no
4132 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_SECONDARY],
4133 [test x$ac_have_builtin_atomic_secondary = xyes])
4135 # does this compiler have built-in functions for atomic memory access on
4136 # 64-bit integers for all targets ?
4138 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch on uint64_t for all targets])
4140 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4143 uint64_t variable = 1;
4144 return __sync_add_and_fetch(&variable, 1)
4146 ac_have_builtin_atomic64_primary=yes
4148 ac_have_builtin_atomic64_primary=no
4151 if test x$VGCONF_PLATFORM_SEC_CAPS != x; then
4154 CFLAGS="$mflag_secondary"
4156 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4159 uint64_t variable = 1;
4160 return __sync_add_and_fetch(&variable, 1)
4162 ac_have_builtin_atomic64_secondary=yes
4164 ac_have_builtin_atomic64_secondary=no
4171 if test x$ac_have_builtin_atomic64_primary = xyes && \
4172 test x$VGCONF_PLATFORM_SEC_CAPS = x \
4173 -o x$ac_have_builtin_atomic64_secondary = xyes; then
4174 AC_MSG_RESULT([yes])
4175 ac_have_builtin_atomic64=yes
4178 ac_have_builtin_atomic64=no
4181 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC64],
4182 [test x$ac_have_builtin_atomic64 = xyes])
4185 # does g++ have built-in functions for atomic memory access ?
4186 AC_MSG_CHECKING([if g++ supports __sync_add_and_fetch])
4188 safe_CXXFLAGS=$CXXFLAGS
4189 CXXFLAGS="$mflag_primary"
4192 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
4194 return (__sync_bool_compare_and_swap(&variable, 1, 2)
4195 && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
4197 ac_have_builtin_atomic_cxx=yes
4198 AC_MSG_RESULT([yes])
4199 AC_DEFINE(HAVE_BUILTIN_ATOMIC_CXX, 1, [Define to 1 if g++ supports __sync_bool_compare_and_swap() and __sync_add_and_fetch()])
4201 ac_have_builtin_atomic_cxx=no
4206 CXXFLAGS=$safe_CXXFLAGS
4208 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_CXX], [test x$ac_have_builtin_atomic_cxx = xyes])
4211 if test x$ac_have_usable_linux_futex_h = xyes \
4212 -a x$ac_have_builtin_atomic_primary = xyes; then
4213 ac_enable_linux_ticket_lock_primary=yes
4215 AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_PRIMARY],
4216 [test x$ac_enable_linux_ticket_lock_primary = xyes])
4218 if test x$VGCONF_PLATFORM_SEC_CAPS != x \
4219 -a x$ac_have_usable_linux_futex_h = xyes \
4220 -a x$ac_have_builtin_atomic_secondary = xyes; then
4221 ac_enable_linux_ticket_lock_secondary=yes
4223 AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_SECONDARY],
4224 [test x$ac_enable_linux_ticket_lock_secondary = xyes])
4227 # does libstdc++ support annotating shared pointers ?
4228 AC_MSG_CHECKING([if libstdc++ supports annotating shared pointers])
4230 safe_CXXFLAGS=$CXXFLAGS
4231 CXXFLAGS="-std=c++0x"
4234 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4237 std::shared_ptr<int> p
4239 ac_have_shared_ptr=yes
4241 ac_have_shared_ptr=no
4243 if test x$ac_have_shared_ptr = xyes; then
4244 # If compilation of the program below fails because of a syntax error
4245 # triggered by substituting one of the annotation macros then that
4246 # means that libstdc++ supports these macros.
4247 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4248 #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(a) (a)----
4249 #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(a) (a)----
4252 std::shared_ptr<int> p
4254 ac_have_shared_pointer_annotation=no
4257 ac_have_shared_pointer_annotation=yes
4258 AC_MSG_RESULT([yes])
4259 AC_DEFINE(HAVE_SHARED_POINTER_ANNOTATION, 1,
4260 [Define to 1 if libstd++ supports annotating shared pointers])
4263 ac_have_shared_pointer_annotation=no
4268 CXXFLAGS=$safe_CXXFLAGS
4270 AM_CONDITIONAL([HAVE_SHARED_POINTER_ANNOTATION],
4271 [test x$ac_have_shared_pointer_annotation = xyes])
4274 #----------------------------------------------------------------------------
4275 # Ok. We're done checking.
4276 #----------------------------------------------------------------------------
4278 # Nb: VEX/Makefile is generated from Makefile.vex.in.
4281 VEX/Makefile:Makefile.vex.in
4290 gdbserver_tests/Makefile
4291 gdbserver_tests/solaris/Makefile
4297 memcheck/tests/Makefile
4298 memcheck/tests/common/Makefile
4299 memcheck/tests/amd64/Makefile
4300 memcheck/tests/x86/Makefile
4301 memcheck/tests/linux/Makefile
4302 memcheck/tests/darwin/Makefile
4303 memcheck/tests/solaris/Makefile
4304 memcheck/tests/amd64-linux/Makefile
4305 memcheck/tests/arm64-linux/Makefile
4306 memcheck/tests/x86-linux/Makefile
4307 memcheck/tests/amd64-solaris/Makefile
4308 memcheck/tests/x86-solaris/Makefile
4309 memcheck/tests/ppc32/Makefile
4310 memcheck/tests/ppc64/Makefile
4311 memcheck/tests/s390x/Makefile
4312 memcheck/tests/vbit-test/Makefile
4314 cachegrind/tests/Makefile
4315 cachegrind/tests/x86/Makefile
4316 cachegrind/cg_annotate
4319 callgrind/callgrind_annotate
4320 callgrind/callgrind_control
4321 callgrind/tests/Makefile
4323 helgrind/tests/Makefile
4325 massif/tests/Makefile
4328 lackey/tests/Makefile
4331 none/tests/scripts/Makefile
4332 none/tests/amd64/Makefile
4333 none/tests/ppc32/Makefile
4334 none/tests/ppc64/Makefile
4335 none/tests/x86/Makefile
4336 none/tests/arm/Makefile
4337 none/tests/arm64/Makefile
4338 none/tests/s390x/Makefile
4339 none/tests/mips32/Makefile
4340 none/tests/mips64/Makefile
4341 none/tests/tilegx/Makefile
4342 none/tests/linux/Makefile
4343 none/tests/darwin/Makefile
4344 none/tests/solaris/Makefile
4345 none/tests/amd64-linux/Makefile
4346 none/tests/x86-linux/Makefile
4347 none/tests/amd64-darwin/Makefile
4348 none/tests/x86-darwin/Makefile
4349 none/tests/amd64-solaris/Makefile
4350 none/tests/x86-solaris/Makefile
4351 exp-sgcheck/Makefile
4352 exp-sgcheck/tests/Makefile
4354 drd/scripts/download-and-build-splash2
4357 exp-bbv/tests/Makefile
4358 exp-bbv/tests/x86/Makefile
4359 exp-bbv/tests/x86-linux/Makefile
4360 exp-bbv/tests/amd64-linux/Makefile
4361 exp-bbv/tests/ppc32-linux/Makefile
4362 exp-bbv/tests/arm-linux/Makefile
4364 exp-dhat/tests/Makefile
4368 AC_CONFIG_FILES([coregrind/link_tool_exe_linux],
4369 [chmod +x coregrind/link_tool_exe_linux])
4370 AC_CONFIG_FILES([coregrind/link_tool_exe_darwin],
4371 [chmod +x coregrind/link_tool_exe_darwin])
4372 AC_CONFIG_FILES([coregrind/link_tool_exe_solaris],
4373 [chmod +x coregrind/link_tool_exe_solaris])
4378 Maximum build arch: ${ARCH_MAX}
4379 Primary build arch: ${VGCONF_ARCH_PRI}
4380 Secondary build arch: ${VGCONF_ARCH_SEC}
4381 Build OS: ${VGCONF_OS}
4382 Primary build target: ${VGCONF_PLATFORM_PRI_CAPS}
4383 Secondary build target: ${VGCONF_PLATFORM_SEC_CAPS}
4384 Platform variant: ${VGCONF_PLATVARIANT}
4385 Primary -DVGPV string: -DVGPV_${VGCONF_ARCH_PRI}_${VGCONF_OS}_${VGCONF_PLATVARIANT}=1
4386 Default supp files: ${DEFAULT_SUPP}