Zubin pushed to branch wip/26435 at Glasgow Haskell Compiler / GHC Commits: 6277d0e1 by Zubin Duggal at 2025-09-30T17:34:41+05:30 compiler: Warn when -finfo-table-map is used with -fllvm These are currently not supported together. Fixes #26435 - - - - - 5 changed files: - compiler/GHC/Driver/Session.hs - docs/users_guide/debug-info.rst - + testsuite/tests/driver/T26435.hs - + testsuite/tests/driver/T26435.stderr - testsuite/tests/driver/all.T Changes: ===================================== compiler/GHC/Driver/Session.hs ===================================== @@ -3784,6 +3784,11 @@ makeDynFlagsConsistent dflags hostFullWays in dflags_c + | gopt Opt_InfoTableMap dflags + , LlvmCodeOutput <- backendCodeOutput (backend dflags) + = loop (gopt_unset dflags Opt_InfoTableMap) + "-finfo-table-map is incompatible with -fllvm" + | otherwise = (dflags, mempty, mempty) where loc = mkGeneralSrcSpan (fsLit "when making flags consistent") loop updated_dflags warning ===================================== docs/users_guide/debug-info.rst ===================================== @@ -370,6 +370,11 @@ to a source location. This lookup table is generated by using the ``-finfo-table also want more precise information about constructor info tables then you should also use :ghc-flag:`-fdistinct-constructor-tables`. + .. note:: + This flag is incompatible with :ghc-flag:`-fllvm`. If both flags are + enabled, GHC will emit a warning and :ghc-flag:`-finfo-table-map` will + have no effect. + The :ghc-flag:`-finfo-table-map` flag will increase the binary size by quite a lot, depending on how big your project is. For compiling a project the size of GHC the overhead was about 200 megabytes. ===================================== testsuite/tests/driver/T26435.hs ===================================== @@ -0,0 +1,2 @@ +main :: IO () +main = putStrLn "hello world" \ No newline at end of file ===================================== testsuite/tests/driver/T26435.stderr ===================================== @@ -0,0 +1,3 @@ +when making flags consistent: warning: [GHC-74335] [-Winconsistent-flags (in -Wdefault)] + -finfo-table-map is incompatible with -fllvm + ===================================== testsuite/tests/driver/all.T ===================================== @@ -331,3 +331,4 @@ test('T24839', [unless(arch('x86_64') or arch('aarch64'), skip), extra_files(["t test('t25150', [extra_files(["t25150"])], multimod_compile, ['Main.hs', '-v0 -working-dir t25150/dir a.c']) test('T25382', normal, makefile_test, []) test('T26018', req_c, makefile_test, []) +test('T26435', normal, compile, ['-finfo-table-map -fllvm']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6277d0e19c3487d2e538f2685b18cfb9... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6277d0e19c3487d2e538f2685b18cfb9... You're receiving this email because of your account on gitlab.haskell.org.