It's a tough problem to fix. If we come down too hard on companies for hiring guest workers, they'll often open off shore offices.
It's simple (not the same as easy) to fix. (1) Raise trade barriers. (2) If you're in the US, you bank in the US, you invest in the US, you use US materials, you hire US workers, you buy US manufacturing equipment and tooling, and you sell to the US market. (3) If you're not in the US, you don't get to sell to the US market. Period. So if company A moves out of the US, company B will simply take over the market company A abandoned.
We have the resources, we have the workers, and we have the market. What we have to stop doing is bleeding work into other economies, while expecting our standard of living, which was based on our economy, to be retained. We cannot do that while economic systems we have no control over are low-balling the cost of our consumables.
So we either lower our standard of living so we can become employable (doubtful); or go without (that's happening... many of us are unemployable at practical wages); or we develop our job market in the same economic context as we develop our consumables market.
That last is what I'm suggesting. If we do not do that, then until other country's standards of living rise to the standards of ours, we will continue to bleed jobs and prosperity in their direction. Equalization can occur in two ways: Our standard of living can drop to rice+hovel, or their standard of living can rise to house+car+retirement. Presently we are 100% engaged in the former, with no sign whatsoever of being able to get free of the fall. There's little to no sign of the latter.
If we do do that, then we can keep the barriers one way until our economy stabilizes again, and then when it does, drop them just far enough that foreign countries have access to our markets at our prices for items we also sell (only those. If we don't make the item, they can't sell it here. That way, if our market wants it, we get a fair crack at manufacturing it.) In this way, they can compete on quality and style, instead of the economic leverage a piss-poor underclass gives them.
They also have the option to take the higher earnings for their products back and spin up their economies. They probably won't, and frankly, it shouldn't matter to us if they do -- but the opportunity would be there. Give the peasants something to revolt over.