From 9ec469f504f4bc4c3cdfa4a3f9e164c26e4881af Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Thu, 29 Apr 2021 14:03:09 +0200 Subject: Add parallelism support to gcov for MinGW platforms If you attempt a profiled bootstrap on the MinGW platforms with -jN, N > 1, it miserably fails because of profile mismatches all over the place, the reason being that gcov has no support for parallelism on these platforms. libgcc/ * libgcov.h: For the target, define GCOV_LOCKED_WITH_LOCKING if __MSVCRT__ and, for the host, define it if HOST_HAS_LK_LOCK. * libgcov-driver.c: Add directives if GCOV_LOCKED_WITH_LOCKING. gcc/ * configure.ac: Check for the presence of sys/locking.h header and for whether _LK_LOCK is supported by _locking. * configure: Regenerate. * config.in: Likewise. * gcov-io.h: Define GCOV_LOCKED_WITH_LOCKING if HOST_HAS_LK_LOCK. * gcov-io.c (gcov_open): Add support for GCOV_LOCKED_WITH_LOCKING. * system.h: Include if HAVE_SYS_LOCKING_H. --- gcc/system.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/system.h') diff --git a/gcc/system.h b/gcc/system.h index a3f5948..6416c4e 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -360,6 +360,10 @@ extern int errno; # endif #endif +#ifdef HAVE_SYS_LOCKING_H +# include +#endif + #ifndef SEEK_SET # define SEEK_SET 0 # define SEEK_CUR 1 -- cgit v1.1