Odin icon indicating copy to clipboard operation
Odin copied to clipboard

Respect `-lld` CLI arg on non-windows machines

Open pcleavelin opened this issue 1 year ago • 3 comments

I noticed that it doesn't seem like the -lld flag does anything on Linux & MacOS hosts. I just naively added a check and appended fuse-ld=lld to the clang args.

I'm not sure if this is the best way to do this, or if there are unintended side-effects of this change (such as changing the system_exec_command_line_app call from ld-link to lld-link).

For more context of how I found this, see #3044

pcleavelin avatar Jan 04 '24 22:01 pcleavelin

@Kelimion can be merged.. will see if that makes link times faster on linux/macOS as lld would be a bit faster then default old ld.

Platin21 avatar Jan 13 '24 23:01 Platin21

Works nicely for me, around 100ms faster just trying it out on some bigger projects

laytan avatar Jan 16 '24 23:01 laytan

Glad to see this is getting some attention. New to Odin and I was looking for a way to choose which linker we wanted to use.

Was looking to see if someone already had the idea or not.

Instead of hard-coding a choice between LD & LLD, could we just instead have it accept -fuse-ld= arguments? So that way we can supply our own linker. I'd like to keep using mold, as I use it with my other c/rust projects? unless I am reading this PR wrong and that would be the intention then completely disregard my idiocy.

norgesSverd avatar Feb 19 '24 18:02 norgesSverd