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

* Re: [PATCH] libgcov: Fix build on Darwin [PR99406]
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Iain Sandoe @ 2021-03-05 16:19 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Jan Hubicka, Martin Liška, Nathan Sidwell, gcc-patches

Jakub Jelinek via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:

> 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?

bootstrap suceeded r11-7524 + this patch on Darwin11.
thanks,
Iain

>
> 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

* Re: [PATCH] libgcov: Fix build on Darwin [PR99406]
  2021-03-05 16:19 ` Iain Sandoe
@ 2021-03-05 20:41   ` Jakub Jelinek
  2021-03-06 14:43     ` Jeff Law
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Jelinek @ 2021-03-05 20:41 UTC (permalink / raw)
  To: Iain Sandoe; +Cc: Jan Hubicka, gcc-patches, Nathan Sidwell

On Fri, Mar 05, 2021 at 04:19:47PM +0000, Iain Sandoe wrote:
> Jakub Jelinek via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> 
> > 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?
> 
> bootstrap suceeded r11-7524 + this patch on Darwin11.

And bootstrap/regtest succeeded on x86_64-linux and i686-linux too.

> > 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.

	Jakub


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

* Re: [PATCH] libgcov: Fix build on Darwin [PR99406]
  2021-03-05 20:41   ` Jakub Jelinek
@ 2021-03-06 14:43     ` Jeff Law
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Law @ 2021-03-06 14:43 UTC (permalink / raw)
  To: Jakub Jelinek, Iain Sandoe; +Cc: Jan Hubicka, gcc-patches, Nathan Sidwell



On 3/5/21 1:41 PM, Jakub Jelinek via Gcc-patches wrote:
> On Fri, Mar 05, 2021 at 04:19:47PM +0000, Iain Sandoe wrote:
>> Jakub Jelinek via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>>
>>> 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?
>> bootstrap suceeded r11-7524 + this patch on Darwin11.
> And bootstrap/regtest succeeded on x86_64-linux and i686-linux too.
>
>>> 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.
OK
jeff


^ 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).