------- Comment #1 from jakub at gcc dot gnu dot org 2009-12-22 08:04 ------- Not just that, but also -march=native -march=i386, while leaving -march=i386 last on the command line, will set various flags that shouldn't be set if -march=native -march=i386 meant just -march=i386 (when the last -march=* wins).
I believe to fix this we need a new gcc spec syntax bit. IMHO we want a way to say in a condition that some option matches only if some prefix of that option is live. Say %{march=*native:...} would mean match if -march=native switch is used and it is a live -march= prefixed option. Then we'd just use %{march=*native:%<march=* %:local_detect_cpu(arch)} which would add local_detect_cpu(arch) stuff only if -march=native was the last -march= option, and would cause not just -march=native to be ignored, but also all other -march= options. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42444