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.17.0.GIT],[valgrind-users@lists.sourceforge.net])
12 AC_CONFIG_SRCDIR(coregrind/m_main.c)
13 AC_CONFIG_HEADERS([config.h])
14 AM_INIT_AUTOMAKE([foreign dist-bzip2 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 # Set LTO_RANLIB variable to an lto enabled ranlib
49 if test "x$LTO_RANLIB" = "x"; then
50 AC_PATH_PROGS([LTO_RANLIB], [gcc-ranlib])
52 AC_ARG_VAR([LTO_RANLIB],[Library indexer command for link time optimisation])
54 # provide a very basic definition for AC_PROG_SED if it's not provided by
55 # autoconf (as e.g. in autoconf 2.59).
56 m4_ifndef([AC_PROG_SED],
57 [AC_DEFUN([AC_PROG_SED],
59 AC_CHECK_PROGS([SED],[gsed sed])])])
62 # If no AR variable was specified, look up the name of the archiver. Otherwise
63 # do not touch the AR variable.
64 if test "x$AR" = "x"; then
65 AC_PATH_PROGS([AR], [`echo $LD | $SED 's/ld$/ar/'` "ar"], [ar])
67 AC_ARG_VAR([AR],[Archiver command])
69 # same for LTO_AR variable for lto enabled archiver
70 if test "x$LTO_AR" = "x"; then
71 AC_PATH_PROGS([LTO_AR], [gcc-ar])
73 AC_ARG_VAR([LTO_AR],[Archiver command for link time optimisation])
76 # Check for the compiler support
77 if test "${GCC}" != "yes" ; then
78 AC_MSG_ERROR([Valgrind relies on GCC to be compiled])
81 # figure out where perl lives
82 AC_PATH_PROG(PERL, perl)
84 # figure out where gdb lives
85 AC_PATH_PROG(GDB, gdb, "/no/gdb/was/found/at/configure/time")
86 AC_DEFINE_UNQUOTED(GDB_PATH, "$GDB", [path to GDB])
88 # some older automake's don't have it so try something on our own
89 ifdef([AM_PROG_AS],[AM_PROG_AS],
99 # Check if 'diff' supports -u (universal diffs) and use it if possible.
101 AC_MSG_CHECKING([for diff -u])
104 # Comparing two identical files results in 0.
105 tmpfile="tmp-xxx-yyy-zzz"
107 if diff -u $tmpfile $tmpfile ; then
116 # Make sure we can compile in C99 mode.
118 if test "$ac_cv_prog_cc_c99" == "no"; then
119 AC_MSG_ERROR([Valgrind relies on a C compiler supporting C99])
122 # We don't want gcc < 3.0
123 AC_MSG_CHECKING([for a supported version of gcc])
125 # Obtain the compiler version.
127 # A few examples of how the ${CC} --version output looks like:
129 # ######## gcc variants ########
130 # Arch Linux: i686-pc-linux-gnu-gcc (GCC) 4.6.2
131 # Debian Linux: gcc (Debian 4.3.2-1.1) 4.3.2
132 # openSUSE: gcc (SUSE Linux) 4.5.1 20101208 [gcc-4_5-branch revision 167585]
133 # Exherbo Linux: x86_64-pc-linux-gnu-gcc (Exherbo gcc-4.6.2) 4.6.2
134 # MontaVista Linux for ARM: arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q1-203) 4.3.3
135 # OS/X 10.6: i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
136 # 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)
138 # ######## clang variants ########
139 # Clang: clang version 2.9 (tags/RELEASE_29/final)
140 # Apple clang: Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
141 # FreeBSD clang: FreeBSD clang version 3.1 (branches/release_31 156863) 20120523
143 # ######## Apple LLVM variants ########
144 # Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
145 # Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
148 if test "x`${CC} --version | $SED -n -e 's/.*\Apple \(LLVM\) version.*clang.*/\1/p'`" = "xLLVM" ;
151 gcc_version=`${CC} --version | $SED -n -e 's/.*LLVM version \([0-9.]*\).*$/\1/p'`
152 elif test "x`${CC} --version | $SED -n -e 's/.*\(clang\) version.*/\1/p'`" = "xclang" ;
155 # Don't use -dumpversion with clang: it will always produce "4.2.1".
156 gcc_version=`${CC} --version | $SED -n -e 's/.*clang version \([0-9.]*\).*$/\1/p'`
157 elif test "x`${CC} --version | $SED -n -e 's/icc.*\(ICC\).*/\1/p'`" = "xICC" ;
160 gcc_version=`${CC} -dumpversion 2>/dev/null`
163 gcc_version=`${CC} -dumpversion 2>/dev/null`
164 if test "x$gcc_version" = x; then
165 gcc_version=`${CC} --version | $SED -n -e 's/[^ ]*gcc[^ ]* ([^)]*) \([0-9.]*\).*$/\1/p'`
169 AM_CONDITIONAL(COMPILER_IS_CLANG, test $is_clang = clang -o $is_clang = applellvm)
170 AM_CONDITIONAL(COMPILER_IS_ICC, test $is_clang = icc)
172 # Note: m4 arguments are quoted with [ and ] so square brackets in shell
173 # statements have to be quoted.
174 case "${is_clang}-${gcc_version}" in
175 applellvm-5.1|applellvm-[[6-9]].*|applellvm-[[1-9][0-9]]*)
176 AC_MSG_RESULT([ok (Apple LLVM version ${gcc_version})])
179 AC_MSG_RESULT([ok (ICC version ${gcc_version})])
181 notclang-[[3-9]]|notclang-[[3-9]].*|notclang-[[1-9][0-9]]*)
182 AC_MSG_RESULT([ok (${gcc_version})])
184 clang-2.9|clang-[[3-9]].*|clang-[[1-9][0-9]]*)
185 AC_MSG_RESULT([ok (clang-${gcc_version})])
188 AC_MSG_RESULT([no (${is_clang}-${gcc_version})])
189 AC_MSG_ERROR([please use gcc >= 3.0 or clang >= 2.9 or icc >= 13.0 or Apple LLVM >= 5.1])
193 #----------------------------------------------------------------------------
194 # Arch/OS/platform tests.
195 #----------------------------------------------------------------------------
196 # We create a number of arch/OS/platform-related variables. We prefix them
197 # all with "VGCONF_" which indicates that they are defined at
198 # configure-time, and distinguishes them from the VGA_*/VGO_*/VGP_*
199 # variables used when compiling C files.
203 AC_MSG_CHECKING([for a supported CPU])
205 # ARCH_MAX reflects the most that this CPU can do: for example if it
206 # is a 64-bit capable PowerPC, then it must be set to ppc64 and not ppc32.
207 # Ditto for amd64. It is used for more configuration below, but is not used
210 # Power PC returns powerpc for Big Endian. This was not changed when Little
211 # Endian support was added to the 64-bit architecture. The 64-bit Little
212 # Endian systems explicitly state le in the host_cpu. For clarity in the
213 # Valgrind code, the ARCH_MAX name will state LE or BE for the endianness of
214 # the 64-bit system. Big Endian is the only mode supported on 32-bit Power PC.
215 # The abreviation PPC or ppc refers to 32-bit and 64-bit systems with either
216 # Endianness. The name PPC64 or ppc64 to 64-bit systems of either Endianness.
217 # The names ppc64be or PPC64BE refer to only 64-bit systems that are Big
218 # Endian. Similarly, ppc64le or PPC64LE refer to only 64-bit systems that are
221 case "${host_cpu}" in
223 AC_MSG_RESULT([ok (${host_cpu})])
228 AC_MSG_RESULT([ok (${host_cpu})])
233 # this only referrs to 64-bit Big Endian
234 AC_MSG_RESULT([ok (${host_cpu})])
239 # this only referrs to 64-bit Little Endian
240 AC_MSG_RESULT([ok (${host_cpu})])
245 # On Linux this means only a 32-bit capable CPU.
246 AC_MSG_RESULT([ok (${host_cpu})])
251 AC_MSG_RESULT([ok (${host_cpu})])
256 AC_MSG_RESULT([ok (${host_cpu})])
261 AC_MSG_RESULT([ok (${host_cpu})])
266 AC_MSG_RESULT([ok (${host_cpu})])
271 AC_MSG_RESULT([ok (${host_cpu})])
276 AC_MSG_RESULT([ok (${host_cpu})])
281 AC_MSG_RESULT([ok (${host_cpu})])
286 AC_MSG_RESULT([ok (${host_cpu})])
290 AC_MSG_RESULT([ok (${host_cpu})])
295 AC_MSG_RESULT([no (${host_cpu})])
296 AC_MSG_ERROR([Unsupported host architecture. Sorry])
300 #----------------------------------------------------------------------------
302 # Sometimes it's convenient to subvert the bi-arch build system and
303 # just have a single build even though the underlying platform is
304 # capable of both. Hence handle --enable-only64bit and
305 # --enable-only32bit. Complain if both are issued :-)
306 # [Actually, if either of these options are used, I think both get built,
307 # but only one gets installed. So if you use an in-place build, both can be
310 # Check if a 64-bit only build has been requested
311 AC_CACHE_CHECK([for a 64-bit only build], vg_cv_only64bit,
312 [AC_ARG_ENABLE(only64bit,
313 [ --enable-only64bit do a 64-bit only build],
314 [vg_cv_only64bit=$enableval],
315 [vg_cv_only64bit=no])])
317 # Check if a 32-bit only build has been requested
318 AC_CACHE_CHECK([for a 32-bit only build], vg_cv_only32bit,
319 [AC_ARG_ENABLE(only32bit,
320 [ --enable-only32bit do a 32-bit only build],
321 [vg_cv_only32bit=$enableval],
322 [vg_cv_only32bit=no])])
325 if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
327 [Nonsensical: both --enable-only64bit and --enable-only32bit.])
330 #----------------------------------------------------------------------------
332 # VGCONF_OS is the primary build OS, eg. "linux". It is passed in to
333 # compilation of many C files via -VGO_$(VGCONF_OS) and
334 # -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS).
335 AC_MSG_CHECKING([for a supported OS])
342 AC_MSG_RESULT([ok (${host_os})])
345 # Ok, this is linux. Check the kernel version
346 AC_MSG_CHECKING([for the kernel version])
351 0.*|1.*|2.0.*|2.1.*|2.2.*|2.3.*|2.4.*|2.5.*)
352 AC_MSG_RESULT([unsupported (${kernel})])
353 AC_MSG_ERROR([Valgrind needs a Linux kernel >= 2.6])
357 AC_MSG_RESULT([2.6 or later (${kernel})])
364 AC_MSG_RESULT([ok (${host_os})])
366 AC_DEFINE([DARWIN_10_5], 100500, [DARWIN_VERS value for Mac OS X 10.5])
367 AC_DEFINE([DARWIN_10_6], 100600, [DARWIN_VERS value for Mac OS X 10.6])
368 AC_DEFINE([DARWIN_10_7], 100700, [DARWIN_VERS value for Mac OS X 10.7])
369 AC_DEFINE([DARWIN_10_8], 100800, [DARWIN_VERS value for Mac OS X 10.8])
370 AC_DEFINE([DARWIN_10_9], 100900, [DARWIN_VERS value for Mac OS X 10.9])
371 AC_DEFINE([DARWIN_10_10], 101000, [DARWIN_VERS value for Mac OS X 10.10])
372 AC_DEFINE([DARWIN_10_11], 101100, [DARWIN_VERS value for Mac OS X 10.11])
373 AC_DEFINE([DARWIN_10_12], 101200, [DARWIN_VERS value for macOS 10.12])
374 AC_DEFINE([DARWIN_10_13], 101300, [DARWIN_VERS value for macOS 10.13])
376 AC_MSG_CHECKING([for the kernel version])
379 # Nb: for Darwin we set DEFAULT_SUPP here. That's because Darwin
380 # has only one relevant version, the OS version. The `uname` check
381 # is a good way to get that version (i.e. "Darwin 9.6.0" is Mac OS
382 # X 10.5.6, and "Darwin 10.x" is Mac OS X 10.6.x Snow Leopard,
383 # and possibly "Darwin 11.x" is Mac OS X 10.7.x Lion),
384 # and we don't know of an macros similar to __GLIBC__ to get that info.
386 # XXX: `uname -r` won't do the right thing for cross-compiles, but
387 # that's not a problem yet.
389 # jseward 21 Sept 2011: I seriously doubt whether V 3.7.0 will work
390 # on OS X 10.5.x; I haven't tested yet, and only plan to test 3.7.0
391 # on 10.6.8 and 10.7.1. Although tempted to delete the configure
392 # time support for 10.5 (the 9.* pattern just below), I'll leave it
393 # in for now, just in case anybody wants to give it a try. But I'm
394 # assuming that 3.7.0 is a Snow Leopard and Lion-only release.
397 AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard])
398 AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version])
399 DEFAULT_SUPP="darwin9.supp ${DEFAULT_SUPP}"
400 DEFAULT_SUPP="darwin9-drd.supp ${DEFAULT_SUPP}"
403 AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard])
404 AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version])
405 DEFAULT_SUPP="darwin10.supp ${DEFAULT_SUPP}"
406 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
409 AC_MSG_RESULT([Darwin 11.x (${kernel}) / Mac OS X 10.7 Lion])
410 AC_DEFINE([DARWIN_VERS], DARWIN_10_7, [Darwin / Mac OS X version])
411 DEFAULT_SUPP="darwin11.supp ${DEFAULT_SUPP}"
412 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
415 AC_MSG_RESULT([Darwin 12.x (${kernel}) / Mac OS X 10.8 Mountain Lion])
416 AC_DEFINE([DARWIN_VERS], DARWIN_10_8, [Darwin / Mac OS X version])
417 DEFAULT_SUPP="darwin12.supp ${DEFAULT_SUPP}"
418 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
421 AC_MSG_RESULT([Darwin 13.x (${kernel}) / Mac OS X 10.9 Mavericks])
422 AC_DEFINE([DARWIN_VERS], DARWIN_10_9, [Darwin / Mac OS X version])
423 DEFAULT_SUPP="darwin13.supp ${DEFAULT_SUPP}"
424 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
427 AC_MSG_RESULT([Darwin 14.x (${kernel}) / Mac OS X 10.10 Yosemite])
428 AC_DEFINE([DARWIN_VERS], DARWIN_10_10, [Darwin / Mac OS X version])
429 DEFAULT_SUPP="darwin14.supp ${DEFAULT_SUPP}"
430 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
433 AC_MSG_RESULT([Darwin 15.x (${kernel}) / Mac OS X 10.11 El Capitan])
434 AC_DEFINE([DARWIN_VERS], DARWIN_10_11, [Darwin / Mac OS X version])
435 DEFAULT_SUPP="darwin15.supp ${DEFAULT_SUPP}"
436 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
439 AC_MSG_RESULT([Darwin 16.x (${kernel}) / macOS 10.12 Sierra])
440 AC_DEFINE([DARWIN_VERS], DARWIN_10_12, [Darwin / Mac OS X version])
441 DEFAULT_SUPP="darwin16.supp ${DEFAULT_SUPP}"
442 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
445 AC_MSG_RESULT([Darwin 17.x (${kernel}) / macOS 10.13 High Sierra])
446 AC_DEFINE([DARWIN_VERS], DARWIN_10_13, [Darwin / Mac OS X version])
447 DEFAULT_SUPP="darwin17.supp ${DEFAULT_SUPP}"
448 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
451 AC_MSG_RESULT([unsupported (${kernel})])
452 AC_MSG_ERROR([Valgrind works on Darwin 10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x and 17.x (Mac OS X 10.6/7/8/9/10/11 and macOS 10.12/13)])
458 AC_MSG_RESULT([ok (${host_os})])
461 uname_v=$( uname -v )
464 DEFAULT_SUPP="solaris12.supp ${DEFAULT_SUPP}"
467 DEFAULT_SUPP="solaris11.supp ${DEFAULT_SUPP}"
473 AC_MSG_RESULT([ok (${host_os})])
475 DEFAULT_SUPP="solaris12.supp ${DEFAULT_SUPP}"
479 AC_MSG_RESULT([no (${host_os})])
480 AC_MSG_ERROR([Valgrind is operating system specific. Sorry.])
484 #----------------------------------------------------------------------------
486 # If we are building on a 64 bit platform test to see if the system
487 # supports building 32 bit programs and disable 32 bit support if it
488 # does not support building 32 bit programs
490 case "$ARCH_MAX-$VGCONF_OS" in
491 amd64-linux|ppc64be-linux|arm64-linux|amd64-solaris)
492 AC_MSG_CHECKING([for 32 bit build support])
495 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
500 vg_cv_only64bit="yes"
503 CFLAGS=$safe_CFLAGS;;
505 AC_MSG_CHECKING([for 32 bit build support])
507 CFLAGS="$CFLAGS -mips32 -mabi=32"
508 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
509 #include <sys/prctl.h>
513 vg_cv_only64bit="yes"
516 CFLAGS=$safe_CFLAGS;;
519 if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
521 [--enable-only32bit was specified but system does not support 32 bit builds])
524 #----------------------------------------------------------------------------
526 # VGCONF_ARCH_PRI is the arch for the primary build target, eg. "amd64". By
527 # default it's the same as ARCH_MAX. But if, say, we do a build on an amd64
528 # machine, but --enable-only32bit has been requested, then ARCH_MAX (see
529 # above) will be "amd64" since that reflects the most that this cpu can do,
530 # but VGCONF_ARCH_PRI will be downgraded to "x86", since that reflects the
531 # arch corresponding to the primary build (VGCONF_PLATFORM_PRI_CAPS). It is
532 # passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_PRI) and
533 # -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS).
534 AC_SUBST(VGCONF_ARCH_PRI)
536 # VGCONF_ARCH_SEC is the arch for the secondary build target, eg. "x86".
537 # It is passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_SEC)
538 # and -VGP_$(VGCONF_ARCH_SEC)_$(VGCONF_OS), if there is a secondary target.
539 # It is empty if there is no secondary target.
540 AC_SUBST(VGCONF_ARCH_SEC)
542 # VGCONF_PLATFORM_PRI_CAPS is the primary build target, eg. "AMD64_LINUX".
543 # The entire system, including regression and performance tests, will be
544 # built for this target. The "_CAPS" indicates that the name is in capital
545 # letters, and it also uses '_' rather than '-' as a separator, because it's
546 # used to create various Makefile variables, which are all in caps by
547 # convention and cannot contain '-' characters. This is in contrast to
548 # VGCONF_ARCH_PRI and VGCONF_OS which are not in caps.
549 AC_SUBST(VGCONF_PLATFORM_PRI_CAPS)
551 # VGCONF_PLATFORM_SEC_CAPS is the secondary build target, if there is one.
552 # Valgrind and tools will also be built for this target, but not the
553 # regression or performance tests.
555 # By default, the primary arch is the same as the "max" arch, as commented
556 # above (at the definition of ARCH_MAX). We may choose to downgrade it in
557 # the big case statement just below here, in the case where we're building
558 # on a 64 bit machine but have been requested only to do a 32 bit build.
559 AC_SUBST(VGCONF_PLATFORM_SEC_CAPS)
561 AC_MSG_CHECKING([for a supported CPU/OS combination])
563 # NB. The load address for a given platform may be specified in more
564 # than one place, in some cases, depending on whether we're doing a biarch,
565 # 32-bit only or 64-bit only build. eg see case for amd64-linux below.
566 # Be careful to give consistent values in all subcases. Also, all four
567 # valt_load_addres_{pri,sec}_{norml,inner} values must always be set,
568 # even if it is to "0xUNSET".
570 case "$ARCH_MAX-$VGCONF_OS" in
572 VGCONF_ARCH_PRI="x86"
574 VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
575 VGCONF_PLATFORM_SEC_CAPS=""
576 valt_load_address_pri_norml="0x58000000"
577 valt_load_address_pri_inner="0x38000000"
578 valt_load_address_sec_norml="0xUNSET"
579 valt_load_address_sec_inner="0xUNSET"
580 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
583 valt_load_address_sec_norml="0xUNSET"
584 valt_load_address_sec_inner="0xUNSET"
585 if test x$vg_cv_only64bit = xyes; then
586 VGCONF_ARCH_PRI="amd64"
588 VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
589 VGCONF_PLATFORM_SEC_CAPS=""
590 valt_load_address_pri_norml="0x58000000"
591 valt_load_address_pri_inner="0x38000000"
592 elif test x$vg_cv_only32bit = xyes; then
593 VGCONF_ARCH_PRI="x86"
595 VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
596 VGCONF_PLATFORM_SEC_CAPS=""
597 valt_load_address_pri_norml="0x58000000"
598 valt_load_address_pri_inner="0x38000000"
600 VGCONF_ARCH_PRI="amd64"
601 VGCONF_ARCH_SEC="x86"
602 VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
603 VGCONF_PLATFORM_SEC_CAPS="X86_LINUX"
604 valt_load_address_pri_norml="0x58000000"
605 valt_load_address_pri_inner="0x38000000"
606 valt_load_address_sec_norml="0x58000000"
607 valt_load_address_sec_inner="0x38000000"
609 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
612 VGCONF_ARCH_PRI="ppc32"
614 VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
615 VGCONF_PLATFORM_SEC_CAPS=""
616 valt_load_address_pri_norml="0x58000000"
617 valt_load_address_pri_inner="0x38000000"
618 valt_load_address_sec_norml="0xUNSET"
619 valt_load_address_sec_inner="0xUNSET"
620 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
623 valt_load_address_sec_norml="0xUNSET"
624 valt_load_address_sec_inner="0xUNSET"
625 if test x$vg_cv_only64bit = xyes; then
626 VGCONF_ARCH_PRI="ppc64be"
628 VGCONF_PLATFORM_PRI_CAPS="PPC64BE_LINUX"
629 VGCONF_PLATFORM_SEC_CAPS=""
630 valt_load_address_pri_norml="0x58000000"
631 valt_load_address_pri_inner="0x38000000"
632 elif test x$vg_cv_only32bit = xyes; then
633 VGCONF_ARCH_PRI="ppc32"
635 VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
636 VGCONF_PLATFORM_SEC_CAPS=""
637 valt_load_address_pri_norml="0x58000000"
638 valt_load_address_pri_inner="0x38000000"
640 VGCONF_ARCH_PRI="ppc64be"
641 VGCONF_ARCH_SEC="ppc32"
642 VGCONF_PLATFORM_PRI_CAPS="PPC64BE_LINUX"
643 VGCONF_PLATFORM_SEC_CAPS="PPC32_LINUX"
644 valt_load_address_pri_norml="0x58000000"
645 valt_load_address_pri_inner="0x38000000"
646 valt_load_address_sec_norml="0x58000000"
647 valt_load_address_sec_inner="0x38000000"
649 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
652 # Little Endian is only supported on PPC64
653 valt_load_address_sec_norml="0xUNSET"
654 valt_load_address_sec_inner="0xUNSET"
655 VGCONF_ARCH_PRI="ppc64le"
657 VGCONF_PLATFORM_PRI_CAPS="PPC64LE_LINUX"
658 VGCONF_PLATFORM_SEC_CAPS=""
659 valt_load_address_pri_norml="0x58000000"
660 valt_load_address_pri_inner="0x38000000"
661 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
663 # Darwin gets identified as 32-bit even when it supports 64-bit.
664 # (Not sure why, possibly because 'uname' returns "i386"?) Just about
665 # all Macs support both 32-bit and 64-bit, so we just build both. If
666 # someone has a really old 32-bit only machine they can (hopefully?)
667 # build with --enable-only32bit. See bug 243362.
668 x86-darwin|amd64-darwin)
670 valt_load_address_sec_norml="0xUNSET"
671 valt_load_address_sec_inner="0xUNSET"
672 if test x$vg_cv_only64bit = xyes; then
673 VGCONF_ARCH_PRI="amd64"
675 VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
676 VGCONF_PLATFORM_SEC_CAPS=""
677 valt_load_address_pri_norml="0x158000000"
678 valt_load_address_pri_inner="0x138000000"
679 elif test x$vg_cv_only32bit = xyes; then
680 VGCONF_ARCH_PRI="x86"
682 VGCONF_PLATFORM_PRI_CAPS="X86_DARWIN"
683 VGCONF_PLATFORM_SEC_CAPS=""
684 VGCONF_ARCH_PRI_CAPS="x86"
685 valt_load_address_pri_norml="0x58000000"
686 valt_load_address_pri_inner="0x38000000"
688 VGCONF_ARCH_PRI="amd64"
689 VGCONF_ARCH_SEC="x86"
690 VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
691 VGCONF_PLATFORM_SEC_CAPS="X86_DARWIN"
692 valt_load_address_pri_norml="0x158000000"
693 valt_load_address_pri_inner="0x138000000"
694 valt_load_address_sec_norml="0x58000000"
695 valt_load_address_sec_inner="0x38000000"
697 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
700 VGCONF_ARCH_PRI="arm"
701 VGCONF_PLATFORM_PRI_CAPS="ARM_LINUX"
702 VGCONF_PLATFORM_SEC_CAPS=""
703 valt_load_address_pri_norml="0x58000000"
704 valt_load_address_pri_inner="0x38000000"
705 valt_load_address_sec_norml="0xUNSET"
706 valt_load_address_sec_inner="0xUNSET"
707 AC_MSG_RESULT([ok (${host_cpu}-${host_os})])
710 valt_load_address_sec_norml="0xUNSET"
711 valt_load_address_sec_inner="0xUNSET"
712 if test x$vg_cv_only64bit = xyes; then
713 VGCONF_ARCH_PRI="arm64"
715 VGCONF_PLATFORM_PRI_CAPS="ARM64_LINUX"
716 VGCONF_PLATFORM_SEC_CAPS=""
717 valt_load_address_pri_norml="0x58000000"
718 valt_load_address_pri_inner="0x38000000"
719 elif test x$vg_cv_only32bit = xyes; then
720 VGCONF_ARCH_PRI="arm"
722 VGCONF_PLATFORM_PRI_CAPS="ARM_LINUX"
723 VGCONF_PLATFORM_SEC_CAPS=""
724 valt_load_address_pri_norml="0x58000000"
725 valt_load_address_pri_inner="0x38000000"
727 VGCONF_ARCH_PRI="arm64"
728 VGCONF_ARCH_SEC="arm"
729 VGCONF_PLATFORM_PRI_CAPS="ARM64_LINUX"
730 VGCONF_PLATFORM_SEC_CAPS="ARM_LINUX"
731 valt_load_address_pri_norml="0x58000000"
732 valt_load_address_pri_inner="0x38000000"
733 valt_load_address_sec_norml="0x58000000"
734 valt_load_address_sec_inner="0x38000000"
736 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
739 VGCONF_ARCH_PRI="s390x"
741 VGCONF_PLATFORM_PRI_CAPS="S390X_LINUX"
742 VGCONF_PLATFORM_SEC_CAPS=""
743 # To improve branch prediction hit rate we want to have
744 # the generated code close to valgrind (host) code
745 valt_load_address_pri_norml="0x800000000"
746 valt_load_address_pri_inner="0x810000000"
747 valt_load_address_sec_norml="0xUNSET"
748 valt_load_address_sec_inner="0xUNSET"
749 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
752 VGCONF_ARCH_PRI="mips32"
754 VGCONF_PLATFORM_PRI_CAPS="MIPS32_LINUX"
755 VGCONF_PLATFORM_SEC_CAPS=""
756 valt_load_address_pri_norml="0x58000000"
757 valt_load_address_pri_inner="0x38000000"
758 valt_load_address_sec_norml="0xUNSET"
759 valt_load_address_sec_inner="0xUNSET"
760 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
763 valt_load_address_sec_norml="0xUNSET"
764 valt_load_address_sec_inner="0xUNSET"
765 if test x$vg_cv_only64bit = xyes; then
766 VGCONF_ARCH_PRI="mips64"
767 VGCONF_PLATFORM_SEC_CAPS=""
768 VGCONF_PLATFORM_PRI_CAPS="MIPS64_LINUX"
769 VGCONF_PLATFORM_SEC_CAPS=""
770 valt_load_address_pri_norml="0x58000000"
771 valt_load_address_pri_inner="0x38000000"
772 elif test x$vg_cv_only32bit = xyes; then
773 VGCONF_ARCH_PRI="mips32"
775 VGCONF_PLATFORM_PRI_CAPS="MIPS32_LINUX"
776 VGCONF_PLATFORM_SEC_CAPS=""
777 valt_load_address_pri_norml="0x58000000"
778 valt_load_address_pri_inner="0x38000000"
780 VGCONF_ARCH_PRI="mips64"
781 VGCONF_ARCH_SEC="mips32"
782 VGCONF_PLATFORM_PRI_CAPS="MIPS64_LINUX"
783 VGCONF_PLATFORM_SEC_CAPS="MIPS32_LINUX"
784 valt_load_address_pri_norml="0x58000000"
785 valt_load_address_pri_inner="0x38000000"
786 valt_load_address_sec_norml="0x58000000"
787 valt_load_address_sec_inner="0x38000000"
789 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
792 VGCONF_ARCH_PRI="nanomips"
794 VGCONF_PLATFORM_PRI_CAPS="NANOMIPS_LINUX"
795 VGCONF_PLATFORM_SEC_CAPS=""
796 valt_load_address_pri_norml="0x58000000"
797 valt_load_address_pri_inner="0x38000000"
798 valt_load_address_sec_norml="0xUNSET"
799 valt_load_address_sec_inner="0xUNSET"
800 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
803 VGCONF_ARCH_PRI="x86"
805 VGCONF_PLATFORM_PRI_CAPS="X86_SOLARIS"
806 VGCONF_PLATFORM_SEC_CAPS=""
807 valt_load_address_pri_norml="0x58000000"
808 valt_load_address_pri_inner="0x38000000"
809 valt_load_address_sec_norml="0xUNSET"
810 valt_load_address_sec_inner="0xUNSET"
811 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
814 valt_load_address_sec_norml="0xUNSET"
815 valt_load_address_sec_inner="0xUNSET"
816 if test x$vg_cv_only64bit = xyes; then
817 VGCONF_ARCH_PRI="amd64"
819 VGCONF_PLATFORM_PRI_CAPS="AMD64_SOLARIS"
820 VGCONF_PLATFORM_SEC_CAPS=""
821 valt_load_address_pri_norml="0x58000000"
822 valt_load_address_pri_inner="0x38000000"
823 elif test x$vg_cv_only32bit = xyes; then
824 VGCONF_ARCH_PRI="x86"
826 VGCONF_PLATFORM_PRI_CAPS="X86_SOLARIS"
827 VGCONF_PLATFORM_SEC_CAPS=""
828 valt_load_address_pri_norml="0x58000000"
829 valt_load_address_pri_inner="0x38000000"
831 VGCONF_ARCH_PRI="amd64"
832 VGCONF_ARCH_SEC="x86"
833 VGCONF_PLATFORM_PRI_CAPS="AMD64_SOLARIS"
834 VGCONF_PLATFORM_SEC_CAPS="X86_SOLARIS"
835 valt_load_address_pri_norml="0x58000000"
836 valt_load_address_pri_inner="0x38000000"
837 valt_load_address_sec_norml="0x58000000"
838 valt_load_address_sec_inner="0x38000000"
840 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
843 VGCONF_ARCH_PRI="unknown"
844 VGCONF_ARCH_SEC="unknown"
845 VGCONF_PLATFORM_PRI_CAPS="UNKNOWN"
846 VGCONF_PLATFORM_SEC_CAPS="UNKNOWN"
847 valt_load_address_pri_norml="0xUNSET"
848 valt_load_address_pri_inner="0xUNSET"
849 valt_load_address_sec_norml="0xUNSET"
850 valt_load_address_sec_inner="0xUNSET"
851 AC_MSG_RESULT([no (${ARCH_MAX}-${VGCONF_OS})])
852 AC_MSG_ERROR([Valgrind is platform specific. Sorry. Please consider doing a port.])
856 #----------------------------------------------------------------------------
858 # Set up VGCONF_ARCHS_INCLUDE_<arch>. Either one or two of these become
860 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_X86,
861 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
862 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
863 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
864 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN \
865 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \
866 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_SOLARIS )
867 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_AMD64,
868 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
869 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN \
870 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS )
871 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC32,
872 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
873 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX )
874 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC64,
875 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64BE_LINUX \
876 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64LE_LINUX )
877 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM,
878 test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
879 -o x$VGCONF_PLATFORM_SEC_CAPS = xARM_LINUX )
880 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM64,
881 test x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX )
882 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_S390X,
883 test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX )
884 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_MIPS32,
885 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
886 -o x$VGCONF_PLATFORM_SEC_CAPS = xMIPS32_LINUX )
887 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_MIPS64,
888 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX )
889 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_NANOMIPS,
890 test x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX )
892 # Set up VGCONF_PLATFORMS_INCLUDE_<platform>. Either one or two of these
894 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_LINUX,
895 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
896 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX)
897 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX,
898 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX)
899 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX,
900 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
901 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX)
902 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64BE_LINUX,
903 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64BE_LINUX)
904 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64LE_LINUX,
905 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64LE_LINUX)
906 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_ARM_LINUX,
907 test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
908 -o x$VGCONF_PLATFORM_SEC_CAPS = xARM_LINUX)
909 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_ARM64_LINUX,
910 test x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX)
911 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_S390X_LINUX,
912 test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \
913 -o x$VGCONF_PLATFORM_SEC_CAPS = xS390X_LINUX)
914 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_MIPS32_LINUX,
915 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
916 -o x$VGCONF_PLATFORM_SEC_CAPS = xMIPS32_LINUX)
917 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_MIPS64_LINUX,
918 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX)
919 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_NANOMIPS_LINUX,
920 test x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX)
921 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_DARWIN,
922 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
923 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN)
924 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN,
925 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
926 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_SOLARIS,
927 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \
928 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_SOLARIS)
929 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_SOLARIS,
930 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS)
933 # Similarly, set up VGCONF_OS_IS_<os>. Exactly one of these becomes defined.
934 # Relies on the assumption that the primary and secondary targets are
935 # for the same OS, so therefore only necessary to test the primary.
936 AM_CONDITIONAL(VGCONF_OS_IS_LINUX,
937 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
938 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
939 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
940 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64BE_LINUX \
941 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64LE_LINUX \
942 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
943 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX \
944 -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \
945 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
946 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \
947 -o x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX)
948 AM_CONDITIONAL(VGCONF_OS_IS_DARWIN,
949 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
950 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
951 AM_CONDITIONAL(VGCONF_OS_IS_SOLARIS,
952 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \
953 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS)
956 # Sometimes, in the Makefile.am files, it's useful to know whether or not
957 # there is a secondary target.
958 AM_CONDITIONAL(VGCONF_HAVE_PLATFORM_SEC,
959 test x$VGCONF_PLATFORM_SEC_CAPS != x)
961 dnl automake-1.10 does not have AM_COND_IF (added in 1.11), so we supply a
962 dnl fallback definition
963 dnl The macro is courtesy of Dave Hart:
964 dnl https://lists.gnu.org/archive/html/automake/2010-12/msg00045.html
965 m4_ifndef([AM_COND_IF], [AC_DEFUN([AM_COND_IF], [
966 if test -z "$$1_TRUE"; then :
975 #----------------------------------------------------------------------------
977 #----------------------------------------------------------------------------
979 # Check if this should be built as an inner Valgrind, to be run within
980 # another Valgrind. Choose the load address accordingly.
981 AC_SUBST(VALT_LOAD_ADDRESS_PRI)
982 AC_SUBST(VALT_LOAD_ADDRESS_SEC)
983 AC_CACHE_CHECK([for use as an inner Valgrind], vg_cv_inner,
984 [AC_ARG_ENABLE(inner,
985 [ --enable-inner enables self-hosting],
986 [vg_cv_inner=$enableval],
988 if test "$vg_cv_inner" = yes; then
989 AC_DEFINE([ENABLE_INNER], 1, [configured to run as an inner Valgrind])
990 VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_inner
991 VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_inner
993 VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_norml
994 VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_norml
997 #----------------------------------------------------------------------------
998 # Undefined behaviour sanitiser
999 #----------------------------------------------------------------------------
1000 # Check whether we should build with the undefined beahviour sanitiser.
1002 AC_CACHE_CHECK([for using the undefined behaviour sanitiser], vg_cv_ubsan,
1003 [AC_ARG_ENABLE(ubsan,
1004 [ --enable-ubsan enables the undefined behaviour sanitiser],
1005 [vg_cv_ubsan=$enableval],
1008 #----------------------------------------------------------------------------
1009 # Extra fine-tuning of installation directories
1010 #----------------------------------------------------------------------------
1012 [ --with-tmpdir=PATH Specify path for temporary files],
1015 AC_DEFINE_UNQUOTED(VG_TMPDIR, "$tmpdir", [Temporary files directory])
1016 AC_SUBST(VG_TMPDIR, [$tmpdir])
1018 #----------------------------------------------------------------------------
1020 #----------------------------------------------------------------------------
1021 AM_COND_IF([VGCONF_OS_IS_DARWIN],
1022 [AC_CHECK_PROG([XCRUN], [xcrun], [yes], [no])
1023 AC_MSG_CHECKING([for xcode sdk include path])
1024 AC_ARG_WITH(xcodedir,
1025 [ --with-xcode-path=PATH Specify path for xcode sdk includes],
1026 [xcodedir="$withval"],
1028 if test "x$XCRUN" != "xno" -a ! -d /usr/include; then
1029 xcrundir=`xcrun --sdk macosx --show-sdk-path`
1030 if test -z "$xcrundir"; then
1031 xcodedir="/usr/include"
1033 xcodedir="$xcrundir/usr/include"
1036 xcodedir="/usr/include"
1039 AC_MSG_RESULT([$xcodedir])
1040 AC_DEFINE_UNQUOTED(XCODE_DIR, "$xcodedir", [xcode sdk include directory])
1041 AC_SUBST(XCODE_DIR, [$xcodedir])])
1043 #----------------------------------------------------------------------------
1044 # Libc and suppressions
1045 #----------------------------------------------------------------------------
1046 # This variable will collect the suppression files to be used.
1047 AC_SUBST(DEFAULT_SUPP)
1049 AC_CHECK_HEADER([features.h])
1051 if test x$ac_cv_header_features_h = xyes; then
1052 rm -f conftest.$ac_ext
1053 cat <<_ACEOF >conftest.$ac_ext
1054 #include <features.h>
1055 #if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__)
1056 glibc version is: __GLIBC__ __GLIBC_MINOR__
1059 GLIBC_VERSION="`$CPP -P conftest.$ac_ext | $SED -n 's/^glibc version is: //p' | $SED 's/ /./g'`"
1062 # not really a version check
1063 AC_EGREP_CPP([DARWIN_LIBC], [
1064 #include <sys/cdefs.h>
1065 #if defined(__DARWIN_VERS_1050)
1069 GLIBC_VERSION="darwin")
1071 # not really a version check
1072 AC_EGREP_CPP([BIONIC_LIBC], [
1073 #if defined(__ANDROID__)
1077 GLIBC_VERSION="bionic")
1079 # there is only one version of libc on Solaris
1080 if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \
1081 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS; then
1082 GLIBC_VERSION="solaris"
1085 # GLIBC_VERSION is empty if a musl libc is used, so use the toolchain tuple
1087 if test x$GLIBC_VERSION = x; then
1088 if $CC -dumpmachine | grep -q musl; then
1093 AC_MSG_CHECKING([the glibc version])
1095 case "${GLIBC_VERSION}" in
1097 AC_MSG_RESULT(${GLIBC_VERSION} family)
1098 DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}"
1099 DEFAULT_SUPP="glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
1100 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1103 AC_MSG_RESULT(${GLIBC_VERSION} family)
1104 DEFAULT_SUPP="glibc-${GLIBC_VERSION}.supp ${DEFAULT_SUPP}"
1105 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
1106 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1109 AC_MSG_RESULT(${GLIBC_VERSION} family)
1110 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
1111 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
1112 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1115 AC_MSG_RESULT(${GLIBC_VERSION} family)
1116 AC_DEFINE([GLIBC_MANDATORY_STRLEN_REDIRECT], 1,
1117 [Define to 1 if strlen() has been optimized heavily (amd64 glibc >= 2.10)])
1118 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
1119 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
1120 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1123 AC_MSG_RESULT(${GLIBC_VERSION} family)
1124 AC_DEFINE([GLIBC_MANDATORY_STRLEN_REDIRECT], 1,
1125 [Define to 1 if strlen() has been optimized heavily (amd64 glibc >= 2.10)])
1126 AC_DEFINE([GLIBC_MANDATORY_INDEX_AND_STRLEN_REDIRECT], 1,
1127 [Define to 1 if index() and strlen() have been optimized heavily (x86 glibc >= 2.12)])
1128 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
1129 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
1130 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
1133 AC_MSG_RESULT(Darwin)
1134 AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
1135 # DEFAULT_SUPP set by kernel version check above.
1138 AC_MSG_RESULT(Bionic)
1139 AC_DEFINE([BIONIC_LIBC], 1, [Define to 1 if you're using Bionic])
1140 DEFAULT_SUPP="bionic.supp ${DEFAULT_SUPP}"
1143 AC_MSG_RESULT(Solaris)
1144 # DEFAULT_SUPP set in host_os switch-case above.
1145 # No other suppression file is used.
1149 AC_DEFINE([MUSL_LIBC], 1, [Define to 1 if you're using Musl libc])
1150 DEFAULT_SUPP="musl.supp ${DEFAULT_SUPP}"
1153 AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
1154 AC_MSG_ERROR([Valgrind requires glibc version 2.2 or later, uClibc,])
1155 AC_MSG_ERROR([musl libc, Darwin libc, Bionic libc or Solaris libc])
1159 AC_SUBST(GLIBC_VERSION)
1162 if test "$VGCONF_OS" != "solaris"; then
1163 # Add default suppressions for the X client libraries. Make no
1164 # attempt to detect whether such libraries are installed on the
1165 # build machine (or even if any X facilities are present); just
1166 # add the suppressions antidisirregardless.
1167 DEFAULT_SUPP="xfree-4.supp ${DEFAULT_SUPP}"
1168 DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}"
1172 #----------------------------------------------------------------------------
1173 # Platform variants?
1174 #----------------------------------------------------------------------------
1176 # Normally the PLAT = (ARCH, OS) characterisation of the platform is enough.
1177 # But there are times where we need a bit more control. The motivating
1178 # and currently only case is Android: this is almost identical to
1179 # {x86,arm,mips}-linux, but not quite. So this introduces the concept of
1180 # platform variant tags, which get passed in the compile as
1181 # -DVGPV_<arch>_<os>_<variant> along with the main -DVGP_<arch>_<os> definition.
1183 # In almost all cases, the <variant> bit is "vanilla". But for Android
1184 # it is "android" instead.
1186 # Consequently (eg), plain arm-linux would build with
1188 # -DVGP_arm_linux -DVGPV_arm_linux_vanilla
1190 # whilst an Android build would have
1192 # -DVGP_arm_linux -DVGPV_arm_linux_android
1194 # Same for x86. The setup of the platform variant is pushed relatively far
1195 # down this file in order that we can inspect any of the variables set above.
1197 # In the normal case ..
1198 VGCONF_PLATVARIANT="vanilla"
1201 if test "$GLIBC_VERSION" = "bionic";
1203 VGCONF_PLATVARIANT="android"
1206 AC_SUBST(VGCONF_PLATVARIANT)
1209 # FIXME: do we also want to define automake variables
1210 # VGCONF_PLATVARIANT_IS_<WHATEVER>, where WHATEVER is (currently)
1211 # VANILLA or ANDROID ? This would be in the style of VGCONF_ARCHS_INCLUDE,
1212 # VGCONF_PLATFORMS_INCLUDE and VGCONF_OS_IS above? Could easily enough
1213 # do that. Problem is that we can't do and-ing in Makefile.am's, but
1214 # that's what we'd need to do to use this, since what we'd want to write
1217 # VGCONF_PLATFORMS_INCLUDE_ARM_LINUX && VGCONF_PLATVARIANT_IS_ANDROID
1219 # Hmm. Can't think of a nice clean solution to this.
1221 AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_VANILLA,
1222 test x$VGCONF_PLATVARIANT = xvanilla)
1223 AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_ANDROID,
1224 test x$VGCONF_PLATVARIANT = xandroid)
1227 #----------------------------------------------------------------------------
1228 # Checking for various library functions and other definitions
1229 #----------------------------------------------------------------------------
1231 # Check for AT_FDCWD
1233 AC_MSG_CHECKING([for AT_FDCWD])
1234 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1241 ac_have_at_fdcwd=yes
1242 AC_MSG_RESULT([yes])
1248 AM_CONDITIONAL([HAVE_AT_FDCWD], [test x$ac_have_at_fdcwd = xyes])
1250 # Check for stpncpy function definition in string.h
1251 # This explicitly checks with _GNU_SOURCE defined since that is also
1252 # used in the test case (some systems might define it without anyway
1253 # since stpncpy is part of The Open Group Base Specifications Issue 7
1254 # IEEE Std 1003.1-2008.
1255 AC_MSG_CHECKING([for stpncpy])
1256 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1263 char *r = stpncpy(d, s, n);
1265 ac_have_gnu_stpncpy=yes
1266 AC_MSG_RESULT([yes])
1268 ac_have_gnu_stpncpy=no
1272 AM_CONDITIONAL([HAVE_GNU_STPNCPY], [test x$ac_have_gnu_stpncpy = xyes])
1274 # Check for PTRACE_GETREGS
1276 AC_MSG_CHECKING([for PTRACE_GETREGS])
1277 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1280 #include <sys/ptrace.h>
1281 #include <sys/user.h>
1284 long res = ptrace (PTRACE_GETREGS, 0, p, p);
1286 AC_MSG_RESULT([yes])
1287 AC_DEFINE([HAVE_PTRACE_GETREGS], 1,
1288 [Define to 1 if you have the `PTRACE_GETREGS' ptrace request.])
1294 # Check for CLOCK_MONOTONIC
1296 AC_MSG_CHECKING([for CLOCK_MONOTONIC])
1298 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1302 clock_gettime(CLOCK_MONOTONIC, &t);
1305 AC_MSG_RESULT([yes])
1306 AC_DEFINE([HAVE_CLOCK_MONOTONIC], 1,
1307 [Define to 1 if you have the `CLOCK_MONOTONIC' constant.])
1313 # Check for ELF32/64_CHDR
1315 AC_CHECK_TYPES([Elf32_Chdr, Elf64_Chdr], [], [], [[#include <elf.h>]])
1318 # Check for PTHREAD_RWLOCK_T
1320 AC_MSG_CHECKING([for pthread_rwlock_t])
1322 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1324 #include <pthread.h>
1326 pthread_rwlock_t rwl;
1328 AC_MSG_RESULT([yes])
1329 AC_DEFINE([HAVE_PTHREAD_RWLOCK_T], 1,
1330 [Define to 1 if you have the `pthread_rwlock_t' type.])
1336 # Check for PTHREAD_MUTEX_ADAPTIVE_NP
1338 AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP])
1340 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1342 #include <pthread.h>
1344 return (PTHREAD_MUTEX_ADAPTIVE_NP);
1346 AC_MSG_RESULT([yes])
1347 AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1,
1348 [Define to 1 if you have the `PTHREAD_MUTEX_ADAPTIVE_NP' constant.])
1354 # Check for PTHREAD_MUTEX_ERRORCHECK_NP
1356 AC_MSG_CHECKING([for PTHREAD_MUTEX_ERRORCHECK_NP])
1358 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1360 #include <pthread.h>
1362 return (PTHREAD_MUTEX_ERRORCHECK_NP);
1364 AC_MSG_RESULT([yes])
1365 AC_DEFINE([HAVE_PTHREAD_MUTEX_ERRORCHECK_NP], 1,
1366 [Define to 1 if you have the `PTHREAD_MUTEX_ERRORCHECK_NP' constant.])
1372 # Check for PTHREAD_MUTEX_RECURSIVE_NP
1374 AC_MSG_CHECKING([for PTHREAD_MUTEX_RECURSIVE_NP])
1376 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1378 #include <pthread.h>
1380 return (PTHREAD_MUTEX_RECURSIVE_NP);
1382 AC_MSG_RESULT([yes])
1383 AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], 1,
1384 [Define to 1 if you have the `PTHREAD_MUTEX_RECURSIVE_NP' constant.])
1390 # Check for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
1392 AC_MSG_CHECKING([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP])
1394 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1396 #include <pthread.h>
1398 pthread_mutex_t m = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
1401 AC_MSG_RESULT([yes])
1402 AC_DEFINE([HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], 1,
1403 [Define to 1 if you have the `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' constant.])
1409 # Check whether pthread_mutex_t has a member called __m_kind.
1411 AC_CHECK_MEMBER([pthread_mutex_t.__m_kind],
1412 [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__M_KIND],
1414 [Define to 1 if pthread_mutex_t has a member called __m_kind.])
1417 [#include <pthread.h>])
1420 # Check whether pthread_mutex_t has a member called __data.__kind.
1422 AC_CHECK_MEMBER([pthread_mutex_t.__data.__kind],
1423 [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__DATA__KIND],
1425 [Define to 1 if pthread_mutex_t has a member __data.__kind.])
1428 [#include <pthread.h>])
1430 # Convenience function. Set flags based on the existing HWCAP entries.
1431 # The AT_HWCAP entries are generated by glibc, and are based on
1432 # functions supported by the hardware/system/libc.
1433 # Subsequent support for whether the capability will actually be utilized
1434 # will also be checked against the compiler capabilities.
1436 # AC_HWCAP_CONTAINS_FLAG[hwcap_string_to_match],[VARIABLE_TO_SET]
1437 AC_DEFUN([AC_HWCAP_CONTAINS_FLAG],[
1439 AC_MSG_CHECKING([if AT_HWCAP contains the $AUXV_CHECK_FOR indicator])
1440 if LD_SHOW_AUXV=1 `which true` | grep ^AT_HWCAP | grep -q -w ${AUXV_CHECK_FOR}
1442 AC_MSG_RESULT([yes])
1443 AC_SUBST([$2],[yes])
1450 # gather hardware capabilities. (hardware/kernel/libc)
1451 AC_HWCAP_CONTAINS_FLAG([altivec],[HWCAP_HAS_ALTIVEC])
1452 AC_HWCAP_CONTAINS_FLAG([vsx],[HWCAP_HAS_VSX])
1453 AC_HWCAP_CONTAINS_FLAG([dfp],[HWCAP_HAS_DFP])
1454 AC_HWCAP_CONTAINS_FLAG([arch_2_05],[HWCAP_HAS_ISA_2_05])
1455 AC_HWCAP_CONTAINS_FLAG([arch_2_06],[HWCAP_HAS_ISA_2_06])
1456 AC_HWCAP_CONTAINS_FLAG([arch_2_07],[HWCAP_HAS_ISA_2_07])
1457 AC_HWCAP_CONTAINS_FLAG([arch_3_00],[HWCAP_HAS_ISA_3_00])
1458 AC_HWCAP_CONTAINS_FLAG([arch_3_1],[HWCAP_HAS_ISA_3_1])
1459 AC_HWCAP_CONTAINS_FLAG([htm],[HWCAP_HAS_HTM])
1460 AC_HWCAP_CONTAINS_FLAG([mma],[HWCAP_HAS_MMA])
1463 AM_CONDITIONAL(HAS_ISA_2_05, [test x$HWCAP_HAS_ISA_2_05 = xyes])
1464 AM_CONDITIONAL(HAS_ISA_2_06, [test x$HWCAP_HAS_ISA_2_06 = xyes])
1465 # compiler support for isa 2.07 level instructions
1466 AC_MSG_CHECKING([that assembler knows ISA 2.07 instructions ])
1467 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1469 __asm__ __volatile__("mtvsrd 1,2 ");
1471 ac_asm_have_isa_2_07=yes
1472 AC_MSG_RESULT([yes])
1474 ac_asm_have_isa_2_07=no
1477 AM_CONDITIONAL(HAS_ISA_2_07, [test x$ac_asm_have_isa_2_07 = xyes \
1478 -a x$HWCAP_HAS_ISA_2_07 = xyes])
1480 # altivec (vsx) support.
1481 # does this compiler support -maltivec and does it have the include file
1483 AC_MSG_CHECKING([for Altivec support in the compiler ])
1485 CFLAGS="-maltivec -Werror"
1486 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1487 #include <altivec.h>
1489 vector unsigned int v;
1492 AC_MSG_RESULT([yes])
1498 AM_CONDITIONAL([HAS_ALTIVEC], [test x$ac_have_altivec = xyes \
1499 -a x$HWCAP_HAS_ALTIVEC = xyes])
1501 # Check that both: the compiler supports -mvsx and that the assembler
1502 # understands VSX instructions. If either of those doesn't work,
1503 # conclude that we can't do VSX.
1504 AC_MSG_CHECKING([for VSX compiler flag support])
1506 CFLAGS="-mvsx -Werror"
1507 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1510 ac_compiler_supports_vsx_flag=yes
1511 AC_MSG_RESULT([yes])
1513 ac_compiler_supports_vsx_flag=no
1518 AC_MSG_CHECKING([for VSX support in the assembler ])
1520 CFLAGS="-mvsx -Werror"
1521 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1522 #include <altivec.h>
1524 vector unsigned int v;
1525 __asm__ __volatile__("xsmaddadp 32, 32, 33" ::: "memory","cc");
1527 ac_compiler_supports_vsx=yes
1528 AC_MSG_RESULT([yes])
1530 ac_compiler_supports_vsx=no
1534 AM_CONDITIONAL([HAS_VSX], [test x$ac_compiler_supports_vsx_flag = xyes \
1535 -a x$ac_compiler_supports_vsx = xyes \
1536 -a x$HWCAP_HAS_VSX = xyes ])
1538 # DFP (Decimal Float)
1539 AC_MSG_CHECKING([that assembler knows DFP])
1540 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1543 __asm__ __volatile__("adtr 1, 2, 3")
1545 __asm__ __volatile__("dadd 1, 2, 3");
1546 __asm__ __volatile__("dcffix 1, 2");
1550 AC_MSG_RESULT([yes])
1555 AC_MSG_CHECKING([that compiler knows -mhard-dfp switch])
1557 CFLAGS="-mhard-dfp -Werror"
1558 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1561 __asm__ __volatile__("adtr 1, 2, 3")
1563 __asm__ __volatile__("dadd 1, 2, 3");
1564 __asm__ __volatile__("dcffix 1, 2");
1567 ac_compiler_have_dfp=yes
1568 AC_MSG_RESULT([yes])
1570 ac_compiler_have_dfp=no
1574 AM_CONDITIONAL(HAS_DFP, test x$ac_asm_have_dfp = xyes \
1575 -a x$ac_compiler_have_dfp = xyes \
1576 -a x$HWCAP_HAS_DFP = xyes )
1578 AC_MSG_CHECKING([that compiler knows DFP datatypes])
1579 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1581 _Decimal64 x = 0.0DD;
1583 ac_compiler_have_dfp_type=yes
1584 AC_MSG_RESULT([yes])
1586 ac_compiler_have_dfp_type=no
1589 AM_CONDITIONAL(BUILD_DFP_TESTS, test x$ac_compiler_have_dfp_type = xyes \
1590 -a x$HWCAP_HAS_DFP = xyes )
1593 # HTM (Hardware Transactional Memory)
1594 AC_MSG_CHECKING([if compiler accepts the -mhtm flag])
1596 CFLAGS="-mhtm -Werror"
1597 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1601 AC_MSG_RESULT([yes])
1602 ac_compiler_supports_htm=yes
1605 ac_compiler_supports_htm=no
1609 AC_MSG_CHECKING([if compiler can find the htm builtins])
1611 CFLAGS="-mhtm -Werror"
1612 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1614 if (__builtin_tbegin (0))
1617 AC_MSG_RESULT([yes])
1618 ac_compiler_sees_htm_builtins=yes
1621 ac_compiler_sees_htm_builtins=no
1625 AM_CONDITIONAL(SUPPORTS_HTM, test x$ac_compiler_supports_htm = xyes \
1626 -a x$ac_compiler_sees_htm_builtins = xyes \
1627 -a x$HWCAP_HAS_HTM = xyes )
1629 # isa 3.0 checking. (actually 3.0 or newer)
1630 AC_MSG_CHECKING([that assembler knows ISA 3.00 ])
1632 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1634 __asm__ __volatile__("cnttzw 1,2 ");
1636 ac_asm_have_isa_3_00=yes
1637 AC_MSG_RESULT([yes])
1639 ac_asm_have_isa_3_00=no
1644 AC_MSG_CHECKING([that assembler knows xscvhpdp ])
1646 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1648 __asm__ __volatile__("xscvhpdp 1,2 ");
1650 ac_asm_have_xscvhpdp=yes
1651 AC_MSG_RESULT([yes])
1653 ac_asm_have_xscvhpdp=no
1658 AC_MSG_CHECKING([that assembler knows ISA 3.1 ])
1660 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1662 __asm__ __volatile__("brh 1,2 ");
1664 ac_asm_have_isa_3_1=yes
1665 AC_MSG_RESULT([yes])
1667 ac_asm_have_isa_3_1=no
1672 AM_CONDITIONAL(HAS_ISA_3_00, [test x$ac_asm_have_isa_3_00 = xyes \
1673 -a x$HWCAP_HAS_ISA_3_00 = xyes])
1675 AM_CONDITIONAL(HAS_XSCVHPDP, [test x$ac_asm_have_xscvhpdp = xyes])
1677 AM_CONDITIONAL(HAS_ISA_3_1, [test x$ac_asm_have_isa_3_1 = xyes \
1678 -a x$HWCAP_HAS_ISA_3_1 = xyes])
1680 # Check for pthread_create@GLIBC2.0
1681 AC_MSG_CHECKING([for pthread_create@GLIBC2.0()])
1684 CFLAGS="-lpthread -Werror"
1685 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1686 extern int pthread_create_glibc_2_0(void*, const void*,
1687 void *(*)(void*), void*);
1688 __asm__(".symver pthread_create_glibc_2_0, pthread_create@GLIBC_2.0");
1692 * Apparently on PowerPC linking this program succeeds and generates an
1693 * executable with the undefined symbol pthread_create@GLIBC_2.0.
1695 #error This test does not work properly on PowerPC.
1697 pthread_create_glibc_2_0(0, 0, 0, 0);
1701 ac_have_pthread_create_glibc_2_0=yes
1702 AC_MSG_RESULT([yes])
1703 AC_DEFINE([HAVE_PTHREAD_CREATE_GLIBC_2_0], 1,
1704 [Define to 1 if you have the `pthread_create@glibc2.0' function.])
1706 ac_have_pthread_create_glibc_2_0=no
1711 AM_CONDITIONAL(HAVE_PTHREAD_CREATE_GLIBC_2_0,
1712 test x$ac_have_pthread_create_glibc_2_0 = xyes)
1715 # Check for dlinfo RTLD_DI_TLS_MODID
1716 AC_MSG_CHECKING([for dlinfo RTLD_DI_TLS_MODID])
1720 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1727 size_t sizes[10000];
1728 size_t modid_offset;
1729 (void) dlinfo ((void*)sizes, RTLD_DI_TLS_MODID, &modid_offset);
1732 ac_have_dlinfo_rtld_di_tls_modid=yes
1733 AC_MSG_RESULT([yes])
1734 AC_DEFINE([HAVE_DLINFO_RTLD_DI_TLS_MODID], 1,
1735 [Define to 1 if you have a dlinfo that can do RTLD_DI_TLS_MODID.])
1737 ac_have_dlinfo_rtld_di_tls_modid=no
1742 AM_CONDITIONAL(HAVE_DLINFO_RTLD_DI_TLS_MODID,
1743 test x$ac_have_dlinfo_rtld_di_tls_modid = xyes)
1746 # Check for eventfd_t, eventfd() and eventfd_read()
1747 AC_MSG_CHECKING([for eventfd()])
1749 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1750 #include <sys/eventfd.h>
1756 eventfd_read(fd, &ev);
1759 AC_MSG_RESULT([yes])
1760 AC_DEFINE([HAVE_EVENTFD], 1,
1761 [Define to 1 if you have the `eventfd' function.])
1762 AC_DEFINE([HAVE_EVENTFD_READ], 1,
1763 [Define to 1 if you have the `eventfd_read' function.])
1768 # Check whether compiler can process #include <thread> without errors
1769 # clang 3.3 cannot process <thread> from e.g.
1770 # gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
1772 AC_MSG_CHECKING([that C++ compiler can include <thread> header file])
1774 safe_CXXFLAGS=$CXXFLAGS
1777 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
1781 ac_cxx_can_include_thread_header=yes
1782 AC_MSG_RESULT([yes])
1784 ac_cxx_can_include_thread_header=no
1787 CXXFLAGS=$safe_CXXFLAGS
1790 AM_CONDITIONAL(CXX_CAN_INCLUDE_THREAD_HEADER, test x$ac_cxx_can_include_thread_header = xyes)
1793 # On aarch64 before glibc 2.20 we would get the kernel user_pt_regs instead
1794 # of the user_regs_struct from sys/user.h. They are structurally the same
1795 # but we get either one or the other.
1797 AC_CHECK_TYPE([struct user_regs_struct],
1798 [sys_user_has_user_regs=yes], [sys_user_has_user_regs=no],
1799 [[#include <sys/ptrace.h>]
1800 [#include <sys/time.h>]
1801 [#include <sys/user.h>]])
1802 if test "$sys_user_has_user_regs" = "yes"; then
1803 AC_DEFINE(HAVE_SYS_USER_REGS, 1,
1804 [Define to 1 if <sys/user.h> defines struct user_regs_struct])
1807 AC_MSG_CHECKING([for __NR_membarrier])
1808 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1809 #include <linux/unistd.h>
1811 return __NR_membarrier
1813 ac_have_nr_membarrier=yes
1814 AC_MSG_RESULT([yes])
1816 ac_have_nr_membarrier=no
1820 AM_CONDITIONAL(HAVE_NR_MEMBARRIER, [test x$ac_have_nr_membarrier = xyes])
1822 #----------------------------------------------------------------------------
1823 # Checking for supported compiler flags.
1824 #----------------------------------------------------------------------------
1826 case "${host_cpu}" in
1828 ARCH=$(echo "$CFLAGS" | grep -E -e '-march=@<:@^ @:>@+' -e '\B-mips@<:@^ +@:>@')
1829 if test -z "$ARCH"; then
1830 # does this compiler support -march=mips32 (mips32 default) ?
1831 AC_MSG_CHECKING([if gcc accepts -march=mips32 -mabi=32])
1834 CFLAGS="$CFLAGS -mips32 -mabi=32 -Werror"
1836 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1839 FLAG_M32="-mips32 -mabi=32"
1840 AC_MSG_RESULT([yes])
1850 # does this compiler support -march=mips64r2 (mips64r2 default) ?
1851 AC_MSG_CHECKING([if gcc accepts -march=mips64r2 -mabi=64])
1854 CFLAGS="$CFLAGS -march=mips64r2 -mabi=64 -Werror"
1856 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1859 FLAG_M64="-march=mips64r2 -mabi=64"
1860 AC_MSG_RESULT([yes])
1873 # does this compiler support -m32 ?
1874 AC_MSG_CHECKING([if gcc accepts -m32])
1877 CFLAGS="-m32 -Werror"
1879 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1883 AC_MSG_RESULT([yes])
1893 # does this compiler support -m64 ?
1894 AC_MSG_CHECKING([if gcc accepts -m64])
1897 CFLAGS="-m64 -Werror"
1899 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1903 AC_MSG_RESULT([yes])
1915 ARCH=$(echo "$CFLAGS" | grep -E -e '-march=@<:@^ @:>@+' -e '\B-mips@<:@^ +@:>@')
1916 if test -z "$ARCH"; then
1917 # does this compiler support -march=octeon (Cavium OCTEON I Specific) ?
1918 AC_MSG_CHECKING([if gcc accepts -march=octeon])
1921 CFLAGS="$CFLAGS $FLAG_M64 -march=octeon -Werror"
1923 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1926 FLAG_OCTEON="-march=octeon"
1927 AC_MSG_RESULT([yes])
1934 AC_SUBST(FLAG_OCTEON)
1937 # does this compiler support -march=octeon2 (Cavium OCTEON II Specific) ?
1938 AC_MSG_CHECKING([if gcc accepts -march=octeon2])
1941 CFLAGS="$CFLAGS $FLAG_M64 -march=octeon2 -Werror"
1943 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1946 FLAG_OCTEON2="-march=octeon2"
1947 AC_MSG_RESULT([yes])
1954 AC_SUBST(FLAG_OCTEON2)
1958 # does this compiler support -mmsa (MIPS MSA ASE) ?
1959 AC_MSG_CHECKING([if gcc accepts -mmsa])
1962 CFLAGS="$CFLAGS -mmsa -Werror"
1964 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1968 AC_MSG_RESULT([yes])
1977 # Are we compiling for the MIPS64 n32 ABI?
1978 AC_MSG_CHECKING([if gcc is producing mips n32 binaries])
1979 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
1980 #if !defined(_MIPS_SIM) || (defined(_MIPS_SIM) && (_MIPS_SIM != _ABIN32))
1985 FLAG_M64="-march=mips64r2 -mabi=n32"
1986 AC_MSG_RESULT([yes])
1991 # Are we compiling for the MIPS64 n64 ABI?
1992 AC_MSG_CHECKING([if gcc is producing mips n64 binaries])
1993 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
1994 #if !defined(_MIPS_SIM) || (defined(_MIPS_SIM) && (_MIPS_SIM != _ABI64))
1999 AC_MSG_RESULT([yes])
2004 # We enter the code block below in the following case:
2005 # Target architecture is set to mips64, the desired abi
2006 # was not specified and the compiler's default abi setting
2007 # is neither n32 nor n64.
2008 # Probe for and set the abi to either n64 or n32, in that order,
2009 # which is required for a mips64 build of valgrind.
2010 if test "$ARCH_MAX" = "mips64" -a "x$VGCONF_ABI" = "x"; then
2012 CFLAGS="$CFLAGS -mabi=64 -Werror"
2013 AC_MSG_CHECKING([if gcc is n64 capable])
2014 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
2018 AC_MSG_RESULT([yes])
2024 if test "x$VGCONF_ABI" = "x"; then
2026 CFLAGS="$CFLAGS -mabi=n32 -Werror"
2027 AC_MSG_CHECKING([if gcc is n32 capable])
2028 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
2032 FLAG_M64="-march=mips64r2 -mabi=n32"
2033 AC_MSG_RESULT([yes])
2041 AM_CONDITIONAL([VGCONF_HAVE_ABI],
2042 [test x$VGCONF_ABI != x])
2043 AC_SUBST(VGCONF_ABI)
2046 # does this compiler support -mmmx ?
2047 AC_MSG_CHECKING([if gcc accepts -mmmx])
2050 CFLAGS="-mmmx -Werror"
2052 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2056 AC_MSG_RESULT([yes])
2066 # does this compiler support -msse ?
2067 AC_MSG_CHECKING([if gcc accepts -msse])
2070 CFLAGS="-msse -Werror"
2072 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2076 AC_MSG_RESULT([yes])
2086 # does this compiler support -mpreferred-stack-boundary=2 when
2087 # generating code for a 32-bit target? Note that we only care about
2088 # this when generating code for (32-bit) x86, so if the compiler
2089 # doesn't recognise -m32 it's no big deal. We'll just get code for
2090 # the Memcheck and other helper functions, that is a bit slower than
2091 # it could be, on x86; and no difference at all on any other platform.
2092 AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary=2 -m32])
2095 CFLAGS="-mpreferred-stack-boundary=2 -m32 -Werror"
2097 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2100 PREFERRED_STACK_BOUNDARY_2="-mpreferred-stack-boundary=2"
2101 AC_MSG_RESULT([yes])
2103 PREFERRED_STACK_BOUNDARY_2=""
2108 AC_SUBST(PREFERRED_STACK_BOUNDARY_2)
2111 # does this compiler support -mlong-double-128 ?
2112 AC_MSG_CHECKING([if gcc accepts -mlong-double-128])
2114 CFLAGS="-mlong-double-128 -Werror"
2115 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2118 ac_compiler_supports_mlong_double_128=yes
2119 AC_MSG_RESULT([yes])
2121 ac_compiler_supports_mlong_double_128=no
2125 AM_CONDITIONAL(HAS_MLONG_DOUBLE_128, test x$ac_compiler_supports_mlong_double_128 = xyes)
2126 FLAG_MLONG_DOUBLE_128="-mlong-double-128"
2127 AC_SUBST(FLAG_MLONG_DOUBLE_128)
2129 # does this toolchain support lto ?
2130 # Not checked for if --enable-lto=no was given, or if LTO_AR or LTO_RANLIG
2132 # If not enable-lto=* arg is provided, default to no, as lto builds are
2133 # a lot slower, and so not appropriate for Valgrind developments.
2134 # --enable-lto=yes should be used by distro packagers.
2135 AC_CACHE_CHECK([for using the link time optimisation], vg_cv_lto,
2137 [ --enable-lto enables building with link time optimisation],
2138 [vg_cv_lto=$enableval],
2141 if test "x${vg_cv_lto}" != "xno" -a "x${LTO_AR}" != "x" -a "x${LTO_RANLIB}" != "x"; then
2142 AC_MSG_CHECKING([if toolchain accepts lto])
2144 TEST_LTO_CFLAGS="-flto -flto-partition=one -fuse-linker-plugin"
2145 # Note : using 'one' partition is giving a slightly smaller/faster memcheck
2146 # and ld/lto-trans1 still needs a reasonable memory (about 0.5GB) when linking.
2147 CFLAGS="$TEST_LTO_CFLAGS -Werror"
2149 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2150 extern void somefun(void);
2154 LTO_CFLAGS=$TEST_LTO_CFLAGS
2155 AC_MSG_RESULT([yes])
2163 AC_SUBST(LTO_CFLAGS)
2165 # if we could not compile with lto args, or lto was disabled,
2166 # then set LTO_AR/LTO_RANLIB to the non lto values
2167 # define in config.h ENABLE_LTO (not needed by the code currently, but
2168 # this guarantees we recompile everything if we re-configure and rebuild
2169 # in a build dir previously build with another value of --enable-lto
2170 if test "x${LTO_CFLAGS}" = "x"; then
2172 LTO_RANLIB=${RANLIB}
2176 AC_DEFINE([ENABLE_LTO], 1, [configured to build with lto link time optimisation])
2179 # Convenience function to check whether GCC supports a particular
2180 # warning option. Takes two arguments,
2181 # first the warning flag name to check (without -W), then the
2182 # substitution name to set with -Wno-warning-flag if the flag exists,
2183 # or the empty string if the compiler doesn't accept the flag. Note
2184 # that checking is done against the warning flag itself, but the
2185 # substitution is then done to cancel the warning flag.
2186 AC_DEFUN([AC_GCC_WARNING_SUBST_NO],[
2187 AC_MSG_CHECKING([if gcc accepts -W$1])
2189 CFLAGS="-W$1 -Werror"
2190 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [
2191 AC_SUBST([$2], [-Wno-$1])
2192 AC_MSG_RESULT([yes])], [
2194 AC_MSG_RESULT([no])])
2198 # Convenience function. Like AC_GCC_WARNING_SUBST_NO, except it substitutes
2199 # -W$1 (instead of -Wno-$1).
2200 AC_DEFUN([AC_GCC_WARNING_SUBST],[
2201 AC_MSG_CHECKING([if gcc accepts -W$1])
2203 CFLAGS="-W$1 -Werror"
2204 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [
2205 AC_SUBST([$2], [-W$1])
2206 AC_MSG_RESULT([yes])], [
2208 AC_MSG_RESULT([no])])
2212 AC_GCC_WARNING_SUBST_NO([memset-transposed-args], [FLAG_W_NO_MEMSET_TRANSPOSED_ARGS])
2213 AC_GCC_WARNING_SUBST_NO([nonnull], [FLAG_W_NO_NONNULL])
2214 AC_GCC_WARNING_SUBST_NO([overflow], [FLAG_W_NO_OVERFLOW])
2215 AC_GCC_WARNING_SUBST_NO([pointer-sign], [FLAG_W_NO_POINTER_SIGN])
2216 AC_GCC_WARNING_SUBST_NO([uninitialized], [FLAG_W_NO_UNINITIALIZED])
2217 AC_GCC_WARNING_SUBST_NO([unused-function], [FLAG_W_NO_UNUSED_FUNCTION])
2218 AC_GCC_WARNING_SUBST_NO([static-local-in-inline], [FLAG_W_NO_STATIC_LOCAL_IN_INLINE])
2219 AC_GCC_WARNING_SUBST_NO([mismatched-new-delete], [FLAG_W_NO_MISMATCHED_NEW_DELETE])
2220 AC_GCC_WARNING_SUBST_NO([infinite-recursion], [FLAG_W_NO_INFINITE_RECURSION])
2222 AC_GCC_WARNING_SUBST([write-strings], [FLAG_W_WRITE_STRINGS])
2223 AC_GCC_WARNING_SUBST([empty-body], [FLAG_W_EMPTY_BODY])
2224 AC_GCC_WARNING_SUBST([format], [FLAG_W_FORMAT])
2225 AC_GCC_WARNING_SUBST([format-signedness], [FLAG_W_FORMAT_SIGNEDNESS])
2226 AC_GCC_WARNING_SUBST([cast-qual], [FLAG_W_CAST_QUAL])
2227 AC_GCC_WARNING_SUBST([old-style-declaration], [FLAG_W_OLD_STYLE_DECLARATION])
2228 AC_GCC_WARNING_SUBST([ignored-qualifiers], [FLAG_W_IGNORED_QUALIFIERS])
2229 AC_GCC_WARNING_SUBST([missing-parameter-type], [FLAG_W_MISSING_PARAMETER_TYPE])
2230 AC_GCC_WARNING_SUBST([logical-op], [FLAG_W_LOGICAL_OP])
2231 AC_GCC_WARNING_SUBST([enum-conversion], [FLAG_W_ENUM_CONVERSION])
2232 AC_GCC_WARNING_SUBST([implicit-fallthrough=2], [FLAG_W_IMPLICIT_FALLTHROUGH])
2234 # Does this compiler support -Wformat-security ?
2235 # Special handling is needed, because certain GCC versions require -Wformat
2236 # being present if -Wformat-security is given. Otherwise a warning is issued.
2237 # However, AC_GCC_WARNING_SUBST will stick in -Werror (see r15323 for rationale).
2238 # And with that the warning will be turned into an error with the result
2239 # that -Wformat-security is believed to be unsupported when in fact it is.
2240 AC_MSG_CHECKING([if gcc accepts -Wformat-security])
2242 CFLAGS="-Wformat -Wformat-security -Werror"
2243 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [
2244 AC_SUBST([FLAG_W_FORMAT_SECURITY], [-Wformat-security])
2245 AC_MSG_RESULT([yes])], [
2246 AC_SUBST([FLAG_W_FORMAT_SECURITY], [])
2247 AC_MSG_RESULT([no])])
2250 # does this compiler support -Wextra or the older -W ?
2252 AC_MSG_CHECKING([if gcc accepts -Wextra or -W])
2255 CFLAGS="-Wextra -Werror"
2257 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2260 AC_SUBST([FLAG_W_EXTRA], [-Wextra])
2261 AC_MSG_RESULT([-Wextra])
2264 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2267 AC_SUBST([FLAG_W_EXTRA], [-W])
2270 AC_SUBST([FLAG_W_EXTRA], [])
2271 AC_MSG_RESULT([not supported])
2276 # On ARM we do not want to pass -Wcast-align as that produces loads
2277 # of warnings. GCC is just being conservative. See here:
2278 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65459#c4
2279 if test "X$VGCONF_ARCH_PRI" = "Xarm"; then
2280 AC_SUBST([FLAG_W_CAST_ALIGN], [""])
2282 AC_SUBST([FLAG_W_CAST_ALIGN], [-Wcast-align])
2285 # does this compiler support -faligned-new ?
2286 AC_MSG_CHECKING([if g++ accepts -faligned-new])
2288 safe_CXXFLAGS=$CXXFLAGS
2289 CXXFLAGS="-faligned-new -Werror"
2292 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2295 FLAG_FALIGNED_NEW="-faligned-new"
2296 AC_MSG_RESULT([yes])
2298 FLAG_FALIGNED_NEW=""
2301 CXXFLAGS=$safe_CXXFLAGS
2304 AC_SUBST(FLAG_FALIGNED_NEW)
2306 # does this compiler support -fsized-deallocation ?
2307 AC_MSG_CHECKING([if g++ accepts -fsized-deallocation])
2309 safe_CXXFLAGS=$CXXFLAGS
2310 CXXFLAGS="-fsized-deallocation -Werror"
2313 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2316 FLAG_FSIZED_DEALLOCATION="-fsized-deallocation"
2317 ac_have_sized_deallocation=yes
2318 AC_MSG_RESULT([yes])
2320 FLAG_FSIZED_DEALLOCATION=""
2321 ac_have_sized_deallocation=no
2324 CXXFLAGS=$safe_CXXFLAGS
2327 AC_SUBST(FLAG_FSIZED_DEALLOCATION)
2328 AM_CONDITIONAL([HAVE_FSIZED_DEALLOCATION], [test x$ac_have_sized_deallocation = xyes])
2331 # does this compiler support -fno-stack-protector ?
2332 AC_MSG_CHECKING([if gcc accepts -fno-stack-protector])
2335 CFLAGS="-fno-stack-protector -Werror"
2337 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2340 no_stack_protector=yes
2341 FLAG_FNO_STACK_PROTECTOR="-fno-stack-protector"
2342 AC_MSG_RESULT([yes])
2344 no_stack_protector=no
2345 FLAG_FNO_STACK_PROTECTOR=""
2350 AC_SUBST(FLAG_FNO_STACK_PROTECTOR)
2352 # does this compiler support -finline-functions ?
2353 AC_MSG_CHECKING([if gcc accepts -finline-functions])
2356 CFLAGS="-finline-functions -Werror"
2358 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2361 inline_functions=yes
2362 FLAG_FINLINE_FUNCTIONS="-finline-functions"
2363 AC_MSG_RESULT([yes])
2366 FLAG_FINLINE_FUNCTIONS=""
2371 AC_SUBST(FLAG_FINLINE_FUNCTIONS)
2373 # Does GCC support disabling Identical Code Folding?
2374 # We want to disabled Identical Code Folding for the
2375 # tools preload shared objects to get better backraces.
2376 # For GCC 5.1+ -fipa-icf is enabled by default at -O2.
2377 # "The optimization reduces code size and may disturb
2378 # unwind stacks by replacing a function by equivalent
2379 # one with a different name."
2380 AC_MSG_CHECKING([if gcc accepts -fno-ipa-icf])
2383 CFLAGS="-fno-ipa-icf -Werror"
2385 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2389 FLAG_FNO_IPA_ICF="-fno-ipa-icf"
2390 AC_MSG_RESULT([yes])
2398 AC_SUBST(FLAG_FNO_IPA_ICF)
2401 # Does this compiler support -fsanitize=undefined. This is true for
2402 # GCC 4.9 and newer. However, the undefined behaviour sanitiser in GCC 5.1
2403 # also checks for alignment violations on memory accesses which the valgrind
2404 # code base is sprinkled (if not littered) with. As those alignment issues
2405 # don't pose a problem we want to suppress warnings about them.
2406 # In GCC 5.1 this can be done by passing -fno-sanitize=alignment. Earlier
2407 # GCCs do not support that.
2409 # Only checked for if --enable-ubsan was given.
2410 if test "x${vg_cv_ubsan}" = "xyes"; then
2411 AC_MSG_CHECKING([if gcc accepts -fsanitize=undefined -fno-sanitize=alignment])
2413 CFLAGS="-fsanitize=undefined -fno-sanitize=alignment -Werror"
2414 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2417 FLAG_FSANITIZE="-fsanitize=undefined -fno-sanitize=alignment"
2418 LIB_UBSAN="-static-libubsan"
2419 AC_MSG_RESULT([yes])
2421 CFLAGS="-fsanitize=undefined -Werror"
2422 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2425 FLAG_FSANITIZE="-fsanitize=undefined"
2426 LIB_UBSAN="-static-libubsan"
2427 AC_MSG_RESULT([yes])
2435 AC_SUBST(FLAG_FSANITIZE)
2438 # does this compiler support --param inline-unit-growth=... ?
2440 AC_MSG_CHECKING([if gcc accepts --param inline-unit-growth])
2443 CFLAGS="--param inline-unit-growth=900 -Werror"
2445 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2448 AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH],
2449 ["--param inline-unit-growth=900"])
2450 AC_MSG_RESULT([yes])
2452 AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH], [""])
2458 # does this compiler support -gdwarf-4 -fdebug-types-section ?
2460 AC_MSG_CHECKING([if gcc accepts -gdwarf-4 -fdebug-types-section])
2463 CFLAGS="-gdwarf-4 -fdebug-types-section -Werror"
2465 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2469 AC_MSG_RESULT([yes])
2474 AM_CONDITIONAL(DWARF4, test x$ac_have_dwarf4 = xyes)
2478 # does this compiler support -g -gz=zlib ?
2480 AC_MSG_CHECKING([if gcc accepts -g -gz=zlib])
2483 CFLAGS="-g -gz=zlib"
2485 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2489 AC_MSG_RESULT([yes])
2494 AM_CONDITIONAL(GZ_ZLIB, test x$ac_have_gz_zlib = xyes)
2498 # does this compiler support -g -gz=zlib-gnu ?
2500 AC_MSG_CHECKING([if gcc accepts -g -gz=zlib-gnu])
2503 CFLAGS="-g -gz=zlib-gnu"
2505 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2508 ac_have_gz_zlib_gnu=yes
2509 AC_MSG_RESULT([yes])
2511 ac_have_gz_zlib_gnu=no
2514 AM_CONDITIONAL(GZ_ZLIB_GNU, test x$ac_have_gz_zlib_gnu = xyes)
2518 # does this compiler support nested functions ?
2520 AC_MSG_CHECKING([if gcc accepts nested functions])
2522 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2523 int foo() { return 1; }
2526 ac_have_nested_functions=yes
2527 AC_MSG_RESULT([yes])
2529 ac_have_nested_functions=no
2532 AM_CONDITIONAL([HAVE_NESTED_FUNCTIONS], [test x$ac_have_nested_functions = xyes])
2535 # does this compiler support the 'p' constraint in ASM statements ?
2537 AC_MSG_CHECKING([if gcc accepts the 'p' constraint in asm statements])
2539 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2541 __asm__ __volatile__ ("movdqa (%0),%%xmm6\n" : "=p" (p));
2543 ac_have_asm_constraint_p=yes
2544 AC_MSG_RESULT([yes])
2546 ac_have_asm_constraint_p=no
2549 AM_CONDITIONAL([HAVE_ASM_CONSTRAINT_P], [test x$ac_have_asm_constraint_p = xyes])
2552 # Does this compiler and linker support -pie?
2553 # Some compilers actually do not support -pie and report its usage
2554 # as an error. We need to check if it is safe to use it first.
2556 AC_MSG_CHECKING([if gcc accepts -pie])
2561 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2564 AC_SUBST([FLAG_PIE], ["-pie"])
2565 AC_MSG_RESULT([yes])
2567 AC_SUBST([FLAG_PIE], [""])
2573 # Does this compiler support -no-pie?
2574 # On Ubuntu 16.10+, gcc produces position independent executables (PIE) by
2575 # default. However this gets in the way with some tests, we use -no-pie
2578 AC_MSG_CHECKING([if gcc accepts -no-pie])
2583 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2586 AC_SUBST([FLAG_NO_PIE], ["-no-pie"])
2587 AC_MSG_RESULT([yes])
2589 AC_SUBST([FLAG_NO_PIE], [""])
2595 # We want to use use the -Ttext-segment option to the linker.
2596 # GNU (bfd) ld supports this directly. Newer GNU gold linkers
2597 # support it as an alias of -Ttext. Sadly GNU (bfd) ld's -Ttext
2598 # semantics are NOT what we want (GNU gold -Ttext is fine).
2600 # For GNU (bfd) ld -Ttext-segment chooses the base at which ELF headers
2601 # will reside. -Ttext aligns just the .text section start (but not any
2604 # So test for -Ttext-segment which is supported by all bfd ld versions
2605 # and use that if it exists. If it doesn't exist it must be an older
2606 # version of gold and we can fall back to using -Ttext which has the
2609 AC_MSG_CHECKING([if the linker accepts -Wl,-Ttext-segment])
2612 CFLAGS="-static -nodefaultlibs -nostartfiles -Wl,-Ttext-segment=$valt_load_address_pri_norml -Werror"
2615 [AC_LANG_SOURCE([int _start () { return 0; }])],
2617 linker_using_t_text="no"
2618 AC_SUBST([FLAG_T_TEXT], ["-Ttext-segment"])
2619 AC_MSG_RESULT([yes])
2621 linker_using_t_text="yes"
2622 AC_SUBST([FLAG_T_TEXT], ["-Ttext"])
2627 # If the linker only supports -Ttext (not -Ttext-segment) then we will
2628 # have to strip any build-id ELF NOTEs from the statically linked tools.
2629 # Otherwise the build-id NOTE might end up at the default load address.
2630 # (Pedantically if the linker is gold then -Ttext is fine, but newer
2631 # gold versions also support -Ttext-segment. So just assume that unless
2632 # we can use -Ttext-segment we need to strip the build-id NOTEs.
2633 if test "x${linker_using_t_text}" = "xyes"; then
2634 AC_MSG_NOTICE([ld -Ttext used, need to strip build-id NOTEs.])
2635 # does the linker support -Wl,--build-id=none ? Note, it's
2636 # important that we test indirectly via whichever C compiler
2637 # is selected, rather than testing /usr/bin/ld or whatever
2639 AC_MSG_CHECKING([if the linker accepts -Wl,--build-id=none])
2641 CFLAGS="-Wl,--build-id=none -Werror"
2644 [AC_LANG_PROGRAM([ ], [return 0;])],
2646 AC_SUBST([FLAG_NO_BUILD_ID], ["-Wl,--build-id=none"])
2647 AC_MSG_RESULT([yes])
2649 AC_SUBST([FLAG_NO_BUILD_ID], [""])
2653 AC_MSG_NOTICE([ld -Ttext-segment used, no need to strip build-id NOTEs.])
2654 AC_SUBST([FLAG_NO_BUILD_ID], [""])
2658 # does the ppc assembler support "mtocrf" et al?
2659 AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf])
2661 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2662 __asm__ __volatile__("mtocrf 4,0");
2663 __asm__ __volatile__("mfocrf 0,4");
2665 ac_have_as_ppc_mftocrf=yes
2666 AC_MSG_RESULT([yes])
2668 ac_have_as_ppc_mftocrf=no
2671 if test x$ac_have_as_ppc_mftocrf = xyes ; then
2672 AC_DEFINE(HAVE_AS_PPC_MFTOCRF, 1, [Define to 1 if as supports mtocrf/mfocrf.])
2676 # does the ppc assembler support "lfdp" and other phased out floating point insns?
2677 AC_MSG_CHECKING([if ppc32/64 asm supports phased out floating point instructions])
2679 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2680 do { typedef struct {
2684 dbl_pair_t dbl_pair[3];
2685 __asm__ volatile ("lfdp 10, %0"::"m" (dbl_pair[0]));
2688 ac_have_as_ppc_fpPO=yes
2689 AC_MSG_RESULT([yes])
2691 ac_have_as_ppc_fpPO=no
2694 if test x$ac_have_as_ppc_fpPO = xyes ; then
2695 AC_DEFINE(HAVE_AS_PPC_FPPO, 1, [Define to 1 if as supports floating point phased out category.])
2699 # does the amd64 assembler understand "fxsave64" and "fxrstor64"?
2700 AC_MSG_CHECKING([if amd64 assembler supports fxsave64/fxrstor64])
2702 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2704 asm __volatile__("fxsave64 (%0)" : : "r" (p) : "memory" );
2705 asm __volatile__("fxrstor64 (%0)" : : "r" (p) : "memory" );
2707 ac_have_as_amd64_fxsave64=yes
2708 AC_MSG_RESULT([yes])
2710 ac_have_as_amd64_fxsave64=no
2713 if test x$ac_have_as_amd64_fxsave64 = xyes ; then
2714 AC_DEFINE(HAVE_AS_AMD64_FXSAVE64, 1, [Define to 1 if as supports fxsave64/fxrstor64.])
2717 # does the x86/amd64 assembler understand SSE3 instructions?
2718 # Note, this doesn't generate a C-level symbol. It generates a
2719 # automake-level symbol (BUILD_SSE3_TESTS), used in test Makefile.am's
2720 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE3])
2722 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2723 do { long long int x;
2724 __asm__ __volatile__("fisttpq (%0)" : :"r"(&x) ); }
2728 AC_MSG_RESULT([yes])
2734 AM_CONDITIONAL(BUILD_SSE3_TESTS, test x$ac_have_as_sse3 = xyes)
2737 # Ditto for SSSE3 instructions (note extra S)
2738 # Note, this doesn't generate a C-level symbol. It generates a
2739 # automake-level symbol (BUILD_SSSE3_TESTS), used in test Makefile.am's
2740 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSSE3])
2742 save_CFLAGS="$CFLAGS"
2743 CFLAGS="$CFLAGS -msse -Werror"
2744 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2745 do { long long int x;
2746 __asm__ __volatile__(
2747 "pabsb (%0),%%xmm7" : : "r"(&x) : "xmm7" ); }
2750 ac_have_as_ssse3=yes
2751 AC_MSG_RESULT([yes])
2756 CFLAGS="$save_CFLAGS"
2758 AM_CONDITIONAL(BUILD_SSSE3_TESTS, test x$ac_have_as_ssse3 = xyes)
2761 # does the x86/amd64 assembler understand the PCLMULQDQ instruction?
2762 # Note, this doesn't generate a C-level symbol. It generates a
2763 # automake-level symbol (BUILD_PCLMULQDQ_TESTS), used in test Makefile.am's
2764 AC_MSG_CHECKING([if x86/amd64 assembler supports 'pclmulqdq'])
2765 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2767 __asm__ __volatile__(
2768 "pclmulqdq \$17,%%xmm6,%%xmm7" : : : "xmm6", "xmm7" ); }
2771 ac_have_as_pclmulqdq=yes
2772 AC_MSG_RESULT([yes])
2774 ac_have_as_pclmulqdq=no
2778 AM_CONDITIONAL(BUILD_PCLMULQDQ_TESTS, test x$ac_have_as_pclmulqdq = xyes)
2781 # does the x86/amd64 assembler understand the VPCLMULQDQ instruction?
2782 # Note, this doesn't generate a C-level symbol. It generates a
2783 # automake-level symbol (BUILD_VPCLMULQDQ_TESTS), used in test Makefile.am's
2784 AC_MSG_CHECKING([if x86/amd64 assembler supports 'vpclmulqdq'])
2785 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2788 * Carry-less multiplication of xmm1 with xmm2 and store the result in
2789 * xmm3. The immediate is used to determine which quadwords of xmm1 and
2790 * xmm2 should be used.
2792 __asm__ __volatile__(
2793 "vpclmulqdq \$0,%%xmm1,%%xmm2,%%xmm3" : : : );
2796 ac_have_as_vpclmulqdq=yes
2797 AC_MSG_RESULT([yes])
2799 ac_have_as_vpclmulqdq=no
2803 AM_CONDITIONAL(BUILD_VPCLMULQDQ_TESTS, test x$ac_have_as_vpclmulqdq = xyes)
2806 # does the x86/amd64 assembler understand FMA4 instructions?
2807 # Note, this doesn't generate a C-level symbol. It generates a
2808 # automake-level symbol (BUILD_AFM4_TESTS), used in test Makefile.am's
2809 AC_MSG_CHECKING([if x86/amd64 assembler supports FMA4 'vfmaddpd'])
2810 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2812 __asm__ __volatile__(
2813 "vfmaddpd %%xmm7,%%xmm8,%%xmm6,%%xmm9" : : : );
2816 ac_have_as_vfmaddpd=yes
2817 AC_MSG_RESULT([yes])
2819 ac_have_as_vfmaddpd=no
2823 AM_CONDITIONAL(BUILD_FMA4_TESTS, test x$ac_have_as_vfmaddpd = xyes)
2826 # does the x86/amd64 assembler understand the LZCNT instruction?
2827 # Note, this doesn't generate a C-level symbol. It generates a
2828 # automake-level symbol (BUILD_LZCNT_TESTS), used in test Makefile.am's
2829 AC_MSG_CHECKING([if x86/amd64 assembler supports 'lzcnt'])
2831 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2833 __asm__ __volatile__("lzcnt %%rax,%%rax" : : : "rax");
2836 ac_have_as_lzcnt=yes
2837 AC_MSG_RESULT([yes])
2843 AM_CONDITIONAL([BUILD_LZCNT_TESTS], [test x$ac_have_as_lzcnt = xyes])
2846 # does the x86/amd64 assembler understand the LOOPNEL instruction?
2847 # Note, this doesn't generate a C-level symbol. It generates a
2848 # automake-level symbol (BUILD_LOOPNEL_TESTS), used in test Makefile.am's
2849 AC_MSG_CHECKING([if x86/amd64 assembler supports 'loopnel'])
2851 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2853 __asm__ __volatile__("1: loopnel 1b\n");
2856 ac_have_as_loopnel=yes
2857 AC_MSG_RESULT([yes])
2859 ac_have_as_loopnel=no
2863 AM_CONDITIONAL([BUILD_LOOPNEL_TESTS], [test x$ac_have_as_loopnel = xyes])
2866 # does the x86/amd64 assembler understand ADDR32 ?
2867 # Note, this doesn't generate a C-level symbol. It generates a
2868 # automake-level symbol (BUILD_ADDR32_TESTS), used in test Makefile.am's
2869 AC_MSG_CHECKING([if x86/amd64 assembler supports 'addr32'])
2871 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2873 asm volatile ("addr32 rep movsb");
2876 ac_have_as_addr32=yes
2877 AC_MSG_RESULT([yes])
2879 ac_have_as_addr32=no
2883 AM_CONDITIONAL([BUILD_ADDR32_TESTS], [test x$ac_have_as_addr32 = xyes])
2886 # does the x86/amd64 assembler understand SSE 4.2 instructions?
2887 # Note, this doesn't generate a C-level symbol. It generates a
2888 # automake-level symbol (BUILD_SSE42_TESTS), used in test Makefile.am's
2889 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE4.2])
2891 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2892 do { long long int x;
2893 __asm__ __volatile__(
2894 "crc32q %%r15,%%r15" : : : "r15" );
2895 __asm__ __volatile__(
2896 "pblendvb (%%rcx), %%xmm11" : : : "memory", "xmm11");
2897 __asm__ __volatile__(
2898 "aesdec %%xmm2, %%xmm1" : : : "xmm2", "xmm1"); }
2901 ac_have_as_sse42=yes
2902 AC_MSG_RESULT([yes])
2908 AM_CONDITIONAL(BUILD_SSE42_TESTS, test x$ac_have_as_sse42 = xyes)
2911 # does the x86/amd64 assembler understand AVX instructions?
2912 # Note, this doesn't generate a C-level symbol. It generates a
2913 # automake-level symbol (BUILD_AVX_TESTS), used in test Makefile.am's
2914 AC_MSG_CHECKING([if x86/amd64 assembler speaks AVX])
2916 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2917 do { long long int x;
2918 __asm__ __volatile__(
2919 "vmovupd (%%rsp), %%ymm7" : : : "xmm7" );
2920 __asm__ __volatile__(
2921 "vaddpd %%ymm6,%%ymm7,%%ymm8" : : : "xmm6","xmm7","xmm8"); }
2925 AC_MSG_RESULT([yes])
2931 AM_CONDITIONAL(BUILD_AVX_TESTS, test x$ac_have_as_avx = xyes)
2934 # does the x86/amd64 assembler understand AVX2 instructions?
2935 # Note, this doesn't generate a C-level symbol. It generates a
2936 # automake-level symbol (BUILD_AVX2_TESTS), used in test Makefile.am's
2937 AC_MSG_CHECKING([if x86/amd64 assembler speaks AVX2])
2939 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2940 do { long long int x;
2941 __asm__ __volatile__(
2942 "vpsravd (%%rsp), %%ymm8, %%ymm7" : : : "xmm7", "xmm8" );
2943 __asm__ __volatile__(
2944 "vpaddb %%ymm6,%%ymm7,%%ymm8" : : : "xmm6","xmm7","xmm8"); }
2948 AC_MSG_RESULT([yes])
2954 AM_CONDITIONAL(BUILD_AVX2_TESTS, test x$ac_have_as_avx2 = xyes)
2957 # does the x86/amd64 assembler understand TSX instructions and
2958 # the XACQUIRE/XRELEASE prefixes?
2959 # Note, this doesn't generate a C-level symbol. It generates a
2960 # automake-level symbol (BUILD_TSX_TESTS), used in test Makefile.am's
2961 AC_MSG_CHECKING([if x86/amd64 assembler speaks TSX])
2963 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2965 __asm__ __volatile__(
2968 " xacquire lock incq 0(%rsp) \n\t"
2969 " xrelease lock incq 0(%rsp) \n"
2974 AC_MSG_RESULT([yes])
2980 AM_CONDITIONAL(BUILD_TSX_TESTS, test x$ac_have_as_tsx = xyes)
2983 # does the x86/amd64 assembler understand BMI1 and BMI2 instructions?
2984 # Note, this doesn't generate a C-level symbol. It generates a
2985 # automake-level symbol (BUILD_BMI_TESTS), used in test Makefile.am's
2986 AC_MSG_CHECKING([if x86/amd64 assembler speaks BMI1 and BMI2])
2988 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2989 do { unsigned int h, l;
2990 __asm__ __volatile__( "mulx %rax,%rcx,%r8" );
2991 __asm__ __volatile__(
2992 "andn %2, %1, %0" : "=r" (h) : "r" (0x1234567), "r" (0x7654321) );
2993 __asm__ __volatile__(
2994 "movl %2, %%edx; mulx %3, %1, %0" : "=r" (h), "=r" (l) : "g" (0x1234567), "rm" (0x7654321) : "edx" ); }
2998 AC_MSG_RESULT([yes])
3004 AM_CONDITIONAL(BUILD_BMI_TESTS, test x$ac_have_as_bmi = xyes)
3007 # does the x86/amd64 assembler understand FMA instructions?
3008 # Note, this doesn't generate a C-level symbol. It generates a
3009 # automake-level symbol (BUILD_FMA_TESTS), used in test Makefile.am's
3010 AC_MSG_CHECKING([if x86/amd64 assembler speaks FMA])
3012 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3013 do { unsigned int h, l;
3014 __asm__ __volatile__(
3015 "vfmadd132ps (%%rsp), %%ymm8, %%ymm7" : : : "xmm7", "xmm8" );
3016 __asm__ __volatile__(
3017 "vfnmsub231sd (%%rsp), %%xmm8, %%xmm7" : : : "xmm7", "xmm8" );
3018 __asm__ __volatile__(
3019 "vfmsubadd213pd (%%rsp), %%xmm8, %%xmm7" : : : "xmm7", "xmm8" ); }
3023 AC_MSG_RESULT([yes])
3029 AM_CONDITIONAL(BUILD_FMA_TESTS, test x$ac_have_as_fma = xyes)
3032 # does the amd64 assembler understand MPX instructions?
3033 # Note, this doesn't generate a C-level symbol. It generates a
3034 # automake-level symbol (BUILD_MPX_TESTS), used in test Makefile.am's
3035 AC_MSG_CHECKING([if amd64 assembler knows the MPX instructions])
3037 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3039 asm ("bndmov %bnd0,(%rsp)");
3040 asm ("bndldx 3(%rbx,%rdx), %bnd2");
3041 asm ("bnd call foo\n"
3048 AC_MSG_RESULT([yes])
3054 AM_CONDITIONAL(BUILD_MPX_TESTS, test x$ac_have_as_mpx = xyes)
3057 # does the amd64 assembler understand ADX instructions?
3058 # Note, this doesn't generate a C-level symbol. It generates a
3059 # automake-level symbol (BUILD_ADX_TESTS), used in test Makefile.am's
3060 AC_MSG_CHECKING([if amd64 assembler knows the ADX instructions])
3062 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3064 asm ("adcxq %r14,%r8");
3068 AC_MSG_RESULT([yes])
3074 AM_CONDITIONAL(BUILD_ADX_TESTS, test x$ac_have_as_adx = xyes)
3077 # does the amd64 assembler understand the RDRAND instruction?
3078 # Note, this doesn't generate a C-level symbol. It generates a
3079 # automake-level symbol (BUILD_RDRAND_TESTS), used in test Makefile.am's
3080 AC_MSG_CHECKING([if amd64 assembler knows the RDRAND instruction])
3082 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3084 asm ("rdrand %r14");
3085 asm ("rdrand %r14d");
3086 asm ("rdrand %r14w");
3089 ac_have_as_rdrand=yes
3090 AC_MSG_RESULT([yes])
3092 ac_have_as_rdrand=no
3096 AM_CONDITIONAL(BUILD_RDRAND_TESTS, test x$ac_have_as_rdrand = xyes)
3098 # does the amd64 assembler understand the RDSEED instruction?
3099 # Note, this doesn't generate a C-level symbol. It generates a
3100 # automake-level symbol (BUILD_RDSEED_TESTS), used in test Makefile.am's
3101 AC_MSG_CHECKING([if amd64 assembler knows the RDSEED instruction])
3103 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3105 asm ("rdseed %r14");
3106 asm ("rdseed %r14d");
3107 asm ("rdseed %r14w");
3110 ac_have_as_rdseed=yes
3111 AC_MSG_RESULT([yes])
3113 ac_have_as_rdseed=no
3117 AM_CONDITIONAL(BUILD_RDSEED_TESTS, test x$ac_have_as_rdseed = xyes)
3119 # does the amd64 assembler understand the F16C instructions (VCVTPH2PS and
3121 # Note, this doesn't generate a C-level symbol. It generates a
3122 # automake-level symbol (BUILD_F16C_TESTS), used in test Makefile.am's
3123 AC_MSG_CHECKING([if amd64 assembler knows the F16C instructions])
3125 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3127 asm ("vcvtph2ps %xmm5, %ymm10");
3128 // If we put the dollar sign and zero together, the shell processing
3129 // this configure.ac script substitutes the command name in. Sigh.
3130 asm ("vcvtps2ph $" "0, %ymm10, %xmm5");
3134 AC_MSG_RESULT([yes])
3140 AM_CONDITIONAL(BUILD_F16C_TESTS, test x$ac_have_as_f16c = xyes)
3143 # does the x86/amd64 assembler understand MOVBE?
3144 # Note, this doesn't generate a C-level symbol. It generates a
3145 # automake-level symbol (BUILD_MOVBE_TESTS), used in test Makefile.am's
3146 AC_MSG_CHECKING([if x86/amd64 assembler knows the MOVBE insn])
3148 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3149 do { long long int x;
3150 __asm__ __volatile__(
3151 "movbe (%%rsp), %%r15" : : : "memory", "r15" ); }
3154 ac_have_as_movbe=yes
3155 AC_MSG_RESULT([yes])
3161 AM_CONDITIONAL(BUILD_MOVBE_TESTS, test x$ac_have_as_movbe = xyes)
3164 # Does the C compiler support the "ifunc" attribute
3165 # Note, this doesn't generate a C-level symbol. It generates a
3166 # automake-level symbol (BUILD_IFUNC_TESTS), used in test Makefile.am's
3167 AC_MSG_CHECKING([if gcc supports the ifunc attribute])
3169 AC_LINK_IFELSE([AC_LANG_SOURCE([[
3170 static void mytest(void) {}
3172 static void (*resolve_test(void))(void)
3174 return (void (*)(void))&mytest;
3177 void test(void) __attribute__((ifunc("resolve_test")));
3185 ac_have_ifunc_attr=yes
3186 AC_MSG_RESULT([yes])
3188 ac_have_ifunc_attr=no
3192 AM_CONDITIONAL(BUILD_IFUNC_TESTS, test x$ac_have_ifunc_attr = xyes)
3194 # Does the C compiler support the armv8 crc feature flag
3195 # Note, this doesn't generate a C-level symbol. It generates a
3196 # automake-level symbol (BUILD_ARMV8_CRC_TESTS), used in test Makefile.am's
3197 AC_MSG_CHECKING([if gcc supports the armv8 crc feature flag])
3199 save_CFLAGS="$CFLAGS"
3200 CFLAGS="$CFLAGS -march=armv8-a+crc -Werror"
3201 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3207 ac_have_armv8_crc_feature=yes
3208 AC_MSG_RESULT([yes])
3210 ac_have_armv8_crc_feature=no
3213 CFLAGS="$save_CFLAGS"
3215 AM_CONDITIONAL(BUILD_ARMV8_CRC_TESTS, test x$ac_have_armv8_crc_feature = xyes)
3218 # Does the C compiler support the armv81 flag and the assembler v8.1 instructions
3219 # Note, this doesn't generate a C-level symbol. It generates a
3220 # automake-level symbol (BUILD_ARMV81_TESTS), used in test Makefile.am's
3221 AC_MSG_CHECKING([if gcc supports the armv81 feature flag and assembler supports v8.1 instructions])
3223 save_CFLAGS="$CFLAGS"
3224 CFLAGS="$CFLAGS -march=armv8.1-a -Werror"
3225 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3228 __asm__ __volatile__("ldadd x0, x1, [x2]" ::: "memory");
3232 ac_have_armv81_feature=yes
3233 AC_MSG_RESULT([yes])
3235 ac_have_armv81_feature=no
3238 CFLAGS="$save_CFLAGS"
3240 AM_CONDITIONAL(BUILD_ARMV81_TESTS, test x$ac_have_armv81_feature = xyes)
3243 # Does the C compiler support the armv82 flag and the assembler v8.2 instructions
3244 # Note, this doesn't generate a C-level symbol. It generates a
3245 # automake-level symbol (BUILD_ARMV82_TESTS), used in test Makefile.am's
3246 AC_MSG_CHECKING([if gcc supports the armv82 feature flag and assembler supports v8.2 instructions])
3248 save_CFLAGS="$CFLAGS"
3249 CFLAGS="$CFLAGS -march=armv8.2-a+fp16 -Werror"
3250 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3253 __asm__ __volatile__("faddp h0, v1.2h");
3257 ac_have_armv82_feature=yes
3258 AC_MSG_RESULT([yes])
3260 ac_have_armv82_feature=no
3263 CFLAGS="$save_CFLAGS"
3265 AM_CONDITIONAL(BUILD_ARMV82_TESTS, test x$ac_have_armv82_feature = xyes)
3268 # XXX JRS 2010 Oct 13: what is this for? For sure, we don't need this
3269 # when building the tool executables. I think we should get rid of it.
3271 # Check for TLS support in the compiler and linker
3272 AC_LINK_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
3274 [vg_cv_linktime_tls=yes],
3275 [vg_cv_linktime_tls=no])
3276 # Native compilation: check whether running a program using TLS succeeds.
3277 # Linking only is not sufficient -- e.g. on Red Hat 7.3 linking TLS programs
3278 # succeeds but running programs using TLS fails.
3279 # Cross-compiling: check whether linking a program using TLS succeeds.
3280 AC_CACHE_CHECK([for TLS support], vg_cv_tls,
3281 [AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS],
3282 [vg_cv_tls=$enableval],
3283 [AC_RUN_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
3287 [vg_cv_tls=$vg_cv_linktime_tls])])])
3289 if test "$vg_cv_tls" = yes -a $is_clang != applellvm; then
3290 AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variables])
3294 #----------------------------------------------------------------------------
3295 # Solaris-specific checks.
3296 #----------------------------------------------------------------------------
3298 if test "$VGCONF_OS" = "solaris" ; then
3299 AC_CHECK_HEADERS([sys/lgrp_user_impl.h])
3301 # Solaris-specific check determining if the Sun Studio Assembler is used to
3302 # build Valgrind. The test checks if the x86/amd64 assembler understands the
3303 # cmovl.l instruction, if yes then it's Sun Assembler.
3305 # C-level symbol: none
3306 # Automake-level symbol: SOLARIS_SUN_STUDIO_AS
3308 AC_MSG_CHECKING([if x86/amd64 assembler speaks cmovl.l (Solaris-specific)])
3309 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3311 __asm__ __volatile__("cmovl.l %edx, %eax");
3313 solaris_have_sun_studio_as=yes
3314 AC_MSG_RESULT([yes])
3316 solaris_have_sun_studio_as=no
3319 AM_CONDITIONAL(SOLARIS_SUN_STUDIO_AS, test x$solaris_have_sun_studio_as = xyes)
3321 # Solaris-specific check determining if symbols __xpg4 and __xpg6
3322 # are present in linked shared libraries when gcc is invoked with -std=gnu99.
3323 # See solaris/vgpreload-solaris.mapfile for details.
3324 # gcc on older Solaris instructs linker to include these symbols,
3325 # gcc on illumos and newer Solaris does not.
3327 # C-level symbol: none
3328 # Automake-level symbol: SOLARIS_XPG_SYMBOLS_PRESENT
3330 save_CFLAGS="$CFLAGS"
3331 CFLAGS="$CFLAGS -std=gnu99"
3332 AC_MSG_CHECKING([if xpg symbols are present with -std=gnu99 (Solaris-specific)])
3333 temp_dir=$( /usr/bin/mktemp -d )
3334 cat <<_ACEOF >${temp_dir}/mylib.c
3336 int myfunc(void) { printf("LaPutyka\n"); }
3338 ${CC} ${CFLAGS} -fpic -shared -o ${temp_dir}/mylib.so ${temp_dir}/mylib.c
3339 xpg_present=$( /usr/bin/nm ${temp_dir}/mylib.so | ${EGREP} '(__xpg4|__xpg6)' )
3340 if test "x${xpg_present}" = "x" ; then
3341 solaris_xpg_symbols_present=no
3344 solaris_xpg_symbols_present=yes
3345 AC_MSG_RESULT([yes])
3348 AM_CONDITIONAL(SOLARIS_XPG_SYMBOLS_PRESENT, test x$solaris_xpg_symbols_present = xyes)
3349 CFLAGS="$save_CFLAGS"
3352 # Solaris-specific check determining if gcc enables largefile support by
3353 # default for 32-bit executables. If it does, then set SOLARIS_UNDEF_LARGESOURCE
3354 # variable with gcc flags which disable it.
3356 AC_MSG_CHECKING([if gcc enables largefile support for 32-bit apps (Solaris-specific)])
3357 save_CFLAGS="$CFLAGS"
3358 CFLAGS="$CFLAGS -m32"
3359 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3360 return _LARGEFILE_SOURCE;
3362 SOLARIS_UNDEF_LARGESOURCE="-U_LARGEFILE_SOURCE -U_LARGEFILE64_SOURCE -U_FILE_OFFSET_BITS"
3363 AC_MSG_RESULT([yes])
3365 SOLARIS_UNDEF_LARGESOURCE=""
3369 AC_SUBST(SOLARIS_UNDEF_LARGESOURCE)
3372 # Solaris-specific check determining if /proc/self/cmdline
3373 # or /proc/<pid>/cmdline is supported.
3375 # C-level symbol: SOLARIS_PROC_CMDLINE
3376 # Automake-level symbol: SOLARIS_PROC_CMDLINE
3378 AC_CHECK_FILE([/proc/self/cmdline],
3380 solaris_proc_cmdline=yes
3381 AC_DEFINE([SOLARIS_PROC_CMDLINE], 1,
3382 [Define to 1 if you have /proc/self/cmdline.])
3384 solaris_proc_cmdline=no
3386 AM_CONDITIONAL(SOLARIS_PROC_CMDLINE, test x$solaris_proc_cmdline = xyes)
3389 # Solaris-specific check determining default platform for the Valgrind launcher.
3390 # Used in case the launcher cannot select platform by looking at the client
3391 # image (for example because the executable is a shell script).
3393 # C-level symbol: SOLARIS_LAUNCHER_DEFAULT_PLATFORM
3394 # Automake-level symbol: none
3396 AC_MSG_CHECKING([for default platform of Valgrind launcher (Solaris-specific)])
3397 # Get the ELF class of /bin/sh first.
3398 if ! test -f /bin/sh; then
3399 AC_MSG_ERROR([Shell interpreter `/bin/sh' not found.])
3401 elf_class=$( /usr/bin/file /bin/sh | sed -n 's/.*ELF \(..\)-bit.*/\1/p' )
3402 case "$elf_class" in
3404 default_arch="$VGCONF_ARCH_PRI";
3407 if test "x$VGCONF_ARCH_SEC" != "x"; then
3408 default_arch="$VGCONF_ARCH_SEC"
3410 default_arch="$VGCONF_ARCH_PRI";
3414 AC_MSG_ERROR([Cannot determine ELF class of `/bin/sh'.])
3417 default_platform="$default_arch-$VGCONF_OS"
3418 AC_MSG_RESULT([$default_platform])
3419 AC_DEFINE_UNQUOTED([SOLARIS_LAUNCHER_DEFAULT_PLATFORM], ["$default_platform"],
3420 [Default platform for Valgrind launcher.])
3423 # Solaris-specific check determining if the old syscalls are available.
3425 # C-level symbol: SOLARIS_OLD_SYSCALLS
3426 # Automake-level symbol: SOLARIS_OLD_SYSCALLS
3428 AC_MSG_CHECKING([for the old Solaris syscalls (Solaris-specific)])
3429 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3430 #include <sys/syscall.h>
3434 solaris_old_syscalls=yes
3435 AC_MSG_RESULT([yes])
3436 AC_DEFINE([SOLARIS_OLD_SYSCALLS], 1,
3437 [Define to 1 if you have the old Solaris syscalls.])
3439 solaris_old_syscalls=no
3442 AM_CONDITIONAL(SOLARIS_OLD_SYSCALLS, test x$solaris_old_syscalls = xyes)
3445 # Solaris-specific check determining if the new accept() syscall is available.
3448 # int accept(int sock, struct sockaddr *name, socklen_t *namelenp,
3451 # New syscall (available on illumos):
3452 # int accept(int sock, struct sockaddr *name, socklen_t *namelenp,
3453 # int version, int flags);
3455 # If the old syscall is present then the following syscall will fail with
3456 # ENOTSOCK (because file descriptor 0 is not a socket), if the new syscall is
3457 # available then it will fail with EINVAL (because the flags parameter is
3460 # C-level symbol: SOLARIS_NEW_ACCEPT_SYSCALL
3461 # Automake-level symbol: none
3463 AC_MSG_CHECKING([for the new `accept' syscall (Solaris-specific)])
3464 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
3465 #include <sys/syscall.h>
3469 syscall(SYS_accept, 0, 0, 0, 0, -1);
3470 return !(errno == EINVAL);
3472 AC_MSG_RESULT([yes])
3473 AC_DEFINE([SOLARIS_NEW_ACCEPT_SYSCALL], 1,
3474 [Define to 1 if you have the new `accept' syscall.])
3480 # Solaris-specific check determining if the new illumos pipe() syscall is
3484 # longlong_t pipe();
3486 # New syscall (available on illumos):
3487 # int pipe(intptr_t arg, int flags);
3489 # If the old syscall is present then the following call will succeed, if the
3490 # new syscall is available then it will fail with EFAULT (because address 0
3491 # cannot be accessed).
3493 # C-level symbol: SOLARIS_NEW_PIPE_SYSCALL
3494 # Automake-level symbol: none
3496 AC_MSG_CHECKING([for the new `pipe' syscall (Solaris-specific)])
3497 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
3498 #include <sys/syscall.h>
3502 syscall(SYS_pipe, 0, 0);
3503 return !(errno == EFAULT);
3505 AC_MSG_RESULT([yes])
3506 AC_DEFINE([SOLARIS_NEW_PIPE_SYSCALL], 1,
3507 [Define to 1 if you have the new `pipe' syscall.])
3513 # Solaris-specific check determining if the new lwp_sigqueue() syscall is
3517 # int lwp_kill(id_t lwpid, int sig);
3519 # New syscall (available on Solaris 11):
3520 # int lwp_sigqueue(id_t lwpid, int sig, void *value,
3521 # int si_code, timespec_t *timeout);
3523 # C-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL
3524 # Automake-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL
3526 AC_MSG_CHECKING([for the new `lwp_sigqueue' syscall (Solaris-specific)])
3527 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3528 #include <sys/syscall.h>
3530 return !SYS_lwp_sigqueue;
3532 solaris_lwp_sigqueue_syscall=yes
3533 AC_MSG_RESULT([yes])
3534 AC_DEFINE([SOLARIS_LWP_SIGQUEUE_SYSCALL], 1,
3535 [Define to 1 if you have the new `lwp_sigqueue' syscall.])
3537 solaris_lwp_sigqueue_syscall=no
3540 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL, test x$solaris_lwp_sigqueue_syscall = xyes)
3543 # Solaris-specific check determining if the lwp_sigqueue() syscall
3544 # takes both pid and thread id arguments or just thread id.
3546 # Old syscall (available up to Solaris 11.3):
3547 # int lwp_sigqueue(id_t lwpid, int sig, void *value,
3548 # int si_code, timespec_t *timeout);
3550 # New syscall (available since Solaris 11.4):
3551 # int lwp_sigqueue(pid_t pid, id_t lwpid, int sig, void *value,
3552 # int si_code, timespec_t *timeout);
3554 # If the old syscall is present then the following syscall will fail with
3555 # EINVAL (because signal is out of range); if the new syscall is available
3556 # then it will fail with ESRCH (because it would not find such thread in the
3559 # C-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID
3560 # Automake-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID
3562 AM_COND_IF(SOLARIS_LWP_SIGQUEUE_SYSCALL,
3563 AC_MSG_CHECKING([if the `lwp_sigqueue' syscall accepts pid (Solaris-specific)])
3564 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
3565 #include <sys/syscall.h>
3569 syscall(SYS_lwp_sigqueue, 0, 101, 0, 0, 0, 0);
3570 return !(errno == ESRCH);
3572 solaris_lwp_sigqueue_syscall_takes_pid=yes
3573 AC_MSG_RESULT([yes])
3574 AC_DEFINE([SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID], 1,
3575 [Define to 1 if you have the new `lwp_sigqueue' syscall which accepts pid.])
3577 solaris_lwp_sigqueue_syscall_takes_pid=no
3580 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID,
3581 test x$solaris_lwp_sigqueue_syscall_takes_pid = xyes)
3583 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID, test x = y)
3587 # Solaris-specific check determining if the new lwp_name() syscall is
3590 # New syscall (available on Solaris 11):
3591 # int lwp_name(int opcode, id_t lwpid, char *name, size_t len);
3593 # C-level symbol: SOLARIS_LWP_NAME_SYSCALL
3594 # Automake-level symbol: SOLARIS_LWP_NAME_SYSCALL
3596 AC_MSG_CHECKING([for the new `lwp_name' syscall (Solaris-specific)])
3597 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3598 #include <sys/syscall.h>
3600 return !SYS_lwp_name;
3602 solaris_lwp_name_syscall=yes
3603 AC_MSG_RESULT([yes])
3604 AC_DEFINE([SOLARIS_LWP_NAME_SYSCALL], 1,
3605 [Define to 1 if you have the new `lwp_name' syscall.])
3607 solaris_lwp_name_syscall=no
3610 AM_CONDITIONAL(SOLARIS_LWP_NAME_SYSCALL, test x$solaris_lwp_name_syscall = xyes)
3613 # Solaris-specific check determining if the new getrandom() syscall is
3616 # New syscall (available on Solaris 11):
3617 # int getrandom(void *buf, size_t buflen, uint_t flags);
3619 # C-level symbol: SOLARIS_GETRANDOM_SYSCALL
3620 # Automake-level symbol: SOLARIS_GETRANDOM_SYSCALL
3622 AC_MSG_CHECKING([for the new `getrandom' syscall (Solaris-specific)])
3623 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3624 #include <sys/syscall.h>
3626 return !SYS_getrandom;
3628 solaris_getrandom_syscall=yes
3629 AC_MSG_RESULT([yes])
3630 AC_DEFINE([SOLARIS_GETRANDOM_SYSCALL], 1,
3631 [Define to 1 if you have the new `getrandom' syscall.])
3633 solaris_getrandom_syscall=no
3636 AM_CONDITIONAL(SOLARIS_GETRANDOM_SYSCALL, test x$solaris_getrandom_syscall = xyes)
3639 # Solaris-specific check determining if the new zone() syscall subcodes
3640 # ZONE_LIST_DEFUNCT and ZONE_GETATTR_DEFUNCT are available. These subcodes
3641 # were added in Solaris 11 but are missing on illumos.
3643 # C-level symbol: SOLARIS_ZONE_DEFUNCT
3644 # Automake-level symbol: SOLARIS_ZONE_DEFUNCT
3646 AC_MSG_CHECKING([for ZONE_LIST_DEFUNCT and ZONE_GETATTR_DEFUNCT (Solaris-specific)])
3647 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3648 #include <sys/zone.h>
3650 return !(ZONE_LIST_DEFUNCT && ZONE_GETATTR_DEFUNCT);
3652 solaris_zone_defunct=yes
3653 AC_MSG_RESULT([yes])
3654 AC_DEFINE([SOLARIS_ZONE_DEFUNCT], 1,
3655 [Define to 1 if you have the `ZONE_LIST_DEFUNCT' and `ZONE_GETATTR_DEFUNC' constants.])
3657 solaris_zone_defunct=no
3660 AM_CONDITIONAL(SOLARIS_ZONE_DEFUNCT, test x$solaris_zone_defunct = xyes)
3663 # Solaris-specific check determining if commands A_GETSTAT and A_SETSTAT
3664 # for auditon(2) subcode of the auditsys() syscall are available.
3665 # These commands are available in Solaris 11 and illumos but were removed
3668 # C-level symbol: SOLARIS_AUDITON_STAT
3669 # Automake-level symbol: SOLARIS_AUDITON_STAT
3671 AC_MSG_CHECKING([for A_GETSTAT and A_SETSTAT auditon(2) commands (Solaris-specific)])
3672 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3673 #include <bsm/audit.h>
3675 return !(A_GETSTAT && A_SETSTAT);
3677 solaris_auditon_stat=yes
3678 AC_MSG_RESULT([yes])
3679 AC_DEFINE([SOLARIS_AUDITON_STAT], 1,
3680 [Define to 1 if you have the `A_GETSTAT' and `A_SETSTAT' constants.])
3682 solaris_auditon_stat=no
3685 AM_CONDITIONAL(SOLARIS_AUDITON_STAT, test x$solaris_auditon_stat = xyes)
3688 # Solaris-specific check determining if the new shmsys() syscall subcodes
3689 # IPC_XSTAT64, SHMADV, SHM_ADV_GET, SHM_ADV_SET and SHMGET_OSM are available.
3690 # These subcodes were added in Solaris 11 but are missing on illumos.
3692 # C-level symbol: SOLARIS_SHM_NEW
3693 # Automake-level symbol: SOLARIS_SHM_NEW
3695 AC_MSG_CHECKING([for SHMADV, SHM_ADV_GET, SHM_ADV_SET and SHMGET_OSM (Solaris-specific)])
3696 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3697 #include <sys/ipc_impl.h>
3698 #include <sys/shm.h>
3699 #include <sys/shm_impl.h>
3701 return !(IPC_XSTAT64 && SHMADV && SHM_ADV_GET && SHM_ADV_SET && SHMGET_OSM);
3704 AC_MSG_RESULT([yes])
3705 AC_DEFINE([SOLARIS_SHM_NEW], 1,
3706 [Define to 1 if you have the `IPC_XSTAT64', `SHMADV', `SHM_ADV_GET', `SHM_ADV_SET' and `SHMGET_OSM' constants.])
3711 AM_CONDITIONAL(SOLARIS_SHM_NEW, test x$solaris_shm_new = xyes)
3714 # Solaris-specific check determining if prxregset_t is available. Illumos
3715 # currently does not define it on the x86 platform.
3717 # C-level symbol: SOLARIS_PRXREGSET_T
3718 # Automake-level symbol: SOLARIS_PRXREGSET_T
3720 AC_MSG_CHECKING([for the `prxregset_t' type (Solaris-specific)])
3721 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3722 #include <sys/procfs_isa.h>
3724 return !sizeof(prxregset_t);
3726 solaris_prxregset_t=yes
3727 AC_MSG_RESULT([yes])
3728 AC_DEFINE([SOLARIS_PRXREGSET_T], 1,
3729 [Define to 1 if you have the `prxregset_t' type.])
3731 solaris_prxregset_t=no
3734 AM_CONDITIONAL(SOLARIS_PRXREGSET_T, test x$solaris_prxregset_t = xyes)
3737 # Solaris-specific check determining if the new frealpathat() syscall is
3740 # New syscall (available on Solaris 11.1):
3741 # int frealpathat(int fd, char *path, char *buf, size_t buflen);
3743 # C-level symbol: SOLARIS_FREALPATHAT_SYSCALL
3744 # Automake-level symbol: SOLARIS_FREALPATHAT_SYSCALL
3746 AC_MSG_CHECKING([for the new `frealpathat' syscall (Solaris-specific)])
3747 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3748 #include <sys/syscall.h>
3750 return !SYS_frealpathat;
3752 solaris_frealpathat_syscall=yes
3753 AC_MSG_RESULT([yes])
3754 AC_DEFINE([SOLARIS_FREALPATHAT_SYSCALL], 1,
3755 [Define to 1 if you have the new `frealpathat' syscall.])
3757 solaris_frealpathat_syscall=no
3760 AM_CONDITIONAL(SOLARIS_FREALPATHAT_SYSCALL, test x$solaris_frealpathat_syscall = xyes)
3763 # Solaris-specific check determining if the new uuidsys() syscall is
3766 # New syscall (available on newer Solaris):
3767 # int uuidsys(struct uuid *uuid);
3769 # C-level symbol: SOLARIS_UUIDSYS_SYSCALL
3770 # Automake-level symbol: SOLARIS_UUIDSYS_SYSCALL
3772 AC_MSG_CHECKING([for the new `uuidsys' syscall (Solaris-specific)])
3773 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3774 #include <sys/syscall.h>
3776 return !SYS_uuidsys;
3778 solaris_uuidsys_syscall=yes
3779 AC_MSG_RESULT([yes])
3780 AC_DEFINE([SOLARIS_UUIDSYS_SYSCALL], 1,
3781 [Define to 1 if you have the new `uuidsys' syscall.])
3783 solaris_uuidsys_syscall=no
3786 AM_CONDITIONAL(SOLARIS_UUIDSYS_SYSCALL, test x$solaris_uuidsys_syscall = xyes)
3789 # Solaris-specific check determining if the new labelsys() syscall subcode
3790 # TNDB_GET_TNIP is available. This subcode was added in Solaris 11 but is
3791 # missing on illumos.
3793 # C-level symbol: SOLARIS_TNDB_GET_TNIP
3794 # Automake-level symbol: SOLARIS_TNDB_GET_TNIP
3796 AC_MSG_CHECKING([for TNDB_GET_TNIP (Solaris-specific)])
3797 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3798 #include <sys/tsol/tndb.h>
3800 return !TNDB_GET_TNIP;
3802 solaris_tndb_get_tnip=yes
3803 AC_MSG_RESULT([yes])
3804 AC_DEFINE([SOLARIS_TNDB_GET_TNIP], 1,
3805 [Define to 1 if you have the `TNDB_GET_TNIP' constant.])
3807 solaris_tndb_get_tnip=no
3810 AM_CONDITIONAL(SOLARIS_TNDB_GET_TNIP, test x$solaris_tndb_get_tnip = xyes)
3813 # Solaris-specific check determining if the new labelsys() syscall opcodes
3814 # TSOL_GETCLEARANCE and TSOL_SETCLEARANCE are available. These opcodes were
3815 # added in Solaris 11 but are missing on illumos.
3817 # C-level symbol: SOLARIS_TSOL_CLEARANCE
3818 # Automake-level symbol: SOLARIS_TSOL_CLEARANCE
3820 AC_MSG_CHECKING([for TSOL_GETCLEARANCE and TSOL_SETCLEARANCE (Solaris-specific)])
3821 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3822 #include <sys/tsol/tsyscall.h>
3824 return !(TSOL_GETCLEARANCE && TSOL_SETCLEARANCE);
3826 solaris_tsol_clearance=yes
3827 AC_MSG_RESULT([yes])
3828 AC_DEFINE([SOLARIS_TSOL_CLEARANCE], 1,
3829 [Define to 1 if you have the `TSOL_GETCLEARANCE' and `TSOL_SETCLEARANCE' constants.])
3831 solaris_tsol_clearance=no
3834 AM_CONDITIONAL(SOLARIS_TSOL_CLEARANCE, test x$solaris_tsol_clearance = xyes)
3837 # Solaris-specific check determining if the new pset() syscall subcode
3838 # PSET_GET_NAME is available. This subcode was added in Solaris 11.4 but
3839 # is missing on illumos and Solaris 11.3.
3841 # C-level symbol: SOLARIS_PSET_GET_NAME
3842 # Automake-level symbol: SOLARIS_PSET_GET_NAME
3844 AC_MSG_CHECKING([for PSET_GET_NAME (Solaris-specific)])
3845 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3846 #include <sys/pset.h>
3848 return !(PSET_GET_NAME);
3850 solaris_pset_get_name=yes
3851 AC_MSG_RESULT([yes])
3852 AC_DEFINE([SOLARIS_PSET_GET_NAME], 1,
3853 [Define to 1 if you have the `PSET_GET_NAME' constants.])
3855 solaris_pset_get_name=no
3858 AM_CONDITIONAL(SOLARIS_PSET_GET_NAME, test x$solaris_pset_get_name = xyes)
3861 # Solaris-specific check determining if the utimesys() syscall is
3862 # available (on illumos and older Solaris).
3864 # C-level symbol: SOLARIS_UTIMESYS_SYSCALL
3865 # Automake-level symbol: SOLARIS_UTIMESYS_SYSCALL
3867 AC_MSG_CHECKING([for the `utimesys' syscall (Solaris-specific)])
3868 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3869 #include <sys/syscall.h>
3871 return !SYS_utimesys;
3873 solaris_utimesys_syscall=yes
3874 AC_MSG_RESULT([yes])
3875 AC_DEFINE([SOLARIS_UTIMESYS_SYSCALL], 1,
3876 [Define to 1 if you have the `utimesys' syscall.])
3878 solaris_utimesys_syscall=no
3881 AM_CONDITIONAL(SOLARIS_UTIMESYS_SYSCALL, test x$solaris_utimesys_syscall = xyes)
3884 # Solaris-specific check determining if the utimensat() syscall is
3885 # available (on newer Solaris).
3887 # C-level symbol: SOLARIS_UTIMENSAT_SYSCALL
3888 # Automake-level symbol: SOLARIS_UTIMENSAT_SYSCALL
3890 AC_MSG_CHECKING([for the `utimensat' syscall (Solaris-specific)])
3891 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3892 #include <sys/syscall.h>
3894 return !SYS_utimensat;
3896 solaris_utimensat_syscall=yes
3897 AC_MSG_RESULT([yes])
3898 AC_DEFINE([SOLARIS_UTIMENSAT_SYSCALL], 1,
3899 [Define to 1 if you have the `utimensat' syscall.])
3901 solaris_utimensat_syscall=no
3904 AM_CONDITIONAL(SOLARIS_UTIMENSAT_SYSCALL, test x$solaris_utimensat_syscall = xyes)
3907 # Solaris-specific check determining if the spawn() syscall is available
3908 # (on newer Solaris).
3910 # C-level symbol: SOLARIS_SPAWN_SYSCALL
3911 # Automake-level symbol: SOLARIS_SPAWN_SYSCALL
3913 AC_MSG_CHECKING([for the `spawn' syscall (Solaris-specific)])
3914 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3915 #include <sys/syscall.h>
3919 solaris_spawn_syscall=yes
3920 AC_MSG_RESULT([yes])
3921 AC_DEFINE([SOLARIS_SPAWN_SYSCALL], 1,
3922 [Define to 1 if you have the `spawn' syscall.])
3924 solaris_spawn_syscall=no
3927 AM_CONDITIONAL(SOLARIS_SPAWN_SYSCALL, test x$solaris_spawn_syscall = xyes)
3930 # Solaris-specific check determining if commands MODNVL_CTRLMAP through
3931 # MODDEVINFO_CACHE_TS for modctl() syscall are available (on newer Solaris).
3933 # C-level symbol: SOLARIS_MODCTL_MODNVL
3934 # Automake-level symbol: SOLARIS_MODCTL_MODNVL
3936 AC_MSG_CHECKING([for MODNVL_CTRLMAP through MODDEVINFO_CACHE_TS modctl(2) commands (Solaris-specific)])
3937 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3938 #include <sys/modctl.h>
3940 return !(MODNVL_CTRLMAP && MODDEVINFO_CACHE_TS);
3942 solaris_modctl_modnvl=yes
3943 AC_MSG_RESULT([yes])
3944 AC_DEFINE([SOLARIS_MODCTL_MODNVL], 1,
3945 [Define to 1 if you have the `MODNVL_CTRLMAP' through `MODDEVINFO_CACHE_TS' constants.])
3947 solaris_modctl_modnvl=no
3950 AM_CONDITIONAL(SOLARIS_MODCTL_MODNVL, test x$solaris_modctl_modnvl = xyes)
3953 # Solaris-specific check determining whether nscd (name switch cache daemon)
3954 # attaches its door at /system/volatile/name_service_door (Solaris)
3955 # or at /var/run/name_service_door (illumos).
3957 # Note that /var/run is a symlink to /system/volatile on Solaris
3958 # but not vice versa on illumos.
3960 # C-level symbol: SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE
3961 # Automake-level symbol: SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE
3963 AC_MSG_CHECKING([for nscd door location (Solaris-specific)])
3964 if test -e /system/volatile/name_service_door; then
3965 solaris_nscd_door_system_volatile=yes
3966 AC_MSG_RESULT([/system/volatile/name_service_door])
3967 AC_DEFINE([SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE], 1,
3968 [Define to 1 if nscd attaches to /system/volatile/name_service_door.])
3970 solaris_nscd_door_system_volatile=no
3971 AC_MSG_RESULT([/var/run/name_service_door])
3973 AM_CONDITIONAL(SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE, test x$solaris_nscd_door_system_volatile = xyes)
3976 # Solaris-specific check determining if the new gethrt() fasttrap is available.
3978 # New fasttrap (available on Solaris 11):
3979 # hrt_t *gethrt(void);
3981 # C-level symbol: SOLARIS_GETHRT_FASTTRAP
3982 # Automake-level symbol: SOLARIS_GETHRT_FASTTRAP
3984 AC_MSG_CHECKING([for the new `gethrt' fasttrap (Solaris-specific)])
3985 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3986 #include <sys/trap.h>
3990 solaris_gethrt_fasttrap=yes
3991 AC_MSG_RESULT([yes])
3992 AC_DEFINE([SOLARIS_GETHRT_FASTTRAP], 1,
3993 [Define to 1 if you have the new `gethrt' fasttrap.])
3995 solaris_gethrt_fasttrap=no
3998 AM_CONDITIONAL(SOLARIS_GETHRT_FASTTRAP, test x$solaris_gethrt_fasttrap = xyes)
4001 # Solaris-specific check determining if the new get_zone_offset() fasttrap
4004 # New fasttrap (available on Solaris 11):
4005 # zonehrtoffset_t *get_zone_offset(void);
4007 # C-level symbol: SOLARIS_GETZONEOFFSET_FASTTRAP
4008 # Automake-level symbol: SOLARIS_GETZONEOFFSET_FASTTRAP
4010 AC_MSG_CHECKING([for the new `get_zone_offset' fasttrap (Solaris-specific)])
4011 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4012 #include <sys/trap.h>
4014 return !T_GETZONEOFFSET;
4016 solaris_getzoneoffset_fasttrap=yes
4017 AC_MSG_RESULT([yes])
4018 AC_DEFINE([SOLARIS_GETZONEOFFSET_FASTTRAP], 1,
4019 [Define to 1 if you have the new `get_zone_offset' fasttrap.])
4021 solaris_getzoneoffset_fasttrap=no
4024 AM_CONDITIONAL(SOLARIS_GETZONEOFFSET_FASTTRAP, test x$solaris_getzoneoffset_fasttrap = xyes)
4027 # Solaris-specific check determining if the execve() syscall
4028 # takes fourth argument (flags) or not.
4030 # Old syscall (available on illumos):
4031 # int execve(const char *fname, const char **argv, const char **envp);
4033 # New syscall (available on Solaris):
4034 # int execve(uintptr_t file, const char **argv, const char **envp, int flags);
4036 # If the new syscall is present then it will fail with EINVAL (because flags
4037 # are invalid); if the old syscall is available then it will fail with ENOENT
4038 # (because the file could not be found).
4040 # C-level symbol: SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS
4041 # Automake-level symbol: SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS
4043 AC_MSG_CHECKING([if the `execve' syscall accepts flags (Solaris-specific)])
4044 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
4045 #include <sys/syscall.h>
4049 syscall(SYS_execve, "/no/existing/path", 0, 0, 0xdeadbeef, 0, 0);
4050 return !(errno == EINVAL);
4052 solaris_execve_syscall_takes_flags=yes
4053 AC_MSG_RESULT([yes])
4054 AC_DEFINE([SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS], 1,
4055 [Define to 1 if you have the new `execve' syscall which accepts flags.])
4057 solaris_execve_syscall_takes_flags=no
4060 AM_CONDITIONAL(SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS,
4061 test x$solaris_execve_syscall_takes_flags = xyes)
4064 # Solaris-specific check determining version of the repository cache protocol.
4065 # Every Solaris version uses a different one, ranging from 21 to current 25.
4066 # The check is very ugly, though.
4068 # C-level symbol: SOLARIS_REPCACHE_PROTOCOL_VERSION vv
4069 # Automake-level symbol: none
4071 AC_PATH_PROG(DIS_PATH, dis, false)
4072 if test "x$DIS_PATH" = "xfalse"; then
4073 AC_MSG_FAILURE([Object code disassembler (`dis') not found.])
4075 AC_CHECK_LIB(scf, scf_handle_bind, [], [
4076 AC_MSG_WARN([Function `scf_handle_bind' was not found in `libscf'.])
4077 AC_MSG_ERROR([Cannot determine version of the repository cache protocol.])
4080 AC_MSG_CHECKING([for version of the repository cache protocol (Solaris-specific)])
4081 if test "X$VGCONF_ARCH_PRI" = "Xamd64"; then
4082 libscf=/usr/lib/64/libscf.so.1
4084 libscf=/usr/lib/libscf.so.1
4086 if ! $DIS_PATH -F scf_handle_bind $libscf | grep -q 0x526570; then
4087 AC_MSG_WARN([Function `scf_handle_bind' does not contain repository cache protocol version.])
4088 AC_MSG_ERROR([Cannot determine version of the repository cache protocol.])
4090 hex=$( $DIS_PATH -F scf_handle_bind $libscf | sed -n 's/.*0x526570\(..\).*/\1/p' )
4091 if test -z "$hex"; then
4092 AC_MSG_WARN([Version of the repository cache protocol is empty?!])
4093 AC_MSG_ERROR([Cannot determine version of the repository cache protocol.])
4095 version=$( printf "%d\n" 0x$hex )
4096 AC_MSG_RESULT([$version])
4097 AC_DEFINE_UNQUOTED([SOLARIS_REPCACHE_PROTOCOL_VERSION], [$version],
4098 [Version number of the repository door cache protocol.])
4101 # Solaris-specific check determining if "sysstat" segment reservation type
4104 # New "sysstat" segment reservation (available on Solaris 11.4):
4105 # - program header type: PT_SUNW_SYSSTAT
4106 # - auxiliary vector entry: AT_SUN_SYSSTAT_ADDR
4108 # C-level symbol: SOLARIS_RESERVE_SYSSTAT_ADDR
4109 # Automake-level symbol: SOLARIS_RESERVE_SYSSTAT_ADDR
4111 AC_MSG_CHECKING([for the new `sysstat' segment reservation (Solaris-specific)])
4112 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4113 #include <sys/auxv.h>
4115 return !AT_SUN_SYSSTAT_ADDR;
4117 solaris_reserve_sysstat_addr=yes
4118 AC_MSG_RESULT([yes])
4119 AC_DEFINE([SOLARIS_RESERVE_SYSSTAT_ADDR], 1,
4120 [Define to 1 if you have the new `sysstat' segment reservation.])
4122 solaris_reserve_sysstat_addr=no
4125 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ADDR, test x$solaris_reserve_sysstat_addr = xyes)
4128 # Solaris-specific check determining if "sysstat_zone" segment reservation type
4131 # New "sysstat_zone" segment reservation (available on Solaris 11.4):
4132 # - program header type: PT_SUNW_SYSSTAT_ZONE
4133 # - auxiliary vector entry: AT_SUN_SYSSTAT_ZONE_ADDR
4135 # C-level symbol: SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR
4136 # Automake-level symbol: SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR
4138 AC_MSG_CHECKING([for the new `sysstat_zone' segment reservation (Solaris-specific)])
4139 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4140 #include <sys/auxv.h>
4142 return !AT_SUN_SYSSTAT_ZONE_ADDR;
4144 solaris_reserve_sysstat_zone_addr=yes
4145 AC_MSG_RESULT([yes])
4146 AC_DEFINE([SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR], 1,
4147 [Define to 1 if you have the new `sysstat_zone' segment reservation.])
4149 solaris_reserve_sysstat_zone_addr=no
4152 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR, test x$solaris_reserve_sysstat_zone_addr = xyes)
4155 # Solaris-specific check determining if the system_stats() syscall is available
4156 # (on newer Solaris).
4158 # C-level symbol: SOLARIS_SYSTEM_STATS_SYSCALL
4159 # Automake-level symbol: SOLARIS_SYSTEM_STATS_SYSCALL
4161 AC_MSG_CHECKING([for the `system_stats' syscall (Solaris-specific)])
4162 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4163 #include <sys/syscall.h>
4165 return !SYS_system_stats;
4167 solaris_system_stats_syscall=yes
4168 AC_MSG_RESULT([yes])
4169 AC_DEFINE([SOLARIS_SYSTEM_STATS_SYSCALL], 1,
4170 [Define to 1 if you have the `system_stats' syscall.])
4172 solaris_system_stats_syscall=no
4175 AM_CONDITIONAL(SOLARIS_SYSTEM_STATS_SYSCALL, test x$solaris_system_stats_syscall = xyes)
4178 # Solaris-specific check determining if fpregset_t defines struct _fpchip_state
4179 # (on newer illumos) or struct fpchip_state (Solaris, older illumos).
4181 # C-level symbol: SOLARIS_FPCHIP_STATE_TAKES_UNDERSCORE
4182 # Automake-level symbol: none
4184 AC_CHECK_TYPE([struct _fpchip_state],
4185 [solaris_fpchip_state_takes_underscore=yes],
4186 [solaris_fpchip_state_takes_underscore=no],
4187 [[#include <sys/regset.h>]])
4188 if test "$solaris_fpchip_state_takes_underscore" = "yes"; then
4189 AC_DEFINE(SOLARIS_FPCHIP_STATE_TAKES_UNDERSCORE, 1,
4190 [Define to 1 if fpregset_t defines struct _fpchip_state])
4194 # Solaris-specific check determining if schedctl page shared between kernel
4195 # and userspace program is executable (illumos, older Solaris) or not (newer
4198 # C-level symbol: SOLARIS_SCHEDCTL_PAGE_EXEC
4199 # Automake-level symbol: none
4201 AC_MSG_CHECKING([if schedctl page is executable (Solaris-specific)])
4202 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
4206 #include <schedctl.h>
4210 schedctl_t *scp = schedctl_init();
4214 int fd = open("/proc/self/map", O_RDONLY);
4219 while ((rd = read(fd, &map, sizeof(map))) == sizeof(map)) {
4220 if (map.pr_vaddr == ((uintptr_t) scp & PAGEMASK)) {
4221 fprintf(stderr, "%#lx [%zu] %s\n", map.pr_vaddr, map.pr_size,
4222 (map.pr_mflags & MA_EXEC) ? "x" : "no-x");
4223 return (map.pr_mflags & MA_EXEC);
4229 solaris_schedctl_page_exec=no
4232 solaris_schedctl_page_exec=yes
4233 AC_MSG_RESULT([yes])
4234 AC_DEFINE([SOLARIS_SCHEDCTL_PAGE_EXEC], 1,
4235 [Define to 1 if you have the schedctl page executable.])
4239 # Solaris-specific check determining if PT_SUNWDTRACE program header provides
4240 # scratch space for DTrace fasttrap provider (illumos, older Solaris) or just
4241 # an initial thread pointer for libc (newer Solaris).
4243 # C-level symbol: SOLARIS_PT_SUNDWTRACE_THRP
4244 # Automake-level symbol: none
4246 AC_MSG_CHECKING([if PT_SUNWDTRACE serves for initial thread pointer (Solaris-specific)])
4247 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
4248 #include <sys/fasttrap_isa.h>
4250 return !FT_SCRATCHSIZE;
4252 solaris_pt_sunwdtrace_thrp=yes
4253 AC_MSG_RESULT([yes])
4254 AC_DEFINE([SOLARIS_PT_SUNDWTRACE_THRP], 1,
4255 [Define to 1 if PT_SUNWDTRACE program header provides just an initial thread pointer for libc.])
4257 solaris_pt_sunwdtrace_thrp=no
4262 AM_CONDITIONAL(SOLARIS_SUN_STUDIO_AS, false)
4263 AM_CONDITIONAL(SOLARIS_XPG_SYMBOLS_PRESENT, false)
4264 AM_CONDITIONAL(SOLARIS_PROC_CMDLINE, false)
4265 AM_CONDITIONAL(SOLARIS_OLD_SYSCALLS, false)
4266 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL, false)
4267 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID, false)
4268 AM_CONDITIONAL(SOLARIS_LWP_NAME_SYSCALL, false)
4269 AM_CONDITIONAL(SOLARIS_GETRANDOM_SYSCALL, false)
4270 AM_CONDITIONAL(SOLARIS_ZONE_DEFUNCT, false)
4271 AM_CONDITIONAL(SOLARIS_AUDITON_STAT, false)
4272 AM_CONDITIONAL(SOLARIS_SHM_NEW, false)
4273 AM_CONDITIONAL(SOLARIS_PRXREGSET_T, false)
4274 AM_CONDITIONAL(SOLARIS_FREALPATHAT_SYSCALL, false)
4275 AM_CONDITIONAL(SOLARIS_UUIDSYS_SYSCALL, false)
4276 AM_CONDITIONAL(SOLARIS_TNDB_GET_TNIP, false)
4277 AM_CONDITIONAL(SOLARIS_TSOL_CLEARANCE, false)
4278 AM_CONDITIONAL(SOLARIS_PSET_GET_NAME, false)
4279 AM_CONDITIONAL(SOLARIS_UTIMESYS_SYSCALL, false)
4280 AM_CONDITIONAL(SOLARIS_UTIMENSAT_SYSCALL, false)
4281 AM_CONDITIONAL(SOLARIS_SPAWN_SYSCALL, false)
4282 AM_CONDITIONAL(SOLARIS_MODCTL_MODNVL, false)
4283 AM_CONDITIONAL(SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE, false)
4284 AM_CONDITIONAL(SOLARIS_GETHRT_FASTTRAP, false)
4285 AM_CONDITIONAL(SOLARIS_GETZONEOFFSET_FASTTRAP, false)
4286 AM_CONDITIONAL(SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS, false)
4287 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ADDR, false)
4288 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR, false)
4289 AM_CONDITIONAL(SOLARIS_SYSTEM_STATS_SYSCALL, false)
4290 fi # test "$VGCONF_OS" = "solaris"
4293 #----------------------------------------------------------------------------
4294 # Checks for C header files.
4295 #----------------------------------------------------------------------------
4297 AC_CHECK_HEADERS([ \
4315 # Verify whether the <linux/futex.h> header is usable.
4316 AC_MSG_CHECKING([if <linux/futex.h> is usable])
4318 save_CFLAGS="$CFLAGS"
4319 CFLAGS="$CFLAGS -D__user="
4320 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4321 #include <linux/futex.h>
4325 ac_have_usable_linux_futex_h=yes
4326 AC_DEFINE([HAVE_USABLE_LINUX_FUTEX_H], 1,
4327 [Define to 1 if you have a usable <linux/futex.h> header file.])
4328 AC_MSG_RESULT([yes])
4330 ac_have_usable_linux_futex_h=no
4333 CFLAGS="$save_CFLAGS"
4336 #----------------------------------------------------------------------------
4337 # Checks for typedefs, structures, and compiler characteristics.
4338 #----------------------------------------------------------------------------
4345 #----------------------------------------------------------------------------
4346 # Checks for library functions.
4347 #----------------------------------------------------------------------------
4351 AC_CHECK_LIB([pthread], [pthread_create])
4352 AC_CHECK_LIB([rt], [clock_gettime])
4366 pthread_barrier_init \
4367 pthread_condattr_setclock \
4368 pthread_mutex_timedlock \
4369 pthread_rwlock_timedrdlock \
4370 pthread_rwlock_timedwrlock \
4373 pthread_setname_np \
4394 # AC_CHECK_LIB adds any library found to the variable LIBS, and links these
4395 # libraries with any shared object and/or executable. This is NOT what we
4396 # want for e.g. vgpreload_core-x86-linux.so
4399 AM_CONDITIONAL([HAVE_PTHREAD_BARRIER],
4400 [test x$ac_cv_func_pthread_barrier_init = xyes])
4401 AM_CONDITIONAL([HAVE_PTHREAD_MUTEX_TIMEDLOCK],
4402 [test x$ac_cv_func_pthread_mutex_timedlock = xyes])
4403 AM_CONDITIONAL([HAVE_PTHREAD_SPINLOCK],
4404 [test x$ac_cv_func_pthread_spin_lock = xyes])
4405 AM_CONDITIONAL([HAVE_PTHREAD_SETNAME_NP],
4406 [test x$ac_cv_func_pthread_setname_np = xyes])
4407 AM_CONDITIONAL([HAVE_COPY_FILE_RANGE],
4408 [test x$ac_cv_func_copy_file_range = xyes])
4409 AM_CONDITIONAL([HAVE_PREADV_PWRITEV],
4410 [test x$ac_cv_func_preadv = xyes && test x$ac_cv_func_pwritev = xyes])
4411 AM_CONDITIONAL([HAVE_PREADV2_PWRITEV2],
4412 [test x$ac_cv_func_preadv2 = xyes && test x$ac_cv_func_pwritev2 = xyes])
4413 AM_CONDITIONAL([HAVE_MEMFD_CREATE],
4414 [test x$ac_cv_func_memfd_create = xyes])
4416 if test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
4417 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \
4418 -o x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX; then
4419 AC_DEFINE([DISABLE_PTHREAD_SPINLOCK_INTERCEPT], 1,
4420 [Disable intercept pthread_spin_lock() on MIPS32, MIPS64 and nanoMIPS.])
4423 #----------------------------------------------------------------------------
4425 #----------------------------------------------------------------------------
4426 # Do we have a useable MPI setup on the primary and/or secondary targets?
4427 # On Linux, by default, assumes mpicc and -m32/-m64
4428 # Note: this is a kludge in that it assumes the specified mpicc
4429 # understands -m32/-m64 regardless of what is specified using
4431 AC_PATH_PROG([MPI_CC], [mpicc], [mpicc],
4432 [$PATH:/usr/lib/openmpi/bin:/usr/lib64/openmpi/bin])
4435 if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
4436 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
4437 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
4438 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
4439 -o x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX \
4440 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS ; then
4441 mflag_primary=$FLAG_M32
4442 elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
4443 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
4444 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX \
4445 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \
4446 -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX ; then
4447 mflag_primary=$FLAG_M64
4448 elif test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN ; then
4449 mflag_primary="$FLAG_M32 -arch i386"
4450 elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN ; then
4451 mflag_primary="$FLAG_M64 -arch x86_64"
4455 if test x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
4456 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX \
4457 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_SOLARIS \
4458 -o x$VGCONF_PLATFORM_SEC_CAPS = xMIPS32_LINUX ; then
4459 mflag_secondary=$FLAG_M32
4460 elif test x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN ; then
4461 mflag_secondary="$FLAG_M32 -arch i386"
4466 [ --with-mpicc= Specify name of MPI2-ised C compiler],
4471 ## We AM_COND_IF here instead of automake "if" in mpi/Makefile.am so that we can
4472 ## use these values in the check for a functioning mpicc.
4474 ## We leave the MPI_FLAG_M3264_ logic in mpi/Makefile.am and assume that
4475 ## mflag_primary/mflag_secondary are sufficient approximations of that behavior
4476 AM_COND_IF([VGCONF_OS_IS_LINUX],
4477 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic"
4478 LDFLAGS_MPI="-fpic -shared"])
4479 AM_COND_IF([VGCONF_OS_IS_DARWIN],
4480 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -dynamic"
4481 LDFLAGS_MPI="-dynamic -dynamiclib -all_load"])
4482 AM_COND_IF([VGCONF_OS_IS_SOLARIS],
4483 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic"
4484 LDFLAGS_MPI="-fpic -shared"])
4486 AC_SUBST([CFLAGS_MPI])
4487 AC_SUBST([LDFLAGS_MPI])
4490 ## See if MPI_CC works for the primary target
4492 AC_MSG_CHECKING([primary target for usable MPI2-compliant C compiler and mpi.h])
4494 saved_CFLAGS=$CFLAGS
4496 CFLAGS="$CFLAGS_MPI $mflag_primary"
4497 saved_LDFLAGS="$LDFLAGS"
4498 LDFLAGS="$LDFLAGS_MPI $mflag_primary"
4499 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4503 int ni, na, nd, comb;
4504 int r = MPI_Init(NULL,NULL);
4505 r |= MPI_Type_get_envelope( MPI_INT, &ni, &na, &nd, &comb );
4506 r |= MPI_Finalize();
4509 ac_have_mpi2_pri=yes
4510 AC_MSG_RESULT([yes, $MPI_CC])
4516 CFLAGS=$saved_CFLAGS
4517 LDFLAGS="$saved_LDFLAGS"
4518 AM_CONDITIONAL(BUILD_MPIWRAP_PRI, test x$ac_have_mpi2_pri = xyes)
4520 ## See if MPI_CC works for the secondary target. Complication: what if
4521 ## there is no secondary target? We need this to then fail.
4522 ## Kludge this by making MPI_CC something which will surely fail in
4525 AC_MSG_CHECKING([secondary target for usable MPI2-compliant C compiler and mpi.h])
4527 saved_CFLAGS=$CFLAGS
4528 saved_LDFLAGS="$LDFLAGS"
4529 LDFLAGS="$LDFLAGS_MPI $mflag_secondary"
4530 if test x$VGCONF_PLATFORM_SEC_CAPS = x ; then
4531 CC="$MPI_CC this will surely fail"
4535 CFLAGS="$CFLAGS_MPI $mflag_secondary"
4536 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4540 int ni, na, nd, comb;
4541 int r = MPI_Init(NULL,NULL);
4542 r |= MPI_Type_get_envelope( MPI_INT, &ni, &na, &nd, &comb );
4543 r |= MPI_Finalize();
4546 ac_have_mpi2_sec=yes
4547 AC_MSG_RESULT([yes, $MPI_CC])
4553 CFLAGS=$saved_CFLAGS
4554 LDFLAGS="$saved_LDFLAGS"
4555 AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec = xyes)
4558 #----------------------------------------------------------------------------
4559 # Other library checks
4560 #----------------------------------------------------------------------------
4561 # There now follow some tests for Boost, and OpenMP. These
4562 # tests are present because Drd has some regression tests that use
4563 # these packages. All regression test programs all compiled only
4564 # for the primary target. And so it is important that the configure
4565 # checks that follow, use the correct -m32 or -m64 flag for the
4566 # primary target (called $mflag_primary). Otherwise, we can end up
4567 # in a situation (eg) where, on amd64-linux, the test for Boost checks
4568 # for usable 64-bit Boost facilities, but because we are doing a 32-bit
4569 # only build (meaning, the primary target is x86-linux), the build
4570 # of the regtest programs that use Boost fails, because they are
4571 # build as 32-bit (IN THIS EXAMPLE).
4573 # Hence: ALWAYS USE $mflag_primary FOR CONFIGURE TESTS FOR FACILITIES
4574 # NEEDED BY THE REGRESSION TEST PROGRAMS.
4577 # Check whether the boost library 1.35 or later has been installed.
4578 # The Boost.Threads library has undergone a major rewrite in version 1.35.0.
4580 AC_MSG_CHECKING([for boost])
4583 safe_CXXFLAGS=$CXXFLAGS
4584 CXXFLAGS="$mflag_primary"
4586 LIBS="-lboost_thread-mt -lboost_system-mt $LIBS"
4588 AC_LINK_IFELSE([AC_LANG_SOURCE([
4589 #include <boost/thread.hpp>
4590 static void thread_func(void)
4592 int main(int argc, char** argv)
4594 boost::thread t(thread_func);
4599 ac_have_boost_1_35=yes
4600 AC_SUBST([BOOST_CFLAGS], [])
4601 AC_SUBST([BOOST_LIBS], ["-lboost_thread-mt -lboost_system-mt"])
4602 AC_MSG_RESULT([yes])
4604 ac_have_boost_1_35=no
4609 CXXFLAGS=$safe_CXXFLAGS
4612 AM_CONDITIONAL([HAVE_BOOST_1_35], [test x$ac_have_boost_1_35 = xyes])
4615 # does this compiler support -fopenmp, does it have the include file
4616 # <omp.h> and does it have libgomp ?
4618 AC_MSG_CHECKING([for OpenMP])
4621 CFLAGS="-fopenmp $mflag_primary -Werror"
4623 AC_LINK_IFELSE([AC_LANG_SOURCE([
4625 int main(int argc, char** argv)
4633 AC_MSG_RESULT([yes])
4640 AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes])
4643 # Check for __builtin_popcount
4644 AC_MSG_CHECKING([for __builtin_popcount()])
4645 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4647 __builtin_popcount(2);
4650 AC_MSG_RESULT([yes])
4651 AC_DEFINE([HAVE_BUILTIN_POPCOUT], 1,
4652 [Define to 1 if compiler provides __builtin_popcount().])
4657 # Check for __builtin_clz
4658 AC_MSG_CHECKING([for __builtin_clz()])
4659 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4664 AC_MSG_RESULT([yes])
4665 AC_DEFINE([HAVE_BUILTIN_CLZ], 1,
4666 [Define to 1 if compiler provides __builtin_clz().])
4671 # Check for __builtin_ctz
4672 AC_MSG_CHECKING([for __builtin_ctz()])
4673 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4678 AC_MSG_RESULT([yes])
4679 AC_DEFINE([HAVE_BUILTIN_CTZ], 1,
4680 [Define to 1 if compiler provides __builtin_ctz().])
4685 # does this compiler have built-in functions for atomic memory access for the
4687 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the primary target])
4690 CFLAGS="$mflag_primary"
4692 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
4694 return (__sync_bool_compare_and_swap(&variable, 1, 2)
4695 && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
4697 ac_have_builtin_atomic_primary=yes
4698 AC_MSG_RESULT([yes])
4699 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])
4701 ac_have_builtin_atomic_primary=no
4707 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC],
4708 [test x$ac_have_builtin_atomic_primary = xyes])
4711 # does this compiler have built-in functions for atomic memory access for the
4712 # secondary target ?
4714 if test x$VGCONF_PLATFORM_SEC_CAPS != x; then
4716 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the secondary target])
4719 CFLAGS="$mflag_secondary"
4721 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
4723 return (__sync_add_and_fetch(&variable, 1) ? 1 : 0)
4725 ac_have_builtin_atomic_secondary=yes
4726 AC_MSG_RESULT([yes])
4728 ac_have_builtin_atomic_secondary=no
4736 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_SECONDARY],
4737 [test x$ac_have_builtin_atomic_secondary = xyes])
4739 # does this compiler have built-in functions for atomic memory access on
4740 # 64-bit integers for all targets ?
4742 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch on uint64_t for all targets])
4744 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4747 uint64_t variable = 1;
4748 return __sync_add_and_fetch(&variable, 1)
4750 ac_have_builtin_atomic64_primary=yes
4752 ac_have_builtin_atomic64_primary=no
4755 if test x$VGCONF_PLATFORM_SEC_CAPS != x; then
4758 CFLAGS="$mflag_secondary"
4760 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4763 uint64_t variable = 1;
4764 return __sync_add_and_fetch(&variable, 1)
4766 ac_have_builtin_atomic64_secondary=yes
4768 ac_have_builtin_atomic64_secondary=no
4775 if test x$ac_have_builtin_atomic64_primary = xyes && \
4776 test x$VGCONF_PLATFORM_SEC_CAPS = x \
4777 -o x$ac_have_builtin_atomic64_secondary = xyes; then
4778 AC_MSG_RESULT([yes])
4779 ac_have_builtin_atomic64=yes
4782 ac_have_builtin_atomic64=no
4785 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC64],
4786 [test x$ac_have_builtin_atomic64 = xyes])
4789 # does g++ have built-in functions for atomic memory access ?
4790 AC_MSG_CHECKING([if g++ supports __sync_add_and_fetch])
4792 safe_CXXFLAGS=$CXXFLAGS
4793 CXXFLAGS="$mflag_primary"
4796 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
4798 return (__sync_bool_compare_and_swap(&variable, 1, 2)
4799 && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
4801 ac_have_builtin_atomic_cxx=yes
4802 AC_MSG_RESULT([yes])
4803 AC_DEFINE(HAVE_BUILTIN_ATOMIC_CXX, 1, [Define to 1 if g++ supports __sync_bool_compare_and_swap() and __sync_add_and_fetch()])
4805 ac_have_builtin_atomic_cxx=no
4810 CXXFLAGS=$safe_CXXFLAGS
4812 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_CXX], [test x$ac_have_builtin_atomic_cxx = xyes])
4815 if test x$ac_have_usable_linux_futex_h = xyes \
4816 -a x$ac_have_builtin_atomic_primary = xyes; then
4817 ac_enable_linux_ticket_lock_primary=yes
4819 AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_PRIMARY],
4820 [test x$ac_enable_linux_ticket_lock_primary = xyes])
4822 if test x$VGCONF_PLATFORM_SEC_CAPS != x \
4823 -a x$ac_have_usable_linux_futex_h = xyes \
4824 -a x$ac_have_builtin_atomic_secondary = xyes; then
4825 ac_enable_linux_ticket_lock_secondary=yes
4827 AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_SECONDARY],
4828 [test x$ac_enable_linux_ticket_lock_secondary = xyes])
4831 # does libstdc++ support annotating shared pointers ?
4832 AC_MSG_CHECKING([if libstdc++ supports annotating shared pointers])
4834 safe_CXXFLAGS=$CXXFLAGS
4835 CXXFLAGS="-std=c++0x"
4838 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4841 std::shared_ptr<int> p
4843 ac_have_shared_ptr=yes
4845 ac_have_shared_ptr=no
4847 if test x$ac_have_shared_ptr = xyes; then
4848 # If compilation of the program below fails because of a syntax error
4849 # triggered by substituting one of the annotation macros then that
4850 # means that libstdc++ supports these macros.
4851 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4852 #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(a) (a)----
4853 #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(a) (a)----
4856 std::shared_ptr<int> p
4858 ac_have_shared_pointer_annotation=no
4861 ac_have_shared_pointer_annotation=yes
4862 AC_MSG_RESULT([yes])
4863 AC_DEFINE(HAVE_SHARED_POINTER_ANNOTATION, 1,
4864 [Define to 1 if libstd++ supports annotating shared pointers])
4867 ac_have_shared_pointer_annotation=no
4872 CXXFLAGS=$safe_CXXFLAGS
4874 AM_CONDITIONAL([HAVE_SHARED_POINTER_ANNOTATION],
4875 [test x$ac_have_shared_pointer_annotation = xyes])
4878 #----------------------------------------------------------------------------
4879 # Ok. We're done checking.
4880 #----------------------------------------------------------------------------
4882 # Nb: VEX/Makefile is generated from Makefile.vex.in.
4885 VEX/Makefile:Makefile.vex.in
4894 gdbserver_tests/Makefile
4895 gdbserver_tests/solaris/Makefile
4901 memcheck/tests/Makefile
4902 memcheck/tests/common/Makefile
4903 memcheck/tests/amd64/Makefile
4904 memcheck/tests/x86/Makefile
4905 memcheck/tests/linux/Makefile
4906 memcheck/tests/darwin/Makefile
4907 memcheck/tests/solaris/Makefile
4908 memcheck/tests/amd64-linux/Makefile
4909 memcheck/tests/arm64-linux/Makefile
4910 memcheck/tests/x86-linux/Makefile
4911 memcheck/tests/amd64-solaris/Makefile
4912 memcheck/tests/x86-solaris/Makefile
4913 memcheck/tests/ppc32/Makefile
4914 memcheck/tests/ppc64/Makefile
4915 memcheck/tests/s390x/Makefile
4916 memcheck/tests/mips32/Makefile
4917 memcheck/tests/mips64/Makefile
4918 memcheck/tests/vbit-test/Makefile
4920 cachegrind/tests/Makefile
4921 cachegrind/tests/x86/Makefile
4922 cachegrind/cg_annotate
4925 callgrind/callgrind_annotate
4926 callgrind/callgrind_control
4927 callgrind/tests/Makefile
4929 helgrind/tests/Makefile
4931 drd/scripts/download-and-build-splash2
4934 massif/tests/Makefile
4939 lackey/tests/Makefile
4942 none/tests/scripts/Makefile
4943 none/tests/amd64/Makefile
4944 none/tests/ppc32/Makefile
4945 none/tests/ppc64/Makefile
4946 none/tests/x86/Makefile
4947 none/tests/arm/Makefile
4948 none/tests/arm64/Makefile
4949 none/tests/s390x/Makefile
4950 none/tests/mips32/Makefile
4951 none/tests/mips64/Makefile
4952 none/tests/nanomips/Makefile
4953 none/tests/linux/Makefile
4954 none/tests/darwin/Makefile
4955 none/tests/solaris/Makefile
4956 none/tests/amd64-linux/Makefile
4957 none/tests/x86-linux/Makefile
4958 none/tests/amd64-darwin/Makefile
4959 none/tests/x86-darwin/Makefile
4960 none/tests/amd64-solaris/Makefile
4961 none/tests/x86-solaris/Makefile
4963 exp-bbv/tests/Makefile
4964 exp-bbv/tests/x86/Makefile
4965 exp-bbv/tests/x86-linux/Makefile
4966 exp-bbv/tests/amd64-linux/Makefile
4967 exp-bbv/tests/ppc32-linux/Makefile
4968 exp-bbv/tests/arm-linux/Makefile
4972 AC_CONFIG_FILES([coregrind/link_tool_exe_linux],
4973 [chmod +x coregrind/link_tool_exe_linux])
4974 AC_CONFIG_FILES([coregrind/link_tool_exe_darwin],
4975 [chmod +x coregrind/link_tool_exe_darwin])
4976 AC_CONFIG_FILES([coregrind/link_tool_exe_solaris],
4977 [chmod +x coregrind/link_tool_exe_solaris])
4982 Maximum build arch: ${ARCH_MAX}
4983 Primary build arch: ${VGCONF_ARCH_PRI}
4984 Secondary build arch: ${VGCONF_ARCH_SEC}
4985 Build OS: ${VGCONF_OS}
4986 Link Time Optimisation: ${vg_cv_lto}
4987 Primary build target: ${VGCONF_PLATFORM_PRI_CAPS}
4988 Secondary build target: ${VGCONF_PLATFORM_SEC_CAPS}
4989 Platform variant: ${VGCONF_PLATVARIANT}
4990 Primary -DVGPV string: -DVGPV_${VGCONF_ARCH_PRI}_${VGCONF_OS}_${VGCONF_PLATVARIANT}=1
4991 Default supp files: ${DEFAULT_SUPP}