Use correct data types in syscall layer. NFC#27108
Conversation
Split out from emscripten-core#19559.
This is an automatic change generated by tools/maint/gen_sig_info.py.
This is an automatic change generated by tools/maint/rebaseline_tests.py. The following (1) test expectation files were updated by running the tests with `--rebaseline`: ``` codesize/test_codesize_hello_dylink_all.json: 855675 => 855705 [+30 bytes / +0.00%] Average change: +0.00% (+0.00% - +0.00%) ```
| "a.out.js": 268089, | ||
| "a.out.nodebug.wasm": 587586, | ||
| "total": 855675, | ||
| "a.out.nodebug.wasm": 587616, |
There was a problem hiding this comment.
Do you know why that wasm gets bigger here? aren't these types all the same size as before?
There was a problem hiding this comment.
I'm not sure why this gets bigger. Perhaps due to the same thing as noticed in https://github.com/emscripten-core/emscripten/pull/26482/changes#r2966436130?
Note that test_codesize_hello_dylink_all.json has a rather low signal-to-noise ratio. 😅
There was a problem hiding this comment.
Ah, the $wait and $waitpid symbols are now included as well, but I'm not sure whether that accounts for +30 bytes.
| UNIMPLEMENTED(sendmmsg, (int sockfd, intptr_t msgvec, unsigned int vlen, unsigned int flags, ...)) | ||
| UNIMPLEMENTED(shutdown, (int sockfd, int how, int dummy, int dummy2, int dummy3, int dummy4)) | ||
| UNIMPLEMENTED(socketpair, (int domain, int type, int protocol, intptr_t fds, int dummy, int dummy2)) | ||
| UNIMPLEMENTED(wait4,(int pid, intptr_t wstatus, int options, int rusage)) |
There was a problem hiding this comment.
The UNIMPLEMENTED marco currently always returns an int, but the wait4 syscall requires a return type of pid_t.
| __syscall_chdir__sig: 'ip', | ||
| __syscall_chmod__sig: 'ipi', | ||
| __syscall_connect__sig: 'iippiii', | ||
| __syscall_connect__sig: 'iipiiii', |
There was a problem hiding this comment.
How did these syscalls work under wasm64 before if the type of arg 3 was not p?
There was a problem hiding this comment.
Oh wait.. I see socklet_t is acually smaller than size_t.. that is good. One less pointer conversion.
| __syscall_openat__sig: 'iipip', | ||
| __syscall_pipe2__sig: 'ipi', | ||
| __syscall_poll__sig: 'ipii', | ||
| __syscall_poll__sig: 'ippi', |
There was a problem hiding this comment.
Maybe we should define nfds_t to int instead of long to avoid this extra p conversion here?
There was a problem hiding this comment.
Good idea. That would match with llvm-libc as well. See e.g.:
versus:
There was a problem hiding this comment.
... this likely also needs to be updated to include || SANITIZER_EMSCRIPTEN.
Split out from #19559.