T7060{a,b,c} can't be build in parallel as they use the same source file and ghc will therefore create the same temporary file (i.e. with the same name) for each invocation which will cause issues with parallel builds. Therefore, force these targets to be build sequentially through a perquisite. diff -upr ghc-9.4.4.orig/testsuite/tests/driver/Makefile ghc-9.4.4/testsuite/tests/driver/Makefile --- ghc-9.4.4.orig/testsuite/tests/driver/Makefile 2023-03-06 18:50:58.621621789 +0100 +++ ghc-9.4.4/testsuite/tests/driver/Makefile 2023-03-06 19:52:10.107136867 +0100 @@ -527,14 +527,14 @@ T7060a: [ -f T7060dump/T7060.dump-rules ] .PHONY: T7060b -T7060b: +T7060b: T7060a $(RM) -rf T7060dump [ ! -d T7060dump ] "$(TEST_HC)" $(TEST_HC_OPTS) -O -c T7060.hs -dumpdir T7060dump -ddump-to-file -ddump-rule-firings [ -f T7060dump/T7060.dump-rule-firings ] .PHONY: T7060c -T7060c: +T7060c: T7060b $(RM) -rf T7060dump [ ! -d T7060dump ] "$(TEST_HC)" $(TEST_HC_OPTS) -O -c T7060.hs -dumpdir T7060dump -ddump-to-file -ddump-rule-rewrites