nodejs / node

Node.js JavaScript runtime ✨🐢🚀✨
https://nodejs.org
Other
107.43k stars 29.52k forks source link

Unable to build Node 12.16.1 with --use-largepages option #31948

Closed emerzon closed 4 years ago

emerzon commented 4 years ago

Hello,

Trying to build Node 12.16.1 with --use-largepages option fails with the error below.

Using GCC 9.2.1 and the following configure line:

./configure --enable-lto --fully-static --use-largepages --without-npm --without-dtrace --with-intl=full-icu --download=all --prefix=/opt/node;

g++ -o /usr/src/node-v12.16.1/out/Release/obj.target/libnode/src/large_pages/node_large_page.o ../src/large_pages/node_large_page.cc '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNODE_ARCH="x64"' '-DNODE_PLATFORM="linux"' '-DNODE_WANT_INTERNALS=1' '-DV8_DEPRECATION_WARNINGS=1' '-DNODE_OPENSSL_SYSTEM_CERT_PATH=""' '-DHAVE_INSPECTOR=1' '-DNODE_REPORT' '-DNODE_ENABLE_LARGE_CODE_PAGES=1' '-DPOSIX' '-DNODE_USE_V8_PLATFORM=1' '-DNODE_HAVE_I18N_SUPPORT=1' '-DHAVE_OPENSSL=1' '-DUCONFIG_NO_SERVICE=1' '-DU_ENABLE_DYLOAD=0' '-DU_STATIC_IMPLEMENTATION=1' '-DU_HAVE_STD_STRING=1' '-DUCONFIG_NO_BREAK_ITERATION=0' '-DHTTP_PARSER_STRICT=0' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_POSIX_C_SOURCE=200112' '-DNGHTTP2_STATICLIB' -I../src -I/usr/src/node-v12.16.1/out/Release/obj/gen -I/usr/src/node-v12.16.1/out/Release/obj/gen/include -I/usr/src/node-v12.16.1/out/Release/obj/gen/src -I../deps/histogram/src -I../deps/uvwasi/include -I../deps/v8/include -I../deps/icu/source/i18n -I../deps/icu/source/common -I../deps/zlib -I../deps/http_parser -I../deps/llhttp/include -I../deps/cares/include -I../deps/uv/include -I../deps/nghttp2/lib/includes -I../deps/brotli/c/include -I../deps/openssl/openssl/include -Wall -Wextra -Wno-unused-parameter -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -flto=4 -fuse-linker-plugin -ffat-lto-objects -fno-rtti -fno-exceptions -std=gnu++1y -MMD -MF /usr/src/node-v12.16.1/out/Release/.deps//usr/src/node-v12.16.1/out/Release/obj.target/libnode/src/large_pages/node_large_page.o.d.raw -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS -O3 -pipe -march=haswell -mtune=haswell -m64 -Wl,-z,max-page-size=0x1000 -fPIC -falign-functions=32 -Wa,-mbranches-within-32B-boundaries -fwhole-program -fno-math-errno -fno-semantic-interposition -fno-trapping-math -fpie -Wl,-pie -fexceptions -fstack-protector-strong -fcf-protection=full -fuse-ld=gold -c ../src/large_pages/node_large_page.cc: In function 'int node::MoveTextRegionToLargePages(const node::text_region&)': ../src/large_pages/node_large_page.cc:336:15: error: expected ';' before 'munmap_on_return' 336 | OnScopeLeave munmap_on_return([nmem, size]() { | ^~~~~ | ; ../src/large_pages/node_large_page.cc:338:3: error: statement cannot resolve address of overloaded function 338 | }); | ^ ../src/large_pages/node_large_page.cc:338:4: error: expected primary-expression before ')' token 338 | }); | ^ make[1]: *** [libnode.target.mk:347: /usr/src/node-v12.16.1/out/Release/obj.target/libnode/src/large_pages/node_large_page.o] Error 1

Version 12.16.0 builds normally. Also, 12.16.1 builds succeeds without using the --use-largepages option.

emerzon commented 4 years ago

Sorry, just realized from the changelog that the fix for this issue didn't made into the release.

emerzon commented 4 years ago

Issue still present on Node 12.16.2

juanarbol commented 4 years ago

May related to https://github.com/nodejs/node/issues/31249

juanarbol commented 4 years ago

@emerzon I could build Node v14.x, well, at least at this commit a87dfd2c6e it works, I'm closing this issue, but feel to re-open if needed. BTW thanks for the report