Skip to content

Commit 348687f

Browse files
authored
WasmFS: Add a no-FS library, to avoid linking in WasmFS only for printf (#19544)
For WasmFS to be shippable as the default we need to only link it in when needed. Otherwise we'd regress vs the old FS, which has the SYSCALLS_REQUIRE_FILESYSTEM optimization. That works by seeing which syscalls are present: if there is no open() and just write() then we have some printf code but no real filesystem usage. Then the JS FS is not included at all in the output, and we just add a minimal printf-supporting shim. That saves a big amount of code size in small programs, and this PR achieves something similar for WasmFS. Rather than the emscripten.py logic for SYSCALLS_REQUIRE_FILESYSTEM, this PR uses library linking. It adds a wasmfs_no_fs library that is linked in right before WasmFS itself. If all we need are the minimal syscalls for printf, then that library ends up linked in instead of all of WasmFS. As shown by test/other/metadce/test_metadce_hello_wasmfs.size, this reduces the size of a hello world wasm size from 44,622 bytes to just 1,778 (which is almost the same as without WasmFS, 1,755). Fixes #19460
1 parent 1b26bf5 commit 348687f

11 files changed

+86
-168
lines changed

embuilder.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
'libfetch',
102102
'libfetch-mt',
103103
'libwasmfs',
104+
'libwasmfs_no_fs',
104105
'giflib',
105106
]
106107

system/lib/wasmfs/no_fs.c

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
//
2+
// "No-FS" implementation for WasmFS. This file implements just enough of the
3+
// syscall API to support printf. In particular, enough for a program that
4+
// only does some file writes, but no open() or such. Then those writes must be
5+
// to the standard streams, and we can implement very simple printing for them
6+
// as opposed to linking in all of WasmFS.
7+
//
8+
// This uses weak linking, and as such it depends on all the normal syscalls
9+
// being implemented in a single file, which is the case (syscalls.cpp). That
10+
// way, if that single other file is included then all these methods get
11+
// overridden. (Otherwise, if we had multiple files, we could end up with a mix
12+
// of this file's functions and others.)
13+
//
14+
15+
#include <emscripten.h>
16+
#include <wasi/api.h>
17+
18+
#include "wasmfs_internal.h"
19+
20+
#define WEAK __attribute__((weak))
21+
22+
// Import the outside (JS or VM) fd_write under a different name. We must
23+
// implement __wasi_fd_write in this file so that all the normal WasmFS code is
24+
// not included - that is the point of no-fs mode - since if we don't implement
25+
// it here then the normal WasmFS code for that function will be linked in. But
26+
// in the cases where this file is linked in, we just want to direct all calls
27+
// to the outside fd_write.
28+
__attribute__((import_module("wasi_snapshot_preview1"),
29+
import_name("fd_write"))) __wasi_errno_t
30+
imported__wasi_fd_write(__wasi_fd_t fd,
31+
const __wasi_ciovec_t* iovs,
32+
size_t iovs_len,
33+
__wasi_size_t* nwritten);
34+
35+
WEAK
36+
__wasi_errno_t __wasi_fd_write(__wasi_fd_t fd,
37+
const __wasi_ciovec_t* iovs,
38+
size_t iovs_len,
39+
__wasi_size_t* nwritten) {
40+
return imported__wasi_fd_write(fd, iovs, iovs_len, nwritten);
41+
}
42+
43+
WEAK
44+
__wasi_errno_t __wasi_fd_close(__wasi_fd_t fd) {
45+
// The only possible file descriptors are the standard streams, and there is
46+
// nothing special to do to close them.
47+
return __WASI_ERRNO_SUCCESS;
48+
}
49+
50+
WEAK
51+
__wasi_errno_t __wasi_fd_fdstat_get(__wasi_fd_t fd, __wasi_fdstat_t* stat) {
52+
// This operation is not supported (but it does appear in system libraries
53+
// even in hello world, even if it isn't actually called, so we do need to
54+
// implement this stub here).
55+
return __WASI_ERRNO_NOSYS;
56+
}

system/lib/wasmfs/wasmfs_internal.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// University of Illinois/NCSA Open Source License. Both these licenses can be
44
// found in the LICENSE file.
55

6+
#ifdef __cplusplus
67
extern "C" {
8+
#endif
79

810
// These helper functions are defined in library_wasmfs.js.
911

@@ -16,4 +18,6 @@ void _wasmfs_get_preloaded_child_path(int index, char* childName);
1618
size_t _wasmfs_get_preloaded_file_size(uint32_t index);
1719
void _wasmfs_copy_preloaded_file_data(uint32_t index, uint8_t* data);
1820

21+
#ifdef __cplusplus
1922
}
23+
#endif
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
q
2-
r
3-
s
4-
t
1+
c
2+
d
3+
e
4+
f
Lines changed: 1 addition & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -1,141 +1,8 @@
1-
$__cxa_pure_virtual
2-
$__cxx_global_array_dtor
3-
$__cxx_global_array_dtor.1
4-
$__cxx_global_array_dtor.2
5-
$__cxx_global_array_dtor.3
6-
$__cxx_global_array_dtor.4
7-
$__cxx_global_array_dtor.5
8-
$__cxx_global_array_dtor.6
9-
$__cxxabiv1::__base_class_type_info::has_unambiguous_public_base\28__cxxabiv1::__dynamic_cast_info*\2c\20void*\2c\20int\29\20const
10-
$__cxxabiv1::__base_class_type_info::search_above_dst\28__cxxabiv1::__dynamic_cast_info*\2c\20void\20const*\2c\20void\20const*\2c\20int\2c\20bool\29\20const
11-
$__cxxabiv1::__base_class_type_info::search_below_dst\28__cxxabiv1::__dynamic_cast_info*\2c\20void\20const*\2c\20int\2c\20bool\29\20const
12-
$__cxxabiv1::__class_type_info::can_catch\28__cxxabiv1::__shim_type_info\20const*\2c\20void*&\29\20const
13-
$__cxxabiv1::__class_type_info::has_unambiguous_public_base\28__cxxabiv1::__dynamic_cast_info*\2c\20void*\2c\20int\29\20const
14-
$__cxxabiv1::__class_type_info::process_found_base_class\28__cxxabiv1::__dynamic_cast_info*\2c\20void*\2c\20int\29\20const
15-
$__cxxabiv1::__class_type_info::process_static_type_above_dst\28__cxxabiv1::__dynamic_cast_info*\2c\20void\20const*\2c\20void\20const*\2c\20int\29\20const
16-
$__cxxabiv1::__class_type_info::search_above_dst\28__cxxabiv1::__dynamic_cast_info*\2c\20void\20const*\2c\20void\20const*\2c\20int\2c\20bool\29\20const
17-
$__cxxabiv1::__class_type_info::search_below_dst\28__cxxabiv1::__dynamic_cast_info*\2c\20void\20const*\2c\20int\2c\20bool\29\20const
18-
$__cxxabiv1::__class_type_info::~__class_type_info\28\29
19-
$__cxxabiv1::__si_class_type_info::has_unambiguous_public_base\28__cxxabiv1::__dynamic_cast_info*\2c\20void*\2c\20int\29\20const
20-
$__cxxabiv1::__si_class_type_info::search_above_dst\28__cxxabiv1::__dynamic_cast_info*\2c\20void\20const*\2c\20void\20const*\2c\20int\2c\20bool\29\20const
21-
$__cxxabiv1::__si_class_type_info::search_below_dst\28__cxxabiv1::__dynamic_cast_info*\2c\20void\20const*\2c\20int\2c\20bool\29\20const
22-
$__cxxabiv1::__vmi_class_type_info::has_unambiguous_public_base\28__cxxabiv1::__dynamic_cast_info*\2c\20void*\2c\20int\29\20const
23-
$__cxxabiv1::__vmi_class_type_info::search_above_dst\28__cxxabiv1::__dynamic_cast_info*\2c\20void\20const*\2c\20void\20const*\2c\20int\2c\20bool\29\20const
24-
$__cxxabiv1::__vmi_class_type_info::search_below_dst\28__cxxabiv1::__dynamic_cast_info*\2c\20void\20const*\2c\20int\2c\20bool\29\20const
1+
$__emscripten_stdout_close
252
$__emscripten_stdout_seek
263
$__fwritex
27-
$__lockfile
28-
$__memcpy
29-
$__memset
30-
$__pthread_mutex_lock
31-
$__stdio_close
32-
$__stdio_seek
334
$__stdio_write
34-
$__time
355
$__towrite
36-
$__unlockfile
376
$__wasi_fd_write
387
$__wasm_call_ctors
39-
$decltype\28auto\29\20std::__2::__variant_detail::__visitation::__base::__dispatcher<1ul>::__dispatch\5babi:v160004\5d<std::__2::__variant_detail::__dtor<std::__2::__variant_detail::__traits<long\2c\20std::__2::shared_ptr<wasmfs::File>>\2c\20\28std::__2::__variant_detail::_Trait\291>::__destroy\5babi:v160004\5d\28\29::'lambda'\28auto&\29&&\2c\20std::__2::__variant_detail::__base<\28std::__2::__variant_detail::_Trait\291\2c\20long\2c\20std::__2::shared_ptr<wasmfs::File>>&>\28auto\2c\20std::__2::__variant_detail::__base<\28std::__2::__variant_detail::_Trait\291\2c\20long\2c\20std::__2::shared_ptr<wasmfs::File>>&\29
40-
$dlfree
41-
$dlmalloc
42-
$dummy
43-
$fflush
44-
$is_equal\28std::type_info\20const*\2c\20std::type_info\20const*\2c\20bool\29
458
$main
46-
$memcmp
47-
$memmove
48-
$operator\20new\28unsigned\20long\29
49-
$pthread_mutex_init
50-
$sbrk
51-
$std::__2::__shared_ptr_emplace<wasmfs::MemoryDataFile\2c\20std::__2::allocator<wasmfs::MemoryDataFile>>::~__shared_ptr_emplace\28\29
52-
$std::__2::__shared_ptr_emplace<wasmfs::MemoryDataFile\2c\20std::__2::allocator<wasmfs::MemoryDataFile>>::~__shared_ptr_emplace\28\29.1
53-
$std::__2::__shared_ptr_emplace<wasmfs::MemoryDirectory\2c\20std::__2::allocator<wasmfs::MemoryDirectory>>::__on_zero_shared\28\29
54-
$std::__2::__shared_ptr_emplace<wasmfs::MemoryDirectory\2c\20std::__2::allocator<wasmfs::MemoryDirectory>>::~__shared_ptr_emplace\28\29
55-
$std::__2::__shared_ptr_emplace<wasmfs::MemoryDirectory\2c\20std::__2::allocator<wasmfs::MemoryDirectory>>::~__shared_ptr_emplace\28\29.1
56-
$std::__2::__shared_ptr_emplace<wasmfs::MemorySymlink\2c\20std::__2::allocator<wasmfs::MemorySymlink>>::__on_zero_shared\28\29
57-
$std::__2::__shared_ptr_emplace<wasmfs::MemorySymlink\2c\20std::__2::allocator<wasmfs::MemorySymlink>>::~__shared_ptr_emplace\28\29
58-
$std::__2::__shared_ptr_emplace<wasmfs::MemorySymlink\2c\20std::__2::allocator<wasmfs::MemorySymlink>>::~__shared_ptr_emplace\28\29.1
59-
$std::__2::__shared_ptr_emplace<wasmfs::OpenFileState\2c\20std::__2::allocator<wasmfs::OpenFileState>>::__on_zero_shared\28\29
60-
$std::__2::__shared_ptr_emplace<wasmfs::OpenFileState\2c\20std::__2::allocator<wasmfs::OpenFileState>>::~__shared_ptr_emplace\28\29
61-
$std::__2::__shared_ptr_emplace<wasmfs::OpenFileState\2c\20std::__2::allocator<wasmfs::OpenFileState>>::~__shared_ptr_emplace\28\29.1
62-
$std::__2::__shared_ptr_emplace<wasmfs::SpecialFiles::\28anonymous\20namespace\29::NullFile\2c\20std::__2::allocator<wasmfs::SpecialFiles::\28anonymous\20namespace\29::NullFile>>::__on_zero_shared\28\29
63-
$std::__2::__shared_ptr_emplace<wasmfs::SpecialFiles::\28anonymous\20namespace\29::NullFile\2c\20std::__2::allocator<wasmfs::SpecialFiles::\28anonymous\20namespace\29::NullFile>>::~__shared_ptr_emplace\28\29
64-
$std::__2::__shared_ptr_emplace<wasmfs::SpecialFiles::\28anonymous\20namespace\29::NullFile\2c\20std::__2::allocator<wasmfs::SpecialFiles::\28anonymous\20namespace\29::NullFile>>::~__shared_ptr_emplace\28\29.1
65-
$std::__2::__shared_ptr_emplace<wasmfs::SpecialFiles::\28anonymous\20namespace\29::RandomFile\2c\20std::__2::allocator<wasmfs::SpecialFiles::\28anonymous\20namespace\29::RandomFile>>::~__shared_ptr_emplace\28\29
66-
$std::__2::__shared_ptr_emplace<wasmfs::SpecialFiles::\28anonymous\20namespace\29::RandomFile\2c\20std::__2::allocator<wasmfs::SpecialFiles::\28anonymous\20namespace\29::RandomFile>>::~__shared_ptr_emplace\28\29.1
67-
$std::__2::__shared_ptr_emplace<wasmfs::SpecialFiles::\28anonymous\20namespace\29::StderrFile\2c\20std::__2::allocator<wasmfs::SpecialFiles::\28anonymous\20namespace\29::StderrFile>>::~__shared_ptr_emplace\28\29
68-
$std::__2::__shared_ptr_emplace<wasmfs::SpecialFiles::\28anonymous\20namespace\29::StderrFile\2c\20std::__2::allocator<wasmfs::SpecialFiles::\28anonymous\20namespace\29::StderrFile>>::~__shared_ptr_emplace\28\29.1
69-
$std::__2::__shared_ptr_emplace<wasmfs::SpecialFiles::\28anonymous\20namespace\29::StdinFile\2c\20std::__2::allocator<wasmfs::SpecialFiles::\28anonymous\20namespace\29::StdinFile>>::~__shared_ptr_emplace\28\29
70-
$std::__2::__shared_ptr_emplace<wasmfs::SpecialFiles::\28anonymous\20namespace\29::StdinFile\2c\20std::__2::allocator<wasmfs::SpecialFiles::\28anonymous\20namespace\29::StdinFile>>::~__shared_ptr_emplace\28\29.1
71-
$std::__2::__shared_ptr_emplace<wasmfs::SpecialFiles::\28anonymous\20namespace\29::StdoutFile\2c\20std::__2::allocator<wasmfs::SpecialFiles::\28anonymous\20namespace\29::StdoutFile>>::~__shared_ptr_emplace\28\29
72-
$std::__2::__shared_ptr_emplace<wasmfs::SpecialFiles::\28anonymous\20namespace\29::StdoutFile\2c\20std::__2::allocator<wasmfs::SpecialFiles::\28anonymous\20namespace\29::StdoutFile>>::~__shared_ptr_emplace\28\29.1
73-
$std::__2::__shared_weak_count::__release_weak\28\29
74-
$std::__2::__shared_weak_count::lock\28\29
75-
$std::__2::__tree<std::__2::__value_type<std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\2c\20wasmfs::Directory::DCacheEntry>\2c\20std::__2::__map_value_compare<std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\2c\20std::__2::__value_type<std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\2c\20wasmfs::Directory::DCacheEntry>\2c\20std::__2::less<std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>>\2c\20true>\2c\20std::__2::allocator<std::__2::__value_type<std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\2c\20wasmfs::Directory::DCacheEntry>>>::destroy\28std::__2::__tree_node<std::__2::__value_type<std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\2c\20wasmfs::Directory::DCacheEntry>\2c\20void*>*\29
76-
$std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>::__begin_lifetime\5babi:v160004\5d\28char*\2c\20unsigned\20long\29
77-
$std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>::__init_copy_ctor_external\28char\20const*\2c\20unsigned\20long\29
78-
$std::__2::shared_ptr<wasmfs::SpecialFiles::\28anonymous\20namespace\29::RandomFile>\20std::__2::make_shared\5babi:v160004\5d<wasmfs::SpecialFiles::\28anonymous\20namespace\29::RandomFile\2c\20void>\28\29
79-
$std::__2::vector<unsigned\20char\2c\20std::__2::allocator<unsigned\20char>>::__append\28unsigned\20long\29
80-
$std::__2::vector<wasmfs::MemoryDirectory::ChildEntry\2c\20std::__2::allocator<wasmfs::MemoryDirectory::ChildEntry>>::erase\5babi:v160004\5d\28std::__2::__wrap_iter<wasmfs::MemoryDirectory::ChildEntry\20const*>\29
81-
$strlen
82-
$void\20std::__2::vector<std::__2::shared_ptr<wasmfs::OpenFileState>\2c\20std::__2::allocator<std::__2::shared_ptr<wasmfs::OpenFileState>>>::__emplace_back_slow_path<>\28\29
83-
$wasmfs::DataFile::Handle::flush\28\29
84-
$wasmfs::DataFile::Handle::write\28unsigned\20char\20const*\2c\20unsigned\20long\2c\20long\20long\29
85-
$wasmfs::Directory::Handle::cacheChild\28std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\20const&\2c\20std::__2::shared_ptr<wasmfs::File>\2c\20wasmfs::Directory::DCacheKind\29
86-
$wasmfs::Directory::Handle::getChild\28std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\20const&\29
87-
$wasmfs::Directory::Handle::insertDirectory\28std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\20const&\2c\20unsigned\20int\29
88-
$wasmfs::Directory::Handle::mountChild\28std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\20const&\2c\20std::__2::shared_ptr<wasmfs::File>\29
89-
$wasmfs::Directory::getName\28std::__2::shared_ptr<wasmfs::File>\29
90-
$wasmfs::Directory::getSize\28\29
91-
$wasmfs::Directory::~Directory\28\29
92-
$wasmfs::File::~File\28\29
93-
$wasmfs::FileTable::Handle::getEntry\28unsigned\20int\29
94-
$wasmfs::MemoryBackend::createDirectory\28unsigned\20int\29
95-
$wasmfs::MemoryBackend::createFile\28unsigned\20int\29
96-
$wasmfs::MemoryBackend::createSymlink\28std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\29
97-
$wasmfs::MemoryDataFile::getSize\28\29
98-
$wasmfs::MemoryDataFile::read\28unsigned\20char*\2c\20unsigned\20long\2c\20long\20long\29
99-
$wasmfs::MemoryDataFile::setSize\28long\20long\29
100-
$wasmfs::MemoryDataFile::write\28unsigned\20char\20const*\2c\20unsigned\20long\2c\20long\20long\29
101-
$wasmfs::MemoryDataFile::~MemoryDataFile\28\29
102-
$wasmfs::MemoryDataFile::~MemoryDataFile\28\29.1
103-
$wasmfs::MemoryDirectory::getChild\28std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\20const&\29
104-
$wasmfs::MemoryDirectory::getEntries\28\29
105-
$wasmfs::MemoryDirectory::getName\28std::__2::shared_ptr<wasmfs::File>\29
106-
$wasmfs::MemoryDirectory::getNumEntries\28\29
107-
$wasmfs::MemoryDirectory::insertChild\28std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\20const&\2c\20std::__2::shared_ptr<wasmfs::File>\29
108-
$wasmfs::MemoryDirectory::insertDataFile\28std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\20const&\2c\20unsigned\20int\29
109-
$wasmfs::MemoryDirectory::insertDirectory\28std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\20const&\2c\20unsigned\20int\29
110-
$wasmfs::MemoryDirectory::insertMove\28std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\20const&\2c\20std::__2::shared_ptr<wasmfs::File>\29
111-
$wasmfs::MemoryDirectory::insertSymlink\28std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\20const&\2c\20std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\20const&\29
112-
$wasmfs::MemoryDirectory::removeChild\28std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\20const&\29
113-
$wasmfs::MemoryDirectory::~MemoryDirectory\28\29
114-
$wasmfs::MemoryDirectory::~MemoryDirectory\28\29.1
115-
$wasmfs::MemorySymlink::getTarget\28\29\20const
116-
$wasmfs::MemorySymlink::~MemorySymlink\28\29
117-
$wasmfs::MemorySymlink::~MemorySymlink\28\29.1
118-
$wasmfs::OpenFileState::create\28std::__2::shared_ptr<wasmfs::File>\2c\20unsigned\20int\2c\20std::__2::shared_ptr<wasmfs::OpenFileState>&\29
119-
$wasmfs::SpecialFiles::\28anonymous\20namespace\29::NullFile::getSize\28\29
120-
$wasmfs::SpecialFiles::\28anonymous\20namespace\29::NullFile::read\28unsigned\20char*\2c\20unsigned\20long\2c\20long\20long\29
121-
$wasmfs::SpecialFiles::\28anonymous\20namespace\29::NullFile::setSize\28long\20long\29
122-
$wasmfs::SpecialFiles::\28anonymous\20namespace\29::NullFile::write\28unsigned\20char\20const*\2c\20unsigned\20long\2c\20long\20long\29
123-
$wasmfs::SpecialFiles::\28anonymous\20namespace\29::NullFile::~NullFile\28\29
124-
$wasmfs::SpecialFiles::\28anonymous\20namespace\29::RandomFile::read\28unsigned\20char*\2c\20unsigned\20long\2c\20long\20long\29
125-
$wasmfs::SpecialFiles::\28anonymous\20namespace\29::StderrFile::write\28unsigned\20char\20const*\2c\20unsigned\20long\2c\20long\20long\29
126-
$wasmfs::SpecialFiles::\28anonymous\20namespace\29::StdinFile::read\28unsigned\20char*\2c\20unsigned\20long\2c\20long\20long\29
127-
$wasmfs::SpecialFiles::\28anonymous\20namespace\29::StdinFile::write\28unsigned\20char\20const*\2c\20unsigned\20long\2c\20long\20long\29
128-
$wasmfs::SpecialFiles::\28anonymous\20namespace\29::StdoutFile::write\28unsigned\20char\20const*\2c\20unsigned\20long\2c\20long\20long\29
129-
$wasmfs::SpecialFiles::\28anonymous\20namespace\29::StdoutFile::~StdoutFile\28\29
130-
$wasmfs::SpecialFiles::\28anonymous\20namespace\29::WritingStdFile::flush\28\29
131-
$wasmfs::SpecialFiles::\28anonymous\20namespace\29::WritingStdFile::writeToJS\28unsigned\20char\20const*\2c\20unsigned\20long\2c\20void\20\28*\29\28char\20const*\29\2c\20std::__2::vector<char\2c\20std::__2::allocator<char>>&\29
132-
$wasmfs::SpecialFiles::\28anonymous\20namespace\29::WritingStdFile::~WritingStdFile\28\29
133-
$wasmfs::SpecialFiles::\28anonymous\20namespace\29::WritingStdFile::~WritingStdFile\28\29.1
134-
$wasmfs::SpecialFiles::getStderr\28\29
135-
$wasmfs::SpecialFiles::getStdin\28\29
136-
$wasmfs::SpecialFiles::getStdout\28\29
137-
$wasmfs::Symlink::getSize\28\29
138-
$wasmfs::path::\28anonymous\20namespace\29::doParseFile\28std::__2::basic_string_view<char\2c\20std::__2::char_traits<char>>\2c\20std::__2::shared_ptr<wasmfs::Directory>\2c\20wasmfs::path::LinkBehavior\2c\20unsigned\20long&\29
139-
$wasmfs::path::\28anonymous\20namespace\29::doParseParent\28std::__2::basic_string_view<char\2c\20std::__2::char_traits<char>>\2c\20std::__2::shared_ptr<wasmfs::Directory>\2c\20unsigned\20long&\29
140-
$wasmfs::path::\28anonymous\20namespace\29::getBaseDir\28unsigned\20int\29
141-
$wasmfs::path::\28anonymous\20namespace\29::getChild\28std::__2::shared_ptr<wasmfs::Directory>\2c\20std::__2::basic_string_view<char\2c\20std::__2::char_traits<char>>\2c\20wasmfs::path::LinkBehavior\2c\20unsigned\20long&\29
Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,2 @@
11
a.a
22
a.b
3-
a.c
4-
a.d
5-
a.e
6-
a.f
7-
a.g
8-
a.h
9-
a.i
10-
a.j
11-
a.k
12-
a.l
13-
a.m
14-
a.n
15-
a.o
16-
a.p
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6940
1+
5770
Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,2 @@
11
a
22
b
3-
c
4-
d
5-
e
6-
f
7-
g
8-
h
9-
i
10-
j
11-
k
12-
l
13-
m
14-
n
15-
o
16-
p
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
44622
1+
1778

test/test_other.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7962,6 +7962,7 @@ def strip_numeric_suffixes(funcname):
79627962
# EVAL_CTORS also removes the __wasm_call_ctors function
79637963
'Oz-ctors': (['-Oz', '-sEVAL_CTORS'], [], []), # noqa
79647964
'64': (['-Oz', '-sMEMORY64', '-Wno-experimental'], [], []), # noqa
7965+
# WasmFS should not be fully linked into a minimal program.
79657966
'wasmfs': (['-Oz', '-sWASMFS'], [], []), # noqa
79667967
})
79677968
def test_metadce_minimal(self, *args):
@@ -8007,6 +8008,7 @@ def test_metadce_cxx(self, *args):
80078008
# TODO(sbc): Investivate why the number of exports is order of magnitude
80088009
# larger for wasm backend.
80098010
'dylink': (['-O3', '-sMAIN_MODULE=2'], [], []), # noqa
8011+
# WasmFS should not be fully linked into a hello world program.
80108012
'wasmfs': (['-O3', '-sWASMFS'], [], []), # noqa
80118013
})
80128014
def test_metadce_hello(self, *args):

0 commit comments

Comments
 (0)