Open
Description
Version of emscripten/emsdk:
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.24-git (6292601a59b6c23382e26a438c9ae3a6c3c4d3e8)
clang version 16.0.0 (https://github.com/llvm/llvm-project 69353e7c82f732ac7303fe94f9a6d527b1b221ab)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: C:\Users\kdots\.emsdk\upstream\bin
Failing command line in full:
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <cassert>
#include <stdio.h>
int main()
{
mkdir("test", S_IRUGO);
int fd = open("test/file", O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
perror("Error: ");
printf("errno - %d\n", errno);
printf("fd - %d\n", fd);
assert(errno == EACCES);
assert(fd < 0);
}
Full link command and output with -v
appended:
C:\emscripten>em++ -v C:/build/test.cpp -o C:/build/test.html -s WASMFS=1
"C:/Users/kdots/.emsdk/upstream/bin\clang.exe" --version
"C:/Users/kdots/.emsdk/upstream/bin\clang++.exe" -target wasm32-unknown-emscripten -fignore-exceptions -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -DEMSCRIPTEN -IC:\emscripten\cache\sysroot\include\SDL --sysroot=C:\emscripten\cache\sysroot -Xclang -iwithsysroot/include\compat -v C:/build/test.cpp -c -o C:\Users\kdots\AppData\Local\Temp\emscripten_temp_itrpqa3s\test_0.o
clang version 16.0.0 (https://github.com/llvm/llvm-project 69353e7c82f732ac7303fe94f9a6d527b1b221ab)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: C:\Users\kdots\.emsdk\upstream\bin
(in-process)
"C:\\Users\\kdots\\.emsdk\\upstream\\bin\\clang++.exe" -cc1 -triple wasm32-unknown-emscripten -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -main-file-name test.cpp -mrelocation-model static -mframe-pointer=none -ffp-contract=on -fno-rounding-math -mconstructor-aliases -target-cpu generic -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=gdb -v "-fcoverage-compilation-dir=C:\\emscripten" -resource-dir "C:\\Users\\kdots\\.emsdk\\upstream\\lib\\clang\\16.0.0" -D EMSCRIPTEN -I "C:\\emscripten\\cache\\sysroot\\include\\SDL" -isysroot "C:\\emscripten\\cache\\sysroot" -internal-isystem "C:\\emscripten\\cache\\sysroot/include/wasm32-emscripten/c++/v1" -internal-isystem "C:\\emscripten\\cache\\sysroot/include/c++/v1" -internal-isystem "C:\\Users\\kdots\\.emsdk\\upstream\\lib\\clang\\16.0.0\\include" -internal-isystem "C:\\emscripten\\cache\\sysroot/include/wasm32-emscripten" -internal-isystem "C:\\emscripten\\cache\\sysroot/include" -fdeprecated-macro "-fdebug-compilation-dir=C:\\emscripten" -ferror-limit 19 -fmessage-length=167 -fvisibility=default -fgnuc-version=4.2.1 -fcxx-exceptions -fignore-exceptions -fexceptions -fcolor-diagnostics "-iwithsysroot/include\\compat" -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -o "C:\\Users\\kdots\\AppData\\Local\\Temp\\emscripten_temp_itrpqa3s\\test_0.o" -x c++ C:/build/test.cpp
clang -cc1 version 16.0.0 based upon LLVM 16.0.0git default target x86_64-pc-windows-msvc
ignoring nonexistent directory "C:\emscripten\cache\sysroot/include/wasm32-emscripten/c++/v1"
ignoring nonexistent directory "C:\emscripten\cache\sysroot/include/wasm32-emscripten"
#include "..." search starts here:
#include <...> search starts here:
C:\emscripten\cache\sysroot\include\SDL
C:\emscripten\cache\sysroot/include\compat
C:\emscripten\cache\sysroot/include/c++/v1
C:\Users\kdots\.emsdk\upstream\lib\clang\16.0.0\include
C:\emscripten\cache\sysroot/include
End of search list.
"C:/Users/kdots/.emsdk/upstream/bin\wasm-ld.exe" -o C:/build/test.wasm C:\Users\kdots\AppData\Local\Temp\emscripten_temp_itrpqa3s\test_0.o -LC:\emscripten\cache\sysroot\lib\wasm32-emscripten --whole-archive -lwasmfs-debug --no-whole-archive -lGL -lal -lhtml5 -lstubs-debug -lnoexit -lc-debug -ldlmalloc -lcompiler_rt -lc++-noexcept -lc++abi-debug-noexcept -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --import-undefined --strip-debug --export-if-defined=main --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__start_em_lib_deps --export-if-defined=__stop_em_lib_deps --export-if-defined=__start_em_js --export-if-defined=__stop_em_js --export-if-defined=__main_argc_argv --export-if-defined=fflush --export=emscripten_stack_get_end --export=emscripten_stack_get_free --export=emscripten_stack_get_base --export=emscripten_stack_init --export=_wasmfs_read_file --export=stackSave --export=stackRestore --export=stackAlloc --export=__wasm_call_ctors --export=__errno_location --export=__get_temp_ret --export=__set_temp_ret --export=malloc --export=free --export-table -z stack-size=5242880 --initial-memory=16777216 --no-entry --max-memory=16777216 --global-base=1024
"C:/Users/kdots/.emsdk/upstream\bin\wasm-emscripten-finalize" --dyncalls-i64 --pass-arg=legalize-js-interface-exported-helpers C:/build/test.wasm -o C:/build/test.wasm --detect-features
"C:/Users/kdots/.emsdk/node/14.18.2_64bit/bin/node.exe" C:\emscripten\src\compiler.js C:\Users\kdots\AppData\Local\Temp\tmpxffglsrr.json
"C:/Users/kdots/.emsdk/upstream/bin\llvm-objcopy.exe" C:/build/test.wasm C:/build/test.wasm --remove-section=.debug* --remove-section=producers
"C:/Users/kdots/.emsdk/node/14.18.2_64bit/bin/node.exe" C:\emscripten\tools\preprocessor.js C:\Users\kdots\AppData\Local\Temp\emscripten_temp_itrpqa3s\settings.js shell.html
Expected output (when building without wasmfs):
Error: : Permission denied
errno - 2
fd - -1
Actual output:
Error: : No error information
errno - 0
fd - 3
Aborted(Assertion failed: errno == EACCES, at: C:/build/test.cpp,14,main)
Metadata
Metadata
Assignees
Type
Projects
Status
Todo