ponylang / ponyc

Pony is an open-source, actor-model, capabilities-secure, high performance programming language
http://www.ponylang.io
BSD 2-Clause "Simplified" License
5.71k stars 415 forks source link

Use embedded LLD for linking #1837

Open sylvanc opened 7 years ago

sylvanc commented 7 years ago

https://lld.llvm.org

This would eliminate the compiler's dependence on a C compiler for linking on Linux and on link.exe for linking on Windows.

LLD could be used as a library rather than needing to shell out to it.

malthe commented 7 years ago

LLD is still buggy on Mac: https://bugs.llvm.org/show_bug.cgi?id=32376

sblessing commented 6 years ago

Hey guys,

slowly but surely returning to this project: I have implemented this and just need to test it on Windows. This issue can be assigned to me and I make sure to submit a pull request soon.

Looks good on OSX, Linux and BSD!

jemc commented 6 years ago

Hey @sblessing! Welcome back.

I've sent you an invite to the org so you can be assigned this ticket. Once you accept, write back here and I'll assign you.

Cogitri commented 5 years ago

Hello,

due to ld.gold being rather buggy on musl (it just plain crashes if built without -fPIE: ld.gold: fatal error: build/release/stable: No error information) Alpine would be very interested in this too (or maybe I can somehow work around this for now by doing position executable binaries with ponyc? I don't know ponyc too well, sorry for my little knowledge :)

SeanTAllen commented 5 years ago

Yes, PIE is support already @Cogitri. If you pass default_pic=true to make when building Pony, it will use when linking all binaries. See https://www.ponylang.io/faq/#pic-compile-error

Cogitri commented 5 years ago

Hm, I already build ponyc with that option and just tried with ponyc --pic and it resulted in the same build error for pony-stable. Adding CFLAGS=-fPIE did the trick for ponyc, but I guess this leaves us with a non-functional compiler nontheless :/

SeanTAllen commented 5 years ago

We build and release for alpine all the time, so I'm not sure what issue you are running into. I suggest checking https://github.com/ponylang/ponyc/blob/master/.dockerhub/alpine/Dockerfile. Beyond that, please open a new issue as this is off topic for this issue.

Cogitri commented 5 years ago

Ah, sorry, I felt this was related to this due to using LLD as linker would fix this. I'll open a new issue.

SeanTAllen commented 5 years ago

No need to apologize @Cogitri. We have veered off from LLD though.

sblessing commented 5 years ago

I do have a running implementation with LLD. Unfortunately LLD is not yet where we need it to be and, and using LLD wouldn't remove vcvars.* :(

But I do think that LLD 9.0.0 looks promising.

SeanTAllen commented 4 years ago

@sblessing any update on LLD 9.0.0?

sblessing commented 4 years ago

@SeanTAllen Yes. I do have various examples running and so far it looks good. Do we need an RFC to eventually get this merged (and potentially at first have this as an experimental ponyc option)

mfelsche commented 4 years ago

I think an RFC would make sense to clarify how/if to expose it to users of ponyc (as an experimental flag or just replace using the system linker). I know I tend to avoid the RFC-route, but in this case I would be fine to bring it in without RFC if it is only enabled via experimental option flag.

SeanTAllen commented 2 years ago

I'm looking to get this moving. See more in Zulip:

https://ponylang.zulipchat.com/#narrow/stream/189952-compiler-discussion/topic/Embedding.20lld.20in.20ponyc

3052 commented 10 months ago

I saw this in 2020, and it was the one issue that kept me from Pony. I eventually learned and now develop in Go, mainly because the install process is simple, for Linux macos and windows. I would still like to try Pony, but asking windows users to install an extra 1 gb worth of stuff (visual c), is hard to justify when the current Go installer is 70 mb, linker included.