[Git][ghc/ghc][master] 2 commits: Revert "Add necessary flag for js linking"

Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: c1cab0c3 by Sylvain Henry at 2025-09-26T10:36:30-04:00 Revert "Add necessary flag for js linking" This reverts commit 84f68e2231b2eddb2e1dc4e90af394ef0f2e803f. This commit didn't have the expected effect. See discussion in #26290. Instead we export HEAP8 and HEAPU8 from rts/js/mem.js - - - - - 0a434a80 by Sylvain Henry at 2025-09-26T10:36:30-04:00 JS: export HEAPU8 (#26290) This is now required by newer Emscripten versions. - - - - - 4 changed files: - m4/fptools_set_c_ld_flags.m4 - rts/js/mem.js - testsuite/driver/testlib.py - utils/ghc-toolchain/src/GHC/Toolchain/Tools/Link.hs Changes: ===================================== m4/fptools_set_c_ld_flags.m4 ===================================== @@ -109,9 +109,6 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS], $2="$$2 -mcmodel=medium" ;; - javascript*) - $3="$$3 -sEXPORTED_RUNTIME_METHODS=HEAP8,HEAPU8" - esac AC_MSG_RESULT([done]) ===================================== rts/js/mem.js ===================================== @@ -1,5 +1,5 @@ //#OPTIONS:CPP -//#OPTIONS:EMCC:EXPORTED_RUNTIME_METHODS=addFunction,removeFunction,getEmptyTableSlot,HEAP8 +//#OPTIONS:EMCC:EXPORTED_RUNTIME_METHODS=addFunction,removeFunction,getEmptyTableSlot,HEAP8,HEAPU8 // #define GHCJS_TRACE_META 1 ===================================== testsuite/driver/testlib.py ===================================== @@ -3005,7 +3005,7 @@ def normalise_errmsg(s: str) -> str: # Emscripten displays cache info and old emcc doesn't support EMCC_LOGGING=0 s = re.sub('cache:INFO: .*\n', '', s) # Old emcc warns when we export HEAP8 but new one requires it (see #26290) - s = s.replace('warning: invalid item in EXPORTED_RUNTIME_METHODS: HEAP8\nemcc: warning: warnings in JS library compilation [-Wjs-compiler]\n','') + s = s.replace('warning: invalid item in EXPORTED_RUNTIME_METHODS: HEAP8\nwarning: invalid item in EXPORTED_RUNTIME_METHODS: HEAPU8\nemcc: warning: warnings in JS library compilation [-Wjs-compiler]\n','') return s ===================================== utils/ghc-toolchain/src/GHC/Toolchain/Tools/Link.hs ===================================== @@ -324,10 +324,6 @@ addPlatformDepLinkFlags archOs cc ccLink0 = do ArchOS ArchPPC OSAIX -> -- We need `-D_THREAD_SAFE` to unlock the thread-local `errno`. return $ ccLink2 & over _prgFlags (++["-D_THREAD_SAFE","-Wl,-bnotextro"]) - ArchOS ArchJavaScript OSGhcjs -> - -- Since https://github.com/emscripten-core/emscripten/blob/main/ChangeLog.md#407---0... - -- the emcc linker does not export the HEAP8 memory view which is used by the js RTS by default anymore. - return $ ccLink2 & _prgFlags %++ "-sEXPORTED_RUNTIME_METHODS=HEAP8,HEAPU8" _ -> return ccLink2 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8bf5b309e9d162f187e96562e6432d9... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8bf5b309e9d162f187e96562e6432d9... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)