diff options
author | njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2009-01-22 21:56:32 +0000 |
---|---|---|
committer | njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2009-01-22 21:56:32 +0000 |
commit | 7fd6d389b97fa365e10be68641066970d16cfa5f (patch) | |
tree | 4c8b7a4efcfb9e80f75ff86e29fcad275cbbd740 | |
parent | 5706ca98d16b4ed5f455c71c01655fc12f6b9eb9 (diff) |
Rename all the arch/OS/platform-related variables in configure.in to make it
clearer what they mean:
- They all have VGCONF_ prefixes now, to indicate they come out of
configure.in (and are clearly distinguished from the VGA_/VGO_/VGP_
#defines passed in to C files).
- The ones that refer to the primary *or* secondary platform have _INCLUDES_
in them.
- The ones that are in all-caps have a _CAPS suffix.
So, for example, what was VGP_X86_LINUX is now
VGCONF_PLATFORMS_INCLUDE_X86_LINUX, which is more verbose but also a lot
clearer. The names of the #defines used in the C files (VGA_x86, VGO_linux,
etc) are unchanged.
cputest.c: changed to reflect the Valgrind installation's capabilities,
rather than the machine's capabilities. In particular, if
--enable-only32bit is used on a 64-bit machine, then this program will claim
to only support 32-bits. Also use the VGA/VGO/VGP macros which are clearer
than the __i386__ ones. (This is partially merged from the DARWIN branch.)
configure.in: clean up the comments, distinguish different sections more
clearly, and generally make it more readable.
valgrind.pc.in: try to make this more accurate. I doubt anyone's using it.
It doesn't appear to be set up to handle dual-architecture builds.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9031 a5019735-40e9-0310-863c-91ae7b9d1cf9
-rw-r--r-- | Makefile.am | 12 | ||||
-rw-r--r-- | Makefile.flags.am | 12 | ||||
-rw-r--r-- | auxprogs/Makefile.am | 43 | ||||
-rw-r--r-- | cachegrind/Makefile.am | 12 | ||||
-rw-r--r-- | cachegrind/tests/Makefile.am | 2 | ||||
-rw-r--r-- | callgrind/Makefile.am | 12 | ||||
-rw-r--r-- | configure.in | 362 | ||||
-rw-r--r-- | coregrind/Makefile.am | 26 | ||||
-rw-r--r-- | docs/internals/multiple-architectures.txt | 31 | ||||
-rw-r--r-- | docs/internals/porting-HOWTO.txt | 1 | ||||
-rw-r--r-- | drd/Makefile.am | 12 | ||||
-rw-r--r-- | drd/tests/Makefile.am | 4 | ||||
-rw-r--r-- | exp-omega/Makefile.am | 12 | ||||
-rw-r--r-- | exp-ptrcheck/Makefile.am | 12 | ||||
-rw-r--r-- | exp-ptrcheck/tests/Makefile.am | 10 | ||||
-rw-r--r-- | helgrind/Makefile.am | 12 | ||||
-rw-r--r-- | lackey/Makefile.am | 12 | ||||
-rw-r--r-- | massif/Makefile.am | 12 | ||||
-rw-r--r-- | memcheck/Makefile.am | 12 | ||||
-rw-r--r-- | memcheck/tests/Makefile.am | 33 | ||||
-rw-r--r-- | none/Makefile.am | 12 | ||||
-rw-r--r-- | none/tests/Makefile.am | 14 | ||||
-rw-r--r-- | none/tests/x86/Makefile.am | 1 | ||||
-rw-r--r-- | none/tests/x86/yield.c | 6 | ||||
-rw-r--r-- | tests/Makefile.am | 10 | ||||
-rw-r--r-- | tests/cputest.c | 46 | ||||
-rw-r--r-- | valgrind.pc.in | 8 |
27 files changed, 408 insertions, 333 deletions
diff --git a/Makefile.am b/Makefile.am index f9e57359..2b72c62c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -42,28 +42,28 @@ BUILT_SOURCES = default.supp valgrind.pc CLEANFILES = DISTCLEANFILES = default.supp -if VGP_X86_LINUX +if VGCONF_PLATFORMS_INCLUDE_X86_LINUX BUILT_SOURCES += valt_load_address_x86_linux.lds CLEANFILES += valt_load_address_x86_linux.lds endif -if VGP_AMD64_LINUX +if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX BUILT_SOURCES += valt_load_address_amd64_linux.lds CLEANFILES += valt_load_address_amd64_linux.lds endif -if VGP_PPC32_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX BUILT_SOURCES += valt_load_address_ppc32_linux.lds CLEANFILES += valt_load_address_ppc32_linux.lds endif -if VGP_PPC64_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX BUILT_SOURCES += valt_load_address_ppc64_linux.lds CLEANFILES += valt_load_address_ppc64_linux.lds endif -if VGP_PPC32_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 # No need to generate valt_load_address*.lds; the final executables # can be linked to be at any address. They will be relocated by # AIX kernel when they are loaded. endif -if VGP_PPC64_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 # Ditto endif diff --git a/Makefile.flags.am b/Makefile.flags.am index 19451774..42a08513 100644 --- a/Makefile.flags.am +++ b/Makefile.flags.am @@ -51,13 +51,13 @@ AM_CCASFLAGS_PPC64_AIX5 = $(add_includes_ppc64_aix5) \ # regtests and performance tests. In fact, these must be used to # build anything which is built only once on a dual-arch build. # -AM_FLAG_M3264_PRI = $(AM_FLAG_M3264_@VG_PLATFORM_PRI@) -AM_CPPFLAGS_PRI = $(AM_CPPFLAGS_@VG_PLATFORM_PRI@) -AM_CFLAGS_PRI = $(AM_CFLAGS_@VG_PLATFORM_PRI@) -AM_CCASFLAGS_PRI = $(AM_CCASFLAGS_@VG_PLATFORM_PRI@) +AM_FLAG_M3264_PRI = $(AM_FLAG_M3264_@VGCONF_PLATFORM_PRI_CAPS@) +AM_CPPFLAGS_PRI = $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +AM_CFLAGS_PRI = $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +AM_CCASFLAGS_PRI = $(AM_CCASFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -if VGP_HAVE_SECONDARY - AM_FLAG_M3264_SEC = $(AM_FLAG_M3264_@VG_PLATFORM_SEC@) +if VGCONF_HAVE_PLATFORM_SEC_CAPS + AM_FLAG_M3264_SEC = $(AM_FLAG_M3264_@VGCONF_PLATFORM_SEC_CAPS@) else AM_FLAG_M3264_SEC = endif diff --git a/auxprogs/Makefile.am b/auxprogs/Makefile.am index 5395090e..9e5fd1e1 100644 --- a/auxprogs/Makefile.am +++ b/auxprogs/Makefile.am @@ -43,7 +43,7 @@ valgrind_listener_LDFLAGS = $(AM_CFLAGS_PRI) # directly saying how to build libmpiwrap-*.so, instead of # using automake's standard gunk. # -if VGO_AIX5 +if VGCONF_OS_IS_AIX5 HACKY_FLAGS_PRI = -g -O -bE:libmpiwrap_aix5.exp -bM:SRE -bnoentry \ -qflag=w:w -qlanglvl=extended \ `echo $(AM_FLAG_M3264_PRI) | sed s/maix/q/g` @@ -62,18 +62,18 @@ endif ## noinst_PROGRAMS = if BUILD_MPIWRAP_PRI -noinst_PROGRAMS += libmpiwrap-@VG_PLATFORM_PRI@.so -libmpiwrap-@VG_PLATFORM_PRI@.so: libmpiwrap.c +noinst_PROGRAMS += libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.so +libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.so: libmpiwrap.c $(MPI_CC) $(HACKY_FLAGS_PRI) \ -I../include \ - -o libmpiwrap-@VG_PLATFORM_PRI@.so libmpiwrap.c + -o libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.so libmpiwrap.c endif if BUILD_MPIWRAP_SEC -noinst_PROGRAMS += libmpiwrap-@VG_PLATFORM_SEC@.so -libmpiwrap-@VG_PLATFORM_SEC@.so: libmpiwrap.c +noinst_PROGRAMS += libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.so +libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.so: libmpiwrap.c $(MPI_CC) $(HACKY_FLAGS_SEC) \ -I../include \ - -o libmpiwrap-@VG_PLATFORM_SEC@.so libmpiwrap.c + -o libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.so libmpiwrap.c endif @@ -87,19 +87,19 @@ install-exec-local: if BUILD_MPIWRAP_PRI # convert (eg) X86_LINUX to x86-linux # really should use sed here, rather than assume tr is available - pD=`echo @VG_PLATFORM_PRI@ | tr A-Z_ a-z-` ; \ + pD=`echo @VGCONF_PLATFORM_PRI_CAPS@ | tr A-Z_ a-z-` ; \ $(mkinstalldirs) $(DESTDIR)$(valdir)/$$pD; \ rm -f ./libmpiwrap.so; \ - cp ./libmpiwrap-@VG_PLATFORM_PRI@.so ./libmpiwrap.so; \ + cp ./libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.so ./libmpiwrap.so; \ $(INSTALL_PROGRAM) ./libmpiwrap.so \ $(DESTDIR)$(valdir)/$$pD; \ rm -f ./libmpiwrap.so endif if BUILD_MPIWRAP_SEC - pD=`echo @VG_PLATFORM_SEC@ | tr A-Z_ a-z-` ; \ + pD=`echo @VGCONF_PLATFORM_SEC_CAPS@ | tr A-Z_ a-z-` ; \ $(mkinstalldirs) $(DESTDIR)$(valdir)/$$pD; \ rm -f ./libmpiwrap.so; \ - cp ./libmpiwrap-@VG_PLATFORM_SEC@.so ./libmpiwrap.so; \ + cp ./libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.so ./libmpiwrap.so; \ $(INSTALL_PROGRAM) ./libmpiwrap.so \ $(DESTDIR)$(valdir)/$$pD; \ rm -f ./libmpiwrap.so @@ -110,27 +110,28 @@ endif ## It would seem that using nodist_SOURCES is the right fix, but ## I can't figure out how to do it. ## -#nodist_SOURCES = libmpiwrap-@VG_PLATFORM_PRI@.c -#nodist_SOURCES = libmpiwrap-@VG_PLATFORM_SEC@.c +#nodist_SOURCES = libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.c +#nodist_SOURCES = libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.c libmpiwrap-.c: rm -f libmpiwrap-.c touch libmpiwrap-.c -libmpiwrap-@VG_PLATFORM_PRI@.c: - rm -f libmpiwrap-@VG_PLATFORM_PRI@.c - touch libmpiwrap-@VG_PLATFORM_PRI@.c +libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.c: + rm -f libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.c + touch libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.c -if VGP_HAVE_SECONDARY -libmpiwrap-@VG_PLATFORM_SEC@.c: - rm -f libmpiwrap-@VG_PLATFORM_SEC@.c - touch libmpiwrap-@VG_PLATFORM_SEC@.c +if VGCONF_HAVE_PLATFORM_SEC_CAPS +libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.c: + rm -f libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.c + touch libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.c endif ## cleanery clean-local: rm -f libmpiwrap-.c \ - libmpiwrap-@VG_PLATFORM_PRI@.c libmpiwrap-@VG_PLATFORM_SEC@.c + libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.c \ + libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.c # #---------------------------------------------------------- diff --git a/cachegrind/Makefile.am b/cachegrind/Makefile.am index 86eeed56..eac28255 100644 --- a/cachegrind/Makefile.am +++ b/cachegrind/Makefile.am @@ -5,22 +5,22 @@ bin_SCRIPTS = cg_annotate noinst_HEADERS = cg_arch.h cg_sim.c cg_branchpred.c noinst_PROGRAMS = -if VGP_X86_LINUX +if VGCONF_PLATFORMS_INCLUDE_X86_LINUX noinst_PROGRAMS += cachegrind-x86-linux endif -if VGP_AMD64_LINUX +if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX noinst_PROGRAMS += cachegrind-amd64-linux endif -if VGP_PPC32_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX noinst_PROGRAMS += cachegrind-ppc32-linux endif -if VGP_PPC64_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX noinst_PROGRAMS += cachegrind-ppc64-linux endif -if VGP_PPC32_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 noinst_PROGRAMS += cachegrind-ppc32-aix5 endif -if VGP_PPC64_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 noinst_PROGRAMS += cachegrind-ppc64-aix5 endif diff --git a/cachegrind/tests/Makefile.am b/cachegrind/tests/Makefile.am index 4b4806bd..0ffc4da6 100644 --- a/cachegrind/tests/Makefile.am +++ b/cachegrind/tests/Makefile.am @@ -3,7 +3,7 @@ include $(top_srcdir)/Makefile.flags.am SUBDIRS = . -if VGA_X86 +if VGCONF_ARCHS_INCLUDE_X86 SUBDIRS += x86 endif diff --git a/callgrind/Makefile.am b/callgrind/Makefile.am index dd15eb04..ac1720c4 100644 --- a/callgrind/Makefile.am +++ b/callgrind/Makefile.am @@ -5,22 +5,22 @@ bin_SCRIPTS = callgrind_annotate callgrind_control noinst_HEADERS = global.h costs.h events.h noinst_PROGRAMS = -if VGP_X86_LINUX +if VGCONF_PLATFORMS_INCLUDE_X86_LINUX noinst_PROGRAMS += callgrind-x86-linux endif -if VGP_AMD64_LINUX +if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX noinst_PROGRAMS += callgrind-amd64-linux endif -if VGP_PPC32_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX noinst_PROGRAMS += callgrind-ppc32-linux endif -if VGP_PPC64_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX noinst_PROGRAMS += callgrind-ppc64-linux endif -if VGP_PPC32_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 noinst_PROGRAMS += callgrind-ppc32-aix5 endif -if VGP_PPC64_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 noinst_PROGRAMS += callgrind-ppc64-aix5 endif diff --git a/configure.in b/configure.in index 4bb7d108..3ca0ef0c 100644 --- a/configure.in +++ b/configure.in @@ -15,7 +15,9 @@ AM_INIT_AUTOMAKE([foreign]) AM_MAINTAINER_MODE +#---------------------------------------------------------------------------- # Where is VEX ? +#---------------------------------------------------------------------------- # Nb: For the 2nd arg, the help string, AS_HELP_STRING is the proper way, but # older autoconfs don't support it... here's what it would say: # @@ -50,7 +52,9 @@ AC_SUBST(VEX_DIR) # place. AC_SUBST([DISTCHECK_CONFIGURE_FLAGS], [--with-vex=$VEX_DIR]) -# Checks for programs. +#---------------------------------------------------------------------------- +# Checks for various programs. +#---------------------------------------------------------------------------- CFLAGS="-Wno-long-long" AC_PROG_LN_S @@ -125,51 +129,49 @@ case "${gcc_version}" in ;; esac - -# Checks for the platform, with the aim of setting VG_ARCH_MAX. Note -# that VG_ARCH_MAX must be set to reflect the most that this CPU can -# do: for example if it is a 64-bit capable PowerPC, then it must be -# set to ppc64 and not ppc32. Ditto for amd64. -# -# We will later in this file set VG_ARCH_PRI, which is the arch for -# the primary target. For example, suppose we do a build on an amd64 -# machine, but --enable-only32bit has been requested. Then -# VG_ARCH_MAX will be "amd64" since that reflects the most that this -# cpu can do, but VG_ARCH_PRI will be "x86", since that reflects the -# arch corresponding to the primary build (VG_PLATFORM_PRI). +#---------------------------------------------------------------------------- +# Arch/OS/platform tests. +#---------------------------------------------------------------------------- +# We create a number of arch/OS/platform-related variables. We prefix them +# all with "VGCONF_" which indicates that they are defined at +# configure-time, and distinguishes them from the VGA_*/VGO_*/VGP_* +# variables used when compiling C files. AC_CANONICAL_HOST AC_MSG_CHECKING([for a supported CPU]) -AC_SUBST(VG_ARCH_MAX) +# ARCH_MAX reflects the most that this CPU can do: for example if it +# is a 64-bit capable PowerPC, then it must be set to ppc64 and not ppc32. +# Ditto for amd64. It is used for more configuration below, but is not used +# outside this file. case "${host_cpu}" in i?86) AC_MSG_RESULT([ok (${host_cpu})]) - VG_ARCH_MAX="x86" + ARCH_MAX="x86" ;; x86_64) AC_MSG_RESULT([ok (${host_cpu})]) - VG_ARCH_MAX="amd64" + ARCH_MAX="amd64" ;; powerpc64) -# This value can only happen on Linux, not on AIX + # This value can only happen on Linux, not on AIX AC_MSG_RESULT([ok (${host_cpu})]) - VG_ARCH_MAX="ppc64" + ARCH_MAX="ppc64" ;; powerpc) -# Complexity. 'powerpc' on AIX implies a 64-bit capable CPU. -# Whereas in Linux that means only a 32-bit capable CPU. + # Complexity. 'powerpc' on AIX implies a 64-bit capable CPU. + # Whereas in Linux that means only a 32-bit capable CPU. AC_MSG_RESULT([ok (${host_cpu})]) case "${host_os}" in aix5.*) - VG_ARCH_MAX="ppc64" + ARCH_MAX="ppc64" ;; *) - VG_ARCH_MAX="ppc32" + ARCH_MAX="ppc32" ;; esac ;; @@ -180,10 +182,15 @@ case "${host_cpu}" in ;; esac +#---------------------------------------------------------------------------- + # Sometimes it's convenient to subvert the bi-arch build system and # just have a single build even though the underlying platform is # capable of both. Hence handle --enable-only64bit and # --enable-only32bit. Complain if both are issued :-) +# [Actually, if either of these options are used, I think both get built, +# but only one gets installed. So if you use an in-place build, both can be +# used. --njn] # Check if a 64-bit only build has been requested AC_CACHE_CHECK([for a 64-bit only build], vg_cv_only64bit, @@ -205,19 +212,17 @@ if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then [Nonsensical: both --enable-only64bit and --enable-only32bit.]) fi +#---------------------------------------------------------------------------- -# This variable will collect the individual suppression files -# depending on the results of autoconf -DEFAULT_SUPP="" -AC_SUBST(DEFAULT_SUPP) - +# VGCONF_OS is the primary build OS. It is passed in to compilation of many +# C files via -VGO_$(VGCONF_OS) and -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS). AC_MSG_CHECKING([for a supported OS]) -AC_SUBST(VG_OS) +AC_SUBST(VGCONF_OS) case "${host_os}" in *linux*) AC_MSG_RESULT([ok (${host_os})]) - VG_OS="linux" + VGCONF_OS="linux" # Ok, this is linux. Check the kernel version AC_MSG_CHECKING([for the kernel version]) @@ -245,20 +250,20 @@ case "${host_os}" in aix5.1.*) AC_MSG_RESULT([ok (${host_os})]) - VG_OS="aix5" + VGCONF_OS="aix5" ;; aix5.2.*) AC_MSG_RESULT([ok (${host_os})]) - VG_OS="aix5" + VGCONF_OS="aix5" ;; aix5.3.*) AC_MSG_RESULT([ok (${host_os})]) - VG_OS="aix5" + VGCONF_OS="aix5" ;; *freebsd*) AC_MSG_RESULT([ok (${host_os})]) - VG_OS="freebsd" + VGCONF_OS="freebsd" ;; *) @@ -267,11 +272,13 @@ case "${host_os}" in ;; esac +#---------------------------------------------------------------------------- + # If we are building on a 64 bit platform test to see if the system # supports building 32 bit programs and disable 32 bit support if it # does not support building 32 bit programs -case "$VG_ARCH_MAX-$VG_OS" in +case "$ARCH_MAX-$VGCONF_OS" in amd64-linux|ppc64-linux) AC_MSG_CHECKING([for 32 bit build support]) safe_CFLAGS=$CFLAGS @@ -293,72 +300,86 @@ if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then [--enable-only32bit was specified but system does not support 32 bit builds]) fi -# Establish VG_PLATFORM_PRI. This is the primary build target. The -# entire system, including regression and performance tests, will be -# built for this target. +#---------------------------------------------------------------------------- + +# VGCONF_ARCH_PRI is the arch for the primary build target. By default it's +# the same as ARCH_MAX. But if, say, we do a build on an amd64 machine, but +# --enable-only32bit has been requested, then ARCH_MAX (see above) will be +# "amd64" since that reflects the most that this cpu can do, but +# VGCONF_ARCH_PRI will be downgraded to "x86", since that reflects the arch +# corresponding to the primary build (VGCONF_PLATFORM_PRI_CAPS). It is +# passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_PRI) and +# -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS). +AC_SUBST(VGCONF_ARCH_PRI) + +# VGCONF_PLATFORM_PRI_CAPS is the primary build target. The entire system, +# including regression and performance tests, will be built for this target. +# The "_CAPS" indicates that the name is in capital letters, because it's +# used to create various Makefile variables, which are all in caps by +# convention. This is in contrast to VGCONF_ARCH_PRI and VGCONF_OS which +# are not in caps. +AC_SUBST(VGCONF_PLATFORM_PRI_CAPS) + +# VGCONF_PLATFORM_SEC_CAPS is the secondary build target, if there is one. +# Valgrind and tools will also be built for this target, but not the +# regression or performance tests. # -# Also establish VG_PLATFORM_SEC, the secondary build target, if -# possible. The system will also be built for this target, but not -# the regression or performance tests. -# -# Also establish VG_ARCH_PRI, which is the arch for the primary -# build target. The various makefiles building regression tests -# sometimes need to see this. -AC_MSG_CHECKING([for a supported CPU/OS combination]) - -AC_SUBST(VG_PLATFORM_PRI) -AC_SUBST(VG_PLATFORM_SEC) -AC_SUBST(VG_ARCH_PRI) +# By default, the primary arch is the same as the "max" arch, as commented +# above (at the definition of ARCH_MAX). We may choose to downgrade it in +# the big case statement just below here, in the case where we're building +# on a 64 bit machine but have been requested only to do a 32 bit build. +AC_SUBST(VGCONF_PLATFORM_SEC_CAPS) -# By default, the primary arch is the same as the "max" arch, as -# commented above (at the definition of VG_ARCH_MAX). We may choose -# to downgrade it in the big case statement just below here, in the -# case where we're building on a 64 bit machine but have been -# requested only to do a 32 bit build. -VG_ARCH_PRI=$VG_ARCH_MAX +AC_MSG_CHECKING([for a supported CPU/OS combination]) -case "$VG_ARCH_MAX-$VG_OS" in +case "$ARCH_MAX-$VGCONF_OS" in x86-linux) - VG_PLATFORM_PRI="X86_LINUX" - VG_PLATFORM_SEC="" + VGCONF_ARCH_PRI="x86" + VGCONF_PLATFORM_PRI_CAPS="X86_LINUX" + VGCONF_PLATFORM_SEC_CAPS="" valt_load_address_normal="0x38000000" valt_load_address_inner="0x28000000" AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) ;; amd64-linux) if test x$vg_cv_only64bit = xyes; then - VG_PLATFORM_PRI="AMD64_LINUX" - VG_PLATFORM_SEC="" + VGCONF_ARCH_PRI="amd64" + VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX" + VGCONF_PLATFORM_SEC_CAPS="" elif test x$vg_cv_only32bit = xyes; then - VG_PLATFORM_PRI="X86_LINUX" - VG_PLATFORM_SEC="" - VG_ARCH_PRI="x86" + VGCONF_ARCH_PRI="x86" + VGCONF_PLATFORM_PRI_CAPS="X86_LINUX" + VGCONF_PLATFORM_SEC_CAPS="" else - VG_PLATFORM_PRI="AMD64_LINUX" - VG_PLATFORM_SEC="X86_LINUX" + VGCONF_ARCH_PRI="amd64" + VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX" + VGCONF_PLATFORM_SEC_CAPS="X86_LINUX" fi valt_load_address_normal="0x38000000" valt_load_address_inner="0x28000000" AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) ;; ppc32-linux) - VG_PLATFORM_PRI="PPC32_LINUX" - VG_PLATFORM_SEC="" + VGCONF_ARCH_PRI="ppc32" + VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX" + VGCONF_PLATFORM_SEC_CAPS="" valt_load_address_normal="0x38000000" valt_load_address_inner="0x28000000" AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) ;; ppc64-aix5) if test x$vg_cv_only64bit = xyes; then - VG_PLATFORM_PRI="PPC64_AIX5" - VG_PLATFORM_SEC="" + VGCONF_ARCH_PRI="ppc64" + VGCONF_PLATFORM_PRI_CAPS="PPC64_AIX5" + VGCONF_PLATFORM_SEC_CAPS="" elif test x$vg_cv_only32bit = xyes; then - VG_PLATFORM_PRI="PPC32_AIX5" - VG_PLATFORM_SEC="" - VG_ARCH_PRI="ppc32" + VGCONF_ARCH_PRI="ppc32" + VGCONF_PLATFORM_PRI_CAPS="PPC32_AIX5" + VGCONF_PLATFORM_SEC_CAPS="" else - VG_PLATFORM_PRI="PPC64_AIX5" - VG_PLATFORM_SEC="PPC32_AIX5" + VGCONF_ARCH_PRI="ppc64" + VGCONF_PLATFORM_PRI_CAPS="PPC64_AIX5" + VGCONF_PLATFORM_SEC_CAPS="PPC32_AIX5" fi valt_load_address_normal="0x38000000" valt_load_address_inner="0x28000000" @@ -366,82 +387,90 @@ case "$VG_ARCH_MAX-$VG_OS" in ;; ppc64-linux) if test x$vg_cv_only64bit = xyes; then - VG_PLATFORM_PRI="PPC64_LINUX" - VG_PLATFORM_SEC="" + VGCONF_ARCH_PRI="ppc64" + VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX" + VGCONF_PLATFORM_SEC_CAPS="" elif test x$vg_cv_only32bit = xyes; then - VG_PLATFORM_PRI="PPC32_LINUX" - VG_PLATFORM_SEC="" - VG_ARCH_PRI="ppc32" + VGCONF_ARCH_PRI="ppc32" + VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX" + VGCONF_PLATFORM_SEC_CAPS="" + VGCONF_ARCH_PRI="ppc32" else - VG_PLATFORM_PRI="PPC64_LINUX" - VG_PLATFORM_SEC="PPC32_LINUX" + VGCONF_ARCH_PRI="ppc64" + VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX" + VGCONF_PLATFORM_SEC_CAPS="PPC32_LINUX" fi valt_load_address_normal="0x38000000" valt_load_address_inner="0x28000000" AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) ;; *) - VG_PLATFORM_PRI="unknown" - VG_PLATFORM_SEC="unknown" + VGCONF_ARCH_PRI="unknown" + VGCONF_PLATFORM_PRI_CAPS="UNKNOWN" + VGCONF_PLATFORM_SEC_CAPS="UNKNOWN" AC_MSG_RESULT([no (${host_cpu}-${host_os})]) AC_MSG_ERROR([Valgrind is platform specific. Sorry. Please consider doing a port.]) ;; esac -# Set up VGA_<arch>. Either one or two of these become defined. -# -AM_CONDITIONAL(VGA_X86, - test x$VG_PLATFORM_PRI = xX86_LINUX \ - -o x$VG_PLATFORM_SEC = xX86_LINUX ) -AM_CONDITIONAL(VGA_AMD64, - test x$VG_PLATFORM_PRI = xAMD64_LINUX ) -AM_CONDITIONAL(VGA_PPC32, - test x$VG_PLATFORM_PRI = xPPC32_LINUX \ - -o x$VG_PLATFORM_SEC = xPPC32_LINUX \ - -o x$VG_PLATFORM_PRI = xPPC32_AIX5 \ - -o x$VG_PLATFORM_SEC = xPPC32_AIX5 ) -AM_CONDITIONAL(VGA_PPC64, - test x$VG_PLATFORM_PRI = xPPC64_LINUX \ - -o x$VG_PLATFORM_PRI = xPPC64_AIX5 ) - -# Set up VGP_<platform>. Either one or two of these become defined. -# -AM_CONDITIONAL(VGP_X86_LINUX, - test x$VG_PLATFORM_PRI = xX86_LINUX \ - -o x$VG_PLATFORM_SEC = xX86_LINUX) -AM_CONDITIONAL(VGP_AMD64_LINUX, - test x$VG_PLATFORM_PRI = xAMD64_LINUX) -AM_CONDITIONAL(VGP_PPC32_LINUX, - test x$VG_PLATFORM_PRI = xPPC32_LINUX \ - -o x$VG_PLATFORM_SEC = xPPC32_LINUX) -AM_CONDITIONAL(VGP_PPC64_LINUX, - test x$VG_PLATFORM_PRI = xPPC64_LINUX) -AM_CONDITIONAL(VGP_PPC32_AIX5, - test x$VG_PLATFORM_PRI = xPPC32_AIX5 \ - -o x$VG_PLATFORM_SEC = xPPC32_AIX5) -AM_CONDITIONAL(VGP_PPC64_AIX5, - test x$VG_PLATFORM_PRI = xPPC64_AIX5) - -# Similarly, set up VGO_<os>. Exactly one of these becomes defined. +#---------------------------------------------------------------------------- + +# Set up VGCONF_ARCHS_INCLUDE_<arch>. Either one or two of these become +# defined. +AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_X86, + test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ + -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX ) +AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_AMD64, + test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX ) +AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC32, + test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \ + -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_AIX5 \ + -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_AIX5 ) +AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC64, + test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_AIX5 ) + +# Set up VGCONF_PLATFORMS_INCLUDE_<platform>. Either one or two of these +# become defined. +AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_LINUX, + test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ + -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX) +AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX, + test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX) +AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX, + test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \ + -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX) +AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX, + test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX) +AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5, + test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_AIX5 \ + -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_AIX5) +AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5, + test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_AIX5) + +# Similarly, set up VGCONF_OF_IS_<os>. Exactly one of these becomes defined. # Relies on the assumption that the primary and secondary targets are # for the same OS, so therefore only necessary to test the primary. -# -AM_CONDITIONAL(VGO_LINUX, - test x$VG_PLATFORM_PRI = xX86_LINUX \ - -o x$VG_PLATFORM_PRI = xAMD64_LINUX \ - -o x$VG_PLATFORM_PRI = xPPC32_LINUX \ - -o x$VG_PLATFORM_PRI = xPPC64_LINUX) -AM_CONDITIONAL(VGO_AIX5, - test x$VG_PLATFORM_PRI = xPPC32_AIX5 \ - -o x$VG_PLATFORM_PRI = xPPC64_AIX5) - - -# Sometimes, in the Makefile.am-s, it's useful to know -# whether or not there is a secondary target. -# -AM_CONDITIONAL(VGP_HAVE_SECONDARY, - test x$VG_PLATFORM_SEC != x) +AM_CONDITIONAL(VGCONF_OS_IS_LINUX, + test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX) +AM_CONDITIONAL(VGCONF_OS_IS_AIX5, + test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_AIX5 \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_AIX5) + +# Sometimes, in the Makefile.am files, it's useful to know whether or not +# there is a secondary target. +AM_CONDITIONAL(VGCONF_HAVE_PLATFORM_SEC_CAPS, + test x$VGCONF_PLATFORM_SEC_CAPS != x) + + +#---------------------------------------------------------------------------- +# Inner Valgrind? +#---------------------------------------------------------------------------- # Check if this should be built as an inner Valgrind, to be run within # another Valgrind. Choose the load address accordingly. @@ -459,7 +488,12 @@ else fi - +#---------------------------------------------------------------------------- +# Libc and suppressions +#---------------------------------------------------------------------------- +# This variable will collect the suppression files to be used. +DEFAULT_SUPP="" +AC_SUBST(DEFAULT_SUPP) GLIBC_VERSION="" @@ -640,6 +674,10 @@ DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}" DEFAULT_SUPP="exp-ptrcheck.supp ${DEFAULT_SUPP}" +#---------------------------------------------------------------------------- +# Checking for various library functions and other definitions +#---------------------------------------------------------------------------- + # Check for CLOCK_MONOTONIC AC_MSG_CHECKING([for CLOCK_MONOTONIC]) @@ -852,6 +890,10 @@ AC_MSG_RESULT([no]) ]) +#---------------------------------------------------------------------------- +# Checking for supported compiler flags. +#---------------------------------------------------------------------------- + # does this compiler support -m32 ? AC_MSG_CHECKING([if gcc accepts -m32]) @@ -1281,7 +1323,10 @@ AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variables]) fi +#---------------------------------------------------------------------------- # Checks for C header files. +#---------------------------------------------------------------------------- + AC_HEADER_STDC AC_CHECK_HEADERS([ \ asm/unistd.h \ @@ -1299,14 +1344,18 @@ AC_CHECK_HEADERS([ \ sys/types.h \ ]) +#---------------------------------------------------------------------------- # Checks for typedefs, structures, and compiler characteristics. +#---------------------------------------------------------------------------- AC_TYPE_UID_T AC_TYPE_OFF_T AC_TYPE_SIZE_T AC_HEADER_TIME +#---------------------------------------------------------------------------- # Checks for library functions. +#---------------------------------------------------------------------------- AC_FUNC_MEMCMP AC_FUNC_MMAP AC_TYPE_SIGNAL @@ -1354,6 +1403,10 @@ AM_CONDITIONAL([HAVE_PTHREAD_MUTEX_TIMEDLOCK], AM_CONDITIONAL([HAVE_PTHREAD_SPINLOCK], [test x$ac_cv_func_pthread_spin_lock = xyes]) + +#---------------------------------------------------------------------------- +# MPI checks +#---------------------------------------------------------------------------- # Do we have a useable MPI setup on the primary and/or secondary targets? # On Linux, by default, assumes mpicc and -m32/-m64 # On AIX, by default, assumes mpxlc and -q32/-q64 @@ -1361,29 +1414,29 @@ AM_CONDITIONAL([HAVE_PTHREAD_SPINLOCK], # understands -m32/-m64/-q32/-q64 regardless of what is specified using # --with-mpicc=. MPI_CC="mpicc" -if test x$VG_PLATFORM_PRI = xPPC32_AIX5 \ - -o x$VG_PLATFORM_PRI = xPPC64_AIX5 ; then +if test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_AIX5 \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_AIX5 ; then MPI_CC="mpxlc" fi mflag_primary= -if test x$VG_PLATFORM_PRI = xX86_LINUX \ - -o x$VG_PLATFORM_PRI = xPPC32_LINUX ; then +if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX ; then mflag_primary=$FLAG_M32 -elif test x$VG_PLATFORM_PRI = xAMD64_LINUX \ - -o x$VG_PLATFORM_PRI = xPPC64_LINUX ; then +elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX ; then mflag_primary=$FLAG_M64 -elif test x$VG_PLATFORM_PRI = xPPC32_AIX5 ; then +elif test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_AIX5 ; then mflag_primary=-q32 -elif test x$VG_PLATFORM_PRI = xPPC64_AIX5 ; then +elif test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_AIX5 ; then mflag_primary=-q64 fi mflag_secondary= -if test x$VG_PLATFORM_SEC = xX86_LINUX \ - -o x$VG_PLATFORM_SEC = xPPC32_LINUX ; then +if test x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \ + -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX ; then mflag_secondary=$FLAG_M32 -elif test x$VG_PLATFORM_SEC = xPPC32_AIX5 ; then +elif test x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_AIX5 ; then mflag_secondary=-q32 fi @@ -1427,7 +1480,7 @@ AM_CONDITIONAL(BUILD_MPIWRAP_PRI, test x$ac_have_mpi2_pri = xyes) AC_MSG_CHECKING([secondary target for usable MPI2-compliant C compiler and mpi.h]) saved_CC=$CC saved_CFLAGS=$CFLAGS -if test x$VG_PLATFORM_SEC = x ; then +if test x$VGCONF_PLATFORM_SEC_CAPS = x ; then CC="$MPI_CC this will surely fail" else CC=$MPI_CC @@ -1452,6 +1505,9 @@ CFLAGS=$saved_CFLAGS AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec = xyes) +#---------------------------------------------------------------------------- +# Other library checks +#---------------------------------------------------------------------------- # There now follow some tests for QtCore, Boost, and OpenMP. These # tests are present because Drd has some regression tests that use # these packages. All regression test programs all compiled only @@ -1614,7 +1670,9 @@ CFLAGS=$safe_CFLAGS AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes]) -# -------------------- ok. We're done. -------------------- +#---------------------------------------------------------------------------- +# Ok. We're done checking. +#---------------------------------------------------------------------------- AC_OUTPUT( Makefile @@ -1683,11 +1741,11 @@ AC_OUTPUT( cat<<EOF - configure.in: VG_ARCH_MAX = ${VG_ARCH_MAX} - configure.in: VG_ARCH_PRI = ${VG_ARCH_PRI} + configure.in: ARCH_MAX = ${ARCH_MAX} + configure.in: VGCONF_ARCH_PRI = ${VGCONF_ARCH_PRI} - Primary build target: ${VG_PLATFORM_PRI} - Secondary build target: ${VG_PLATFORM_SEC} + Primary build target: ${VGCONF_PLATFORM_PRI_CAPS} + Secondary build target: ${VGCONF_PLATFORM_SEC_CAPS} Default supp files: ${DEFAULT_SUPP} EOF diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am index 4f247e55..339ad23d 100644 --- a/coregrind/Makefile.am +++ b/coregrind/Makefile.am @@ -19,22 +19,22 @@ AM_CPPFLAGS_PPC64_AIX5 += -DVG_LIBDIR="\"$(valdir)"\" default.supp: $(SUPP_FILES) noinst_LIBRARIES = -if VGP_X86_LINUX +if VGCONF_PLATFORMS_INCLUDE_X86_LINUX noinst_LIBRARIES += libcoregrind_x86_linux.a libreplacemalloc_toolpreload_x86_linux.a endif -if VGP_AMD64_LINUX +if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX noinst_LIBRARIES += libcoregrind_amd64_linux.a libreplacemalloc_toolpreload_amd64_linux.a endif -if VGP_PPC32_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX noinst_LIBRARIES += libcoregrind_ppc32_linux.a libreplacemalloc_toolpreload_ppc32_linux.a endif -if VGP_PPC64_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX noinst_LIBRARIES += libcoregrind_ppc64_linux.a libreplacemalloc_toolpreload_ppc64_linux.a endif -if VGP_PPC32_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 noinst_LIBRARIES += libcoregrind_ppc32_aix5.a libreplacemalloc_toolpreload_ppc32_aix5.a endif -if VGP_PPC64_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 noinst_LIBRARIES += libcoregrind_ppc64_aix5.a libreplacemalloc_toolpreload_ppc64_aix5.a endif @@ -44,7 +44,7 @@ endif bin_PROGRAMS = \ valgrind no_op_client_for_valgrind -if VGO_AIX5 +if VGCONF_OS_IS_AIX5 valgrind_SOURCES = \ launcher-aix5.c \ m_debuglog.c \ @@ -70,22 +70,22 @@ no_op_client_for_valgrind_LDFLAGS = $(AM_CFLAGS_PRI) noinst_PROGRAMS = -if VGP_X86_LINUX +if VGCONF_PLATFORMS_INCLUDE_X86_LINUX noinst_PROGRAMS += vgpreload_core-x86-linux.so endif -if VGP_AMD64_LINUX +if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX noinst_PROGRAMS += vgpreload_core-amd64-linux.so endif -if VGP_PPC32_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX noinst_PROGRAMS += vgpreload_core-ppc32-linux.so endif -if VGP_PPC64_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX noinst_PROGRAMS += vgpreload_core-ppc64-linux.so endif -if VGP_PPC32_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 noinst_PROGRAMS += vgpreload_core-ppc32-aix5.so endif -if VGP_PPC64_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 noinst_PROGRAMS += vgpreload_core-ppc64-aix5.so endif diff --git a/docs/internals/multiple-architectures.txt b/docs/internals/multiple-architectures.txt index 5c5eece1..fee423fd 100644 --- a/docs/internals/multiple-architectures.txt +++ b/docs/internals/multiple-architectures.txt @@ -41,21 +41,25 @@ The keys to understanding this are in: The configure script inspects the CPU. It then sets - VG_PLATFORM_PRI to be the primary target - VG_PLATFORM_SEC to be the secondary target, if any + VGCONF_PLATFORM_PRI_CAPS to be the primary target + VGCONF_PLATFORM_SEC_CAPS to be the secondary target, if any It also sets one (single-arch build) or two (dual-arch build) of the following: - VG_X86_LINUX - VG_AMD64_LINUX - VG_PPC32_LINUX - VG_PPC64_LINUX + VGCONF_PLATFORMS_INCLUDE_X86_LINUX + VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX + VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX + VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX + ... -On an amd64 system both VG_X86_LINUX and VG_AMD64_LINUX will be true -so that two versions of all the tools will be built. Similarly on a -ppc64 system both VG_PPC32_LINUX and VG_PPC64_LINUX will be defined. -For the amd64 example, the coregrind libraries will be named: +On an amd64 system both VGCONF_PLATFORMS_INCLUDE_X86_LINUX and +VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX will be true so that two versions of +all the tools will be built. Similarly on a ppc64 system both +VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX and +VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX will be defined (unless +--enable-only32bit or --enable-only64bit is used). For the amd64 example, + the coregrind libraries will be named: libcoregrind_x86_linux.a libcoregrind_amd64_linux.a @@ -117,12 +121,7 @@ Rules for Makefile.am hacking ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In places where compilation should happen twice (on a dual-arch system), the decision about which directories and flags to use is -guarded by the symbols: - - VG_X86_LINUX - VG_AMD64_LINUX - VG_PPC32_LINUX - VG_PPC64_LINUX +guarded by the VGCONF_PLATFORMS_INCLUDE_* symbols. But there are also places where building must only happen once, for the primary architecture. These places are (at least): diff --git a/docs/internals/porting-HOWTO.txt b/docs/internals/porting-HOWTO.txt index 8ea1909f..121e39c8 100644 --- a/docs/internals/porting-HOWTO.txt +++ b/docs/internals/porting-HOWTO.txt @@ -85,7 +85,6 @@ Similarly to above, this implies both a new OS, and a new platform. - Create necessary subdirs (copy linux/ and x86-linux/ subdirs). - Update configure.in (use linux and x86-linux as a guide). - Don't forget to update VG_OS_ALL, VG_PLATFORM_ALL. - Implement all the necessary OS-specific and platform-specific types, functions, and macros... use the following as templates: diff --git a/drd/Makefile.am b/drd/Makefile.am index 7bcd9c65..19e374de 100644 --- a/drd/Makefile.am +++ b/drd/Makefile.am @@ -1,22 +1,22 @@ include $(top_srcdir)/Makefile.tool.am noinst_PROGRAMS = -if VGP_X86_LINUX +if VGCONF_PLATFORMS_INCLUDE_X86_LINUX noinst_PROGRAMS += drd-x86-linux vgpreload_drd-x86-linux.so endif -if VGP_AMD64_LINUX +if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX noinst_PROGRAMS += drd-amd64-linux vgpreload_drd-amd64-linux.so endif -if VGP_PPC32_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX noinst_PROGRAMS += drd-ppc32-linux vgpreload_drd-ppc32-linux.so endif -if VGP_PPC64_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX noinst_PROGRAMS += drd-ppc64-linux vgpreload_drd-ppc64-linux.so endif -if VGP_PPC32_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 noinst_PROGRAMS += drd-ppc32-aix5 vgpreload_drd-ppc32-aix5.so endif -if VGP_PPC64_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 noinst_PROGRAMS += drd-ppc64-aix5 vgpreload_drd-ppc64-aix5.so endif diff --git a/drd/tests/Makefile.am b/drd/tests/Makefile.am index 554bc969..12ca592d 100644 --- a/drd/tests/Makefile.am +++ b/drd/tests/Makefile.am @@ -198,8 +198,8 @@ EXTRA_DIST = \ trylock.vgtest AM_CFLAGS = $(WERROR) -Wall @FLAG_W_EXTRA@ -Wno-inline -Wno-unused-parameter\ - -g $(AM_FLAG_M3264_PRI) -DVGA_$(VG_ARCH_PRI)=1 -DVGO_$(VG_OS)=1 \ - -DVGP_$(VG_ARCH_PRI)_$(VG_OS)=1 + -g $(AM_FLAG_M3264_PRI) -DVGA_$(VGCONF_ARCH_PRI)=1 \ + -DVGO_$(VGCONF_OS)=1 -DVGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS)=1 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include \ -I$(top_builddir)/include -I$(top_srcdir)/VEX/pub AM_CXXFLAGS = $(AM_CFLAGS) diff --git a/exp-omega/Makefile.am b/exp-omega/Makefile.am index 8d8da7e0..6af2f3ff 100644 --- a/exp-omega/Makefile.am +++ b/exp-omega/Makefile.am @@ -12,22 +12,22 @@ EXTRA_DIST = exp-omega.h o_main.c o_replace_memops.c ##zz ##zz # include memcheck/ for mac_shared.h ##zz noinst_PROGRAMS = -##zz if VGP_X86_LINUX +##zz if VGCONF_PLATFORMS_INCLUDE_X86_LINUX ##zz noinst_PROGRAMS += exp-omega-x86-linux vgpreload_exp-omega-x86-linux.so ##zz endif -##zz if VGP_AMD64_LINUX +##zz if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX ##zz noinst_PROGRAMS += exp-omega-amd64-linux vgpreload_exp-omega-amd64-linux.so ##zz endif -##zz if VGP_PPC32_LINUX +##zz if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX ##zz noinst_PROGRAMS += exp-omega-ppc32-linux vgpreload_exp-omega-ppc32-linux.so ##zz endif -##zz if VGP_PPC64_LINUX +##zz if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX ##zz noinst_PROGRAMS += exp-omega-ppc64-linux vgpreload_exp-omega-ppc64-linux.so ##zz endif -##zz if VGP_PPC32_AIX5 +##zz if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 ##zz noinst_PROGRAMS += exp-omega-ppc32-aix5 vgpreload_exp-omega-ppc32-aix5.so ##zz endif -##zz if VGP_PPC64_AIX5 +##zz if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 ##zz noinst_PROGRAMS += exp-omega-ppc64-aix5 vgpreload_exp-omega-ppc64-aix5.so ##zz endif ##zz diff --git a/exp-ptrcheck/Makefile.am b/exp-ptrcheck/Makefile.am index eba61caf..d4591e3d 100644 --- a/exp-ptrcheck/Makefile.am +++ b/exp-ptrcheck/Makefile.am @@ -1,22 +1,22 @@ include $(top_srcdir)/Makefile.tool.am noinst_PROGRAMS = -if VGP_X86_LINUX +if VGCONF_PLATFORMS_INCLUDE_X86_LINUX noinst_PROGRAMS += exp-ptrcheck-x86-linux vgpreload_exp-ptrcheck-x86-linux.so endif -if VGP_AMD64_LINUX +if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX noinst_PROGRAMS += exp-ptrcheck-amd64-linux vgpreload_exp-ptrcheck-amd64-linux.so endif -if VGP_PPC32_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX noinst_PROGRAMS += exp-ptrcheck-ppc32-linux vgpreload_exp-ptrcheck-ppc32-linux.so endif -if VGP_PPC64_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX noinst_PROGRAMS += exp-ptrcheck-ppc64-linux vgpreload_exp-ptrcheck-ppc64-linux.so endif -if VGP_PPC32_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 noinst_PROGRAMS += exp-ptrcheck-ppc32-aix5 vgpreload_exp-ptrcheck-ppc32-aix5.so endif -if VGP_PPC64_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 noinst_PROGRAMS += exp-ptrcheck-ppc64-aix5 vgpreload_exp-ptrcheck-ppc64-aix5.so endif diff --git a/exp-ptrcheck/tests/Makefile.am b/exp-ptrcheck/tests/Makefile.am index 73553c07..d382cac9 100644 --- a/exp-ptrcheck/tests/Makefile.am +++ b/exp-ptrcheck/tests/Makefile.am @@ -3,7 +3,7 @@ include $(top_srcdir)/Makefile.flags.am #SUBDIRS = . -#if VGA_X86 +#if VGCONF_ARCHS_INCLUDE_X86 #SUBDIRS += x86 #DIST_SUBDIRS = x86 . @@ -128,11 +128,11 @@ ccc_SOURCES = ccc.cpp # Build shared object for preen_invars preen_invars_SOURCES = preen_invars.c preen_invars_DEPENDENCIES = preen_invars_so.so -if VGP_PPC64_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 preen_invars_LDADD = -ldl preen_invars_LDFLAGS = $(AM_FLAG_M3264_PRI) else -if VGP_PPC32_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 preen_invars_LDADD = -ldl preen_invars_LDFLAGS = $(AM_FLAG_M3264_PRI) -Wl,-G -Wl,-bnogc else @@ -146,10 +146,10 @@ preen_invars_so_so_SOURCES = preen_invars_so.c preen_invars_so_so_LDADD = preen_invars_so_so_DEPENDENCIES = preen_invars_so_so_CFLAGS = -fpic $(AM_FLAG_M3264_PRI) -g -if VGP_PPC64_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 preen_invars_so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -shared else -if VGP_PPC32_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 preen_invars_so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -shared \ -Wl,-G -Wl,-bnogc else diff --git a/helgrind/Makefile.am b/helgrind/Makefile.am index 098b217b..02f96bab 100644 --- a/helgrind/Makefile.am +++ b/helgrind/Makefile.am @@ -1,22 +1,22 @@ include $(top_srcdir)/Makefile.tool.am noinst_PROGRAMS = -if VGP_X86_LINUX +if VGCONF_PLATFORMS_INCLUDE_X86_LINUX noinst_PROGRAMS += helgrind-x86-linux vgpreload_helgrind-x86-linux.so endif -if VGP_AMD64_LINUX +if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX noinst_PROGRAMS += helgrind-amd64-linux vgpreload_helgrind-amd64-linux.so endif -if VGP_PPC32_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX noinst_PROGRAMS += helgrind-ppc32-linux vgpreload_helgrind-ppc32-linux.so endif -if VGP_PPC64_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX noinst_PROGRAMS += helgrind-ppc64-linux vgpreload_helgrind-ppc64-linux.so endif -if VGP_PPC32_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 noinst_PROGRAMS += helgrind-ppc32-aix5 vgpreload_helgrind-ppc32-aix5.so endif -if VGP_PPC64_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 noinst_PROGRAMS += helgrind-ppc64-aix5 vgpreload_helgrind-ppc64-aix5.so endif diff --git a/lackey/Makefile.am b/lackey/Makefile.am index 3091c62b..69a1a823 100644 --- a/lackey/Makefile.am +++ b/lackey/Makefile.am @@ -1,22 +1,22 @@ include $(top_srcdir)/Makefile.tool.am noinst_PROGRAMS = -if VGP_X86_LINUX +if VGCONF_PLATFORMS_INCLUDE_X86_LINUX noinst_PROGRAMS += lackey-x86-linux endif -if VGP_AMD64_LINUX +if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX noinst_PROGRAMS += lackey-amd64-linux endif -if VGP_PPC32_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX noinst_PROGRAMS += lackey-ppc32-linux endif -if VGP_PPC64_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX noinst_PROGRAMS += lackey-ppc64-linux endif -if VGP_PPC32_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 noinst_PROGRAMS += lackey-ppc32-aix5 endif -if VGP_PPC64_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 noinst_PROGRAMS += lackey-ppc64-aix5 endif diff --git a/massif/Makefile.am b/massif/Makefile.am index 413935c3..6ff1f51a 100644 --- a/massif/Makefile.am +++ b/massif/Makefile.am @@ -5,22 +5,22 @@ SUBDIRS += perf bin_SCRIPTS = ms_print noinst_PROGRAMS = -if VGP_X86_LINUX +if VGCONF_PLATFORMS_INCLUDE_X86_LINUX noinst_PROGRAMS += massif-x86-linux vgpreload_massif-x86-linux.so endif -if VGP_AMD64_LINUX +if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX noinst_PROGRAMS += massif-amd64-linux vgpreload_massif-amd64-linux.so endif -if VGP_PPC32_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX noinst_PROGRAMS += massif-ppc32-linux vgpreload_massif-ppc32-linux.so endif -if VGP_PPC64_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX noinst_PROGRAMS += massif-ppc64-linux vgpreload_massif-ppc64-linux.so endif -if VGP_PPC32_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 noinst_PROGRAMS += massif-ppc32-aix5 vgpreload_massif-ppc32-aix5.so endif -if VGP_PPC64_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 noinst_PROGRAMS += massif-ppc64-aix5 vgpreload_massif-ppc64-aix5.so endif diff --git a/memcheck/Makefile.am b/memcheck/Makefile.am index 8414da40..08de8e59 100644 --- a/memcheck/Makefile.am +++ b/memcheck/Makefile.am @@ -1,22 +1,22 @@ include $(top_srcdir)/Makefile.tool.am noinst_PROGRAMS = -if VGP_X86_LINUX +if VGCONF_PLATFORMS_INCLUDE_X86_LINUX noinst_PROGRAMS += memcheck-x86-linux vgpreload_memcheck-x86-linux.so endif -if VGP_AMD64_LINUX +if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX noinst_PROGRAMS += memcheck-amd64-linux vgpreload_memcheck-amd64-linux.so endif -if VGP_PPC32_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX noinst_PROGRAMS += memcheck-ppc32-linux vgpreload_memcheck-ppc32-linux.so endif -if VGP_PPC64_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX noinst_PROGRAMS += memcheck-ppc64-linux vgpreload_memcheck-ppc64-linux.so endif -if VGP_PPC32_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 noinst_PROGRAMS += memcheck-ppc32-aix5 vgpreload_memcheck-ppc32-aix5.so endif -if VGP_PPC64_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 noinst_PROGRAMS += memcheck-ppc64-aix5 vgpreload_memcheck-ppc64-aix5.so endif diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am index 7b4398e1..ebc0d28c 100644 --- a/memcheck/tests/Makefile.am +++ b/memcheck/tests/Makefile.am @@ -5,20 +5,20 @@ include $(top_srcdir)/Makefile.flags.am SUBDIRS = . # Arch-specific tests. -if VGA_X86 +if VGCONF_ARCHS_INCLUDE_X86 SUBDIRS += x86 endif -if VGA_AMD64 +if VGCONF_ARCHS_INCLUDE_AMD64 SUBDIRS += amd64 endif # OS-specific tests -if VGO_LINUX +if VGCONF_OS_IS_LINUX SUBDIRS += linux endif # Platform-specific tests -if VGP_X86_LINUX +if VGCONF_PLATFORMS_INCLUDE_X86_LINUX SUBDIRS += x86-linux endif @@ -237,8 +237,9 @@ AM_CXXFLAGS = $(AM_CFLAGS) # Extra stuff for C tests memcmptest_CFLAGS = $(AM_FLAG_M3264_PRI) $(AM_CFLAGS) -fno-builtin-memcmp oset_test_CFLAGS = $(AM_FLAG_M3264_PRI) \ - -DVGA_$(VG_ARCH_PRI)=1 -DVGO_$(VG_OS)=1 \ - -DVGP_$(VG_ARCH_PRI)_$(VG_OS)=1 + -DVGA_$(VGCONF_ARCH_PRI)=1 \ + -DVGO_$(VGCONF_OS)=1 \ + -DVGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS)=1 vcpu_bz2_CFLAGS = $(AM_FLAG_M3264_PRI) $(AM_CFLAGS) -O2 -g vcpu_fbench_CFLAGS = $(AM_FLAG_M3264_PRI) $(AM_CFLAGS) -O2 -g vcpu_fnfns_CFLAGS = $(AM_FLAG_M3264_PRI) $(AM_CFLAGS) -O2 -g @@ -274,8 +275,8 @@ deep_templates_SOURCES = deep_templates.cpp long_namespace_xml_SOURCES = long_namespace_xml.cpp deep_templates_CXXFLAGS = $(AM_FLAG_M3264_PRI) $(AM_CFLAGS) -O -gstabs -if VGP_PPC32_AIX5 -if VGP_PPC64_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 else # persuade the AIX linker not to junk apparently unused # function descriptors. Unfortunately -Wl,-G -Wl,-bnogc @@ -294,11 +295,11 @@ endif # Build shared object for wrap7 wrap7_SOURCES = wrap7.c wrap7_DEPENDENCIES = wrap7so.so -if VGP_PPC64_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 wrap7_LDADD = `pwd`/wrap7so.so wrap7_LDFLAGS = $(AM_FLAG_M3264_PRI) else -if VGP_PPC32_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 wrap7_LDADD = `pwd`/wrap7so.so wrap7_LDFLAGS = $(AM_FLAG_M3264_PRI) -Wl,-G -Wl,-bnogc else @@ -312,10 +313,10 @@ wrap7so_so_SOURCES = wrap7so.c wrap7so_so_LDADD = wrap7so_so_DEPENDENCIES = wrap7so_so_CFLAGS = -fpic $(AM_FLAG_M3264_PRI) -if VGP_PPC64_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 wrap7so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -shared else -if VGP_PPC32_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 wrap7so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -shared \ -Wl,-G -Wl,-bnogc else @@ -327,11 +328,11 @@ endif # Build shared object for varinfo5 varinfo5_SOURCES = varinfo5.c varinfo5_DEPENDENCIES = varinfo5so.so -if VGP_PPC64_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 varinfo5_LDADD = `pwd`/varinfo5so.so varinfo5_LDFLAGS = $(AM_FLAG_M3264_PRI) else -if VGP_PPC32_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 varinfo5_LDADD = `pwd`/varinfo5so.so varinfo5_LDFLAGS = $(AM_FLAG_M3264_PRI) -Wl,-G -Wl,-bnogc else @@ -345,10 +346,10 @@ varinfo5so_so_SOURCES = varinfo5so.c varinfo5so_so_LDADD = varinfo5so_so_DEPENDENCIES = varinfo5so_so_CFLAGS = -fpic $(AM_FLAG_M3264_PRI) -g -O -if VGP_PPC64_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 varinfo5so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -shared else -if VGP_PPC32_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 varinfo5so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -shared \ -Wl,-G -Wl,-bnogc else diff --git a/none/Makefile.am b/none/Makefile.am index da625648..ac47371f 100644 --- a/none/Makefile.am +++ b/none/Makefile.am @@ -1,22 +1,22 @@ include $(top_srcdir)/Makefile.tool.am noinst_PROGRAMS = -if VGP_X86_LINUX +if VGCONF_PLATFORMS_INCLUDE_X86_LINUX noinst_PROGRAMS += none-x86-linux endif -if VGP_AMD64_LINUX +if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX noinst_PROGRAMS += none-amd64-linux endif -if VGP_PPC32_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX noinst_PROGRAMS += none-ppc32-linux endif -if VGP_PPC64_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX noinst_PROGRAMS += none-ppc64-linux endif -if VGP_PPC32_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 noinst_PROGRAMS += none-ppc32-aix5 endif -if VGP_PPC64_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 noinst_PROGRAMS += none-ppc64-aix5 endif diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 5f063372..43a51bc3 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -3,16 +3,16 @@ include $(top_srcdir)/Makefile.flags.am SUBDIRS = . -if VGA_X86 +if VGCONF_ARCHS_INCLUDE_X86 SUBDIRS += x86 endif -if VGA_AMD64 +if VGCONF_ARCHS_INCLUDE_AMD64 SUBDIRS += amd64 endif -if VGA_PPC32 +if VGCONF_ARCHS_INCLUDE_PPC32 SUBDIRS += ppc32 endif -if VGA_PPC64 +if VGCONF_ARCHS_INCLUDE_PPC64 SUBDIRS += ppc64 endif @@ -180,7 +180,7 @@ pth_mutexspeed_LDADD = -lpthread pth_once_LDADD = -lpthread pth_rwlock_LDADD = -lpthread pth_stackalign_LDADD = -lpthread -if VGO_AIX5 +if VGCONF_OS_IS_AIX5 res_search_LDADD = -lpthread else res_search_LDADD = -lresolv -lpthread @@ -192,7 +192,7 @@ threaded_fork_LDADD = -lpthread threadederrno_LDADD = -lpthread tls_SOURCES = tls.c tls2.c tls_DEPENDENCIES = tls.so -if VGO_AIX5 +if VGCONF_OS_IS_AIX5 tls_LDFLAGS = else tls_LDFLAGS = -Wl,-rpath,$(top_builddir)/none/tests @@ -200,7 +200,7 @@ endif tls_LDADD = tls.so -lpthread tls_so_SOURCES = tls_so.c tls_so_DEPENDENCIES = tls2.so -if VGO_AIX5 +if VGCONF_OS_IS_AIX5 tls_so_LDFLAGS = -shared -fPIC tls_so_LDADD = `pwd`/tls2.so else diff --git a/none/tests/x86/Makefile.am b/none/tests/x86/Makefile.am index 774e320c..b5781373 100644 --- a/none/tests/x86/Makefile.am +++ b/none/tests/x86/Makefile.am @@ -100,7 +100,6 @@ insn_sse2_SOURCES = insn_sse2.def insn_sse2_LDADD = -lm insn_sse3_SOURCES = insn_sse3.def insn_sse3_LDADD = -lm -yield_CFLAGS = $(AM_CFLAGS) -D__$(VG_ARCH_PRI)__ yield_LDADD = -lpthread .def.c: $(srcdir)/gen_insn_test.pl diff --git a/none/tests/x86/yield.c b/none/tests/x86/yield.c index 8aa8b465..78fc1f42 100644 --- a/none/tests/x86/yield.c +++ b/none/tests/x86/yield.c @@ -42,11 +42,9 @@ static void *rep_nopper(void *v) while(alive) { rep_nop++; -#ifdef __x86__ // This gives a hint to a P4, telling it to pause // (ie. we're in a spin-wait loop) asm volatile ("rep; nop" : : : "memory"); -#endif } return 0; @@ -54,9 +52,6 @@ static void *rep_nopper(void *v) int main() { -#if defined(__powerpc__) - printf("PASS\n"); -#else pthread_t a, b; pthread_create(&a, NULL, spinner, NULL); @@ -87,7 +82,6 @@ int main() else printf("FAIL spin=%d rep_nop=%d rep_nop:spin ratio: %g\n", spin, rep_nop, (float)rep_nop / spin); -#endif return 0; } diff --git a/tests/Makefile.am b/tests/Makefile.am index 5dfdf562..bb467031 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -23,9 +23,7 @@ AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g $(AM_FLAG_M3264_PRI) AM_CXXFLAGS = $(AM_CFLAGS) # generic C ones -cputest_SOURCES = cputest.c -cputest_CFLAGS = $(AM_CFLAGS) -D__$(VG_ARCH_MAX)__ -cputest_DEPENDENCIES = -cputest_LDADD = -toobig_allocs_SOURCES = toobig-allocs.c -true_SOURCES = true.c +cputest_CFLAGS = $(AM_CFLAGS) \ + -DVGA_$(VGCONF_ARCH_PRI)=1 \ + -DVGO_$(VGCONF_OS)=1 \ + -DVGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS)=1 diff --git a/tests/cputest.c b/tests/cputest.c index aab5792d..fc82b739 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -3,12 +3,18 @@ #include <string.h> #include <assert.h> +// This file determines which architectures that this Valgrind installation +// supports, which depends on the machine's architecture. It also depends +// on the configuration options; for example, if Valgrind is installed on +// an AMD64 machine but has been configured with --enable-only32bit then +// this program will not match "amd64". +// // We return: // - 0 if the machine matches the asked-for cpu // - 1 if it didn't match, but did match the name of another arch // - 2 otherwise -// When updating this file for a new architecture, add the name to +// Nb: When updating this file for a new architecture, add the name to // 'all_archs' as well as adding go(). #define False 0 @@ -23,16 +29,22 @@ char* all_archs[] = { NULL }; -#if !defined(_AIX) && defined(__powerpc__) && !defined(__powerpc64__) +//----------------------------------------------------------------------------- +// ppc32-linux +//--------------------------------------------------------------------------- +#if defined(VGP_ppc32_linux) static Bool go(char* cpu) { if ( strcmp( cpu, "ppc32" ) == 0 ) return True; return False; } -#endif // __powerpc__ (32) +#endif // VGP_ppc32_linux -#if !defined(_AIX) && defined(__powerpc__) && defined(__powerpc64__) +//--------------------------------------------------------------------------- +// ppc64-linux +//--------------------------------------------------------------------------- +#if defined(VGP_ppc64_linux) static Bool go(char* cpu) { if ( strcmp( cpu, "ppc64" ) == 0 ) @@ -41,9 +53,12 @@ static Bool go(char* cpu) return True; return False; } -#endif // __powerpc__ (64) +#endif // VGP_ppc64_linux -#if defined(_AIX) +//--------------------------------------------------------------------------- +// ppc{32,64}-aix +//--------------------------------------------------------------------------- +#if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5) static Bool go(char* cpu) { if (sizeof(void*) == 8) { @@ -58,9 +73,12 @@ static Bool go(char* cpu) } return False; } -#endif // _AIX +#endif // VGP_ppc32_aix5 || VGP_ppc64_aix5 -#if !defined(_AIX) && (defined(__i386__) || defined(__x86_64__)) +//--------------------------------------------------------------------------- +// {x86,amd64}-linux (part 1 of 2) +//--------------------------------------------------------------------------- +#if defined(VGP_x86_linux) || defined(VGP_amd64_linux) static void cpuid ( unsigned int n, unsigned int* a, unsigned int* b, unsigned int* c, unsigned int* d ) @@ -71,7 +89,12 @@ static void cpuid ( unsigned int n, : "0" (n) /* input */ ); } +#endif // VGP_x86_linux || VGP_amd64_linux +//--------------------------------------------------------------------------- +// {x86,amd64}-{linux} (part 2 of 2) +//--------------------------------------------------------------------------- +#if defined(VGP_x86_linux) || defined(VGP_amd64_linux) static Bool go(char* cpu) { unsigned int level = 0, cmask = 0, dmask = 0, a, b, c, d; @@ -102,7 +125,7 @@ static Bool go(char* cpu) } else if ( strcmp( cpu, "x86-ssse3" ) == 0 ) { level = 1; cmask = 1 << 9; -#if defined(__x86_64__) +#if defined(VGA_amd64) } else if ( strcmp( cpu, "amd64" ) == 0 ) { return True; } else if ( strcmp( cpu, "amd64-sse3" ) == 0 ) { @@ -129,9 +152,12 @@ static Bool go(char* cpu) } return False; } -#endif // !_AIX && (__i386__ || __x86_64__) +#endif // VGP_x86_linux || VGP_amd64_linux +//--------------------------------------------------------------------------- +// main +//--------------------------------------------------------------------------- int main(int argc, char **argv) { int i; diff --git a/valgrind.pc.in b/valgrind.pc.in index 6246b923..34a2407f 100644 --- a/valgrind.pc.in +++ b/valgrind.pc.in @@ -2,15 +2,15 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@/valgrind -arch=@VG_ARCH_PRI@ -os=@VG_OS@ -platform=@VG_PLATFORM_PRI@ +arch=@VGCONF_ARCH_PRI@ +os=@VGCONF_OS@ +platform=@VGCONF_ARCH_PRI@-@VGCONF_OS@ valt_load_address=@VALT_LOAD_ADDRESS@ Name: Valgrind Description: A dynamic binary instrumentation framework Version: @VERSION@ Requires: -Libs: -L${libdir}/valgrind/@VG_PLATFORM_PRI@ -lcoregrind -lvex -lgcc +Libs: -L${libdir}/valgrind/@VGCONF_ARCH_PRI@-@VGCONF_OS@ -lcoregrind -lvex -lgcc Cflags: -I${includedir} |