public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] libgcov: Fix build on Darwin [PR99406]
@ 2021-03-05 14:00 Jakub Jelinek
  2021-03-05 16:19 ` Iain Sandoe
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Jelinek @ 2021-03-05 14:00 UTC (permalink / raw)
  To: Jan Hubicka, Martin Liška, Nathan Sidwell; +Cc: gcc-patches

Hi!

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.
Build tested on x86_64-linux, ok for trunk?

2021-03-05  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.

--- libgcc/libgcov.h.jj	2021-03-04 19:36:52.931789790 +0100
+++ libgcc/libgcov.h	2021-03-05 14:41:18.912291100 +0100
@@ -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

	Jakub


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-06 14:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05 14:00 [PATCH] libgcov: Fix build on Darwin [PR99406] Jakub Jelinek
2021-03-05 16:19 ` Iain Sandoe
2021-03-05 20:41   ` Jakub Jelinek
2021-03-06 14:43     ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).