[PATCH] Respect object format choice on Darwin

Keno Fischer kfischer at college.harvard.edu
Sun Nov 9 17:45:49 PST 2014


It actually works quite nicely in practice, but I agree that I won't enable it in production anytime soon. In the meantime, it's quite quite useful for testing purposes. I assume it only work so nicely because a lot of the work as already been done to support ELF-on-windows.

================
Comment at: lib/MC/MCObjectFileInfo.cpp:844-845
@@ -843,3 +843,4 @@
        Arch == Triple::UnknownArch) &&
-      (TT.isOSDarwin() || TT.isOSBinFormatMachO())) {
+      (TT.isOSDarwin() || TT.isOSBinFormatMachO()) &&
+       TT.getObjectFormat() == Triple::MachO) {
     Env = IsMachO;
----------------
t.p.northover wrote:
> The new condition is redundant: isOSBinFormatMachO is the same as your added clause, so it amounts to completely removing the isOSDarwin check. Which actually does seem like quite an improvement, even if the code you get out of x86_64-macosx-elf is clinically insane.
Ah, interesting. Does anybody know why the `TT.isOSDarwin()` was there in the first place?

http://reviews.llvm.org/D6185






More information about the llvm-commits mailing list