aboutsummaryrefslogtreecommitdiff
path: root/libphobos/m4
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2023-07-10 17:16:17 +0200
committerIain Buclaw <ibuclaw@gdcproject.org>2023-07-10 23:31:29 +0200
commite9251fea2debebfebe1f762a4a8d5b3b1d4c75ef (patch)
tree09b47f4d760019131aa27d19bfb8e5ee0f1ed31f /libphobos/m4
parent2d7c95e31431a297060c94697af84f498abf97a2 (diff)
downloadgcc-e9251fea2debebfebe1f762a4a8d5b3b1d4c75ef.zip
gcc-e9251fea2debebfebe1f762a4a8d5b3b1d4c75ef.tar.gz
gcc-e9251fea2debebfebe1f762a4a8d5b3b1d4c75ef.tar.bz2
d: Merge upstream dmd, druntime a88e1335f7, phobos 1921d29df.
D front-end changes: - Import dmd v2.104.1. - Deprecation phase ended for access to private method when overloaded with public method. D runtime changes: - Import druntime v2.104.1. - Linux input header translations were added to druntime. - Integration with the Valgrind `memcheck' tool has been added to the garbage collector. Phobos changes: - Import phobos v2.104.1. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd a88e1335f7. * dmd/VERSION: Bump version to v2.104.1. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime a88e1335f7. * src/MERGE: Merge upstream phobos 1921d29df. * config.h.in: Regenerate. * configure: Regenerate. * configure.ac (libphobos-checking): Add valgrind flag. (DRUNTIME_LIBRARIES_VALGRIND): Call. * libdruntime/Makefile.am (DRUNTIME_CSOURCES): Add etc/valgrind/valgrind_.c. (DRUNTIME_DSOURCES): Add etc/valgrind/valgrind.d. (DRUNTIME_DSOURCES_LINUX): Add core/sys/linux/input.d, core/sys/linux/input_event_codes.d, core/sys/linux/uinput.d. * libdruntime/Makefile.in: Regenerate. * m4/druntime/libraries.m4 (DRUNTIME_LIBRARIES_VALGRIND): Define.
Diffstat (limited to 'libphobos/m4')
-rw-r--r--libphobos/m4/druntime/libraries.m453
1 files changed, 53 insertions, 0 deletions
diff --git a/libphobos/m4/druntime/libraries.m4 b/libphobos/m4/druntime/libraries.m4
index 45a56f6..8dd9c7d 100644
--- a/libphobos/m4/druntime/libraries.m4
+++ b/libphobos/m4/druntime/libraries.m4
@@ -233,3 +233,56 @@ AC_DEFUN([DRUNTIME_LIBRARIES_UCONTEXT],
AC_MSG_ERROR([swapcontext required but not found]))
fi
])
+
+# DRUNTIME_LIBRARIES_VALGRIND
+# ------------------------------
+# Allow specifying whether to use valgrind integration in the GC, which enables
+# the D run-time to communicate which memory access operations are valid.
+# This is only required if `--enable-libphobos-checking=valgrind' was seen.
+AC_DEFUN([DRUNTIME_LIBRARIES_VALGRIND],
+[
+ AC_CHECK_HEADERS(stddef.h stdlib.h)
+
+ AC_CHECK_HEADER(valgrind.h, have_valgrind_h=yes, have_valgrind_h=no)
+
+ AC_MSG_CHECKING(for VALGRIND_DISCARD in <valgrind/memcheck.h>)
+ AC_PREPROC_IFELSE([AC_LANG_SOURCE(
+ [[#include <valgrind/memcheck.h>
+ #ifndef VALGRIND_DISCARD
+ #error VALGRIND_DISCARD not defined
+ #endif]])],
+ [have_valgrind_memcheck_h=yes],
+ [have_valgrind_memcheck_h=no])
+ AC_MSG_RESULT($have_valgrind_memcheck_h)
+ AC_MSG_CHECKING(for VALGRIND_DISCARD in <memcheck.h>)
+ AC_PREPROC_IFELSE([AC_LANG_SOURCE(
+ [[#include <memcheck.h>
+ #ifndef VALGRIND_DISCARD
+ #error VALGRIND_DISCARD not defined
+ #endif]])],
+ [have_memcheck_h=yes],
+ [have_memcheck_h=no])
+ AC_MSG_RESULT($have_memcheck_h)
+
+ if test x$VALGRIND_FLAG != x ; then
+ AC_DEFINE(ENABLE_VALGRIND_CHECKING, 1,
+ [Define to enable to integrate valgrind (a memory checker) in the GC.])
+ fi
+ if test $have_valgrind_memcheck_h = yes; then
+ AC_DEFINE(HAVE_VALGRIND_MEMCHECK_H, 1,
+ [Define if valgrind's valgrind/memcheck.h header is installed.])
+ fi
+ if test $have_memcheck_h = yes; then
+ AC_DEFINE(HAVE_MEMCHECK_H, 1,
+ [Define if valgrind's memcheck.h header is installed.])
+ fi
+
+ if test x$VALGRIND_FLAG != x; then
+ if (test $have_valgrind_h = no \
+ && test $have_memcheck_h = no \
+ && test $have_valgrind_memcheck_h = no); then
+ AC_MSG_ERROR([*** valgrind checking requested, but
+*** Can't find valgrind/memcheck.h, memcheck.h or valgrind.h])
+ fi
+ fi
+])