- Jan 14, 2025
-
-
Cheng Shao authored
(cherry picked from commit 3655c3fd)
-
(cherry picked from commit 7202a02c0a5238682de6a3a06a9b5137f02ad70c) (cherry picked from commit 5e60fd64)
-
Cheng Shao authored
(cherry picked from commit 42826a89) (cherry picked from commit 3ea15740)
-
Cheng Shao authored
This patch bumps macOS minimum SDK version to 11.0 for x86_64-darwin to align it with aarch64-darwin. This allows us to get rid of the horrible -Wl,-U,___darwin_check_fd_set_overflow hack, which is causing linker warnings and testsuite failures on macOS 15. Fixes #25504. (cherry picked from commit 88c4fe1d) (cherry picked from commit 5c7e7695)
-
Cheng Shao authored
This patch makes test-bootstrap related ci jobs only depend on hadrian-ghc-in-ghci job to finish, consistent with other jobs in the full-build stage generated by gen_ci.hs. This allows the jobs to be spawned earlier and improve overall pipeline parallelism. (cherry picked from commit e684c406) (cherry picked from commit 4884eb08)
-
Cheng Shao authored
This patch fixes foreign import javascript "wrapper" in wasm backend's TH/ghci by fixing the handling of dyld/finalization_registry magic variables. Fixes T25473 and closes #25473. (cherry picked from commit bd0a8b7e) (cherry picked from commit 610b0f77)
-
Cheng Shao authored
This commit adds regression test T25473 marked as broken due to #25473. It will be fixed in the subsequent commit. (cherry picked from commit ed2ed6c5) (cherry picked from commit fb470cb6)
-
Cheng Shao authored
This patch improves the compile_flags.txt config used to power clangd for the rts C codebase. The flags in the file are sampled & deduped from a real stage1 build with clang-19 and vastly improves the IDE accuracy when hacking the rts. For maximum code coverage under the default settings, compile_flags.txt defaults to threaded+profiled+dynamic+debug way. This does not mean profdyn needs to be actually built in _build/stage1 for IDE to work. To activate IDE for other RTS ways, simply remove one of the -D flags at the end of compile_flags.txt and restart clangd. (cherry picked from commit 59e0a770) (cherry picked from commit 222a08ae)
-
Cheng Shao authored
This patch fixes one incoherent place between bindist makefile and hadrian logic: I forgot to include wasi/wasm32 in OsSupportsGHCi/ArchSupportsGHCi as well. And this results in incorrect settings file generated after installing the bindist, and "Use interpreter"/"Have interpreter" fields incorrectly have "NO" values where they should be "YES" like --info output of in-tree version. (cherry picked from commit 75a2eae4) (cherry picked from commit 735f3f9a)
-
Cheng Shao authored
This patch removes the obsolete cross-port script in the tree. The script was based on the legacy Make build system which has been pruned from the tree long ago. For hadrian, proper support for two-stage bootstrapping onto a new unsupported platform is a work in progress in !11444. (cherry picked from commit 00d551bf) (cherry picked from commit 329a26da)
-
Cheng Shao authored
This patch fixes FinalizationRegistry related logic for Cloudflare Workers in wasm backend js post linker. Cloudflare Workers doesn't support FinalizationRegistry, in this case we use a dummy implementation that doesn't do anything. (cherry picked from commit bea8ea4c) (cherry picked from commit 0346e7b7)
-
Cheng Shao authored
This patch fixes setImmediate() implementation for Cloudflare Workers in the wasm backend's js prelude script. Cloudflare Workers doesn't support the MessageChannel API, and we use a setTimeout() based fallback implementation in this case. (cherry picked from commit c37b96fa) (cherry picked from commit 6bd2d9ad)
-
Cheng Shao authored
The executable wrappers are handled by hadrian and bindist Makefile. The various .wrapper scripts in the tree are unused since removal of Make build system, so this patch removes them all. (cherry picked from commit 9ede97f3) (cherry picked from commit 737e9e0b)
-
Cheng Shao authored
This patch removes unused `USE_REPORT_PRELUDE` code paths from the tree. They have been present since the first git revision 4fb94ae5, and might have been useful for debugging purposes many years ago, but these code paths are never actually built. Removing these ease maintenance of relevant modules in the future, and also allows us to get rid of `CPP` extension in those modules as a nice byproduct. (cherry picked from commit 573cad4b)
-
Cheng Shao authored
This patch fixes foreign stub handling logic in `hscParsedDecls`. Previously foreign stubs were simply ignored here, so any feature that involve foreign stubs would not work in ghci (e.g. CApiFFI). The patch reuses `generateByteCode` logic and eliminates a large chunk of duplicate logic that implements Core to bytecode generation pipeline here. Fixes #25414. (cherry picked from commit 677e3aa56e905524071fc9717a88ad2cd1bc2951)
-
Cheng Shao authored
This commit adds T25414 test case to demonstrate #25414. It is marked as broken and will be fixed by the next commit. (cherry picked from commit 82213395dc2fbdc8b452336da0909896b4300218)
-
Cheng Shao authored
This patch removes unused `hscDecls`/`hscDeclsWithLocation` functions from the compiler, to reduce maintenance burden when doing refactorings related to ghci. (cherry picked from commit e3496ef6)
-
Cheng Shao authored
This patch fixes the wasm backend JSFFI prelude script to avoid calling `import("node:timers")` on non-deno hosts. Safari doesn't like it and would print an error message to the console. Fixes https://gitlab.haskell.org/ghc/ghc-wasm-meta/-/issues/13. (cherry picked from commit 301c3b54)
-
Cheng Shao authored
(cherry picked from commit 589fea7f)
-
Cheng Shao authored
This patch disables internal-interpreter flag for stage0 ghc-bin when not cross compiling, see added comment for explanation. Fixes #25406. (cherry picked from commit fde12aba)
-
Cheng Shao authored
This patch adds `--max-old-space-size=8192` to wasm dyld shebang arguments to bump V8 heap size limit. The default limit (`heap_size_limit` returned by `v8.getHeapStatistics()`) is dynamically determined and a bit too low under certain workloads, and V8 would waste too much CPU time to garbage collect old generation heap more aggressively. Bumping the limit to 8G doesn't imply dyld would really take that much memory at run-time, but it lessens V8 heap stress significantly. (cherry picked from commit 14c5143899d164c7ac1213d918b4819684538c4b)
-
This adds locking to communication with the external interpreter to prevent concurrent tasks interfering with each other. This fixes Template Haskell with the external interpreter in parallel (-j) builds. Fixes #25083
-
Cheng Shao authored
This patch fixes an unnoticed undefined behavior in the bytecode interpreter. It can be caught by building `rts/Interpreter.c` with `-fsanitize=pointer-overflow`, the warning message is something like: ``` rts/Interpreter.c:1369:13: runtime error: addition of unsigned offset to 0x004200197660 overflowed to 0x004200197658 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1369:13 rts/Interpreter.c:1265:13: runtime error: addition of unsigned offset to 0x004200197660 overflowed to 0x004200197658 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1265:13 rts/Interpreter.c:1645:13: runtime error: addition of unsigned offset to 0x0042000b22f8 overflowed to 0x0042000b22f0 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1645:13 ``` Whenever we do something like `SpW(-1)`, the negative argument is implicitly converted to an unsigned integer type and causes pointer arithmetic overflow. It happens to be harmless for most targets since overflowing would wrap the result to desired value, but it's still coincidental and undefined behavior. Furthermore, it causes real damage to the wasm backend, given clang-20 will emit invalid wasm code that crashes at run-time for this kind of C code! (see https://github.com/llvm/llvm-project/issues/108770) The fix here is adding some explicit casts to ensure we always use the signed `ptrdiff_t` type as right hand operand of pointer arithmetic. (cherry picked from commit 5bcfefd5)
-
Cheng Shao authored
This reverts commit 1c064ef1. Turns out the GHC-WPC project does use it to observe Cmm in the pipeline, see #25363. (cherry picked from commit 525d451e)
-
Cheng Shao authored
This commit flips on support for shared libs, TH & ghci for wasm in the testsuite, given support has been landed in previous commits. (cherry picked from commit 74a1f681)
-
Cheng Shao authored
This commit flips on the support for shared libs and ghci for the wasm target, given all required support logic has been added in previous commits. (cherry picked from commit 652e7239)
-
Cheng Shao authored
This commit adds support for generating PIC to the wasm backend NCG. (cherry picked from commit 61f5baa5)
-
Cheng Shao authored
This commit adds wasm backend iserv logic to the driver, see added comments for explanation. (cherry picked from commit 2d6107dc)
-
Cheng Shao authored
This commit fixes getGccSearchDirectory logic for wasm target, ensures the correct search directory containing libc.so etc can be found by GHC. getGccSearchDirectory is also exported so it can be used elsewhere to obtain the wasi-sdk libdir and pass to the dyld script. (cherry picked from commit b562e3a6)
-
Cheng Shao authored
This commit adds the wasm dynamic linker implementation, as well as ghci logic to call it and hadrian logic to install it to the correct location. See the top-level note in utils/jsffi/dyld.mjs for more details. (cherry picked from commit 549582ef)
-
Cheng Shao authored
This commit makes ghc-bin use dynamic way when it is doing interactive stuff on certain targets whose RTS linker can only handle dynamic code. (cherry picked from commit 88e99248)
-
Cheng Shao authored
This commit fixes checkNonStdWay to ensure that for targets whose RTS linker can only load dynamic code, the dynamic way of object is selected. (cherry picked from commit 94ef949e)
-
Cheng Shao authored
This commit fixes dynamic_too_enable for targets whose RTS linker can only load dynamic code. (cherry picked from commit fc3a5591)
-
Cheng Shao authored
This commit ensures static archives are picked when linking .wasm modules which are supposed to be fully static, even when ghc may be invoked with -dynamic, see added comment for explanation. (cherry picked from commit 47baa904)
-
Cheng Shao authored
This commit ensures the GHC driver never passes any RPATH-related link-time flags on wasm, which is not supported at all. (cherry picked from commit 649aae00)
-
Cheng Shao authored
This commit adds necessary link-time flags for wasm shared libs, see added comments for detailed explanation. (cherry picked from commit 9745fcfb)
-
Cheng Shao authored
This commit adds necessary compile-time flags when compiling for wasm PIC mode, see added comment for detailed explanation. (cherry picked from commit f6abaf13)
-
Cheng Shao authored
This commit fixes the handling of dynamic CLabels for the wasm backend. Just do the simplest handling: preserve the original CLabel, both unreg/NCG backends can handle them properly without issue. (cherry picked from commit 74411461)
-
Cheng Shao authored
This commit use the interpreterDynamic predicate in preloadLib to decide if we should do dynLoadObjs instead of loadObj. Previously we used hostIsDynamic which was only written with non-cross internal interpreter in mind. The testsuite is also adjusted to remove hard-wired -fPIC flag for cbits (doesn't work in i386 RTS linker in vanilla way, #25260) and properly pass ghc_th_way_flags to ghc. (cherry picked from commit 80aa8983)
-
Cheng Shao authored
Previously, -fexternal-interpreter is broken for JS backend, since GHC would attempt to launch a non-existent ghc-iserv* executable. This commit fixes it by adjusting pattern matching order in setTopSessionDynFlags. (cherry picked from commit 621c753d)
-