[PATCH] MachO-embedded: refactor Clang to use "*-*-unknown-macho" triple

Rafael Espíndola rafael.espindola at gmail.com
Mon Jan 6 13:48:44 PST 2014


> ================
> Comment at: lib/Basic/Targets.cpp:87
> @@ -86,3 +86,3 @@
>
>  static void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts,
>                               const llvm::Triple &Triple,
> ----------------
> Rafael Ávila de Espíndola wrote:
>> Should this be MachODefines now?
> Almost certainly longer-term. I've taken a lighter hand to the code in lib/Basic/Targets.cpp for now. It could probably do with a much more thorough overhaul along the lines of lib/Driver, but for now it looks mostly generic.

OK.

> ================
> Comment at: lib/Driver/Driver.cpp:382
> @@ -383,1 +381,3 @@
> +  // MachO targets this uses the driver-driver and universal actions.
> +  if (TC.getTriple().isOSBinFormatMachO())
>      BuildUniversalActions(C->getDefaultToolChain(), C->getArgs(),
> ----------------
> Rafael Ávila de Espíndola wrote:
>> Really? Why do you need a driver driver for? Are you building a fat binary for an embedded system?
> I'm not, but you never know what closeted developers will get up to.
>
> My thinking was that the driver-driver (& generally fat binaries) are more of an Apple platform feature than a Darwin target one: the linker and other tools will let you do it, no matter how unwise it might be.

I see. I also realized people might be using a single -arch option for
convenience. We could implement a single -arch as a special case
without the driver driver, but it is not clear if it is profitable to
do so.

I am taking a second look at the updated patch.




More information about the cfe-commits mailing list