Update musl to v1.2.6#26860
Conversation
This is an automatic change generated with: ``` ./system/lib/update_musl.py ~/Downloads/musl-1.2.5 ```
In preparation for the next commit.
This is an automatic change generated with: ``` ./system/lib/update_musl.py ~/Downloads/musl-1.2.6 ```
This reverts commit 8afc084.
Done via: ``` ./tools/gen_struct_info.py ./tools/gen_struct_info.py --wasm64 ```
Details: ``` wasm-ld: error: --shared-memory is disallowed by exit.o because it was not compiled with 'atomics' or 'bulk-memory' features. ```
This is an automatic change generated by tools/maint/rebaseline_tests.py. The following (25) test expectation files were updated by running the tests with `--rebaseline`: ``` codesize/test_codesize_cxx_ctors1.json: 151887 => 151940 [+53 bytes / +0.03%] codesize/test_codesize_cxx_ctors2.json: 151292 => 151346 [+54 bytes / +0.04%] codesize/test_codesize_cxx_except.json: 195766 => 195851 [+85 bytes / +0.04%] codesize/test_codesize_cxx_except_wasm.json: 167018 => 167109 [+91 bytes / +0.05%] codesize/test_codesize_cxx_except_wasm_legacy.json: 164898 => 164989 [+91 bytes / +0.06%] codesize/test_codesize_cxx_lto.json: 120587 => 120608 [+21 bytes / +0.02%] codesize/test_codesize_cxx_mangle.json: 262245 => 262330 [+85 bytes / +0.03%] codesize/test_codesize_cxx_noexcept.json: 153917 => 153956 [+39 bytes / +0.03%] codesize/test_codesize_cxx_wasmfs.json: 179773 => 179812 [+39 bytes / +0.02%] codesize/test_codesize_file_preload.json: 23855 => 23873 [+18 bytes / +0.08%] codesize/test_codesize_hello_O0.json: 39070 => 39335 [+265 bytes / +0.68%] codesize/test_codesize_hello_O1.json: 8875 => 8889 [+14 bytes / +0.16%] codesize/test_codesize_hello_O2.json: 6221 => 6235 [+14 bytes / +0.23%] codesize/test_codesize_hello_O3.json: 5913 => 5931 [+18 bytes / +0.30%] codesize/test_codesize_hello_Os.json: 5903 => 5919 [+16 bytes / +0.27%] codesize/test_codesize_hello_Oz.json: 5072 => 5088 [+16 bytes / +0.32%] codesize/test_codesize_hello_dylink.json: 43922 => 44112 [+190 bytes / +0.43%] codesize/test_codesize_hello_dylink_all.json: 822610 => 822562 [-48 bytes / -0.01%] codesize/test_codesize_hello_single_file.json: 5223 => 5241 [+18 bytes / +0.34%] codesize/test_codesize_hello_wasmfs.json: 5913 => 5931 [+18 bytes / +0.30%] codesize/test_codesize_minimal_pthreads.json: 26370 => 26347 [-23 bytes / -0.09%] codesize/test_codesize_minimal_pthreads_memgrowth.json: 26774 => 26751 [-23 bytes / -0.09%] codesize/test_minimal_runtime_code_size_random_printf_wasm.json: 10815 => 11057 [+242 bytes / +2.24%] codesize/test_minimal_runtime_code_size_random_printf_wasm2js.json: 17114 => 17417 [+303 bytes / +1.77%] codesize/test_unoptimized_code_size.json: 180144 => 180893 [+749 bytes / +0.42%] Average change: +0.31% (-0.09% - +2.24%) ```
|
Were you able to follow up process for updating musl in https://github.com/emscripten-core/emscripten/blob/main/docs/process.md#updating-musl? I would expect to see some updates to https://github.com/emscripten-core/musl before the emscripten side change. |
|
I skipped https://github.com/emscripten-core/musl because maintaining the code in two separate places feels unconventional (and I don't have contributor access there anyway). Instead, I followed a workflow similar to the one used when updating mimalloc:
|
|
If you think the instructions in https://github.com/emscripten-core/emscripten/blob/main/docs/process.md#updating-musl are too complex then perhaps we should update them? I find it kind of convenient to be able to see the emscripten changes as a git diff, and it means we can follow the same pattern for llvm and musl. Another option, if we are look into changing things up is what wasi-libc recently did suing But for this update would you mind updating the emscripten/musl fork? Even if we end up landing this PR, I'd still like the result reflected there.. unless we want to deprecate that repo. |
Sure, I'll look into this tomorrow (as I'm in UTC+2). |
|
See companion PR emscripten-core/musl#3 for a diff that includes only the musl-specific changes. |
| typedef jmp_buf sigjmp_buf; | ||
| /* XXX EMSCRIPTEN: No signals support, alias sigsetjmp and siglongjmp to their non-signals counterparts. */ | ||
| #if __EMSCRIPTEN__ && !defined(LLVM_LIBC) | ||
| #if defined(__EMSCRIPTEN__) && !defined(LLVM_LIBC) |
There was a problem hiding this comment.
Would you mind splitting out a PR for all the places where we should have done ifdef rather then if like this?
| #ifdef __EMSCRIPTEN__ | ||
| #define _POSIX_SPAWN -1 | ||
| #else | ||
| #define _POSIX_SPAWN _POSIX_VERSION |
There was a problem hiding this comment.
Maybe you can include this kind of refactor in the split-out PR too?
| * that is not fdpic-aware. We can assume normal fixed- | ||
| * displacement ELF loading was performed, but when ldso was | ||
| * run as a command, finding the Ehdr is a heursitic: we | ||
| * run as a command, finding the Ehdr is a heuristic: we |
There was a problem hiding this comment.
Is this a spelling fix from upstream of from you?
There was a problem hiding this comment.
This change is the result of running ./system/lib/push_musl_changes.py
|
I created and Hopefully if we land this first it will make this PR more precise/concise? |
This change was generated by running ./system/lib/push_musl_changes.py.
This change was generated by running ./system/lib/push_musl_changes.py within the Emscripten repo.
This is an automatic change generated by tools/maint/rebaseline_tests.py. The following (23) test expectation files were updated by running the tests with `--rebaseline`: ``` codesize/test_codesize_cxx_ctors1.json: 151949 => 152002 [+53 bytes / +0.03%] codesize/test_codesize_cxx_ctors2.json: 151352 => 151408 [+56 bytes / +0.04%] codesize/test_codesize_cxx_except.json: 195817 => 195902 [+85 bytes / +0.04%] codesize/test_codesize_cxx_except_wasm.json: 167044 => 167135 [+91 bytes / +0.05%] codesize/test_codesize_cxx_except_wasm_legacy.json: 164924 => 165015 [+91 bytes / +0.06%] codesize/test_codesize_cxx_lto.json: 120826 => 120848 [+22 bytes / +0.02%] codesize/test_codesize_cxx_mangle.json: 262296 => 262381 [+85 bytes / +0.03%] codesize/test_codesize_cxx_noexcept.json: 153965 => 154004 [+39 bytes / +0.03%] codesize/test_codesize_cxx_wasmfs.json: 179712 => 179751 [+39 bytes / +0.02%] codesize/test_codesize_file_preload.json: 23872 => 23890 [+18 bytes / +0.08%] codesize/test_codesize_hello_O0.json: 39104 => 39369 [+265 bytes / +0.68%] codesize/test_codesize_hello_O1.json: 8908 => 8922 [+14 bytes / +0.16%] codesize/test_codesize_hello_O2.json: 6242 => 6256 [+14 bytes / +0.22%] codesize/test_codesize_hello_O3.json: 5934 => 5952 [+18 bytes / +0.30%] codesize/test_codesize_hello_Os.json: 5924 => 5940 [+16 bytes / +0.27%] codesize/test_codesize_hello_Oz.json: 5093 => 5109 [+16 bytes / +0.31%] codesize/test_codesize_hello_dylink.json: 44104 => 44294 [+190 bytes / +0.43%] codesize/test_codesize_hello_dylink_all.json: 855794 => 855865 [+71 bytes / +0.01%] codesize/test_codesize_hello_single_file.json: 5244 => 5262 [+18 bytes / +0.34%] codesize/test_codesize_hello_wasmfs.json: 5934 => 5952 [+18 bytes / +0.30%] codesize/test_minimal_runtime_code_size_random_printf_wasm.json: 10815 => 11057 [+242 bytes / +2.24%] codesize/test_minimal_runtime_code_size_random_printf_wasm2js.json: 17114 => 17417 [+303 bytes / +1.77%] codesize/test_unoptimized_code_size.json: 180220 => 180969 [+749 bytes / +0.42%] Average change: +0.34% (+0.01% - +2.24%) ```
PR emscripten-core/musl#7 includes only the Emscripten-specific changes (+ changes that were not synced yet). |
This change was generated by running ./system/lib/push_musl_changes.py within the Emscripten repo.
This change was generated by running ./system/lib/push_musl_changes.py within the Emscripten repo.
|
I'm not sure why |
|
Thats a known flake that started showing up with recent chrome releases. |
This is an automatic change generated by tools/maint/rebaseline_tests.py. The following (5) test expectation files were updated by running the tests with `--rebaseline`: ``` codesize/test_codesize_libcxxabi_message_O3_standalone.json: 3727 => 3817 [+90 bytes / +2.41%] codesize/test_codesize_mem_O3_grow_standalone.json: 9675 => 9768 [+93 bytes / +0.96%] codesize/test_codesize_mem_O3_standalone.json: 9532 => 9625 [+93 bytes / +0.98%] codesize/test_codesize_mem_O3_standalone_narg.json: 8860 => 8949 [+89 bytes / +1.00%] codesize/test_codesize_mem_O3_standalone_narg_flto.json: 7796 => 7880 [+84 bytes / +1.08%] Average change: +1.29% (+0.96% - +2.41%) ```
| #define PTRDIFF_MIN INT64_MIN | ||
| #define PTRDIFF_MAX INT64_MAX | ||
| #define SIZE_MAX UINT64_MAX | ||
| #endif |
There was a problem hiding this comment.
I modified stdint.h to not depend on bits/stdint.h at all, so maybe we can just skip this file? (i.e. delete it).
See #26689
In preparation for the next commit.
It's no longer needed.
This is an automatic change generated by tools/maint/rebaseline_tests.py. The following (2) test expectation files were updated by running the tests with `--rebaseline`: ``` codesize/test_codesize_hello_dylink_all.json: 855671 => 855742 [+71 bytes / +0.01%] codesize/test_minimal_runtime_code_size_audio_worklet.json: 16226 => 16399 [+173 bytes / +1.07%] Average change: +0.54% (+0.01% - +1.07%) ```
| {{{ makeSetValue('buf', C_STRUCTS.stat.st_mtim.tv_nsec, '(mtime % 1000) * 1000 * 1000', SIZE_TYPE) }}}; | ||
| {{{ makeSetValue('buf', C_STRUCTS.stat.st_ctim.tv_sec, 'Math.floor(ctime / 1000)', 'i64') }}}; | ||
| {{{ makeSetValue('buf', C_STRUCTS.stat.st_ctim.tv_nsec, '(ctime % 1000) * 1000 * 1000', SIZE_TYPE) }}}; | ||
| {{{ makeSetValue('buf', C_STRUCTS.stat.st_ino, 'stat.ino', 'i64') }}}; |
There was a problem hiding this comment.
This looks like just a re-ordering? Revert this file?
There was a problem hiding this comment.
It was re-ordered to match the stat struct, see commit 7378ee6.
There was a problem hiding this comment.
... though I can revert this, I need to resolve the merge conflicts anyway.
There was a problem hiding this comment.
Actually, let's revert this stat struct field reordering. I forgot that changing the layout breaks Rust compatibility, see for example:
https://github.com/rust-lang/libc/blob/0.2.186/src/unix/linux_like/linux/musl/b32/x86/mod.rs#L9-L48
versus:
https://github.com/rust-lang/libc/blob/0.2.186/src/unix/linux_like/emscripten/mod.rs#L217-L240
See also rust-lang/rust#131467, where a similar change caused a significant amount of churn.
There was a problem hiding this comment.
The ordering of assignments in JS doesn't not need to match the ordering in native code necessarily.
I don't really care of we keep the old ordering on the native side but it seems very bad if rust depends on this ..
| mtime: {{{ makeGetValue('statBuf', C_STRUCTS.stat.st_mtim.tv_sec, "i53") }}}, | ||
| ctime: {{{ makeGetValue('statBuf', C_STRUCTS.stat.st_ctim.tv_sec, "i53") }}}, | ||
| ino: {{{ makeGetValue('statBuf', C_STRUCTS.stat.st_ino, "u53") }}} | ||
| ctime: {{{ makeGetValue('statBuf', C_STRUCTS.stat.st_ctim.tv_sec, "i53") }}} |
sbc100
left a comment
There was a problem hiding this comment.
Thanks for working on this!
| "a.out.nodebug.wasm": 102186, | ||
| "a.out.nodebug.wasm.gz": 39572, | ||
| "total": 120848, | ||
| "total_gz": 47263, |
There was a problem hiding this comment.
The endless creep of progress :)
This reverts commit 7378ee6.
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: 855738 => 855809 [+71 bytes / +0.01%] Average change: +0.01% (+0.01% - +0.01%) ```
No description provided.