Four major automakers are racing to find workarounds to China’s stranglehold on rare-earth magnets, which they fear could force them to shut down some car production within weeks. Several traditional and electric-vehicle makers—and their suppliers—are considering shifting some auto-parts manufacturing to China to avoid looming factory shutdowns...