Skip to content

Commit

Permalink
fbc/emscripten: pass -sASYNCIFY at link-time not compile-time
Browse files Browse the repository at this point in the history
It is a link-time flag and does nothing at compile-time. I think this has
changed since earlier Emscripten versions, due to Emscripten's new wasm backend.
  • Loading branch information
rversteegen committed Jul 24, 2023
1 parent a7928cc commit 559302f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Expand Up @@ -11,6 +11,7 @@ Version 1.10.1
- fbc: emscripten: wstring was broken because sizeof(wstring) was 2 rather than 4
- emscripten: non-graphical programs will now run under node.js. Use -x output.js to produce a .js rather than an .html
- rtlib: emscripten: CURDIR and EXEPATH always returned ""
- emscripten/fbc: -sASYNCIFY wasn't passed to emcc at link-time as needed by recent Emscripten


Version 1.10.0
Expand Down
5 changes: 3 additions & 2 deletions src/compiler/fbc.bas
Expand Up @@ -898,7 +898,8 @@ private function hLinkFiles( ) as integer
"CASE_INSENSITIVE_FS=1", _
"TOTAL_MEMORY=67108864", _
"ALLOW_MEMORY_GROWTH=1", _
"RETAIN_COMPILER_SETTINGS=1" _
"RETAIN_COMPILER_SETTINGS=1", _
"ASYNCIFY=1" _
}
'"WARN_UNALIGNED=1", _

Expand Down Expand Up @@ -3443,7 +3444,7 @@ private function hCompileStage2Module( byval module as FBCIOFILE ptr ) as intege
'if Emscripten is used, we will skip the assembly generation and compile directly to object code
ln += "-c -nostdlib -nostdinc -Wall -Wno-unused-label " + _
"-Wno-unused-function -Wno-unused-variable "
ln += "-Wno-warn-absolute-paths -s ASYNCIFY=1 -s RETAIN_COMPILER_SETTINGS=1 "
ln += "-Wno-warn-absolute-paths "
end if

'' Don't warn about non-standard main() signature
Expand Down
2 changes: 1 addition & 1 deletion tests/unit-tests.mk
Expand Up @@ -122,7 +122,7 @@ ifdef TARGET
endif
ifeq ($(TARGET_OS),js)
# Copy the file/ and data/ directories into the in-memory FS
FBC_LFLAGS += -Wl -sASYNCIFY,-sEXIT_RUNTIME -Wl --preload-file,file,--preload-file,data
FBC_LFLAGS += -Wl -sEXIT_RUNTIME -Wl --preload-file,file,--preload-file,data
endif

ifeq ($(ENABLE_CHECK_BUGS),1)
Expand Down

0 comments on commit 559302f

Please sign in to comment.