TSMC has a big volume and an edge in node process. However, the vast majority of chips in use are in embedded usecases. Most non-general-computing hardware containing chips doesn't need 4nm. It would chug just fine with two decade old chips. Even military hardware uses very outdated chips.
Catching up to a modern semi fab would cost time and money, but making more outdated chips isn't that much of a problem. There's a certification issue, but in such a scenario surely certification would be relaxed.
As for general purpose computing, servers always have the option of scaling horizontally. The biggest issue would be with phones and tablets. Unfortunate, but tiny compared to the other costs of war.