Opened 4 years ago

Closed 4 years ago

#60106 closed defect (fixed)

nodejs12, nodejs13: error: use of undeclared identifier 'MAP_ANONYMOUS'

Reported by: dubiousjim Owned by: ci42
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: snowleopard lion mountainlion mavericks yosemite haspatch Cc:
Port: nodejs13

Description (last modified by ryandesign (Ryan Carsten Schmidt))

A recent attempt to upgrade from nodejs12 @12.15.0_0 to @12.16.0_0, and an attempt to (build and) install nodejs13 @13.8.0_0 failed with a similar error. The logs for each attempt end with errors about the presence of the macro MAP_ANONYMOUS in src/large_pages/node_large_page.cc. (I've already discarded the log, and am disinclined to wait the several hours it takes to get that far in the failed build.) Apparently this macro is undefined on older OSXs. I'm using Mac 10.10.5.

I searched on that, and found this discussion, which prompted me to create the attached patch and attempt the build again. With the Portfile modified to include that patch, both nodejs12 and nodejs13 were able to build and install.

Attachments (1)

patch-anonymous.diff (544 bytes) - added by dubiousjim 4 years ago.
patch MAP_ANONYMOUS to fallback to MAP_ANON

Download all attachments as: .zip

Change History (5)

Changed 4 years ago by dubiousjim

Attachment: patch-anonymous.diff added

patch MAP_ANONYMOUS to fallback to MAP_ANON

comment:1 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: snowleopard lion mountainlion mavericks yosemite added
Summary: nodejs12/13 fail to build on older OSXnodejs12, nodejs13: error: use of undeclared identifier 'MAP_ANONYMOUS'

Here is a log showing the build failure:

https://build.macports.org/builders/ports-10.7_x86_64-builder/builds/19672/steps/install-port/logs/stdio

../src/large_pages/node_large_page.cc:337:53: error: use of undeclared identifier 'MAP_ANONYMOUS'
              PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
                                                    ^
../src/large_pages/node_large_page.cc:387:29: error: use of undeclared identifier 'MAP_ANONYMOUS'
              MAP_PRIVATE | MAP_ANONYMOUS,
                            ^

If it is not desired to patch the software, the legacysupport portgroup could also be used.

comment:2 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Keywords: haspatch added

comment:3 Changed 4 years ago by dubiousjim

This still seems to be a problem. Had to use the patch to upgrade to nodejs13 @13.13.0.

comment:4 Changed 4 years ago by ken-cunningham-webuse

Resolution: fixed
Status: assignedclosed

In 5cff60c0d9976d0c0dd9e49bd3dfc096e9d6f68a/macports-ports (master):

nodejs12: use legacysupport

for MAP_ANONYMOUS, viz nodejs13,14
closes: #60106

Note: See TracTickets for help on using tickets.