[Git][ghc/ghc][wip/andreask/linker_fix] 19 commits: Add regression test for #18177