[llvm-commits] FW: [PATCH] enabling generation of ELF objects on Windows with the help of the triple

Michael Spencer bigcheesegs at gmail.com
Wed Feb 1 02:43:06 PST 2012


On Wed, Feb 1, 2012 at 1:13 AM, Anton Korobeynikov
<anton at korobeynikov.info> wrote:
> Hi Eli,
>
>> Re-sending the patch itself (by request on IRC)
> I thought about this patch a little bit more. And I think we should
> have something "symmetric" wrt other targets/environments.
>
> How do you feel about the following: we should have "sane" set of
> defaults (macho on darwin, coff on win, elf everywhere else). If one
> will explicitly ask for other format, it should be tolerated,
> regardless whether elf was asked on windows or macho. What do you
> think? I believe this will make the patch cleaner... I don't like
> special case of ELF everywhere, such cases tend to be forgotten in
> many places.
>
> Minor nitpicks:
>
> -    return !isTargetDarwin() && !isTargetWindows() && !isTargetCygMing();
> +      return TargetTriple.getEnvironment() == Triple::ELF || (
> +          !isTargetDarwin() && !isTargetWindows() && !isTargetCygMing());
> Put ( at the new line :)
>
> --
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University

I agree with Anton here. This should be consistent and not just
special cased for ELF/Windows.

The only thing I'm not sure about is how much effort will be required
to properly respect the requested format. As it stands, there is quite
a bit of code that assumes Windows => COFF and Darwin => MachO. There
are also features, such as TLS, which depend on the format, but are
all currently based on the OS.

- Michael Spencer




More information about the llvm-commits mailing list