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.18.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])
2330 # does this compiler support C++17 aligned new/delete?
2331 AC_MSG_CHECKING([if g++ supports aligned new and delete])
2333 safe_CXXFLAGS=$CXXFLAGS
2334 CXXFLAGS="-std=c++17"
2337 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2341 operator delete(nullptr, std::align_val_t(64U));
2343 ac_have_aligned_cxx_alloc=yes
2344 AC_MSG_RESULT([yes])
2346 ac_have_aligned_cxx_alloc=no
2349 CXXFLAGS=$safe_CXXFLAGS
2352 AM_CONDITIONAL([HAVE_ALIGNED_CXX_ALLOC], [test x$ac_have_aligned_cxx_alloc = xyes])
2354 # does this compiler support -fno-stack-protector ?
2355 AC_MSG_CHECKING([if gcc accepts -fno-stack-protector])
2358 CFLAGS="-fno-stack-protector -Werror"
2360 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2363 no_stack_protector=yes
2364 FLAG_FNO_STACK_PROTECTOR="-fno-stack-protector"
2365 AC_MSG_RESULT([yes])
2367 no_stack_protector=no
2368 FLAG_FNO_STACK_PROTECTOR=""
2373 AC_SUBST(FLAG_FNO_STACK_PROTECTOR)
2375 # does this compiler support -finline-functions ?
2376 AC_MSG_CHECKING([if gcc accepts -finline-functions])
2379 CFLAGS="-finline-functions -Werror"
2381 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2384 inline_functions=yes
2385 FLAG_FINLINE_FUNCTIONS="-finline-functions"
2386 AC_MSG_RESULT([yes])
2389 FLAG_FINLINE_FUNCTIONS=""
2394 AC_SUBST(FLAG_FINLINE_FUNCTIONS)
2396 # Does GCC support disabling Identical Code Folding?
2397 # We want to disabled Identical Code Folding for the
2398 # tools preload shared objects to get better backraces.
2399 # For GCC 5.1+ -fipa-icf is enabled by default at -O2.
2400 # "The optimization reduces code size and may disturb
2401 # unwind stacks by replacing a function by equivalent
2402 # one with a different name."
2403 AC_MSG_CHECKING([if gcc accepts -fno-ipa-icf])
2406 CFLAGS="-fno-ipa-icf -Werror"
2408 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2412 FLAG_FNO_IPA_ICF="-fno-ipa-icf"
2413 AC_MSG_RESULT([yes])
2421 AC_SUBST(FLAG_FNO_IPA_ICF)
2424 # Does this compiler support -fsanitize=undefined. This is true for
2425 # GCC 4.9 and newer. However, the undefined behaviour sanitiser in GCC 5.1
2426 # also checks for alignment violations on memory accesses which the valgrind
2427 # code base is sprinkled (if not littered) with. As those alignment issues
2428 # don't pose a problem we want to suppress warnings about them.
2429 # In GCC 5.1 this can be done by passing -fno-sanitize=alignment. Earlier
2430 # GCCs do not support that.
2432 # Only checked for if --enable-ubsan was given.
2433 if test "x${vg_cv_ubsan}" = "xyes"; then
2434 AC_MSG_CHECKING([if gcc accepts -fsanitize=undefined -fno-sanitize=alignment])
2436 CFLAGS="-fsanitize=undefined -fno-sanitize=alignment -Werror"
2437 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2440 FLAG_FSANITIZE="-fsanitize=undefined -fno-sanitize=alignment"
2441 LIB_UBSAN="-static-libubsan"
2442 AC_MSG_RESULT([yes])
2444 CFLAGS="-fsanitize=undefined -Werror"
2445 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2448 FLAG_FSANITIZE="-fsanitize=undefined"
2449 LIB_UBSAN="-static-libubsan"
2450 AC_MSG_RESULT([yes])
2458 AC_SUBST(FLAG_FSANITIZE)
2461 # does this compiler support --param inline-unit-growth=... ?
2463 AC_MSG_CHECKING([if gcc accepts --param inline-unit-growth])
2466 CFLAGS="--param inline-unit-growth=900 -Werror"
2468 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2471 AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH],
2472 ["--param inline-unit-growth=900"])
2473 AC_MSG_RESULT([yes])
2475 AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH], [""])
2481 # does this compiler support -gdwarf-4 -fdebug-types-section ?
2483 AC_MSG_CHECKING([if gcc accepts -gdwarf-4 -fdebug-types-section])
2486 CFLAGS="-gdwarf-4 -fdebug-types-section -Werror"
2488 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2492 AC_MSG_RESULT([yes])
2497 AM_CONDITIONAL(DWARF4, test x$ac_have_dwarf4 = xyes)
2501 # does this compiler support -g -gz=zlib ?
2503 AC_MSG_CHECKING([if gcc accepts -g -gz=zlib])
2506 CFLAGS="-g -gz=zlib"
2508 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2512 AC_MSG_RESULT([yes])
2517 AM_CONDITIONAL(GZ_ZLIB, test x$ac_have_gz_zlib = xyes)
2521 # does this compiler support -g -gz=zlib-gnu ?
2523 AC_MSG_CHECKING([if gcc accepts -g -gz=zlib-gnu])
2526 CFLAGS="-g -gz=zlib-gnu"
2528 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2531 ac_have_gz_zlib_gnu=yes
2532 AC_MSG_RESULT([yes])
2534 ac_have_gz_zlib_gnu=no
2537 AM_CONDITIONAL(GZ_ZLIB_GNU, test x$ac_have_gz_zlib_gnu = xyes)
2541 # does this compiler support nested functions ?
2543 AC_MSG_CHECKING([if gcc accepts nested functions])
2545 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2546 int foo() { return 1; }
2549 ac_have_nested_functions=yes
2550 AC_MSG_RESULT([yes])
2552 ac_have_nested_functions=no
2555 AM_CONDITIONAL([HAVE_NESTED_FUNCTIONS], [test x$ac_have_nested_functions = xyes])
2558 # does this compiler support the 'p' constraint in ASM statements ?
2560 AC_MSG_CHECKING([if gcc accepts the 'p' constraint in asm statements])
2562 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2564 __asm__ __volatile__ ("movdqa (%0),%%xmm6\n" : "=p" (p));
2566 ac_have_asm_constraint_p=yes
2567 AC_MSG_RESULT([yes])
2569 ac_have_asm_constraint_p=no
2572 AM_CONDITIONAL([HAVE_ASM_CONSTRAINT_P], [test x$ac_have_asm_constraint_p = xyes])
2575 # Does this compiler and linker support -pie?
2576 # Some compilers actually do not support -pie and report its usage
2577 # as an error. We need to check if it is safe to use it first.
2579 AC_MSG_CHECKING([if gcc accepts -pie])
2584 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2587 AC_SUBST([FLAG_PIE], ["-pie"])
2588 AC_MSG_RESULT([yes])
2590 AC_SUBST([FLAG_PIE], [""])
2596 # Does this compiler support -no-pie?
2597 # On Ubuntu 16.10+, gcc produces position independent executables (PIE) by
2598 # default. However this gets in the way with some tests, we use -no-pie
2601 AC_MSG_CHECKING([if gcc accepts -no-pie])
2606 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
2609 AC_SUBST([FLAG_NO_PIE], ["-no-pie"])
2610 AC_MSG_RESULT([yes])
2612 AC_SUBST([FLAG_NO_PIE], [""])
2618 # We want to use use the -Ttext-segment option to the linker.
2619 # GNU (bfd) ld supports this directly. Newer GNU gold linkers
2620 # support it as an alias of -Ttext. Sadly GNU (bfd) ld's -Ttext
2621 # semantics are NOT what we want (GNU gold -Ttext is fine).
2623 # For GNU (bfd) ld -Ttext-segment chooses the base at which ELF headers
2624 # will reside. -Ttext aligns just the .text section start (but not any
2627 # So test for -Ttext-segment which is supported by all bfd ld versions
2628 # and use that if it exists. If it doesn't exist it must be an older
2629 # version of gold and we can fall back to using -Ttext which has the
2632 AC_MSG_CHECKING([if the linker accepts -Wl,-Ttext-segment])
2635 CFLAGS="-static -nodefaultlibs -nostartfiles -Wl,-Ttext-segment=$valt_load_address_pri_norml -Werror"
2638 [AC_LANG_SOURCE([int _start () { return 0; }])],
2640 linker_using_t_text="no"
2641 AC_SUBST([FLAG_T_TEXT], ["-Ttext-segment"])
2642 AC_MSG_RESULT([yes])
2644 linker_using_t_text="yes"
2645 AC_SUBST([FLAG_T_TEXT], ["-Ttext"])
2650 # If the linker only supports -Ttext (not -Ttext-segment) then we will
2651 # have to strip any build-id ELF NOTEs from the statically linked tools.
2652 # Otherwise the build-id NOTE might end up at the default load address.
2653 # (Pedantically if the linker is gold then -Ttext is fine, but newer
2654 # gold versions also support -Ttext-segment. So just assume that unless
2655 # we can use -Ttext-segment we need to strip the build-id NOTEs.
2656 if test "x${linker_using_t_text}" = "xyes"; then
2657 AC_MSG_NOTICE([ld -Ttext used, need to strip build-id NOTEs.])
2658 # does the linker support -Wl,--build-id=none ? Note, it's
2659 # important that we test indirectly via whichever C compiler
2660 # is selected, rather than testing /usr/bin/ld or whatever
2662 AC_MSG_CHECKING([if the linker accepts -Wl,--build-id=none])
2664 CFLAGS="-Wl,--build-id=none -Werror"
2667 [AC_LANG_PROGRAM([ ], [return 0;])],
2669 AC_SUBST([FLAG_NO_BUILD_ID], ["-Wl,--build-id=none"])
2670 AC_MSG_RESULT([yes])
2672 AC_SUBST([FLAG_NO_BUILD_ID], [""])
2676 AC_MSG_NOTICE([ld -Ttext-segment used, no need to strip build-id NOTEs.])
2677 AC_SUBST([FLAG_NO_BUILD_ID], [""])
2681 # does the ppc assembler support "mtocrf" et al?
2682 AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf])
2684 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2685 __asm__ __volatile__("mtocrf 4,0");
2686 __asm__ __volatile__("mfocrf 0,4");
2688 ac_have_as_ppc_mftocrf=yes
2689 AC_MSG_RESULT([yes])
2691 ac_have_as_ppc_mftocrf=no
2694 if test x$ac_have_as_ppc_mftocrf = xyes ; then
2695 AC_DEFINE(HAVE_AS_PPC_MFTOCRF, 1, [Define to 1 if as supports mtocrf/mfocrf.])
2699 # does the ppc assembler support "lfdp" and other phased out floating point insns?
2700 AC_MSG_CHECKING([if ppc32/64 asm supports phased out floating point instructions])
2702 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2703 do { typedef struct {
2707 dbl_pair_t dbl_pair[3];
2708 __asm__ volatile ("lfdp 10, %0"::"m" (dbl_pair[0]));
2711 ac_have_as_ppc_fpPO=yes
2712 AC_MSG_RESULT([yes])
2714 ac_have_as_ppc_fpPO=no
2717 if test x$ac_have_as_ppc_fpPO = xyes ; then
2718 AC_DEFINE(HAVE_AS_PPC_FPPO, 1, [Define to 1 if as supports floating point phased out category.])
2722 # does the amd64 assembler understand "fxsave64" and "fxrstor64"?
2723 AC_MSG_CHECKING([if amd64 assembler supports fxsave64/fxrstor64])
2725 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2727 asm __volatile__("fxsave64 (%0)" : : "r" (p) : "memory" );
2728 asm __volatile__("fxrstor64 (%0)" : : "r" (p) : "memory" );
2730 ac_have_as_amd64_fxsave64=yes
2731 AC_MSG_RESULT([yes])
2733 ac_have_as_amd64_fxsave64=no
2736 if test x$ac_have_as_amd64_fxsave64 = xyes ; then
2737 AC_DEFINE(HAVE_AS_AMD64_FXSAVE64, 1, [Define to 1 if as supports fxsave64/fxrstor64.])
2740 # does the x86/amd64 assembler understand SSE3 instructions?
2741 # Note, this doesn't generate a C-level symbol. It generates a
2742 # automake-level symbol (BUILD_SSE3_TESTS), used in test Makefile.am's
2743 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE3])
2745 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2746 do { long long int x;
2747 __asm__ __volatile__("fisttpq (%0)" : :"r"(&x) ); }
2751 AC_MSG_RESULT([yes])
2757 AM_CONDITIONAL(BUILD_SSE3_TESTS, test x$ac_have_as_sse3 = xyes)
2760 # Ditto for SSSE3 instructions (note extra S)
2761 # Note, this doesn't generate a C-level symbol. It generates a
2762 # automake-level symbol (BUILD_SSSE3_TESTS), used in test Makefile.am's
2763 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSSE3])
2765 save_CFLAGS="$CFLAGS"
2766 CFLAGS="$CFLAGS -msse -Werror"
2767 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2768 do { long long int x;
2769 __asm__ __volatile__(
2770 "pabsb (%0),%%xmm7" : : "r"(&x) : "xmm7" ); }
2773 ac_have_as_ssse3=yes
2774 AC_MSG_RESULT([yes])
2779 CFLAGS="$save_CFLAGS"
2781 AM_CONDITIONAL(BUILD_SSSE3_TESTS, test x$ac_have_as_ssse3 = xyes)
2784 # does the x86/amd64 assembler understand the PCLMULQDQ instruction?
2785 # Note, this doesn't generate a C-level symbol. It generates a
2786 # automake-level symbol (BUILD_PCLMULQDQ_TESTS), used in test Makefile.am's
2787 AC_MSG_CHECKING([if x86/amd64 assembler supports 'pclmulqdq'])
2788 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2790 __asm__ __volatile__(
2791 "pclmulqdq \$17,%%xmm6,%%xmm7" : : : "xmm6", "xmm7" ); }
2794 ac_have_as_pclmulqdq=yes
2795 AC_MSG_RESULT([yes])
2797 ac_have_as_pclmulqdq=no
2801 AM_CONDITIONAL(BUILD_PCLMULQDQ_TESTS, test x$ac_have_as_pclmulqdq = xyes)
2804 # does the x86/amd64 assembler understand the VPCLMULQDQ instruction?
2805 # Note, this doesn't generate a C-level symbol. It generates a
2806 # automake-level symbol (BUILD_VPCLMULQDQ_TESTS), used in test Makefile.am's
2807 AC_MSG_CHECKING([if x86/amd64 assembler supports 'vpclmulqdq'])
2808 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2811 * Carry-less multiplication of xmm1 with xmm2 and store the result in
2812 * xmm3. The immediate is used to determine which quadwords of xmm1 and
2813 * xmm2 should be used.
2815 __asm__ __volatile__(
2816 "vpclmulqdq \$0,%%xmm1,%%xmm2,%%xmm3" : : : );
2819 ac_have_as_vpclmulqdq=yes
2820 AC_MSG_RESULT([yes])
2822 ac_have_as_vpclmulqdq=no
2826 AM_CONDITIONAL(BUILD_VPCLMULQDQ_TESTS, test x$ac_have_as_vpclmulqdq = xyes)
2829 # does the x86/amd64 assembler understand FMA4 instructions?
2830 # Note, this doesn't generate a C-level symbol. It generates a
2831 # automake-level symbol (BUILD_AFM4_TESTS), used in test Makefile.am's
2832 AC_MSG_CHECKING([if x86/amd64 assembler supports FMA4 'vfmaddpd'])
2833 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2835 __asm__ __volatile__(
2836 "vfmaddpd %%xmm7,%%xmm8,%%xmm6,%%xmm9" : : : );
2839 ac_have_as_vfmaddpd=yes
2840 AC_MSG_RESULT([yes])
2842 ac_have_as_vfmaddpd=no
2846 AM_CONDITIONAL(BUILD_FMA4_TESTS, test x$ac_have_as_vfmaddpd = xyes)
2849 # does the x86/amd64 assembler understand the LZCNT instruction?
2850 # Note, this doesn't generate a C-level symbol. It generates a
2851 # automake-level symbol (BUILD_LZCNT_TESTS), used in test Makefile.am's
2852 AC_MSG_CHECKING([if x86/amd64 assembler supports 'lzcnt'])
2854 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2856 __asm__ __volatile__("lzcnt %%rax,%%rax" : : : "rax");
2859 ac_have_as_lzcnt=yes
2860 AC_MSG_RESULT([yes])
2866 AM_CONDITIONAL([BUILD_LZCNT_TESTS], [test x$ac_have_as_lzcnt = xyes])
2869 # does the x86/amd64 assembler understand the LOOPNEL instruction?
2870 # Note, this doesn't generate a C-level symbol. It generates a
2871 # automake-level symbol (BUILD_LOOPNEL_TESTS), used in test Makefile.am's
2872 AC_MSG_CHECKING([if x86/amd64 assembler supports 'loopnel'])
2874 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2876 __asm__ __volatile__("1: loopnel 1b\n");
2879 ac_have_as_loopnel=yes
2880 AC_MSG_RESULT([yes])
2882 ac_have_as_loopnel=no
2886 AM_CONDITIONAL([BUILD_LOOPNEL_TESTS], [test x$ac_have_as_loopnel = xyes])
2889 # does the x86/amd64 assembler understand ADDR32 ?
2890 # Note, this doesn't generate a C-level symbol. It generates a
2891 # automake-level symbol (BUILD_ADDR32_TESTS), used in test Makefile.am's
2892 AC_MSG_CHECKING([if x86/amd64 assembler supports 'addr32'])
2894 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2896 asm volatile ("addr32 rep movsb");
2899 ac_have_as_addr32=yes
2900 AC_MSG_RESULT([yes])
2902 ac_have_as_addr32=no
2906 AM_CONDITIONAL([BUILD_ADDR32_TESTS], [test x$ac_have_as_addr32 = xyes])
2909 # does the x86/amd64 assembler understand SSE 4.2 instructions?
2910 # Note, this doesn't generate a C-level symbol. It generates a
2911 # automake-level symbol (BUILD_SSE42_TESTS), used in test Makefile.am's
2912 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE4.2])
2914 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2915 do { long long int x;
2916 __asm__ __volatile__(
2917 "crc32q %%r15,%%r15" : : : "r15" );
2918 __asm__ __volatile__(
2919 "pblendvb (%%rcx), %%xmm11" : : : "memory", "xmm11");
2920 __asm__ __volatile__(
2921 "aesdec %%xmm2, %%xmm1" : : : "xmm2", "xmm1"); }
2924 ac_have_as_sse42=yes
2925 AC_MSG_RESULT([yes])
2931 AM_CONDITIONAL(BUILD_SSE42_TESTS, test x$ac_have_as_sse42 = xyes)
2934 # does the x86/amd64 assembler understand AVX instructions?
2935 # Note, this doesn't generate a C-level symbol. It generates a
2936 # automake-level symbol (BUILD_AVX_TESTS), used in test Makefile.am's
2937 AC_MSG_CHECKING([if x86/amd64 assembler speaks AVX])
2939 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2940 do { long long int x;
2941 __asm__ __volatile__(
2942 "vmovupd (%%rsp), %%ymm7" : : : "xmm7" );
2943 __asm__ __volatile__(
2944 "vaddpd %%ymm6,%%ymm7,%%ymm8" : : : "xmm6","xmm7","xmm8"); }
2948 AC_MSG_RESULT([yes])
2954 AM_CONDITIONAL(BUILD_AVX_TESTS, test x$ac_have_as_avx = xyes)
2957 # does the x86/amd64 assembler understand AVX2 instructions?
2958 # Note, this doesn't generate a C-level symbol. It generates a
2959 # automake-level symbol (BUILD_AVX2_TESTS), used in test Makefile.am's
2960 AC_MSG_CHECKING([if x86/amd64 assembler speaks AVX2])
2962 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2963 do { long long int x;
2964 __asm__ __volatile__(
2965 "vpsravd (%%rsp), %%ymm8, %%ymm7" : : : "xmm7", "xmm8" );
2966 __asm__ __volatile__(
2967 "vpaddb %%ymm6,%%ymm7,%%ymm8" : : : "xmm6","xmm7","xmm8"); }
2971 AC_MSG_RESULT([yes])
2977 AM_CONDITIONAL(BUILD_AVX2_TESTS, test x$ac_have_as_avx2 = xyes)
2980 # does the x86/amd64 assembler understand TSX instructions and
2981 # the XACQUIRE/XRELEASE prefixes?
2982 # Note, this doesn't generate a C-level symbol. It generates a
2983 # automake-level symbol (BUILD_TSX_TESTS), used in test Makefile.am's
2984 AC_MSG_CHECKING([if x86/amd64 assembler speaks TSX])
2986 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2988 __asm__ __volatile__(
2991 " xacquire lock incq 0(%rsp) \n\t"
2992 " xrelease lock incq 0(%rsp) \n"
2997 AC_MSG_RESULT([yes])
3003 AM_CONDITIONAL(BUILD_TSX_TESTS, test x$ac_have_as_tsx = xyes)
3006 # does the x86/amd64 assembler understand BMI1 and BMI2 instructions?
3007 # Note, this doesn't generate a C-level symbol. It generates a
3008 # automake-level symbol (BUILD_BMI_TESTS), used in test Makefile.am's
3009 AC_MSG_CHECKING([if x86/amd64 assembler speaks BMI1 and BMI2])
3011 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3012 do { unsigned int h, l;
3013 __asm__ __volatile__( "mulx %rax,%rcx,%r8" );
3014 __asm__ __volatile__(
3015 "andn %2, %1, %0" : "=r" (h) : "r" (0x1234567), "r" (0x7654321) );
3016 __asm__ __volatile__(
3017 "movl %2, %%edx; mulx %3, %1, %0" : "=r" (h), "=r" (l) : "g" (0x1234567), "rm" (0x7654321) : "edx" ); }
3021 AC_MSG_RESULT([yes])
3027 AM_CONDITIONAL(BUILD_BMI_TESTS, test x$ac_have_as_bmi = xyes)
3030 # does the x86/amd64 assembler understand FMA instructions?
3031 # Note, this doesn't generate a C-level symbol. It generates a
3032 # automake-level symbol (BUILD_FMA_TESTS), used in test Makefile.am's
3033 AC_MSG_CHECKING([if x86/amd64 assembler speaks FMA])
3035 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3036 do { unsigned int h, l;
3037 __asm__ __volatile__(
3038 "vfmadd132ps (%%rsp), %%ymm8, %%ymm7" : : : "xmm7", "xmm8" );
3039 __asm__ __volatile__(
3040 "vfnmsub231sd (%%rsp), %%xmm8, %%xmm7" : : : "xmm7", "xmm8" );
3041 __asm__ __volatile__(
3042 "vfmsubadd213pd (%%rsp), %%xmm8, %%xmm7" : : : "xmm7", "xmm8" ); }
3046 AC_MSG_RESULT([yes])
3052 AM_CONDITIONAL(BUILD_FMA_TESTS, test x$ac_have_as_fma = xyes)
3055 # does the amd64 assembler understand MPX instructions?
3056 # Note, this doesn't generate a C-level symbol. It generates a
3057 # automake-level symbol (BUILD_MPX_TESTS), used in test Makefile.am's
3058 AC_MSG_CHECKING([if amd64 assembler knows the MPX instructions])
3060 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3062 asm ("bndmov %bnd0,(%rsp)");
3063 asm ("bndldx 3(%rbx,%rdx), %bnd2");
3064 asm ("bnd call foo\n"
3071 AC_MSG_RESULT([yes])
3077 AM_CONDITIONAL(BUILD_MPX_TESTS, test x$ac_have_as_mpx = xyes)
3080 # does the amd64 assembler understand ADX instructions?
3081 # Note, this doesn't generate a C-level symbol. It generates a
3082 # automake-level symbol (BUILD_ADX_TESTS), used in test Makefile.am's
3083 AC_MSG_CHECKING([if amd64 assembler knows the ADX instructions])
3085 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3087 asm ("adcxq %r14,%r8");
3091 AC_MSG_RESULT([yes])
3097 AM_CONDITIONAL(BUILD_ADX_TESTS, test x$ac_have_as_adx = xyes)
3100 # does the amd64 assembler understand the RDRAND instruction?
3101 # Note, this doesn't generate a C-level symbol. It generates a
3102 # automake-level symbol (BUILD_RDRAND_TESTS), used in test Makefile.am's
3103 AC_MSG_CHECKING([if amd64 assembler knows the RDRAND instruction])
3105 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3107 asm ("rdrand %r14");
3108 asm ("rdrand %r14d");
3109 asm ("rdrand %r14w");
3112 ac_have_as_rdrand=yes
3113 AC_MSG_RESULT([yes])
3115 ac_have_as_rdrand=no
3119 AM_CONDITIONAL(BUILD_RDRAND_TESTS, test x$ac_have_as_rdrand = xyes)
3121 # does the amd64 assembler understand the RDSEED instruction?
3122 # Note, this doesn't generate a C-level symbol. It generates a
3123 # automake-level symbol (BUILD_RDSEED_TESTS), used in test Makefile.am's
3124 AC_MSG_CHECKING([if amd64 assembler knows the RDSEED instruction])
3126 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3128 asm ("rdseed %r14");
3129 asm ("rdseed %r14d");
3130 asm ("rdseed %r14w");
3133 ac_have_as_rdseed=yes
3134 AC_MSG_RESULT([yes])
3136 ac_have_as_rdseed=no
3140 AM_CONDITIONAL(BUILD_RDSEED_TESTS, test x$ac_have_as_rdseed = xyes)
3142 # does the amd64 assembler understand the F16C instructions (VCVTPH2PS and
3144 # Note, this doesn't generate a C-level symbol. It generates a
3145 # automake-level symbol (BUILD_F16C_TESTS), used in test Makefile.am's
3146 AC_MSG_CHECKING([if amd64 assembler knows the F16C instructions])
3148 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3150 asm ("vcvtph2ps %xmm5, %ymm10");
3151 // If we put the dollar sign and zero together, the shell processing
3152 // this configure.ac script substitutes the command name in. Sigh.
3153 asm ("vcvtps2ph $" "0, %ymm10, %xmm5");
3157 AC_MSG_RESULT([yes])
3163 AM_CONDITIONAL(BUILD_F16C_TESTS, test x$ac_have_as_f16c = xyes)
3166 # does the x86/amd64 assembler understand MOVBE?
3167 # Note, this doesn't generate a C-level symbol. It generates a
3168 # automake-level symbol (BUILD_MOVBE_TESTS), used in test Makefile.am's
3169 AC_MSG_CHECKING([if x86/amd64 assembler knows the MOVBE insn])
3171 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3172 do { long long int x;
3173 __asm__ __volatile__(
3174 "movbe (%%rsp), %%r15" : : : "memory", "r15" ); }
3177 ac_have_as_movbe=yes
3178 AC_MSG_RESULT([yes])
3184 AM_CONDITIONAL(BUILD_MOVBE_TESTS, test x$ac_have_as_movbe = xyes)
3187 # Does the C compiler support the "ifunc" attribute
3188 # Note, this doesn't generate a C-level symbol. It generates a
3189 # automake-level symbol (BUILD_IFUNC_TESTS), used in test Makefile.am's
3190 AC_MSG_CHECKING([if gcc supports the ifunc attribute])
3192 AC_LINK_IFELSE([AC_LANG_SOURCE([[
3193 static void mytest(void) {}
3195 static void (*resolve_test(void))(void)
3197 return (void (*)(void))&mytest;
3200 void test(void) __attribute__((ifunc("resolve_test")));
3208 ac_have_ifunc_attr=yes
3209 AC_MSG_RESULT([yes])
3211 ac_have_ifunc_attr=no
3215 AM_CONDITIONAL(BUILD_IFUNC_TESTS, test x$ac_have_ifunc_attr = xyes)
3217 # Does the C compiler support the armv8 crc feature flag
3218 # Note, this doesn't generate a C-level symbol. It generates a
3219 # automake-level symbol (BUILD_ARMV8_CRC_TESTS), used in test Makefile.am's
3220 AC_MSG_CHECKING([if gcc supports the armv8 crc feature flag])
3222 save_CFLAGS="$CFLAGS"
3223 CFLAGS="$CFLAGS -march=armv8-a+crc -Werror"
3224 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3230 ac_have_armv8_crc_feature=yes
3231 AC_MSG_RESULT([yes])
3233 ac_have_armv8_crc_feature=no
3236 CFLAGS="$save_CFLAGS"
3238 AM_CONDITIONAL(BUILD_ARMV8_CRC_TESTS, test x$ac_have_armv8_crc_feature = xyes)
3241 # Does the C compiler support the armv81 flag and the assembler v8.1 instructions
3242 # Note, this doesn't generate a C-level symbol. It generates a
3243 # automake-level symbol (BUILD_ARMV81_TESTS), used in test Makefile.am's
3244 AC_MSG_CHECKING([if gcc supports the armv81 feature flag and assembler supports v8.1 instructions])
3246 save_CFLAGS="$CFLAGS"
3247 CFLAGS="$CFLAGS -march=armv8.1-a -Werror"
3248 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3251 __asm__ __volatile__("ldadd x0, x1, [x2]" ::: "memory");
3255 ac_have_armv81_feature=yes
3256 AC_MSG_RESULT([yes])
3258 ac_have_armv81_feature=no
3261 CFLAGS="$save_CFLAGS"
3263 AM_CONDITIONAL(BUILD_ARMV81_TESTS, test x$ac_have_armv81_feature = xyes)
3266 # Does the C compiler support the armv82 flag and the assembler v8.2 instructions
3267 # Note, this doesn't generate a C-level symbol. It generates a
3268 # automake-level symbol (BUILD_ARMV82_TESTS), used in test Makefile.am's
3269 AC_MSG_CHECKING([if gcc supports the armv82 feature flag and assembler supports v8.2 instructions])
3271 save_CFLAGS="$CFLAGS"
3272 CFLAGS="$CFLAGS -march=armv8.2-a+fp16 -Werror"
3273 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3276 __asm__ __volatile__("faddp h0, v1.2h");
3280 ac_have_armv82_feature=yes
3281 AC_MSG_RESULT([yes])
3283 ac_have_armv82_feature=no
3286 CFLAGS="$save_CFLAGS"
3288 AM_CONDITIONAL(BUILD_ARMV82_TESTS, test x$ac_have_armv82_feature = xyes)
3291 # XXX JRS 2010 Oct 13: what is this for? For sure, we don't need this
3292 # when building the tool executables. I think we should get rid of it.
3294 # Check for TLS support in the compiler and linker
3295 AC_LINK_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
3297 [vg_cv_linktime_tls=yes],
3298 [vg_cv_linktime_tls=no])
3299 # Native compilation: check whether running a program using TLS succeeds.
3300 # Linking only is not sufficient -- e.g. on Red Hat 7.3 linking TLS programs
3301 # succeeds but running programs using TLS fails.
3302 # Cross-compiling: check whether linking a program using TLS succeeds.
3303 AC_CACHE_CHECK([for TLS support], vg_cv_tls,
3304 [AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS],
3305 [vg_cv_tls=$enableval],
3306 [AC_RUN_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
3310 [vg_cv_tls=$vg_cv_linktime_tls])])])
3312 if test "$vg_cv_tls" = yes -a $is_clang != applellvm; then
3313 AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variables])
3317 #----------------------------------------------------------------------------
3318 # Solaris-specific checks.
3319 #----------------------------------------------------------------------------
3321 if test "$VGCONF_OS" = "solaris" ; then
3322 AC_CHECK_HEADERS([sys/lgrp_user_impl.h])
3324 # Solaris-specific check determining if the Sun Studio Assembler is used to
3325 # build Valgrind. The test checks if the x86/amd64 assembler understands the
3326 # cmovl.l instruction, if yes then it's Sun Assembler.
3328 # C-level symbol: none
3329 # Automake-level symbol: SOLARIS_SUN_STUDIO_AS
3331 AC_MSG_CHECKING([if x86/amd64 assembler speaks cmovl.l (Solaris-specific)])
3332 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3334 __asm__ __volatile__("cmovl.l %edx, %eax");
3336 solaris_have_sun_studio_as=yes
3337 AC_MSG_RESULT([yes])
3339 solaris_have_sun_studio_as=no
3342 AM_CONDITIONAL(SOLARIS_SUN_STUDIO_AS, test x$solaris_have_sun_studio_as = xyes)
3344 # Solaris-specific check determining if symbols __xpg4 and __xpg6
3345 # are present in linked shared libraries when gcc is invoked with -std=gnu99.
3346 # See solaris/vgpreload-solaris.mapfile for details.
3347 # gcc on older Solaris instructs linker to include these symbols,
3348 # gcc on illumos and newer Solaris does not.
3350 # C-level symbol: none
3351 # Automake-level symbol: SOLARIS_XPG_SYMBOLS_PRESENT
3353 save_CFLAGS="$CFLAGS"
3354 CFLAGS="$CFLAGS -std=gnu99"
3355 AC_MSG_CHECKING([if xpg symbols are present with -std=gnu99 (Solaris-specific)])
3356 temp_dir=$( /usr/bin/mktemp -d )
3357 cat <<_ACEOF >${temp_dir}/mylib.c
3359 int myfunc(void) { printf("LaPutyka\n"); }
3361 ${CC} ${CFLAGS} -fpic -shared -o ${temp_dir}/mylib.so ${temp_dir}/mylib.c
3362 xpg_present=$( /usr/bin/nm ${temp_dir}/mylib.so | ${EGREP} '(__xpg4|__xpg6)' )
3363 if test "x${xpg_present}" = "x" ; then
3364 solaris_xpg_symbols_present=no
3367 solaris_xpg_symbols_present=yes
3368 AC_MSG_RESULT([yes])
3371 AM_CONDITIONAL(SOLARIS_XPG_SYMBOLS_PRESENT, test x$solaris_xpg_symbols_present = xyes)
3372 CFLAGS="$save_CFLAGS"
3375 # Solaris-specific check determining if gcc enables largefile support by
3376 # default for 32-bit executables. If it does, then set SOLARIS_UNDEF_LARGESOURCE
3377 # variable with gcc flags which disable it.
3379 AC_MSG_CHECKING([if gcc enables largefile support for 32-bit apps (Solaris-specific)])
3380 save_CFLAGS="$CFLAGS"
3381 CFLAGS="$CFLAGS -m32"
3382 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
3383 return _LARGEFILE_SOURCE;
3385 SOLARIS_UNDEF_LARGESOURCE="-U_LARGEFILE_SOURCE -U_LARGEFILE64_SOURCE -U_FILE_OFFSET_BITS"
3386 AC_MSG_RESULT([yes])
3388 SOLARIS_UNDEF_LARGESOURCE=""
3392 AC_SUBST(SOLARIS_UNDEF_LARGESOURCE)
3395 # Solaris-specific check determining if /proc/self/cmdline
3396 # or /proc/<pid>/cmdline is supported.
3398 # C-level symbol: SOLARIS_PROC_CMDLINE
3399 # Automake-level symbol: SOLARIS_PROC_CMDLINE
3401 AC_CHECK_FILE([/proc/self/cmdline],
3403 solaris_proc_cmdline=yes
3404 AC_DEFINE([SOLARIS_PROC_CMDLINE], 1,
3405 [Define to 1 if you have /proc/self/cmdline.])
3407 solaris_proc_cmdline=no
3409 AM_CONDITIONAL(SOLARIS_PROC_CMDLINE, test x$solaris_proc_cmdline = xyes)
3412 # Solaris-specific check determining default platform for the Valgrind launcher.
3413 # Used in case the launcher cannot select platform by looking at the client
3414 # image (for example because the executable is a shell script).
3416 # C-level symbol: SOLARIS_LAUNCHER_DEFAULT_PLATFORM
3417 # Automake-level symbol: none
3419 AC_MSG_CHECKING([for default platform of Valgrind launcher (Solaris-specific)])
3420 # Get the ELF class of /bin/sh first.
3421 if ! test -f /bin/sh; then
3422 AC_MSG_ERROR([Shell interpreter `/bin/sh' not found.])
3424 elf_class=$( /usr/bin/file /bin/sh | sed -n 's/.*ELF \(..\)-bit.*/\1/p' )
3425 case "$elf_class" in
3427 default_arch="$VGCONF_ARCH_PRI";
3430 if test "x$VGCONF_ARCH_SEC" != "x"; then
3431 default_arch="$VGCONF_ARCH_SEC"
3433 default_arch="$VGCONF_ARCH_PRI";
3437 AC_MSG_ERROR([Cannot determine ELF class of `/bin/sh'.])
3440 default_platform="$default_arch-$VGCONF_OS"
3441 AC_MSG_RESULT([$default_platform])
3442 AC_DEFINE_UNQUOTED([SOLARIS_LAUNCHER_DEFAULT_PLATFORM], ["$default_platform"],
3443 [Default platform for Valgrind launcher.])
3446 # Solaris-specific check determining if the old syscalls are available.
3448 # C-level symbol: SOLARIS_OLD_SYSCALLS
3449 # Automake-level symbol: SOLARIS_OLD_SYSCALLS
3451 AC_MSG_CHECKING([for the old Solaris syscalls (Solaris-specific)])
3452 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3453 #include <sys/syscall.h>
3457 solaris_old_syscalls=yes
3458 AC_MSG_RESULT([yes])
3459 AC_DEFINE([SOLARIS_OLD_SYSCALLS], 1,
3460 [Define to 1 if you have the old Solaris syscalls.])
3462 solaris_old_syscalls=no
3465 AM_CONDITIONAL(SOLARIS_OLD_SYSCALLS, test x$solaris_old_syscalls = xyes)
3468 # Solaris-specific check determining if the new accept() syscall is available.
3471 # int accept(int sock, struct sockaddr *name, socklen_t *namelenp,
3474 # New syscall (available on illumos):
3475 # int accept(int sock, struct sockaddr *name, socklen_t *namelenp,
3476 # int version, int flags);
3478 # If the old syscall is present then the following syscall will fail with
3479 # ENOTSOCK (because file descriptor 0 is not a socket), if the new syscall is
3480 # available then it will fail with EINVAL (because the flags parameter is
3483 # C-level symbol: SOLARIS_NEW_ACCEPT_SYSCALL
3484 # Automake-level symbol: none
3486 AC_MSG_CHECKING([for the new `accept' syscall (Solaris-specific)])
3487 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
3488 #include <sys/syscall.h>
3492 syscall(SYS_accept, 0, 0, 0, 0, -1);
3493 return !(errno == EINVAL);
3495 AC_MSG_RESULT([yes])
3496 AC_DEFINE([SOLARIS_NEW_ACCEPT_SYSCALL], 1,
3497 [Define to 1 if you have the new `accept' syscall.])
3503 # Solaris-specific check determining if the new illumos pipe() syscall is
3507 # longlong_t pipe();
3509 # New syscall (available on illumos):
3510 # int pipe(intptr_t arg, int flags);
3512 # If the old syscall is present then the following call will succeed, if the
3513 # new syscall is available then it will fail with EFAULT (because address 0
3514 # cannot be accessed).
3516 # C-level symbol: SOLARIS_NEW_PIPE_SYSCALL
3517 # Automake-level symbol: none
3519 AC_MSG_CHECKING([for the new `pipe' syscall (Solaris-specific)])
3520 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
3521 #include <sys/syscall.h>
3525 syscall(SYS_pipe, 0, 0);
3526 return !(errno == EFAULT);
3528 AC_MSG_RESULT([yes])
3529 AC_DEFINE([SOLARIS_NEW_PIPE_SYSCALL], 1,
3530 [Define to 1 if you have the new `pipe' syscall.])
3536 # Solaris-specific check determining if the new lwp_sigqueue() syscall is
3540 # int lwp_kill(id_t lwpid, int sig);
3542 # New syscall (available on Solaris 11):
3543 # int lwp_sigqueue(id_t lwpid, int sig, void *value,
3544 # int si_code, timespec_t *timeout);
3546 # C-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL
3547 # Automake-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL
3549 AC_MSG_CHECKING([for the new `lwp_sigqueue' syscall (Solaris-specific)])
3550 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3551 #include <sys/syscall.h>
3553 return !SYS_lwp_sigqueue;
3555 solaris_lwp_sigqueue_syscall=yes
3556 AC_MSG_RESULT([yes])
3557 AC_DEFINE([SOLARIS_LWP_SIGQUEUE_SYSCALL], 1,
3558 [Define to 1 if you have the new `lwp_sigqueue' syscall.])
3560 solaris_lwp_sigqueue_syscall=no
3563 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL, test x$solaris_lwp_sigqueue_syscall = xyes)
3566 # Solaris-specific check determining if the lwp_sigqueue() syscall
3567 # takes both pid and thread id arguments or just thread id.
3569 # Old syscall (available up to Solaris 11.3):
3570 # int lwp_sigqueue(id_t lwpid, int sig, void *value,
3571 # int si_code, timespec_t *timeout);
3573 # New syscall (available since Solaris 11.4):
3574 # int lwp_sigqueue(pid_t pid, id_t lwpid, int sig, void *value,
3575 # int si_code, timespec_t *timeout);
3577 # If the old syscall is present then the following syscall will fail with
3578 # EINVAL (because signal is out of range); if the new syscall is available
3579 # then it will fail with ESRCH (because it would not find such thread in the
3582 # C-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID
3583 # Automake-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID
3585 AM_COND_IF(SOLARIS_LWP_SIGQUEUE_SYSCALL,
3586 AC_MSG_CHECKING([if the `lwp_sigqueue' syscall accepts pid (Solaris-specific)])
3587 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
3588 #include <sys/syscall.h>
3592 syscall(SYS_lwp_sigqueue, 0, 101, 0, 0, 0, 0);
3593 return !(errno == ESRCH);
3595 solaris_lwp_sigqueue_syscall_takes_pid=yes
3596 AC_MSG_RESULT([yes])
3597 AC_DEFINE([SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID], 1,
3598 [Define to 1 if you have the new `lwp_sigqueue' syscall which accepts pid.])
3600 solaris_lwp_sigqueue_syscall_takes_pid=no
3603 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID,
3604 test x$solaris_lwp_sigqueue_syscall_takes_pid = xyes)
3606 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID, test x = y)
3610 # Solaris-specific check determining if the new lwp_name() syscall is
3613 # New syscall (available on Solaris 11):
3614 # int lwp_name(int opcode, id_t lwpid, char *name, size_t len);
3616 # C-level symbol: SOLARIS_LWP_NAME_SYSCALL
3617 # Automake-level symbol: SOLARIS_LWP_NAME_SYSCALL
3619 AC_MSG_CHECKING([for the new `lwp_name' syscall (Solaris-specific)])
3620 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3621 #include <sys/syscall.h>
3623 return !SYS_lwp_name;
3625 solaris_lwp_name_syscall=yes
3626 AC_MSG_RESULT([yes])
3627 AC_DEFINE([SOLARIS_LWP_NAME_SYSCALL], 1,
3628 [Define to 1 if you have the new `lwp_name' syscall.])
3630 solaris_lwp_name_syscall=no
3633 AM_CONDITIONAL(SOLARIS_LWP_NAME_SYSCALL, test x$solaris_lwp_name_syscall = xyes)
3636 # Solaris-specific check determining if the new getrandom() syscall is
3639 # New syscall (available on Solaris 11):
3640 # int getrandom(void *buf, size_t buflen, uint_t flags);
3642 # C-level symbol: SOLARIS_GETRANDOM_SYSCALL
3643 # Automake-level symbol: SOLARIS_GETRANDOM_SYSCALL
3645 AC_MSG_CHECKING([for the new `getrandom' syscall (Solaris-specific)])
3646 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3647 #include <sys/syscall.h>
3649 return !SYS_getrandom;
3651 solaris_getrandom_syscall=yes
3652 AC_MSG_RESULT([yes])
3653 AC_DEFINE([SOLARIS_GETRANDOM_SYSCALL], 1,
3654 [Define to 1 if you have the new `getrandom' syscall.])
3656 solaris_getrandom_syscall=no
3659 AM_CONDITIONAL(SOLARIS_GETRANDOM_SYSCALL, test x$solaris_getrandom_syscall = xyes)
3662 # Solaris-specific check determining if the new zone() syscall subcodes
3663 # ZONE_LIST_DEFUNCT and ZONE_GETATTR_DEFUNCT are available. These subcodes
3664 # were added in Solaris 11 but are missing on illumos.
3666 # C-level symbol: SOLARIS_ZONE_DEFUNCT
3667 # Automake-level symbol: SOLARIS_ZONE_DEFUNCT
3669 AC_MSG_CHECKING([for ZONE_LIST_DEFUNCT and ZONE_GETATTR_DEFUNCT (Solaris-specific)])
3670 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3671 #include <sys/zone.h>
3673 return !(ZONE_LIST_DEFUNCT && ZONE_GETATTR_DEFUNCT);
3675 solaris_zone_defunct=yes
3676 AC_MSG_RESULT([yes])
3677 AC_DEFINE([SOLARIS_ZONE_DEFUNCT], 1,
3678 [Define to 1 if you have the `ZONE_LIST_DEFUNCT' and `ZONE_GETATTR_DEFUNC' constants.])
3680 solaris_zone_defunct=no
3683 AM_CONDITIONAL(SOLARIS_ZONE_DEFUNCT, test x$solaris_zone_defunct = xyes)
3686 # Solaris-specific check determining if commands A_GETSTAT and A_SETSTAT
3687 # for auditon(2) subcode of the auditsys() syscall are available.
3688 # These commands are available in Solaris 11 and illumos but were removed
3691 # C-level symbol: SOLARIS_AUDITON_STAT
3692 # Automake-level symbol: SOLARIS_AUDITON_STAT
3694 AC_MSG_CHECKING([for A_GETSTAT and A_SETSTAT auditon(2) commands (Solaris-specific)])
3695 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3696 #include <bsm/audit.h>
3698 return !(A_GETSTAT && A_SETSTAT);
3700 solaris_auditon_stat=yes
3701 AC_MSG_RESULT([yes])
3702 AC_DEFINE([SOLARIS_AUDITON_STAT], 1,
3703 [Define to 1 if you have the `A_GETSTAT' and `A_SETSTAT' constants.])
3705 solaris_auditon_stat=no
3708 AM_CONDITIONAL(SOLARIS_AUDITON_STAT, test x$solaris_auditon_stat = xyes)
3711 # Solaris-specific check determining if the new shmsys() syscall subcodes
3712 # IPC_XSTAT64, SHMADV, SHM_ADV_GET, SHM_ADV_SET and SHMGET_OSM are available.
3713 # These subcodes were added in Solaris 11 but are missing on illumos.
3715 # C-level symbol: SOLARIS_SHM_NEW
3716 # Automake-level symbol: SOLARIS_SHM_NEW
3718 AC_MSG_CHECKING([for SHMADV, SHM_ADV_GET, SHM_ADV_SET and SHMGET_OSM (Solaris-specific)])
3719 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3720 #include <sys/ipc_impl.h>
3721 #include <sys/shm.h>
3722 #include <sys/shm_impl.h>
3724 return !(IPC_XSTAT64 && SHMADV && SHM_ADV_GET && SHM_ADV_SET && SHMGET_OSM);
3727 AC_MSG_RESULT([yes])
3728 AC_DEFINE([SOLARIS_SHM_NEW], 1,
3729 [Define to 1 if you have the `IPC_XSTAT64', `SHMADV', `SHM_ADV_GET', `SHM_ADV_SET' and `SHMGET_OSM' constants.])
3734 AM_CONDITIONAL(SOLARIS_SHM_NEW, test x$solaris_shm_new = xyes)
3737 # Solaris-specific check determining if prxregset_t is available. Illumos
3738 # currently does not define it on the x86 platform.
3740 # C-level symbol: SOLARIS_PRXREGSET_T
3741 # Automake-level symbol: SOLARIS_PRXREGSET_T
3743 AC_MSG_CHECKING([for the `prxregset_t' type (Solaris-specific)])
3744 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3745 #include <sys/procfs_isa.h>
3747 return !sizeof(prxregset_t);
3749 solaris_prxregset_t=yes
3750 AC_MSG_RESULT([yes])
3751 AC_DEFINE([SOLARIS_PRXREGSET_T], 1,
3752 [Define to 1 if you have the `prxregset_t' type.])
3754 solaris_prxregset_t=no
3757 AM_CONDITIONAL(SOLARIS_PRXREGSET_T, test x$solaris_prxregset_t = xyes)
3760 # Solaris-specific check determining if the new frealpathat() syscall is
3763 # New syscall (available on Solaris 11.1):
3764 # int frealpathat(int fd, char *path, char *buf, size_t buflen);
3766 # C-level symbol: SOLARIS_FREALPATHAT_SYSCALL
3767 # Automake-level symbol: SOLARIS_FREALPATHAT_SYSCALL
3769 AC_MSG_CHECKING([for the new `frealpathat' syscall (Solaris-specific)])
3770 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3771 #include <sys/syscall.h>
3773 return !SYS_frealpathat;
3775 solaris_frealpathat_syscall=yes
3776 AC_MSG_RESULT([yes])
3777 AC_DEFINE([SOLARIS_FREALPATHAT_SYSCALL], 1,
3778 [Define to 1 if you have the new `frealpathat' syscall.])
3780 solaris_frealpathat_syscall=no
3783 AM_CONDITIONAL(SOLARIS_FREALPATHAT_SYSCALL, test x$solaris_frealpathat_syscall = xyes)
3786 # Solaris-specific check determining if the new uuidsys() syscall is
3789 # New syscall (available on newer Solaris):
3790 # int uuidsys(struct uuid *uuid);
3792 # C-level symbol: SOLARIS_UUIDSYS_SYSCALL
3793 # Automake-level symbol: SOLARIS_UUIDSYS_SYSCALL
3795 AC_MSG_CHECKING([for the new `uuidsys' syscall (Solaris-specific)])
3796 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3797 #include <sys/syscall.h>
3799 return !SYS_uuidsys;
3801 solaris_uuidsys_syscall=yes
3802 AC_MSG_RESULT([yes])
3803 AC_DEFINE([SOLARIS_UUIDSYS_SYSCALL], 1,
3804 [Define to 1 if you have the new `uuidsys' syscall.])
3806 solaris_uuidsys_syscall=no
3809 AM_CONDITIONAL(SOLARIS_UUIDSYS_SYSCALL, test x$solaris_uuidsys_syscall = xyes)
3812 # Solaris-specific check determining if the new labelsys() syscall subcode
3813 # TNDB_GET_TNIP is available. This subcode was added in Solaris 11 but is
3814 # missing on illumos.
3816 # C-level symbol: SOLARIS_TNDB_GET_TNIP
3817 # Automake-level symbol: SOLARIS_TNDB_GET_TNIP
3819 AC_MSG_CHECKING([for TNDB_GET_TNIP (Solaris-specific)])
3820 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3821 #include <sys/tsol/tndb.h>
3823 return !TNDB_GET_TNIP;
3825 solaris_tndb_get_tnip=yes
3826 AC_MSG_RESULT([yes])
3827 AC_DEFINE([SOLARIS_TNDB_GET_TNIP], 1,
3828 [Define to 1 if you have the `TNDB_GET_TNIP' constant.])
3830 solaris_tndb_get_tnip=no
3833 AM_CONDITIONAL(SOLARIS_TNDB_GET_TNIP, test x$solaris_tndb_get_tnip = xyes)
3836 # Solaris-specific check determining if the new labelsys() syscall opcodes
3837 # TSOL_GETCLEARANCE and TSOL_SETCLEARANCE are available. These opcodes were
3838 # added in Solaris 11 but are missing on illumos.
3840 # C-level symbol: SOLARIS_TSOL_CLEARANCE
3841 # Automake-level symbol: SOLARIS_TSOL_CLEARANCE
3843 AC_MSG_CHECKING([for TSOL_GETCLEARANCE and TSOL_SETCLEARANCE (Solaris-specific)])
3844 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3845 #include <sys/tsol/tsyscall.h>
3847 return !(TSOL_GETCLEARANCE && TSOL_SETCLEARANCE);
3849 solaris_tsol_clearance=yes
3850 AC_MSG_RESULT([yes])
3851 AC_DEFINE([SOLARIS_TSOL_CLEARANCE], 1,
3852 [Define to 1 if you have the `TSOL_GETCLEARANCE' and `TSOL_SETCLEARANCE' constants.])
3854 solaris_tsol_clearance=no
3857 AM_CONDITIONAL(SOLARIS_TSOL_CLEARANCE, test x$solaris_tsol_clearance = xyes)
3860 # Solaris-specific check determining if the new pset() syscall subcode
3861 # PSET_GET_NAME is available. This subcode was added in Solaris 11.4 but
3862 # is missing on illumos and Solaris 11.3.
3864 # C-level symbol: SOLARIS_PSET_GET_NAME
3865 # Automake-level symbol: SOLARIS_PSET_GET_NAME
3867 AC_MSG_CHECKING([for PSET_GET_NAME (Solaris-specific)])
3868 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3869 #include <sys/pset.h>
3871 return !(PSET_GET_NAME);
3873 solaris_pset_get_name=yes
3874 AC_MSG_RESULT([yes])
3875 AC_DEFINE([SOLARIS_PSET_GET_NAME], 1,
3876 [Define to 1 if you have the `PSET_GET_NAME' constants.])
3878 solaris_pset_get_name=no
3881 AM_CONDITIONAL(SOLARIS_PSET_GET_NAME, test x$solaris_pset_get_name = xyes)
3884 # Solaris-specific check determining if the utimesys() syscall is
3885 # available (on illumos and older Solaris).
3887 # C-level symbol: SOLARIS_UTIMESYS_SYSCALL
3888 # Automake-level symbol: SOLARIS_UTIMESYS_SYSCALL
3890 AC_MSG_CHECKING([for the `utimesys' syscall (Solaris-specific)])
3891 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3892 #include <sys/syscall.h>
3894 return !SYS_utimesys;
3896 solaris_utimesys_syscall=yes
3897 AC_MSG_RESULT([yes])
3898 AC_DEFINE([SOLARIS_UTIMESYS_SYSCALL], 1,
3899 [Define to 1 if you have the `utimesys' syscall.])
3901 solaris_utimesys_syscall=no
3904 AM_CONDITIONAL(SOLARIS_UTIMESYS_SYSCALL, test x$solaris_utimesys_syscall = xyes)
3907 # Solaris-specific check determining if the utimensat() syscall is
3908 # available (on newer Solaris).
3910 # C-level symbol: SOLARIS_UTIMENSAT_SYSCALL
3911 # Automake-level symbol: SOLARIS_UTIMENSAT_SYSCALL
3913 AC_MSG_CHECKING([for the `utimensat' syscall (Solaris-specific)])
3914 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3915 #include <sys/syscall.h>
3917 return !SYS_utimensat;
3919 solaris_utimensat_syscall=yes
3920 AC_MSG_RESULT([yes])
3921 AC_DEFINE([SOLARIS_UTIMENSAT_SYSCALL], 1,
3922 [Define to 1 if you have the `utimensat' syscall.])
3924 solaris_utimensat_syscall=no
3927 AM_CONDITIONAL(SOLARIS_UTIMENSAT_SYSCALL, test x$solaris_utimensat_syscall = xyes)
3930 # Solaris-specific check determining if the spawn() syscall is available
3931 # (on newer Solaris).
3933 # C-level symbol: SOLARIS_SPAWN_SYSCALL
3934 # Automake-level symbol: SOLARIS_SPAWN_SYSCALL
3936 AC_MSG_CHECKING([for the `spawn' syscall (Solaris-specific)])
3937 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3938 #include <sys/syscall.h>
3942 solaris_spawn_syscall=yes
3943 AC_MSG_RESULT([yes])
3944 AC_DEFINE([SOLARIS_SPAWN_SYSCALL], 1,
3945 [Define to 1 if you have the `spawn' syscall.])
3947 solaris_spawn_syscall=no
3950 AM_CONDITIONAL(SOLARIS_SPAWN_SYSCALL, test x$solaris_spawn_syscall = xyes)
3953 # Solaris-specific check determining if commands MODNVL_CTRLMAP through
3954 # MODDEVINFO_CACHE_TS for modctl() syscall are available (on newer Solaris).
3956 # C-level symbol: SOLARIS_MODCTL_MODNVL
3957 # Automake-level symbol: SOLARIS_MODCTL_MODNVL
3959 AC_MSG_CHECKING([for MODNVL_CTRLMAP through MODDEVINFO_CACHE_TS modctl(2) commands (Solaris-specific)])
3960 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3961 #include <sys/modctl.h>
3963 return !(MODNVL_CTRLMAP && MODDEVINFO_CACHE_TS);
3965 solaris_modctl_modnvl=yes
3966 AC_MSG_RESULT([yes])
3967 AC_DEFINE([SOLARIS_MODCTL_MODNVL], 1,
3968 [Define to 1 if you have the `MODNVL_CTRLMAP' through `MODDEVINFO_CACHE_TS' constants.])
3970 solaris_modctl_modnvl=no
3973 AM_CONDITIONAL(SOLARIS_MODCTL_MODNVL, test x$solaris_modctl_modnvl = xyes)
3976 # Solaris-specific check determining whether nscd (name switch cache daemon)
3977 # attaches its door at /system/volatile/name_service_door (Solaris)
3978 # or at /var/run/name_service_door (illumos).
3980 # Note that /var/run is a symlink to /system/volatile on Solaris
3981 # but not vice versa on illumos.
3983 # C-level symbol: SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE
3984 # Automake-level symbol: SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE
3986 AC_MSG_CHECKING([for nscd door location (Solaris-specific)])
3987 if test -e /system/volatile/name_service_door; then
3988 solaris_nscd_door_system_volatile=yes
3989 AC_MSG_RESULT([/system/volatile/name_service_door])
3990 AC_DEFINE([SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE], 1,
3991 [Define to 1 if nscd attaches to /system/volatile/name_service_door.])
3993 solaris_nscd_door_system_volatile=no
3994 AC_MSG_RESULT([/var/run/name_service_door])
3996 AM_CONDITIONAL(SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE, test x$solaris_nscd_door_system_volatile = xyes)
3999 # Solaris-specific check determining if the new gethrt() fasttrap is available.
4001 # New fasttrap (available on Solaris 11):
4002 # hrt_t *gethrt(void);
4004 # C-level symbol: SOLARIS_GETHRT_FASTTRAP
4005 # Automake-level symbol: SOLARIS_GETHRT_FASTTRAP
4007 AC_MSG_CHECKING([for the new `gethrt' fasttrap (Solaris-specific)])
4008 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4009 #include <sys/trap.h>
4013 solaris_gethrt_fasttrap=yes
4014 AC_MSG_RESULT([yes])
4015 AC_DEFINE([SOLARIS_GETHRT_FASTTRAP], 1,
4016 [Define to 1 if you have the new `gethrt' fasttrap.])
4018 solaris_gethrt_fasttrap=no
4021 AM_CONDITIONAL(SOLARIS_GETHRT_FASTTRAP, test x$solaris_gethrt_fasttrap = xyes)
4024 # Solaris-specific check determining if the new get_zone_offset() fasttrap
4027 # New fasttrap (available on Solaris 11):
4028 # zonehrtoffset_t *get_zone_offset(void);
4030 # C-level symbol: SOLARIS_GETZONEOFFSET_FASTTRAP
4031 # Automake-level symbol: SOLARIS_GETZONEOFFSET_FASTTRAP
4033 AC_MSG_CHECKING([for the new `get_zone_offset' fasttrap (Solaris-specific)])
4034 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4035 #include <sys/trap.h>
4037 return !T_GETZONEOFFSET;
4039 solaris_getzoneoffset_fasttrap=yes
4040 AC_MSG_RESULT([yes])
4041 AC_DEFINE([SOLARIS_GETZONEOFFSET_FASTTRAP], 1,
4042 [Define to 1 if you have the new `get_zone_offset' fasttrap.])
4044 solaris_getzoneoffset_fasttrap=no
4047 AM_CONDITIONAL(SOLARIS_GETZONEOFFSET_FASTTRAP, test x$solaris_getzoneoffset_fasttrap = xyes)
4050 # Solaris-specific check determining if the execve() syscall
4051 # takes fourth argument (flags) or not.
4053 # Old syscall (available on illumos):
4054 # int execve(const char *fname, const char **argv, const char **envp);
4056 # New syscall (available on Solaris):
4057 # int execve(uintptr_t file, const char **argv, const char **envp, int flags);
4059 # If the new syscall is present then it will fail with EINVAL (because flags
4060 # are invalid); if the old syscall is available then it will fail with ENOENT
4061 # (because the file could not be found).
4063 # C-level symbol: SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS
4064 # Automake-level symbol: SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS
4066 AC_MSG_CHECKING([if the `execve' syscall accepts flags (Solaris-specific)])
4067 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
4068 #include <sys/syscall.h>
4072 syscall(SYS_execve, "/no/existing/path", 0, 0, 0xdeadbeef, 0, 0);
4073 return !(errno == EINVAL);
4075 solaris_execve_syscall_takes_flags=yes
4076 AC_MSG_RESULT([yes])
4077 AC_DEFINE([SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS], 1,
4078 [Define to 1 if you have the new `execve' syscall which accepts flags.])
4080 solaris_execve_syscall_takes_flags=no
4083 AM_CONDITIONAL(SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS,
4084 test x$solaris_execve_syscall_takes_flags = xyes)
4087 # Solaris-specific check determining version of the repository cache protocol.
4088 # Every Solaris version uses a different one, ranging from 21 to current 25.
4089 # The check is very ugly, though.
4091 # C-level symbol: SOLARIS_REPCACHE_PROTOCOL_VERSION vv
4092 # Automake-level symbol: none
4094 AC_PATH_PROG(DIS_PATH, dis, false)
4095 if test "x$DIS_PATH" = "xfalse"; then
4096 AC_MSG_FAILURE([Object code disassembler (`dis') not found.])
4098 AC_CHECK_LIB(scf, scf_handle_bind, [], [
4099 AC_MSG_WARN([Function `scf_handle_bind' was not found in `libscf'.])
4100 AC_MSG_ERROR([Cannot determine version of the repository cache protocol.])
4103 AC_MSG_CHECKING([for version of the repository cache protocol (Solaris-specific)])
4104 if test "X$VGCONF_ARCH_PRI" = "Xamd64"; then
4105 libscf=/usr/lib/64/libscf.so.1
4107 libscf=/usr/lib/libscf.so.1
4109 if ! $DIS_PATH -F scf_handle_bind $libscf | grep -q 0x526570; then
4110 AC_MSG_WARN([Function `scf_handle_bind' does not contain repository cache protocol version.])
4111 AC_MSG_ERROR([Cannot determine version of the repository cache protocol.])
4113 hex=$( $DIS_PATH -F scf_handle_bind $libscf | sed -n 's/.*0x526570\(..\).*/\1/p' )
4114 if test -z "$hex"; then
4115 AC_MSG_WARN([Version of the repository cache protocol is empty?!])
4116 AC_MSG_ERROR([Cannot determine version of the repository cache protocol.])
4118 version=$( printf "%d\n" 0x$hex )
4119 AC_MSG_RESULT([$version])
4120 AC_DEFINE_UNQUOTED([SOLARIS_REPCACHE_PROTOCOL_VERSION], [$version],
4121 [Version number of the repository door cache protocol.])
4124 # Solaris-specific check determining if "sysstat" segment reservation type
4127 # New "sysstat" segment reservation (available on Solaris 11.4):
4128 # - program header type: PT_SUNW_SYSSTAT
4129 # - auxiliary vector entry: AT_SUN_SYSSTAT_ADDR
4131 # C-level symbol: SOLARIS_RESERVE_SYSSTAT_ADDR
4132 # Automake-level symbol: SOLARIS_RESERVE_SYSSTAT_ADDR
4134 AC_MSG_CHECKING([for the new `sysstat' segment reservation (Solaris-specific)])
4135 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4136 #include <sys/auxv.h>
4138 return !AT_SUN_SYSSTAT_ADDR;
4140 solaris_reserve_sysstat_addr=yes
4141 AC_MSG_RESULT([yes])
4142 AC_DEFINE([SOLARIS_RESERVE_SYSSTAT_ADDR], 1,
4143 [Define to 1 if you have the new `sysstat' segment reservation.])
4145 solaris_reserve_sysstat_addr=no
4148 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ADDR, test x$solaris_reserve_sysstat_addr = xyes)
4151 # Solaris-specific check determining if "sysstat_zone" segment reservation type
4154 # New "sysstat_zone" segment reservation (available on Solaris 11.4):
4155 # - program header type: PT_SUNW_SYSSTAT_ZONE
4156 # - auxiliary vector entry: AT_SUN_SYSSTAT_ZONE_ADDR
4158 # C-level symbol: SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR
4159 # Automake-level symbol: SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR
4161 AC_MSG_CHECKING([for the new `sysstat_zone' segment reservation (Solaris-specific)])
4162 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4163 #include <sys/auxv.h>
4165 return !AT_SUN_SYSSTAT_ZONE_ADDR;
4167 solaris_reserve_sysstat_zone_addr=yes
4168 AC_MSG_RESULT([yes])
4169 AC_DEFINE([SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR], 1,
4170 [Define to 1 if you have the new `sysstat_zone' segment reservation.])
4172 solaris_reserve_sysstat_zone_addr=no
4175 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR, test x$solaris_reserve_sysstat_zone_addr = xyes)
4178 # Solaris-specific check determining if the system_stats() syscall is available
4179 # (on newer Solaris).
4181 # C-level symbol: SOLARIS_SYSTEM_STATS_SYSCALL
4182 # Automake-level symbol: SOLARIS_SYSTEM_STATS_SYSCALL
4184 AC_MSG_CHECKING([for the `system_stats' syscall (Solaris-specific)])
4185 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4186 #include <sys/syscall.h>
4188 return !SYS_system_stats;
4190 solaris_system_stats_syscall=yes
4191 AC_MSG_RESULT([yes])
4192 AC_DEFINE([SOLARIS_SYSTEM_STATS_SYSCALL], 1,
4193 [Define to 1 if you have the `system_stats' syscall.])
4195 solaris_system_stats_syscall=no
4198 AM_CONDITIONAL(SOLARIS_SYSTEM_STATS_SYSCALL, test x$solaris_system_stats_syscall = xyes)
4201 # Solaris-specific check determining if fpregset_t defines struct _fpchip_state
4202 # (on newer illumos) or struct fpchip_state (Solaris, older illumos).
4204 # C-level symbol: SOLARIS_FPCHIP_STATE_TAKES_UNDERSCORE
4205 # Automake-level symbol: none
4207 AC_CHECK_TYPE([struct _fpchip_state],
4208 [solaris_fpchip_state_takes_underscore=yes],
4209 [solaris_fpchip_state_takes_underscore=no],
4210 [[#include <sys/regset.h>]])
4211 if test "$solaris_fpchip_state_takes_underscore" = "yes"; then
4212 AC_DEFINE(SOLARIS_FPCHIP_STATE_TAKES_UNDERSCORE, 1,
4213 [Define to 1 if fpregset_t defines struct _fpchip_state])
4217 # Solaris-specific check determining if schedctl page shared between kernel
4218 # and userspace program is executable (illumos, older Solaris) or not (newer
4221 # C-level symbol: SOLARIS_SCHEDCTL_PAGE_EXEC
4222 # Automake-level symbol: none
4224 AC_MSG_CHECKING([if schedctl page is executable (Solaris-specific)])
4225 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
4229 #include <schedctl.h>
4233 schedctl_t *scp = schedctl_init();
4237 int fd = open("/proc/self/map", O_RDONLY);
4242 while ((rd = read(fd, &map, sizeof(map))) == sizeof(map)) {
4243 if (map.pr_vaddr == ((uintptr_t) scp & PAGEMASK)) {
4244 fprintf(stderr, "%#lx [%zu] %s\n", map.pr_vaddr, map.pr_size,
4245 (map.pr_mflags & MA_EXEC) ? "x" : "no-x");
4246 return (map.pr_mflags & MA_EXEC);
4252 solaris_schedctl_page_exec=no
4255 solaris_schedctl_page_exec=yes
4256 AC_MSG_RESULT([yes])
4257 AC_DEFINE([SOLARIS_SCHEDCTL_PAGE_EXEC], 1,
4258 [Define to 1 if you have the schedctl page executable.])
4262 # Solaris-specific check determining if PT_SUNWDTRACE program header provides
4263 # scratch space for DTrace fasttrap provider (illumos, older Solaris) or just
4264 # an initial thread pointer for libc (newer Solaris).
4266 # C-level symbol: SOLARIS_PT_SUNDWTRACE_THRP
4267 # Automake-level symbol: none
4269 AC_MSG_CHECKING([if PT_SUNWDTRACE serves for initial thread pointer (Solaris-specific)])
4270 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
4271 #include <sys/fasttrap_isa.h>
4273 return !FT_SCRATCHSIZE;
4275 solaris_pt_sunwdtrace_thrp=yes
4276 AC_MSG_RESULT([yes])
4277 AC_DEFINE([SOLARIS_PT_SUNDWTRACE_THRP], 1,
4278 [Define to 1 if PT_SUNWDTRACE program header provides just an initial thread pointer for libc.])
4280 solaris_pt_sunwdtrace_thrp=no
4285 AM_CONDITIONAL(SOLARIS_SUN_STUDIO_AS, false)
4286 AM_CONDITIONAL(SOLARIS_XPG_SYMBOLS_PRESENT, false)
4287 AM_CONDITIONAL(SOLARIS_PROC_CMDLINE, false)
4288 AM_CONDITIONAL(SOLARIS_OLD_SYSCALLS, false)
4289 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL, false)
4290 AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID, false)
4291 AM_CONDITIONAL(SOLARIS_LWP_NAME_SYSCALL, false)
4292 AM_CONDITIONAL(SOLARIS_GETRANDOM_SYSCALL, false)
4293 AM_CONDITIONAL(SOLARIS_ZONE_DEFUNCT, false)
4294 AM_CONDITIONAL(SOLARIS_AUDITON_STAT, false)
4295 AM_CONDITIONAL(SOLARIS_SHM_NEW, false)
4296 AM_CONDITIONAL(SOLARIS_PRXREGSET_T, false)
4297 AM_CONDITIONAL(SOLARIS_FREALPATHAT_SYSCALL, false)
4298 AM_CONDITIONAL(SOLARIS_UUIDSYS_SYSCALL, false)
4299 AM_CONDITIONAL(SOLARIS_TNDB_GET_TNIP, false)
4300 AM_CONDITIONAL(SOLARIS_TSOL_CLEARANCE, false)
4301 AM_CONDITIONAL(SOLARIS_PSET_GET_NAME, false)
4302 AM_CONDITIONAL(SOLARIS_UTIMESYS_SYSCALL, false)
4303 AM_CONDITIONAL(SOLARIS_UTIMENSAT_SYSCALL, false)
4304 AM_CONDITIONAL(SOLARIS_SPAWN_SYSCALL, false)
4305 AM_CONDITIONAL(SOLARIS_MODCTL_MODNVL, false)
4306 AM_CONDITIONAL(SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE, false)
4307 AM_CONDITIONAL(SOLARIS_GETHRT_FASTTRAP, false)
4308 AM_CONDITIONAL(SOLARIS_GETZONEOFFSET_FASTTRAP, false)
4309 AM_CONDITIONAL(SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS, false)
4310 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ADDR, false)
4311 AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR, false)
4312 AM_CONDITIONAL(SOLARIS_SYSTEM_STATS_SYSCALL, false)
4313 fi # test "$VGCONF_OS" = "solaris"
4316 #----------------------------------------------------------------------------
4317 # Checks for C header files.
4318 #----------------------------------------------------------------------------
4320 AC_CHECK_HEADERS([ \
4338 # Verify whether the <linux/futex.h> header is usable.
4339 AC_MSG_CHECKING([if <linux/futex.h> is usable])
4341 save_CFLAGS="$CFLAGS"
4342 CFLAGS="$CFLAGS -D__user="
4343 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4344 #include <linux/futex.h>
4348 ac_have_usable_linux_futex_h=yes
4349 AC_DEFINE([HAVE_USABLE_LINUX_FUTEX_H], 1,
4350 [Define to 1 if you have a usable <linux/futex.h> header file.])
4351 AC_MSG_RESULT([yes])
4353 ac_have_usable_linux_futex_h=no
4356 CFLAGS="$save_CFLAGS"
4359 #----------------------------------------------------------------------------
4360 # Checks for typedefs, structures, and compiler characteristics.
4361 #----------------------------------------------------------------------------
4368 #----------------------------------------------------------------------------
4369 # Checks for library functions.
4370 #----------------------------------------------------------------------------
4374 AC_CHECK_LIB([pthread], [pthread_create])
4375 AC_CHECK_LIB([rt], [clock_gettime])
4394 pthread_barrier_init \
4395 pthread_condattr_setclock \
4396 pthread_mutex_timedlock \
4397 pthread_rwlock_timedrdlock \
4398 pthread_rwlock_timedwrlock \
4399 pthread_setname_np \
4418 # AC_CHECK_LIB adds any library found to the variable LIBS, and links these
4419 # libraries with any shared object and/or executable. This is NOT what we
4420 # want for e.g. vgpreload_core-x86-linux.so
4423 AM_CONDITIONAL([HAVE_PTHREAD_BARRIER],
4424 [test x$ac_cv_func_pthread_barrier_init = xyes])
4425 AM_CONDITIONAL([HAVE_PTHREAD_MUTEX_TIMEDLOCK],
4426 [test x$ac_cv_func_pthread_mutex_timedlock = xyes])
4427 AM_CONDITIONAL([HAVE_PTHREAD_SPINLOCK],
4428 [test x$ac_cv_func_pthread_spin_lock = xyes])
4429 AM_CONDITIONAL([HAVE_PTHREAD_SETNAME_NP],
4430 [test x$ac_cv_func_pthread_setname_np = xyes])
4431 AM_CONDITIONAL([HAVE_COPY_FILE_RANGE],
4432 [test x$ac_cv_func_copy_file_range = xyes])
4433 AM_CONDITIONAL([HAVE_PREADV_PWRITEV],
4434 [test x$ac_cv_func_preadv = xyes && test x$ac_cv_func_pwritev = xyes])
4435 AM_CONDITIONAL([HAVE_PREADV2_PWRITEV2],
4436 [test x$ac_cv_func_preadv2 = xyes && test x$ac_cv_func_pwritev2 = xyes])
4437 AM_CONDITIONAL([HAVE_SWAPCONTEXT], [test x$ac_cv_func_swapcontext = xyes])
4438 AM_CONDITIONAL([HAVE_MEMFD_CREATE],
4439 [test x$ac_cv_func_memfd_create = xyes])
4441 if test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
4442 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \
4443 -o x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX; then
4444 AC_DEFINE([DISABLE_PTHREAD_SPINLOCK_INTERCEPT], 1,
4445 [Disable intercept pthread_spin_lock() on MIPS32, MIPS64 and nanoMIPS.])
4448 #----------------------------------------------------------------------------
4450 #----------------------------------------------------------------------------
4451 # Do we have a useable MPI setup on the primary and/or secondary targets?
4452 # On Linux, by default, assumes mpicc and -m32/-m64
4453 # Note: this is a kludge in that it assumes the specified mpicc
4454 # understands -m32/-m64 regardless of what is specified using
4456 AC_PATH_PROG([MPI_CC], [mpicc], [mpicc],
4457 [$PATH:/usr/lib/openmpi/bin:/usr/lib64/openmpi/bin])
4460 if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
4461 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
4462 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
4463 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
4464 -o x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX \
4465 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS ; then
4466 mflag_primary=$FLAG_M32
4467 elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
4468 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
4469 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX \
4470 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \
4471 -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX ; then
4472 mflag_primary=$FLAG_M64
4473 elif test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN ; then
4474 mflag_primary="$FLAG_M32 -arch i386"
4475 elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN ; then
4476 mflag_primary="$FLAG_M64 -arch x86_64"
4480 if test x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
4481 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX \
4482 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_SOLARIS \
4483 -o x$VGCONF_PLATFORM_SEC_CAPS = xMIPS32_LINUX ; then
4484 mflag_secondary=$FLAG_M32
4485 elif test x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN ; then
4486 mflag_secondary="$FLAG_M32 -arch i386"
4491 [ --with-mpicc= Specify name of MPI2-ised C compiler],
4496 ## We AM_COND_IF here instead of automake "if" in mpi/Makefile.am so that we can
4497 ## use these values in the check for a functioning mpicc.
4499 ## We leave the MPI_FLAG_M3264_ logic in mpi/Makefile.am and assume that
4500 ## mflag_primary/mflag_secondary are sufficient approximations of that behavior
4501 AM_COND_IF([VGCONF_OS_IS_LINUX],
4502 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic"
4503 LDFLAGS_MPI="-fpic -shared"])
4504 AM_COND_IF([VGCONF_OS_IS_DARWIN],
4505 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -dynamic"
4506 LDFLAGS_MPI="-dynamic -dynamiclib -all_load"])
4507 AM_COND_IF([VGCONF_OS_IS_SOLARIS],
4508 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic"
4509 LDFLAGS_MPI="-fpic -shared"])
4511 AC_SUBST([CFLAGS_MPI])
4512 AC_SUBST([LDFLAGS_MPI])
4515 ## See if MPI_CC works for the primary target
4517 AC_MSG_CHECKING([primary target for usable MPI2-compliant C compiler and mpi.h])
4519 saved_CFLAGS=$CFLAGS
4521 CFLAGS="$CFLAGS_MPI $mflag_primary"
4522 saved_LDFLAGS="$LDFLAGS"
4523 LDFLAGS="$LDFLAGS_MPI $mflag_primary"
4524 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4528 int ni, na, nd, comb;
4529 int r = MPI_Init(NULL,NULL);
4530 r |= MPI_Type_get_envelope( MPI_INT, &ni, &na, &nd, &comb );
4531 r |= MPI_Finalize();
4534 ac_have_mpi2_pri=yes
4535 AC_MSG_RESULT([yes, $MPI_CC])
4541 CFLAGS=$saved_CFLAGS
4542 LDFLAGS="$saved_LDFLAGS"
4543 AM_CONDITIONAL(BUILD_MPIWRAP_PRI, test x$ac_have_mpi2_pri = xyes)
4545 ## See if MPI_CC works for the secondary target. Complication: what if
4546 ## there is no secondary target? We need this to then fail.
4547 ## Kludge this by making MPI_CC something which will surely fail in
4550 AC_MSG_CHECKING([secondary target for usable MPI2-compliant C compiler and mpi.h])
4552 saved_CFLAGS=$CFLAGS
4553 saved_LDFLAGS="$LDFLAGS"
4554 LDFLAGS="$LDFLAGS_MPI $mflag_secondary"
4555 if test x$VGCONF_PLATFORM_SEC_CAPS = x ; then
4556 CC="$MPI_CC this will surely fail"
4560 CFLAGS="$CFLAGS_MPI $mflag_secondary"
4561 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4565 int ni, na, nd, comb;
4566 int r = MPI_Init(NULL,NULL);
4567 r |= MPI_Type_get_envelope( MPI_INT, &ni, &na, &nd, &comb );
4568 r |= MPI_Finalize();
4571 ac_have_mpi2_sec=yes
4572 AC_MSG_RESULT([yes, $MPI_CC])
4578 CFLAGS=$saved_CFLAGS
4579 LDFLAGS="$saved_LDFLAGS"
4580 AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec = xyes)
4583 #----------------------------------------------------------------------------
4584 # Other library checks
4585 #----------------------------------------------------------------------------
4586 # There now follow some tests for Boost, and OpenMP. These
4587 # tests are present because Drd has some regression tests that use
4588 # these packages. All regression test programs all compiled only
4589 # for the primary target. And so it is important that the configure
4590 # checks that follow, use the correct -m32 or -m64 flag for the
4591 # primary target (called $mflag_primary). Otherwise, we can end up
4592 # in a situation (eg) where, on amd64-linux, the test for Boost checks
4593 # for usable 64-bit Boost facilities, but because we are doing a 32-bit
4594 # only build (meaning, the primary target is x86-linux), the build
4595 # of the regtest programs that use Boost fails, because they are
4596 # build as 32-bit (IN THIS EXAMPLE).
4598 # Hence: ALWAYS USE $mflag_primary FOR CONFIGURE TESTS FOR FACILITIES
4599 # NEEDED BY THE REGRESSION TEST PROGRAMS.
4602 # Check whether the boost library 1.35 or later has been installed.
4603 # The Boost.Threads library has undergone a major rewrite in version 1.35.0.
4605 AC_MSG_CHECKING([for boost])
4608 safe_CXXFLAGS=$CXXFLAGS
4609 CXXFLAGS="$mflag_primary"
4611 LIBS="-lboost_thread-mt -lboost_system-mt $LIBS"
4613 AC_LINK_IFELSE([AC_LANG_SOURCE([
4614 #include <boost/thread.hpp>
4615 static void thread_func(void)
4617 int main(int argc, char** argv)
4619 boost::thread t(thread_func);
4624 ac_have_boost_1_35=yes
4625 AC_SUBST([BOOST_CFLAGS], [])
4626 AC_SUBST([BOOST_LIBS], ["-lboost_thread-mt -lboost_system-mt"])
4627 AC_MSG_RESULT([yes])
4629 ac_have_boost_1_35=no
4634 CXXFLAGS=$safe_CXXFLAGS
4637 AM_CONDITIONAL([HAVE_BOOST_1_35], [test x$ac_have_boost_1_35 = xyes])
4640 # does this compiler support -fopenmp, does it have the include file
4641 # <omp.h> and does it have libgomp ?
4643 AC_MSG_CHECKING([for OpenMP])
4646 CFLAGS="-fopenmp $mflag_primary -Werror"
4648 AC_LINK_IFELSE([AC_LANG_SOURCE([
4650 int main(int argc, char** argv)
4658 AC_MSG_RESULT([yes])
4665 AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes])
4668 # Check for __builtin_popcount
4669 AC_MSG_CHECKING([for __builtin_popcount()])
4670 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4672 __builtin_popcount(2);
4675 AC_MSG_RESULT([yes])
4676 AC_DEFINE([HAVE_BUILTIN_POPCOUT], 1,
4677 [Define to 1 if compiler provides __builtin_popcount().])
4682 # Check for __builtin_clz
4683 AC_MSG_CHECKING([for __builtin_clz()])
4684 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4689 AC_MSG_RESULT([yes])
4690 AC_DEFINE([HAVE_BUILTIN_CLZ], 1,
4691 [Define to 1 if compiler provides __builtin_clz().])
4696 # Check for __builtin_ctz
4697 AC_MSG_CHECKING([for __builtin_ctz()])
4698 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4703 AC_MSG_RESULT([yes])
4704 AC_DEFINE([HAVE_BUILTIN_CTZ], 1,
4705 [Define to 1 if compiler provides __builtin_ctz().])
4710 # does this compiler have built-in functions for atomic memory access for the
4712 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the primary target])
4715 CFLAGS="$mflag_primary"
4717 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
4719 return (__sync_bool_compare_and_swap(&variable, 1, 2)
4720 && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
4722 ac_have_builtin_atomic_primary=yes
4723 AC_MSG_RESULT([yes])
4724 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])
4726 ac_have_builtin_atomic_primary=no
4732 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC],
4733 [test x$ac_have_builtin_atomic_primary = xyes])
4736 # does this compiler have built-in functions for atomic memory access for the
4737 # secondary target ?
4739 if test x$VGCONF_PLATFORM_SEC_CAPS != x; then
4741 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the secondary target])
4744 CFLAGS="$mflag_secondary"
4746 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
4748 return (__sync_add_and_fetch(&variable, 1) ? 1 : 0)
4750 ac_have_builtin_atomic_secondary=yes
4751 AC_MSG_RESULT([yes])
4753 ac_have_builtin_atomic_secondary=no
4761 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_SECONDARY],
4762 [test x$ac_have_builtin_atomic_secondary = xyes])
4764 # does this compiler have built-in functions for atomic memory access on
4765 # 64-bit integers for all targets ?
4767 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch on uint64_t for all targets])
4769 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4772 uint64_t variable = 1;
4773 return __sync_add_and_fetch(&variable, 1)
4775 ac_have_builtin_atomic64_primary=yes
4777 ac_have_builtin_atomic64_primary=no
4780 if test x$VGCONF_PLATFORM_SEC_CAPS != x; then
4783 CFLAGS="$mflag_secondary"
4785 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4788 uint64_t variable = 1;
4789 return __sync_add_and_fetch(&variable, 1)
4791 ac_have_builtin_atomic64_secondary=yes
4793 ac_have_builtin_atomic64_secondary=no
4800 if test x$ac_have_builtin_atomic64_primary = xyes && \
4801 test x$VGCONF_PLATFORM_SEC_CAPS = x \
4802 -o x$ac_have_builtin_atomic64_secondary = xyes; then
4803 AC_MSG_RESULT([yes])
4804 ac_have_builtin_atomic64=yes
4807 ac_have_builtin_atomic64=no
4810 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC64],
4811 [test x$ac_have_builtin_atomic64 = xyes])
4814 # does g++ have built-in functions for atomic memory access ?
4815 AC_MSG_CHECKING([if g++ supports __sync_add_and_fetch])
4817 safe_CXXFLAGS=$CXXFLAGS
4818 CXXFLAGS="$mflag_primary"
4821 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
4823 return (__sync_bool_compare_and_swap(&variable, 1, 2)
4824 && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
4826 ac_have_builtin_atomic_cxx=yes
4827 AC_MSG_RESULT([yes])
4828 AC_DEFINE(HAVE_BUILTIN_ATOMIC_CXX, 1, [Define to 1 if g++ supports __sync_bool_compare_and_swap() and __sync_add_and_fetch()])
4830 ac_have_builtin_atomic_cxx=no
4835 CXXFLAGS=$safe_CXXFLAGS
4837 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_CXX], [test x$ac_have_builtin_atomic_cxx = xyes])
4840 if test x$ac_have_usable_linux_futex_h = xyes \
4841 -a x$ac_have_builtin_atomic_primary = xyes; then
4842 ac_enable_linux_ticket_lock_primary=yes
4844 AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_PRIMARY],
4845 [test x$ac_enable_linux_ticket_lock_primary = xyes])
4847 if test x$VGCONF_PLATFORM_SEC_CAPS != x \
4848 -a x$ac_have_usable_linux_futex_h = xyes \
4849 -a x$ac_have_builtin_atomic_secondary = xyes; then
4850 ac_enable_linux_ticket_lock_secondary=yes
4852 AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_SECONDARY],
4853 [test x$ac_enable_linux_ticket_lock_secondary = xyes])
4856 # does libstdc++ support annotating shared pointers ?
4857 AC_MSG_CHECKING([if libstdc++ supports annotating shared pointers])
4859 safe_CXXFLAGS=$CXXFLAGS
4860 CXXFLAGS="-std=c++0x"
4863 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4866 std::shared_ptr<int> p
4868 ac_have_shared_ptr=yes
4870 ac_have_shared_ptr=no
4872 if test x$ac_have_shared_ptr = xyes; then
4873 # If compilation of the program below fails because of a syntax error
4874 # triggered by substituting one of the annotation macros then that
4875 # means that libstdc++ supports these macros.
4876 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4877 #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(a) (a)----
4878 #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(a) (a)----
4881 std::shared_ptr<int> p
4883 ac_have_shared_pointer_annotation=no
4886 ac_have_shared_pointer_annotation=yes
4887 AC_MSG_RESULT([yes])
4888 AC_DEFINE(HAVE_SHARED_POINTER_ANNOTATION, 1,
4889 [Define to 1 if libstd++ supports annotating shared pointers])
4892 ac_have_shared_pointer_annotation=no
4897 CXXFLAGS=$safe_CXXFLAGS
4899 AM_CONDITIONAL([HAVE_SHARED_POINTER_ANNOTATION],
4900 [test x$ac_have_shared_pointer_annotation = xyes])
4903 #----------------------------------------------------------------------------
4904 # Ok. We're done checking.
4905 #----------------------------------------------------------------------------
4907 # Nb: VEX/Makefile is generated from Makefile.vex.in.
4910 VEX/Makefile:Makefile.vex.in
4919 gdbserver_tests/Makefile
4920 gdbserver_tests/solaris/Makefile
4926 memcheck/tests/Makefile
4927 memcheck/tests/common/Makefile
4928 memcheck/tests/amd64/Makefile
4929 memcheck/tests/x86/Makefile
4930 memcheck/tests/linux/Makefile
4931 memcheck/tests/linux/debuginfod-check.vgtest
4932 memcheck/tests/darwin/Makefile
4933 memcheck/tests/solaris/Makefile
4934 memcheck/tests/amd64-linux/Makefile
4935 memcheck/tests/arm64-linux/Makefile
4936 memcheck/tests/x86-linux/Makefile
4937 memcheck/tests/amd64-solaris/Makefile
4938 memcheck/tests/x86-solaris/Makefile
4939 memcheck/tests/ppc32/Makefile
4940 memcheck/tests/ppc64/Makefile
4941 memcheck/tests/s390x/Makefile
4942 memcheck/tests/mips32/Makefile
4943 memcheck/tests/mips64/Makefile
4944 memcheck/tests/vbit-test/Makefile
4946 cachegrind/tests/Makefile
4947 cachegrind/tests/x86/Makefile
4948 cachegrind/cg_annotate
4951 callgrind/callgrind_annotate
4952 callgrind/callgrind_control
4953 callgrind/tests/Makefile
4955 helgrind/tests/Makefile
4957 drd/scripts/download-and-build-splash2
4960 massif/tests/Makefile
4965 lackey/tests/Makefile
4968 none/tests/scripts/Makefile
4969 none/tests/amd64/Makefile
4970 none/tests/ppc32/Makefile
4971 none/tests/ppc64/Makefile
4972 none/tests/x86/Makefile
4973 none/tests/arm/Makefile
4974 none/tests/arm64/Makefile
4975 none/tests/s390x/Makefile
4976 none/tests/mips32/Makefile
4977 none/tests/mips64/Makefile
4978 none/tests/nanomips/Makefile
4979 none/tests/linux/Makefile
4980 none/tests/darwin/Makefile
4981 none/tests/solaris/Makefile
4982 none/tests/amd64-linux/Makefile
4983 none/tests/x86-linux/Makefile
4984 none/tests/amd64-darwin/Makefile
4985 none/tests/x86-darwin/Makefile
4986 none/tests/amd64-solaris/Makefile
4987 none/tests/x86-solaris/Makefile
4989 exp-bbv/tests/Makefile
4990 exp-bbv/tests/x86/Makefile
4991 exp-bbv/tests/x86-linux/Makefile
4992 exp-bbv/tests/amd64-linux/Makefile
4993 exp-bbv/tests/ppc32-linux/Makefile
4994 exp-bbv/tests/arm-linux/Makefile
4998 AC_CONFIG_FILES([coregrind/link_tool_exe_linux],
4999 [chmod +x coregrind/link_tool_exe_linux])
5000 AC_CONFIG_FILES([coregrind/link_tool_exe_darwin],
5001 [chmod +x coregrind/link_tool_exe_darwin])
5002 AC_CONFIG_FILES([coregrind/link_tool_exe_solaris],
5003 [chmod +x coregrind/link_tool_exe_solaris])
5008 Maximum build arch: ${ARCH_MAX}
5009 Primary build arch: ${VGCONF_ARCH_PRI}
5010 Secondary build arch: ${VGCONF_ARCH_SEC}
5011 Build OS: ${VGCONF_OS}
5012 Link Time Optimisation: ${vg_cv_lto}
5013 Primary build target: ${VGCONF_PLATFORM_PRI_CAPS}
5014 Secondary build target: ${VGCONF_PLATFORM_SEC_CAPS}
5015 Platform variant: ${VGCONF_PLATVARIANT}
5016 Primary -DVGPV string: -DVGPV_${VGCONF_ARCH_PRI}_${VGCONF_OS}_${VGCONF_PLATVARIANT}=1
5017 Default supp files: ${DEFAULT_SUPP}