I'm currently working on adding Windows CE as a Target Operating system in LLVM/Clang. I've compiled LLVM/Clang on Windows and when I use it to compile code for my own native windows target or when I cross-compile to my new Windows CE target it produces ELF object files. The problem is that I need it to produce COFF object files. I couldn't find any way to configure Clang to emit COFF at runtime, so I've been adding debug to the code to try and figure out how I can get it to produce COFF by modifying the source code itself. I've been working on it for a while and figured I would ask if anyone could help me figure how I can get it to generate COFF.
When the TargetInfo class is constructed (lib/Basic/Targets.cpp) I see that Triple.getObjectFormat returns the enum value for COFF so I'm not sure why it's producing ELF. I figure the culprit will be in the lib/CodeGen project but I'm having a hard time figuring out where the final object file format is evaluated. Any help would be appreciated.