Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
7b616b9f by Cheng Shao at 2026-01-16T06:45:00-05:00
compiler: fix regression when compiling foreign stubs in the rts unit
This patch fixes a regression when compiling foreign stubs in the rts
unit introduced in 05e25647f72bc102061af3f20478aa72bff6ff6e. A simple
revert would fix it, but it's better to implement a proper fix with
comment for better understanding of the underlying problem, see the
added comment for explanation.
Co-authored-by: Codex
- - - - -
1 changed file:
- compiler/GHC/Driver/CodeOutput.hs
Changes:
=====================================
compiler/GHC/Driver/CodeOutput.hs
=====================================
@@ -296,10 +296,15 @@ outputForeignStubs logger tmpfs dflags unit_state mod location stubs
mk_include i = "#include \"" ++ ST.unpack i ++ "\"\n"
in case mrts_pkg of
Just rts_pkg -> concatMap mk_include (unitIncludes rts_pkg)
- -- This case only happens when compiling foreign stub for the rts
- -- library itself. The only time we do this at the moment is for
- -- IPE information for the RTS info tables
- Nothing -> ""
+ -- The Nothing case only happens when compiling
+ -- foreign stubs for the rts library itself (e.g.
+ -- building with +ipe), and the rts unit is not
+ -- registered yet.
+ --
+ -- The generated stubs may still use RTS API, so
+ -- we must ensure that Rts.h is included,
+ -- otherwise we may run into regressions (#26779).
+ Nothing -> "#include \"Rts.h\"\n"
-- wrapper code mentions the ffi_arg type, which comes from ffi.h
ffi_includes
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7b616b9f0236f4160f28923784b448f3...
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7b616b9f0236f4160f28923784b448f3...
You're receiving this email because of your account on gitlab.haskell.org.