-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMake check_type_size
returns wrong value in Node 18
#17268
Comments
I was looking for source of this problem and found that is related with issue #16913. Node 18 failed to load a wasm file and returned error code 7 that was treated as sizeof value. Works well in |
sbc100
added a commit
that referenced
this issue
Dec 2, 2022
Update the CheckTypeSize files to v3.20.0 (mostly arbitrary version). Local patch to CheckTypeSize is not much smaller. Instead of executing the program and using the return value (doesn't work for return values greater than 255), we simply inject `-oformat=wasm` onto the link command, and then we can use `strings` on the binary just like the upstream check. This is basically a single line patch against upstream now. Fixes: #18278 #18238 #17268 #18084 #17811
sbc100
added a commit
that referenced
this issue
Dec 2, 2022
Update the CheckTypeSize files to v3.10.2 (mostly arbitrary version, but this is what we use in CI). Local patch to CheckTypeSize is not much smaller. Instead of executing the program and using the return value (doesn't work for return values greater than 255), we simply inject `-oformat=wasm` onto the link command, and then we can use `strings` on the binary just like the upstream check. This is basically a single line patch against upstream now. Fixes: #18278 #18238 #17268 #18084 #17811
sbc100
added a commit
that referenced
this issue
Dec 5, 2022
Update the CheckTypeSize files to v3.10.2 (mostly arbitrary version, but this is what we use in CI). Local patch to CheckTypeSize is not much smaller. Instead of executing the program and using the return value (doesn't work for return values greater than 255), we simply inject `-oformat=wasm` onto the link command, and then we can use `strings` on the binary just like the upstream check. This is basically a single line patch against upstream now. Fixes: #18278 #18238 #17268 #18084 #17811
sbc100
added a commit
that referenced
this issue
Dec 5, 2022
Update the CheckTypeSize files to v3.10.2 (mostly arbitrary version, but this is what we use in CI). Local patch to CheckTypeSize is not much smaller. Instead of executing the program and using the return value (doesn't work for return values greater than 255), we simply inject `-oformat=wasm` onto the link command, and then we can use `strings` on the binary just like the upstream check. This is basically a single line patch against upstream now. This change also avoids a second issue which is that node failures (non-zero return codes) are indistinguishable from non-zero return codes from user code. Fixes: #18278 #18238 #17268 #18084 #17811
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cmake command
check_type_size
returns7
for all variable types with using node 18 asCMAKE_CROSSCOMPILING_EMULATOR
, but with node 16 works well.Tested on static binaries of node downloaded from official site:
Node 16.15.1
Node 18.4.0
Testing sources
CMakeLists.txt
test.cpp
test.js
Invalid behaviour (Node.js v18.4.0)
cmake log
Expected behaviour (Node.js v16.15.1)
cmake log
output from test() call
How to reproduce
node_16
andnode_18
)mkdir build_18 && cd build_18
cmake .. -DCMAKE_TOOLCHAIN_FILE=/usr/lib/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=../node_18
mkdir build_16 && cd build_16
cmake .. -DCMAKE_TOOLCHAIN_FILE=/usr/lib/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=../node_16
Versions of used programs
Version of emscripten/emsdk:
Version of cmake: 3.23.2
Version of node: 18.4.0 and 16.15.1
The text was updated successfully, but these errors were encountered: