Thread overview
Commandline compatibility with Clang?
Oct 16, 2015
Shriramana Sharma
Oct 22, 2015
Kai Nacke
Oct 23, 2015
Kagamin
Oct 24, 2015
Kai Nacke
Oct 26, 2015
Kagamin
Oct 23, 2015
Kagamin
October 16, 2015
Hello. I downloaded ldc expecting that it will have relative Commandline compatibility with Clang, especially that the -o option will work just like in Clang/GCC. But neither the ldc2 nor ldmd2 provides the -o option but goes -of= like DMD. Can I open an issue requesting this or is there a particular reason that the syntax deviates?

Thanks.

-- 
Shriramana Sharma, Penguin #395953
October 22, 2015
On Friday, 16 October 2015 at 13:33:36 UTC, Shriramana Sharma wrote:
> Hello. I downloaded ldc expecting that it will have relative Commandline compatibility with Clang, especially that the -o option will work just like in Clang/GCC. But neither the ldc2 nor ldmd2 provides the -o option but goes -of= like DMD. Can I open an issue requesting this or is there a particular reason that the syntax deviates?
>
> Thanks.

Hi Shriramana!

There are 2 reasons for the naming of command line options. First, ldc predates Clang. Second, ldc links against LLVM and inherits all the command line options which are also not compatible with Clang.

I think about introducing a new ldc driver and sanitizing the command line options. But many tools (e.g. dub) depends on the current options ldc2 provides. This will not change.

Regards,
Kai
October 23, 2015
On Thursday, 22 October 2015 at 19:16:00 UTC, Kai Nacke wrote:
> There are 2 reasons for the naming of command line options. First, ldc predates Clang. Second, ldc links against LLVM and inherits all the command line options which are also not compatible with Clang.

How is that? AFAIK all llvm tools use gcc-like -o option.
October 23, 2015
https://github.com/llvm-mirror/llvm/blob/master/tools/llc/llc.cpp#L59
October 24, 2015
On Friday, 23 October 2015 at 08:37:38 UTC, Kagamin wrote:
> On Thursday, 22 October 2015 at 19:16:00 UTC, Kai Nacke wrote:
>> There are 2 reasons for the naming of command line options. First, ldc predates Clang. Second, ldc links against LLVM and inherits all the command line options which are also not compatible with Clang.
>
> How is that? AFAIK all llvm tools use gcc-like -o option.

You not only want the -o option but also all of the -f/-m options. The LLVM libraries do not use -f/-m options.

Regards,
Kai
October 26, 2015
On Saturday, 24 October 2015 at 21:47:31 UTC, Kai Nacke wrote:
> You not only want the -o option but also all of the -f/-m options. The LLVM libraries do not use -f/-m options.

I mean only -o option: -of= is just too weird. Other options are ok, e.g. -debug is definitely better than -fdebug. That said, LLVM tools options convention seems to be generally better than that of gcc. -m options may be better to implement as traditional -W/-X/-L forwarding. I think it would be great to be able to forward llc options to codegen stage.