diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2021-04-29 14:03:09 +0200 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2021-04-29 16:02:17 +0200 |
commit | 9ec469f504f4bc4c3cdfa4a3f9e164c26e4881af (patch) | |
tree | 97e4d0e08706a85c153da52ec785c7c1fb7523e0 /gcc/configure.ac | |
parent | d03ca8a6148f55e119b8220a9c65147173b32065 (diff) | |
download | gcc-9ec469f504f4bc4c3cdfa4a3f9e164c26e4881af.zip gcc-9ec469f504f4bc4c3cdfa4a3f9e164c26e4881af.tar.gz gcc-9ec469f504f4bc4c3cdfa4a3f9e164c26e4881af.tar.bz2 |
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 <sys/locking.h> if HAVE_SYS_LOCKING_H.
Diffstat (limited to 'gcc/configure.ac')
-rw-r--r-- | gcc/configure.ac | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/configure.ac b/gcc/configure.ac index 22305e3..e9ba2af 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1257,7 +1257,7 @@ AC_HEADER_SYS_WAIT AC_HEADER_TIOCGWINSZ AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h iconv.h \ fcntl.h ftw.h unistd.h sys/file.h sys/time.h sys/mman.h \ - sys/resource.h sys/param.h sys/times.h sys/stat.h \ + sys/resource.h sys/param.h sys/times.h sys/stat.h sys/locking.h \ direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h) # Check for thread headers. @@ -1711,6 +1711,19 @@ if test $ac_cv_af_inet6 = yes; then [Define if AF_INET6 supported.]) fi +# Check if _LK_LOCK is supported by _locking +AC_CACHE_CHECK(for _LK_LOCK, ac_cv_lk_lock, [ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include <io.h> +#include <sys/locking.h>]], [[ + int fd; + return _locking (fd, _LK_LOCK, 0);]])], +[ac_cv_lk_lock=yes],[ac_cv_lk_lock=no])]) +if test $ac_cv_lk_lock = yes; then + AC_DEFINE(HOST_HAS_LK_LOCK, 1, + [Define if _LK_LOC supported by _locking.]) +fi + # Restore CFLAGS, CXXFLAGS from before the gcc_AC_NEED_DECLARATIONS tests. CFLAGS="$saved_CFLAGS" CXXFLAGS="$saved_CXXFLAGS" |