When a flags requires another flag (for example clang -fwhole-program-vtables requires -flto) it gets stripped even if the requirement is met. This happens because each flag is tested independently. Maybe the easiest way to fix it is by patching the compiler to just ignore those flags when the requirement is not met (or emit a warning instead of an error).
This also causes problems with *FLAGS generated by `resolve-march-native --clang`. As of version 6.0.1, rmn generates something like this: -march=sandybridge -Xclang -target-feature -Xclang +64bit -Xclang -target-feature -Xclang +aes which gets filtered into something invalid like this: -march=sandybridge -Xclang -Xclang -Xclang -Xclang