We found that to be the case – changing the exclusive access to memory setting from Runtime Checks in All Builds to Runtime Checks in Debug Builds Only made our compiles finish again. We didn't see this issue in Xcode 10.1, but it might be because the setting wasn't enabled by default back then (see this nice table someone made).
Just figured I'd share – we tried a bunch of different combinations of optimization settings, and the exclusive access to memory definitely seemed to be the culprit (❌are stalling builds, ✅are passing)
❌wholemodule, -O, legacy build system, enforced exclusive memory access (runtime checks)
✅wholemodule, -O, legacy build system, enforced exclusive memory access (compile-time only)
❌wholemodule, -O, new build system, enforced exclusive memory access (runtime checks)
✅wholemodule, -O, new build system, enforced exclusive memory access (compile-time only)
❌incremental, -O, legacy build system, enforced exclusive memory access (runtime checks)
✅incremental, -O, legacy build system, enforced exclusive memory access (compile-time only)
❌incremental, -O, new build system, enforced exclusive memory access (runtime checks)
❌incremental, -O, new build system, enforced exclusive memory access (compile-time only)