Additional note: I actually tested the patches on two different machines to be sure (with and without the patch) and built the package in interactive mode (i.e. dpkg-buildpackage, not sbuild).
In the machine where I didn't apply the patch, this is what was shown on screen at the moment of hangup: [100%] Running lld test suite cd /home/sanvila/llvm-toolchain-7-7.0.1/build-llvm/tools/clang/stage2-bins/tools/lld/test && /usr/bin/python2.7 /home/sanvila/llvm-toolchain-7-7.0.1/build-llvm/tools/clang/stage2-bins/./bin/llvm-lit -sv --param lld_site_config=/home/sanvila/llvm-toolchain-7-7.0.1/build-llvm/tools/clang/stage2-bins/tools/lld/test/lit.site.cfg --param lld_unit_site_config=/home/sanvila/llvm-toolchain-7-7.0.1/build-llvm/tools/clang/stage2-bins/tools/lld/test/Unit/lit.site.cfg /home/sanvila/llvm-toolchain-7-7.0.1/build-llvm/tools/clang/stage2-bins/tools/lld/test -- Testing: 1808 tests, 1 threads -- 92% [========================================================================------] ETA: 00:00:10 lld :: mach-o/write-final-sections.yaml I agree that this is for historical interest only, as I guess that nobody here wants to investigate the failure, and everybody here probably agrees that disabling the tests is a much better course of action. Thanks.