Opened 4 years ago

Last modified 4 years ago

#60106 closed defect

nodejs12, nodejs13: error: use of undeclared identifier 'MAP_ANONYMOUS' — at Version 2

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.

Change History (3)

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
Note: See TracTickets for help on using tickets.