Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,9 @@ AC_SUBST(VGCONF_PLATFORM_ARM_ARCH)
# but only one gets installed. So if you use an in-place build, both can be
# used. --njn]

# CodSpeed: 64-bit only by default. See m4/codspeed_capstone.m4.
CODSPEED_ONLY64BIT_DEFAULT

# Check if a 64-bit only build has been requested
AC_CACHE_CHECK([for a 64-bit only build], vg_cv_only64bit,
[AC_ARG_ENABLE(only64bit,
Expand Down
26 changes: 26 additions & 0 deletions m4/codspeed_capstone.m4
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
# third_party/capstone submodule is compiled by third_party/Makefile.am;
# --with-capstone=PATH (or CAPSTONE_DIR) selects a prebuilt install instead.
AC_DEFUN([CODSPEED_CAPSTONE], [
# Capstone is compiled for the primary platform only, and cycledecode.c does not
# build without it, so a secondary (bi-arch) Callgrind cannot be built.
if test -n "$VGCONF_PLATFORM_SEC_CAPS"; then
AC_MSG_ERROR([Callgrind cycle estimation needs Capstone, which is only built
for the primary platform ($VGCONF_PLATFORM_PRI_CAPS), not for the secondary one
($VGCONF_PLATFORM_SEC_CAPS). Configure with --enable-only64bit or --enable-only32bit.])
fi

AC_ARG_WITH([capstone],
[AS_HELP_STRING([--with-capstone=PATH],
[use a prebuilt Capstone install for Callgrind cycle estimation instead
Expand Down Expand Up @@ -49,6 +57,24 @@ AC_SUBST([CAPSTONE_CFLAGS])
AC_SUBST([CAPSTONE_LIBS])
])

# CODSPEED_ONLY64BIT_DEFAULT
# --------------------------
# Default to --enable-only64bit unless --enable-only64bit or --enable-only32bit
# was given either way: see the secondary platform check in CODSPEED_CAPSTONE.
#
# This sets the cache variable rather than enable_only64bit, so that a
# vg_cv_only64bit=no left in config.cache by an earlier bi-arch run does not
# skip the default. A cached 32-bit only choice has no secondary platform
# either, so it is kept.
#
# Must be called before Valgrind's AC_CACHE_CHECK for vg_cv_only64bit.
AC_DEFUN([CODSPEED_ONLY64BIT_DEFAULT], [
if test -z "${enable_only64bit+set}" -a -z "${enable_only32bit+set}" \
-a "x$vg_cv_only32bit" != xyes; then
vg_cv_only64bit=yes
fi
])

# CODSPEED_C_STD_GNU17
# --------------------
# Export CODSPEED_C_STD, the dialect the Callgrind tool is compiled with. Under
Expand Down
Loading