If a required module is missing from "other-modules", cabal will produce a broken library that results in a non-obvious error, e.g.:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/ld: dist/build/A.dyn_o: warning: relocation against `testzm0zi1zi0zi0_B_zdfShowY2_closure' in readonly section `.text'.
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/ld: dist/build/A.dyn_o: relocation R_X86_64_PC32 against undefined symbol `testzm0zi1zi0zi0_B_zdfShowY2_closure' can not be use\
d when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
See https://gist.github.com/leonbaum/9164940 for full example.
+1 for this. When I switched to ghc 7.8-rc2, because of a missing "other-modules" I got this error
ld: illegal text reloc in '_enablezmlibraryzmcoveragezm0zi0zi1_Library_sendMsg2_info' to '__hpc_tickboxes_enablezmlibraryzmcoveragezm0zi0zi1_Util_hpc' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
with library-coverage enabled on a package that builds OK on 7.6.3. I spent a lot of time figuring out why, thought it was a problem with the rc2.
If parsing the source files for this check is beyond the boundaries of cabal, at least it could be possible to make the error only surface when testing the distribution file and ensuring that if the hs-source-dirs are the correct ones the linker and compiler won't complain.
Previous discussion: #1455. Our current plan is to write a patch for ghc --make to output the module dependency graph.
I can't reproduce the gist in the OP using GHC 7.8.2, cabal 18.104.22.168, and cabal-install 22.214.171.124, fwiw.
Closing as a duplicate of #1746.
@23Skidoo You didn't close.