Passing the features in random order will lead to unpredictable results when some of the features are related (like the architecture-version feature on ARM).
It might be possible to fix this particular case in the ARM target code, to avoid adding overlapping target features. But we should probably be sorting in any case: the behavior shouldn't depend on StringMap's hashing algorithm.
Could you add a comment here briefly explaining why we sort here?