-target or --target

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:

Thanks,
–renato

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 also note that it doesn't document --sysroot. Should it? Is -isysroot an
alias for that?

Thanks,

Steve.

clang++ --help does not document -target or -gcc-toolchain, but it does
document the -- variants.

This is a good point. Should I use --gcc-toolchain= instead of
-ccc-gcc-name?

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

alias for that?

Looks like it. I'll change the docs to reflect what's on --help, and
someone that has a better idea about the "expected" syntax can change later.

Thanks,
--renato

The -ccc-* options should normally be avoided. They are normally just
testing tools.

I know, I’ve added for completeness. I can remove that if you think we should really avoid people knowing that…

–renato

Probably a good idea.

Cheers,
Rafael

I've never found --help to be definitive, or even all that helpful.
It describes things it shouldn't (e.g. options valid only with -cc1)
and omits things it should include. Last I checked, it dumped exactly
the options that had a help string, which I don't think is a very
good criterion for choosing what to display.
--paulr

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.

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've used the two dash versions on the doc.

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.

I left it as --sysroot, since --isysroot doesn't behave like --sysroot on
Linux (the platform of the how-to).

cheers,
--renato

Sorry for being late to the party…

I wrote up a doc that described the recommended flag spellings and mailed it out. Renato, I could swear you reviewed it. ;] Anyways, you should be able to refer to that document for a lot of this information. To sum up:

  • Yes, use two-dash flag spellings for “high level” flags that are handled by the driver and express general intent. This should apply to most cross compiling flags.
  • Yes, specifically ‘–target=…’ would be my preference above ‘-target …’.
  • And ‘–sysroot=…’ over ‘-isysroot …’ or ‘–sysroot …’

I have, and agreed! But since the only people actually involved were you,
me and Bob, and the --help was still contrary to that document, I thought
it was more like a wish-list item than a real change.

I stand corrected. :wink:

cheers,
--renato