public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug gcov-profile/99406] New: [11 regression] MAP_ANONYMOUS undeclared in libgcov.h
@ 2021-03-05 13:32 ro at gcc dot gnu.org
  2021-03-05 13:33 ` [Bug gcov-profile/99406] " ro at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: ro at gcc dot gnu.org @ 2021-03-05 13:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99406

            Bug ID: 99406
           Summary: [11 regression] MAP_ANONYMOUS undeclared in libgcov.h
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: gcov-profile
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
                CC: iains at gcc dot gnu.org, marxin at gcc dot gnu.org
  Target Milestone: ---
            Target: *-apple-darwin11

The unconditional use of MAP_ANONYMOUS in libgcov.h broke Mac OS X 10.7/Darwin
11
bootstrap:

In file included from /vol/gcc/src/hg/master/darwin/libgcc/libgcov-merge.c:26:
/vol/gcc/src/hg/master/darwin/libgcc/libgcov.h: In function 'malloc_mmap':
In file included from /vol/gcc/src/hg/master/darwin/libgcc/libgcov-merge.c:26:
/vol/gcc/src/hg/master/darwin/libgcc/libgcov.h: In function 'malloc_mmap':
/vol/gcc/src/hg/master/darwin/libgcc/libgcov.h:420:30: error: 'MAP_ANONYMOUS'
undeclared (first use in this function); did you mean 'MAP_ANON'?
  420 |                MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
      |                              ^~~~~~~~~~~~~
      |                              MAP_ANON
/vol/gcc/src/hg/master/darwin/libgcc/libgcov.h:420:30: note: each undeclared
identifier is reported only once for each function it appears in

I haven't checked which macOS version introduced MAP_ANONYMOUS as alias for
MAP_ANON, but macOS 11/Darwin 20 has it.

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

* [Bug gcov-profile/99406] [11 regression] MAP_ANONYMOUS undeclared in libgcov.h
  2021-03-05 13:32 [Bug gcov-profile/99406] New: [11 regression] MAP_ANONYMOUS undeclared in libgcov.h ro at gcc dot gnu.org
@ 2021-03-05 13:33 ` ro at gcc dot gnu.org
  2021-03-05 13:37 ` iains at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ro at gcc dot gnu.org @ 2021-03-05 13:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99406

Rainer Orth <ro at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0

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

* [Bug gcov-profile/99406] [11 regression] MAP_ANONYMOUS undeclared in libgcov.h
  2021-03-05 13:32 [Bug gcov-profile/99406] New: [11 regression] MAP_ANONYMOUS undeclared in libgcov.h ro at gcc dot gnu.org
  2021-03-05 13:33 ` [Bug gcov-profile/99406] " ro at gcc dot gnu.org
@ 2021-03-05 13:37 ` iains at gcc dot gnu.org
  2021-03-05 13:39 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: iains at gcc dot gnu.org @ 2021-03-05 13:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99406

--- Comment #1 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Rainer Orth from comment #0)
> The unconditional use of MAP_ANONYMOUS in libgcov.h broke Mac OS X
> 10.7/Darwin 11
> bootstrap:
> 
> In file included from
> /vol/gcc/src/hg/master/darwin/libgcc/libgcov-merge.c:26:
> /vol/gcc/src/hg/master/darwin/libgcc/libgcov.h: In function 'malloc_mmap':
> In file included from
> /vol/gcc/src/hg/master/darwin/libgcc/libgcov-merge.c:26:
> /vol/gcc/src/hg/master/darwin/libgcc/libgcov.h: In function 'malloc_mmap':
> /vol/gcc/src/hg/master/darwin/libgcc/libgcov.h:420:30: error:
> 'MAP_ANONYMOUS' undeclared (first use in this function); did you mean
> 'MAP_ANON'?
>   420 |                MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
>       |                              ^~~~~~~~~~~~~
>       |                              MAP_ANON
> /vol/gcc/src/hg/master/darwin/libgcc/libgcov.h:420:30: note: each undeclared
> identifier is reported only once for each function it appears in
> 
> I haven't checked which macOS version introduced MAP_ANONYMOUS as alias for
> MAP_ANON, but macOS 11/Darwin 20 has it.

I think from darwin15 / macOS 10.11

/opt/iains/SDKs/darwin15/usr/include/sys/mman.h:#define MAP_ANONYMOUS  
MAP_ANON
/opt/iains/SDKs/darwin16/usr/include/sys/mman.h:#define MAP_ANONYMOUS  
MAP_ANON
/opt/iains/SDKs/darwin17/usr/include/sys/mman.h:#define MAP_ANONYMOUS  
MAP_ANON
/opt/iains/SDKs/darwin18/usr/include/sys/mman.h:#define MAP_ANONYMOUS  
MAP_ANON
/opt/iains/SDKs/darwin19/usr/include/sys/mman.h:#define MAP_ANONYMOUS  
MAP_ANON

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

* [Bug gcov-profile/99406] [11 regression] MAP_ANONYMOUS undeclared in libgcov.h
  2021-03-05 13:32 [Bug gcov-profile/99406] New: [11 regression] MAP_ANONYMOUS undeclared in libgcov.h ro at gcc dot gnu.org
  2021-03-05 13:33 ` [Bug gcov-profile/99406] " ro at gcc dot gnu.org
  2021-03-05 13:37 ` iains at gcc dot gnu.org
@ 2021-03-05 13:39 ` jakub at gcc dot gnu.org
  2021-03-05 13:42 ` marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-03-05 13:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99406

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
gcc/system.h has:
#ifndef MAP_FAILED
# define MAP_FAILED ((void *)-1)
#endif

#if !defined (MAP_ANONYMOUS) && defined (MAP_ANON)
# define MAP_ANONYMOUS MAP_ANON
#endif

so I think libgcov.h needs to do that too.

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

* [Bug gcov-profile/99406] [11 regression] MAP_ANONYMOUS undeclared in libgcov.h
  2021-03-05 13:32 [Bug gcov-profile/99406] New: [11 regression] MAP_ANONYMOUS undeclared in libgcov.h ro at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-03-05 13:39 ` jakub at gcc dot gnu.org
@ 2021-03-05 13:42 ` marxin at gcc dot gnu.org
  2021-03-05 13:43 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-03-05 13:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99406

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |marxin at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-03-05
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #2)
> gcc/system.h has:
> #ifndef MAP_FAILED
> # define MAP_FAILED ((void *)-1)
> #endif
> 
> #if !defined (MAP_ANONYMOUS) && defined (MAP_ANON)
> # define MAP_ANONYMOUS MAP_ANON
> #endif
> 
> so I think libgcov.h needs to do that too.

Yes, mine.

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

* [Bug gcov-profile/99406] [11 regression] MAP_ANONYMOUS undeclared in libgcov.h
  2021-03-05 13:32 [Bug gcov-profile/99406] New: [11 regression] MAP_ANONYMOUS undeclared in libgcov.h ro at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-03-05 13:42 ` marxin at gcc dot gnu.org
@ 2021-03-05 13:43 ` jakub at gcc dot gnu.org
  2021-03-06 15:23 ` cvs-commit at gcc dot gnu.org
  2021-03-06 15:24 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-03-05 13:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99406

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 50309
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50309&action=edit
gcc11-pr99406.patch

Like this.

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

* [Bug gcov-profile/99406] [11 regression] MAP_ANONYMOUS undeclared in libgcov.h
  2021-03-05 13:32 [Bug gcov-profile/99406] New: [11 regression] MAP_ANONYMOUS undeclared in libgcov.h ro at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-03-05 13:43 ` jakub at gcc dot gnu.org
@ 2021-03-06 15:23 ` cvs-commit at gcc dot gnu.org
  2021-03-06 15:24 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-06 15:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99406

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:73a9216b8a47889234c94e3aaec193391ee6604d

commit r11-7543-g73a9216b8a47889234c94e3aaec193391ee6604d
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Sat Mar 6 16:22:27 2021 +0100

    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.

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

* [Bug gcov-profile/99406] [11 regression] MAP_ANONYMOUS undeclared in libgcov.h
  2021-03-05 13:32 [Bug gcov-profile/99406] New: [11 regression] MAP_ANONYMOUS undeclared in libgcov.h ro at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2021-03-06 15:23 ` cvs-commit at gcc dot gnu.org
@ 2021-03-06 15:24 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-03-06 15:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99406

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05 13:32 [Bug gcov-profile/99406] New: [11 regression] MAP_ANONYMOUS undeclared in libgcov.h ro at gcc dot gnu.org
2021-03-05 13:33 ` [Bug gcov-profile/99406] " ro at gcc dot gnu.org
2021-03-05 13:37 ` iains at gcc dot gnu.org
2021-03-05 13:39 ` jakub at gcc dot gnu.org
2021-03-05 13:42 ` marxin at gcc dot gnu.org
2021-03-05 13:43 ` jakub at gcc dot gnu.org
2021-03-06 15:23 ` cvs-commit at gcc dot gnu.org
2021-03-06 15:24 ` jakub at gcc dot gnu.org

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