Fixing the -march/-mcpu situation

safety0ff safety0ff.dev at gmail.com
Wed Oct 2 11:35:43 PDT 2013


On Wednesday, 2 October 2013 at 17:01:41 UTC, David Nadlinger 
wrote:
> So, what should we do for LDC?
>  (1) Follow the convention of the LLVM tools, because it seems 
> like
> the natural thing to do and the LLVM convention is arguably 
> saner?
>  (2) Change the meaning of the parameters to match GCC, because 
> this is what many users will probably expect?
>
> If we go with (1), the flag to use for best-effort compilation 
> would probably be "-mcpu=native", although we could probably 
> include
> "-march=native" to provide a "just works" experience for GCC 
> users.

IMHO you should go with (1).
Real confusion will come from one LLVM tool having a different 
convention then the other LLVM tools.
Adjustment is required for going between GCC and LLVM tools 
everywhere else.

As for "-march=native" convenience option, only do so if you're 
confident it will not conflict and need to be changed later on.

If translation from GCC options to LLVM options is really needed, 
then there should be a wrapper like ldmd2 which does so.


More information about the digitalmars-d-ldc mailing list