Skip to content

Commit f496d34

Browse files
committed
Merge branch 'main' into revise-musl-alltypes-h
2 parents ecefbbd + 40782fe commit f496d34

25 files changed

+103
-128
lines changed

ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ See docs/process.md for more on how version tagging works.
2020

2121
4.0.12 (in development)
2222
-----------------------
23+
- The `fsblkcnt_t` and `fsfilcnt_t` types used by `statfs`/`statvfs` were
24+
changed from 32-bit to 64-bit. (#24769)
2325
- Support for `-sTEXT_DECODER=0` was removed, due to widespread support for
2426
`TextDecoder`. The remaining valid values for this setting are `=1`
2527
(conditional use of `TextDecoder` with fallback) and `=2` (unconditional use

src/lib/libsyscall.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ var SyscallsLibrary = {
6666
writeStatFs(buf, stats) {
6767
{{{ makeSetValue('buf', C_STRUCTS.statfs.f_bsize, 'stats.bsize', 'i32') }}};
6868
{{{ makeSetValue('buf', C_STRUCTS.statfs.f_frsize, 'stats.bsize', 'i32') }}};
69-
{{{ makeSetValue('buf', C_STRUCTS.statfs.f_blocks, 'stats.blocks', 'i32') }}};
70-
{{{ makeSetValue('buf', C_STRUCTS.statfs.f_bfree, 'stats.bfree', 'i32') }}};
71-
{{{ makeSetValue('buf', C_STRUCTS.statfs.f_bavail, 'stats.bavail', 'i32') }}};
72-
{{{ makeSetValue('buf', C_STRUCTS.statfs.f_files, 'stats.files', 'i32') }}};
73-
{{{ makeSetValue('buf', C_STRUCTS.statfs.f_ffree, 'stats.ffree', 'i32') }}};
69+
{{{ makeSetValue('buf', C_STRUCTS.statfs.f_blocks, 'stats.blocks', 'i64') }}};
70+
{{{ makeSetValue('buf', C_STRUCTS.statfs.f_bfree, 'stats.bfree', 'i64') }}};
71+
{{{ makeSetValue('buf', C_STRUCTS.statfs.f_bavail, 'stats.bavail', 'i64') }}};
72+
{{{ makeSetValue('buf', C_STRUCTS.statfs.f_files, 'stats.files', 'i64') }}};
73+
{{{ makeSetValue('buf', C_STRUCTS.statfs.f_ffree, 'stats.ffree', 'i64') }}};
7474
{{{ makeSetValue('buf', C_STRUCTS.statfs.f_fsid, 'stats.fsid', 'i32') }}};
7575
{{{ makeSetValue('buf', C_STRUCTS.statfs.f_flags, 'stats.flags', 'i32') }}}; // ST_NOSUID
7676
{{{ makeSetValue('buf', C_STRUCTS.statfs.f_namelen, 'stats.namelen', 'i32') }}};

src/lib/libwebgl.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -663,12 +663,24 @@ for (/**@suppress{duplicate}*/var i = 0; i <= {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
663663
var contextHandle = glCtx.canvas.GLctxObject.handle;
664664
glCtx[f] = function(...args) {
665665
var ret = orig.apply(this, args);
666-
// Some GL functions take a view of the entire linear memory. Replace
667-
// such arguments with the string 'HEAP' to avoid serializing all of
668-
// memory.
669666
for (var i in args) {
670-
if (ArrayBuffer.isView(args[i]) && args[i].byteLength === HEAPU8.byteLength) {
671-
args[i] = 'HEAP';
667+
if (ArrayBuffer.isView(args[i])) {
668+
// Some GL functions take a view of the entire linear memory. Replace
669+
// such arguments with the string 'HEAP' to avoid serializing all of
670+
// memory.
671+
if (args[i].byteLength === HEAPU8.byteLength) {
672+
args[i] = 'HEAP';
673+
continue;
674+
}
675+
// For large arrays just take the first N elements.
676+
const MAX_ARRAY_ELEMS = 30;
677+
if (args[i].length > MAX_ARRAY_ELEMS) {
678+
const notShown = args[i].length - MAX_ARRAY_ELEMS;
679+
args[i] = args[i].subarray(0, MAX_ARRAY_ELEMS);
680+
args[i] = `[${args[i]}, ... <${notShown} more elements not shown>]`;
681+
} else {
682+
args[i] = `[${args[i]}]`;
683+
}
672684
}
673685
}
674686
#if PTHREADS

src/struct_info_generated.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,17 +1699,17 @@
16991699
"st_uid": 12
17001700
},
17011701
"statfs": {
1702-
"__size__": 64,
1703-
"f_bavail": 16,
1704-
"f_bfree": 12,
1702+
"__size__": 88,
1703+
"f_bavail": 24,
1704+
"f_bfree": 16,
17051705
"f_blocks": 8,
17061706
"f_bsize": 4,
1707-
"f_ffree": 24,
1708-
"f_files": 20,
1709-
"f_flags": 44,
1710-
"f_frsize": 40,
1711-
"f_fsid": 28,
1712-
"f_namelen": 36
1707+
"f_ffree": 40,
1708+
"f_files": 32,
1709+
"f_flags": 64,
1710+
"f_frsize": 60,
1711+
"f_fsid": 48,
1712+
"f_namelen": 56
17131713
},
17141714
"termios": {
17151715
"__c_ispeed": 52,

src/struct_info_generated_wasm64.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,17 +1699,17 @@
16991699
"st_uid": 16
17001700
},
17011701
"statfs": {
1702-
"__size__": 104,
1703-
"f_bavail": 24,
1704-
"f_bfree": 20,
1702+
"__size__": 120,
1703+
"f_bavail": 32,
1704+
"f_bfree": 24,
17051705
"f_blocks": 16,
17061706
"f_bsize": 8,
1707-
"f_ffree": 32,
1708-
"f_files": 28,
1709-
"f_flags": 64,
1710-
"f_frsize": 56,
1711-
"f_fsid": 36,
1712-
"f_namelen": 48
1707+
"f_ffree": 48,
1708+
"f_files": 40,
1709+
"f_flags": 80,
1710+
"f_frsize": 72,
1711+
"f_fsid": 56,
1712+
"f_namelen": 64
17131713
},
17141714
"termios": {
17151715
"__c_ispeed": 52,

system/lib/llvm-libc/readme.txt

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,21 @@ llvm's libc
33

44
These files are from llvm-project's HEAD.
55

6-
We maintain a local fork of llvm-project that contains any emscripten
7-
specific patches:
8-
9-
https://github.com/emscripten-core/llvm-project
10-
11-
The current patch is based on the emscripten-libs-20 branch.
12-
13-
Currently in producgtion, we do not use LLVM's libc directly yet, but libcxx uses a subset
14-
of headers from libc. So libcxx directly depends on the following directories:
6+
Currently in production, we do not use LLVM's libc directly yet, but libcxx uses
7+
a subset of headers from libc. So libcxx directly depends on the following
8+
directories:
159
- libc/hdr
1610
- libc/include/llvm-libc-macros
1711
- libc/include/llvm-libc-types
1812
- libc/shared
1913
- libc/src/__support
2014

21-
In addition, we are experimenting with using llvm-libc in overlay mode. You can enable this
22-
by running with `EMCC_CFLAGS=-lllvmlibc`. See https://libc.llvm.org/overlay_mode.html for more
23-
details.
15+
In addition, we are experimenting with using llvm-libc in overlay mode. You can
16+
enable this by running with `EMCC_CFLAGS=-lllvmlibc`. See
17+
https://libc.llvm.org/overlay_mode.html for more details.
2418

2519
Update Instructions
2620
-------------------
2721

2822
Run `system/lib/update_libcxx.py path/to/llvm-project`
2923
Run `system/lib/update_llvm_libc.py path/to/llvm-project`
30-
31-
Modifications
32-
-------------
33-
34-
For a list of changes from upstream see the libc files that are part of:
35-
36-
https://github.com/llvm/llvm-project/compare/llvmorg-20.1.4...emscripten-core:emscripten-libs-20

test/code_size/test_codesize_files_wasmfs.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"a.out.js": 5598,
33
"a.out.js.gz": 2597,
4-
"a.out.nodebug.wasm": 50314,
5-
"a.out.nodebug.wasm.gz": 18114,
6-
"total": 55912,
7-
"total_gz": 20711,
4+
"a.out.nodebug.wasm": 50233,
5+
"a.out.nodebug.wasm.gz": 18074,
6+
"total": 55831,
7+
"total_gz": 20671,
88
"sent": [
99
"a (emscripten_date_now)",
1010
"b (emscripten_err)",

test/code_size/test_codesize_hello_O3.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"a.out.js": 4360,
33
"a.out.js.gz": 2110,
4-
"a.out.nodebug.wasm": 1735,
5-
"a.out.nodebug.wasm.gz": 982,
6-
"total": 6095,
7-
"total_gz": 3092,
4+
"a.out.nodebug.wasm": 1733,
5+
"a.out.nodebug.wasm.gz": 980,
6+
"total": 6093,
7+
"total_gz": 3090,
88
"sent": [
99
"a (fd_write)"
1010
],

test/code_size/test_codesize_hello_Os.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"a.out.js": 4360,
33
"a.out.js.gz": 2110,
4-
"a.out.nodebug.wasm": 1725,
5-
"a.out.nodebug.wasm.gz": 987,
6-
"total": 6085,
7-
"total_gz": 3097,
4+
"a.out.nodebug.wasm": 1723,
5+
"a.out.nodebug.wasm.gz": 985,
6+
"total": 6083,
7+
"total_gz": 3095,
88
"sent": [
99
"a (fd_write)"
1010
],

test/code_size/test_codesize_hello_Oz.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"a.out.js": 3980,
33
"a.out.js.gz": 1912,
4-
"a.out.nodebug.wasm": 1259,
4+
"a.out.nodebug.wasm": 1257,
55
"a.out.nodebug.wasm.gz": 763,
6-
"total": 5239,
6+
"total": 5237,
77
"total_gz": 2675,
88
"sent": [
99
"a (fd_write)"

0 commit comments

Comments
 (0)