Dupe of h$rts_isProfiled
Summary
Commit !11447 (diffs) added a dupe of h$rts_isProfiled
which was already defined by 08d8e9ef
That's one of reasons why Google Closure Compiler does not work in Advanced Optimizations Mode.
Steps to reproduce
Create Hello-World app like at the wiki page: https://gitlab.haskell.org/ghc/ghc/-/wikis/javascript-backend/building
Try to build it and then pass through google closure compiler.
../ghc-js/_build/stage1/bin/javascript-unknown-ghcjs-ghc -fforce-recomp HelloJS.hs
google-closure-compiler --compilation_level ADVANCED_OPTIMIZATIONS ./HelloJS.jsexe/all.js --js_output_file ./HelloJS.jsexe/all.min.js
It will show the error:
./HelloJS.jsexe/all.js:12611:9: ERROR - [JSC_VAR_MULTIPLY_DECLARED_ERROR] Variable h$rts_isProfiled declared more than once. First occurrence: ./HelloJS.jsexe/all.js:8723:9
12611| function h$rts_isProfiled() {
Expected behavior
Google Closure Compiler does not treat h$rts_isProfiled
as declared more than once. Better to have it fully working for hello-world, but it requires more scope of work than this pretty trivial change.
Environment
- GHC version used: #3e0b2b1f
Optional:
- Operating System: MacOS 13.6.3 (22G436)
- System Architecture: Apple M1
Linked Issues
[Parent] Size reduction of "hello world" bundle compiled by javascript-backend