[cfe-dev] -target or --target

Bob Wilson bob.wilson at apple.com
Mon Sep 9 19:57:16 PDT 2013


On Sep 6, 2013, at 3:48 AM, Stephen Kelly <steveire at gmail.com> wrote:

> Renato Golin wrote:
> 
>> Hi folks,
>> 
>> I'm writing a document on cross-compilation and there is an issue about
>> using "--target=" instead of "-target ". Is this the new preferred format
>> by the community at large? Are we deprecating the old format?
>> 
>> Also, is "-gcc-toolchain" the same as "-ccc-gcc-name" ? Which one is
>> preferred to use from now on? Why not "--gcc-toolchain="?
>> 
>> Context:
>> * http://thread.gmane.org/gmane.comp.compilers.clang.devel/29975
>> * http://llvm-reviews.chandlerc.com/D1606
> 
> clang++ --help does not document -target or -gcc-toolchain, but it does 
> document the -- variants. 

I personally prefer the two-dash versions of those options.  If we need to continue accepting the single-dash versions for compatibility, that’s fine, but at least it would be nice to only document the two-dash versions.

> 
> I also note that it doesn't document --sysroot. Should it? Is -isysroot an 
> alias for that?

It’s a bit complicated.  On non-Apple platforms, -isysroot is like —sysroot except that it only applies to the header search paths.  For historical reasons, Apple ended up using -isysroot as the option to select an SDK: it applies to both headers and libraries and does so in a way that is different than —sysroot.  (I don’t remember the exact difference.)  I have no idea what is the best way to document that.



More information about the cfe-dev mailing list