aboutsummaryrefslogtreecommitdiff
path: root/libgcc/libgcov.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2021-03-06 16:22:27 +0100
committerJakub Jelinek <jakub@redhat.com>2021-03-06 16:22:27 +0100
commit73a9216b8a47889234c94e3aaec193391ee6604d (patch)
treef6e8adbde15e21a0e99e723edc13a787335798a8 /libgcc/libgcov.h
parent84185598dc7470bad4e7f8c22b64e3c944efb670 (diff)
downloadgcc-73a9216b8a47889234c94e3aaec193391ee6604d.zip
gcc-73a9216b8a47889234c94e3aaec193391ee6604d.tar.gz
gcc-73a9216b8a47889234c94e3aaec193391ee6604d.tar.bz2
libgcov: Fix build on Darwin [PR99406]
As reported, bootstrap currently fails on older Darwin because MAP_ANONYMOUS is not defined. The following is what gcc/system.h does, so I think it should work for libgcov. 2021-03-06 Jakub Jelinek <jakub@redhat.com> PR gcov-profile/99406 * libgcov.h (MAP_FAILED, MAP_ANONYMOUS): If HAVE_SYS_MMAN_H is defined, define these macros if not defined already.
Diffstat (limited to 'libgcc/libgcov.h')
-rw-r--r--libgcc/libgcov.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h
index 2780cc0..7b0d367 100644
--- a/libgcc/libgcov.h
+++ b/libgcc/libgcov.h
@@ -172,6 +172,16 @@ extern struct gcov_info *gcov_list;
#define ATTRIBUTE_HIDDEN
#endif
+#if HAVE_SYS_MMAN_H
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+
+#if !defined (MAP_ANONYMOUS) && defined (MAP_ANON)
+#define MAP_ANONYMOUS MAP_ANON
+#endif
+#endif
+
#include "gcov-io.h"
/* Structures embedded in coveraged program. The structures generated