| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
This breaks on Ubuntu 18.04.
Sorry, something went wrong.
|
The file given needs to be the object file, not the static library. |
Sorry, something went wrong.
|
... and it needs to be the first file given to the linker. |
Sorry, something went wrong.
|
I mean, if you build with this change, it fails to find the mapping for large pages – probably because the value of __node_text_start is 0x0000000000000000, because the symbol is not linked in. That's why the object file needs to be passed to the linker directly, not via the static library. |
Sorry, something went wrong.
|
Is there a gyp variable holding the directory where object files are placed? |
Sorry, something went wrong.
<obj_dir>, but the location of the object files under that appear different when using ninja vs. make. Lines 88 to 94 in 3d894d0 |
Sorry, something went wrong.
|
@richardlau oh, so ninja doesn't do src/large_pages/node_text_start.o, meaning that it's the same as the path to the source file, but with .o? |
Sorry, something went wrong.
|
@richardlau we should then be able to use a condition like the one above to switch between the two paths, right? |
Sorry, something went wrong.
I'm testing that right now. |
Sorry, something went wrong.
|
@richardlau can you also manually run node --use-largepages=on? It should not output failed to find text region. |
Sorry, something went wrong.
|
The test that runs node --use-largepages=on cannot be made to expect quiet on stderr, because mapping is fairly platform-dependent, and failure to map must not be fatal to the execution. Thus, the test only tests that Node.js successfully runs with the flag, not that it successfully maps with the flag. |
Sorry, something went wrong.
I don't think my Linux environment has support for large pages (it prints Large pages are not enabled.). |
Sorry, something went wrong.
echo madvise > /sys/kernel/mm/transparent_hugepage/enabled |
Sorry, something went wrong.
@gabrielschulhof It's a shared development server so I almost certainly don't have permissions to do that. |
Sorry, something went wrong.
|
@richardlau OK, no problem. I can test on my machine when you push to this PR. |
Sorry, something went wrong.
|
@richardlau another good check is to examine the g++ -o /home/nix/node/node/out/Release/node -pthread -rdynamic -m64 -Wl,--whole-archive... line at the end of the build to make sure that node_text_start.o is the first file listed. |
Sorry, something went wrong.
|
FTR with Ninja it looks like the object file is written to <(obj_dir)/src/large_pages/node_text_start.node_text_start.o. with make: g++ -o /home/users/riclau/sandbox/github/nodejs/out/Release/node -pthread -rdynamic -m64 -Wl,--whole-archive /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/libnode.a /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/tools/v8_gypfiles/libv8_base_without_compiler.a -Wl,--no-whole-archive /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/node_text_start/src/large_pages/node_text_start.o -Wl,--whole-archive /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/deps/zlib/libzlib.a -Wl,--no-whole-archive -Wl,--whole-archive /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/deps/uv/libuv.a -Wl,--no-whole-archive -Wl,-z,noexecstack -Wl,--whole-archive /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/tools/v8_gypfiles/libv8_snapshot.a -Wl,--no-whole-archive -Wl,-z,relro -Wl,-z,now -Wl,--whole-archive,/home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/deps/openssl/libopenssl.a -Wl,--no-whole-archive -pthread -Wl,--start-group /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/node/src/node_main.o /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/node/gen/node_code_cache.o /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/node/gen/node_snapshot.o /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/deps/histogram/libhistogram.a /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/deps/uvwasi/libuvwasi.a /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/libnode.a /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/libnode_text_start.a /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/tools/v8_gypfiles/libv8_libplatform.a /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/tools/icu/libicui18n.a /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/deps/zlib/libzlib.a /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/deps/llhttp/libllhttp.a /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/deps/cares/libcares.a /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/deps/uv/libuv.a /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/deps/nghttp2/libnghttp2.a /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/deps/brotli/libbrotli.a /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/deps/openssl/libopenssl.a /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/tools/v8_gypfiles/libv8_base_without_compiler.a /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/tools/icu/libicuucx.a /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/tools/icu/libicudata.a /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/tools/v8_gypfiles/libv8_libbase.a /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/tools/v8_gypfiles/libv8_libsampler.a /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/tools/v8_gypfiles/libv8_compiler.a /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/tools/v8_gypfiles/libv8_snapshot.a /home/users/riclau/sandbox/github/nodejs/out/Release/obj.target/tools/v8_gypfiles/libv8_initializers.a -lm -ldl -Wl,--end-group and with ninja: [60/60] c++ -pthread -rdynamic -m64 -Wl,--whole-archive obj/libnode.a obj/tools/v8_gypfiles/libv8_base_without_compiler.a -Wl,--no-whole-archive obj/src/large_pages/node_text_start.node_text_start.o -Wl,--whole-archive obj/deps/zlib/libzlib.a -Wl,--no-whole-archive -Wl,--whole-archive obj/deps/uv/libuv.a -Wl,--no-whole-archive -Wl,-z,noexecstack -Wl,--whole-archive obj/tools/v8_gypfiles/libv8_snapshot.a -Wl,--no-whole-archive -Wl,-z,relro -Wl,-z,now -Wl,--whole-archive,obj/deps/openssl/libopenssl.a -Wl,--no-whole-archive -pthread -o node -Wl,--start-group obj/gen/node.node_code_cache.o obj/gen/node.node_snapshot.o obj/src/node.node_main.o obj/deps/histogram/libhistogram.a obj/deps/uvwasi/libuvwasi.a obj/libnode.a obj/libnode_text_start.a obj/tools/v8_gypfiles/libv8_libplatform.a obj/tools/icu/libicui18n.a obj/deps/zlib/libzlib.a obj/deps/llhttp/libllhttp.a obj/deps/cares/libcares.a obj/deps/uv/libuv.a obj/deps/nghttp2/libnghttp2.a obj/deps/brotli/libbrotli.a obj/deps/openssl/libopenssl.a obj/tools/v8_gypfiles/libv8_base_without_compiler.a obj/tools/icu/libicuucx.a obj/tools/icu/libicudata.a obj/tools/v8_gypfiles/libv8_libbase.a obj/tools/v8_gypfiles/libv8_libsampler.a obj/tools/v8_gypfiles/libv8_compiler.a obj/tools/v8_gypfiles/libv8_snapshot.a obj/tools/v8_gypfiles/libv8_initializers.a -lm -ldl -Wl,--end-group |
Sorry, something went wrong.
|
@richardlau argh! This works, but the command line changes: g++ -o /home/gschulho/node/out/Release/node -pthread -rdynamic -m64 -Wl,--whole-archive /home/gschulho/node/out/Release/obj.target/libnode.a /home/gschulho/node/out/Release/obj.target/tools/v8_gypfiles/libv8_base_without_compiler.a -Wl,--no-whole-archive /home/gschulho/node/out/Release/obj.target/node_text_start/src/large_pages/node_text_start.o so the textobject file gets placed after libnode.a and libv8_base_without_compiler.a and so the usefulness of the symbol is greatly diminished because it comes a lot later in the game. I don't understand why the switch to a condition has such a terrible effect. I would like to test putting the condition in the variables section so that we can add the ldflags+ unconditionally. Maybe that'll please The GYP King™ 🤷 |
Sorry, something went wrong.
|
Pushed one more minor change – to remove the trailing comma, thereby removing a superfluous diff. |
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
should this be fast-tracked? |
Sorry, something went wrong.
|
@MylesBorins I guess it does break the GitHub action, so it's probably a good idea. |
Sorry, something went wrong.
The ninja build places objects in a different directory. Co-authored-by: Gabriel Schulhof <gabriel.schulhof@intel.com> Signed-off-by: Richard Lau <riclau@uk.ibm.com> PR-URL: nodejs#32071 Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
The ninja build places objects in a different directory. Co-authored-by: Gabriel Schulhof <gabriel.schulhof@intel.com> Signed-off-by: Richard Lau <riclau@uk.ibm.com> PR-URL: #32071 Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
The ninja build places objects in a different directory. Co-authored-by: Gabriel Schulhof <gabriel.schulhof@intel.com> Signed-off-by: Richard Lau <riclau@uk.ibm.com> PR-URL: nodejs#32071 Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
The ninja build places objects in a different directory. Co-authored-by: Gabriel Schulhof <gabriel.schulhof@intel.com> Signed-off-by: Richard Lau <riclau@uk.ibm.com> PR-URL: nodejs#32071 Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
The ninja build places objects in a different directory. Co-authored-by: Gabriel Schulhof <gabriel.schulhof@intel.com> Signed-off-by: Richard Lau <riclau@uk.ibm.com> Backport-PR-URL: nodejs#32092 PR-URL: nodejs#32071 Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
The ninja build places objects in a different directory. Co-authored-by: Gabriel Schulhof <gabriel.schulhof@intel.com> Signed-off-by: Richard Lau <riclau@uk.ibm.com> Backport-PR-URL: #32092 PR-URL: #32071 Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
| Back | FazBrowse Home | New Git URL |
The ninja build places objects in a different directory.
Refs: #31981 (comment)
cc @gabrielschulhof
Checklist