Fix superenv arch flag handling

Fixes #21943.