Skip to content

Commit b713859

Browse files
authored
WasmFS: Do not link in the no-fs version when forced-fs [NFC] (#19563)
I don't think this fixes any actual bug - it should just be wasted work that this PR avoids - but it was confusing to me to even see it on the link command, when it obviously should not be there (when the FS is forced, we must include it, and not the no-fs version).
1 parent 120241d commit b713859

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tools/system_libs.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,7 +1878,8 @@ class libwasmfs_no_fs(Library):
18781878
src_files = ['no_fs.c']
18791879

18801880
def can_use(self):
1881-
return settings.WASMFS
1881+
# If the filesystem is forced then we definitely do not need this library.
1882+
return settings.WASMFS and not settings.FORCE_FILESYSTEM
18821883

18831884

18841885
class libwasmfs_noderawfs(Library):
@@ -2217,8 +2218,12 @@ def add_sanitizer_libs():
22172218

22182219
if settings.WASMFS:
22192220
# Link in the no-fs version first, so that if it provides all the needed
2220-
# system libraries then WasmFS is not linked in at all.
2221-
add_library('libwasmfs_no_fs')
2221+
# system libraries then WasmFS is not linked in at all. (We only do this if
2222+
# the filesystem is not forced; if it is then we know we definitely need the
2223+
# whole thing, and it would be unnecessary work to try to link in the no-fs
2224+
# version).
2225+
if not settings.FORCE_FILESYSTEM:
2226+
add_library('libwasmfs_no_fs')
22222227
add_library('libwasmfs')
22232228

22242229
add_sanitizer_libs()

0 commit comments

Comments
 (0)