What problem? It's not my problem if my employer is screwed after my generation retires. That's the shareholders or owners' problem. The people making 2-10x my salary upstream of me in the org chart are being paid that presumably because they have such greater wisdom and foresight than I do. If I'm the CTO or have very significant equity, maybe I'll talk about restarting hiring of juniors. Otherwise I'll just sit and wait for the desperate consulting offers. It'll be like the COBOL boom in the late 90s.
Note: That isn't my retirement plan, but it'll just be a fun source of extra money if I'm right.