Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix filesystem/syscall optimization #8438

Merged
merged 21 commits into from
Apr 19, 2019
Merged

Fix filesystem/syscall optimization #8438

merged 21 commits into from
Apr 19, 2019

Conversation

kripken
Copy link
Member

@kripken kripken commented Apr 11, 2019

Fixes #8421

The problem there is that if we see too few syscalls for serious streams operations, then we don't emit filesystem support - but that's wrong if other code uses the filesystem in a non-syscall manner, like calling utimes.

To fix that, we don't disable the whole filesystem when we see so few syscalls, rather we just note that SYSCALLS_REQUIRE_FILESYSTEM is false, and then emit no filesystem support in the syscalls themselves. This leaves other code free to include filesystem support if it needs to.

@kripken kripken requested a review from sbc100 April 11, 2019 23:29
@kripken kripken merged commit 59c14a2 into incoming Apr 19, 2019
@kripken kripken deleted the filesystem branch April 19, 2019 00:17
kripken added a commit that referenced this pull request Apr 19, 2019
…e filesystem. that flag means we manually want to not include filesystem support, even if the code seems to use it.
kripken added a commit that referenced this pull request Apr 25, 2019
They just surfaced because of it - we were lucky before that they were not noticeable, since we included too much code, which hid things.

*    Split up PATH into PATH and PATH_FS, where the latter depends on FS while the former does not. This allows code to use basic path functionality without getting the whole FS.
*    Fix missing PATH dependencies through the codebase - turns out we missed them because FS depended on it, and we assumed that covered things (which it mostly does).
*    Refactor syscall internals to move sockets code into the sockets syscall, so non-socket-using code doesn't get sockets + FS + all the support for that.
*    Optimize syscall internals to not depend on ERRNO_CODES.
kripken added a commit that referenced this pull request Apr 30, 2019
…_FILESYSTEM` as 0 too (#8524)

Otherwise, we incorrectly try to use the filesystem in some cases, like the testcase added here with libc++ code. This also affected binaryen which is how I noticed.

Followup to #8438 and #8464.
VirtualTim pushed a commit to VirtualTim/emscripten that referenced this pull request May 21, 2019
Fixes emscripten-core#8421

The problem there is that if we see too few syscalls for serious streams operations, then we don't emit filesystem support - but that's wrong if other code uses the filesystem in a non-syscall manner, like calling utimes.

To fix that, we don't disable the whole filesystem when we see so few syscalls, rather we just note that SYSCALLS_REQUIRE_FILESYSTEM is false, and then emit no filesystem support in the syscalls themselves. This leaves other code free to include filesystem support if it needs to.
VirtualTim pushed a commit to VirtualTim/emscripten that referenced this pull request May 21, 2019
…created (emscripten-core#8464)

They just surfaced because of it - we were lucky before that they were not noticeable, since we included too much code, which hid things.

*    Split up PATH into PATH and PATH_FS, where the latter depends on FS while the former does not. This allows code to use basic path functionality without getting the whole FS.
*    Fix missing PATH dependencies through the codebase - turns out we missed them because FS depended on it, and we assumed that covered things (which it mostly does).
*    Refactor syscall internals to move sockets code into the sockets syscall, so non-socket-using code doesn't get sockets + FS + all the support for that.
*    Optimize syscall internals to not depend on ERRNO_CODES.
VirtualTim pushed a commit to VirtualTim/emscripten that referenced this pull request May 21, 2019
…_FILESYSTEM` as 0 too (emscripten-core#8524)

Otherwise, we incorrectly try to use the filesystem in some cases, like the testcase added here with libc++ code. This also affected binaryen which is how I noticed.

Followup to emscripten-core#8438 and emscripten-core#8464.
VirtualTim added a commit to VirtualTim/emscripten that referenced this pull request May 23, 2019
VirtualTim added a commit to VirtualTim/emscripten that referenced this pull request May 23, 2019
VirtualTim added a commit to VirtualTim/emscripten that referenced this pull request May 23, 2019
VirtualTim added a commit to VirtualTim/emscripten that referenced this pull request May 23, 2019
belraquib pushed a commit to belraquib/emscripten that referenced this pull request Dec 23, 2020
Fixes emscripten-core#8421

The problem there is that if we see too few syscalls for serious streams operations, then we don't emit filesystem support - but that's wrong if other code uses the filesystem in a non-syscall manner, like calling utimes.

To fix that, we don't disable the whole filesystem when we see so few syscalls, rather we just note that SYSCALLS_REQUIRE_FILESYSTEM is false, and then emit no filesystem support in the syscalls themselves. This leaves other code free to include filesystem support if it needs to.
belraquib pushed a commit to belraquib/emscripten that referenced this pull request Dec 23, 2020
…created (emscripten-core#8464)

They just surfaced because of it - we were lucky before that they were not noticeable, since we included too much code, which hid things.

*    Split up PATH into PATH and PATH_FS, where the latter depends on FS while the former does not. This allows code to use basic path functionality without getting the whole FS.
*    Fix missing PATH dependencies through the codebase - turns out we missed them because FS depended on it, and we assumed that covered things (which it mostly does).
*    Refactor syscall internals to move sockets code into the sockets syscall, so non-socket-using code doesn't get sockets + FS + all the support for that.
*    Optimize syscall internals to not depend on ERRNO_CODES.
belraquib pushed a commit to belraquib/emscripten that referenced this pull request Dec 23, 2020
…_FILESYSTEM` as 0 too (emscripten-core#8524)

Otherwise, we incorrectly try to use the filesystem in some cases, like the testcase added here with libc++ code. This also affected binaryen which is how I noticed.

Followup to emscripten-core#8438 and emscripten-core#8464.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

undefined symbol: $FS
1 participant