Project

General

Profile

Actions

Bug #18556

closed

error: use of undeclared identifier 'MAP_ANONYMOUS'

Added by ryandesign (Ryan Schmidt) about 2 years ago. Updated about 2 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:107336]

Description

ruby 3.1.0 fails to build on older versions of macOS such as OS X 10.10.5:

gc.c:11141:88: error: use of undeclared identifier 'MAP_ANONYMOUS'
        char *ptr = mmap(NULL, alignment + size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
                                                                                       ^
1 error generated.

MAP_ANONYMOUS used to be called MAP_ANON on older systems; I suggest either using MAP_ANON everywhere you're using MAP_ANONYMOUS, or else add a block like this somewhere central that each of those files uses:

#ifndef MAP_ANONYMOUS
#define MAP_ANONYMOUS MAP_ANON
#endif

or

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

(Such blocks already occur in multiple places under ext/fiddle/libffi-3.2.1 in the ruby 3.1.0 source code.)

Updated by nobu (Nobuyoshi Nakada) about 2 years ago

  • Backport changed from 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN to 2.6: DONTNEED, 2.7: DONTNEED, 3.0: DONTNEED, 3.1: REQUIRED
Actions #2

Updated by jeremyevans0 (Jeremy Evans) about 2 years ago

  • Status changed from Open to Closed

Updated by naruse (Yui NARUSE) about 2 years ago

  • Backport changed from 2.6: DONTNEED, 2.7: DONTNEED, 3.0: DONTNEED, 3.1: REQUIRED to 2.6: DONTNEED, 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONE

ruby_3_1 e54289bb632047b750f9c9371410d1adff2a740a merged revision(s) 67f4729.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0