Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emscripten #826

Closed
TurkeyMan opened this issue Jan 20, 2015 · 6 comments
Closed

Emscripten #826

TurkeyMan opened this issue Jan 20, 2015 · 6 comments

Comments

@TurkeyMan
Copy link

Hey people, I was trying to use Emscripten with LDC. I didn't get very far.
As far as I can tell, Emscripten appears to be an officially supported platform in LLVM these days, so I figured there was good chance that it would 'just work'... but not so lucky.

I tried to supply -mtriple=asmjs-unknown-emscripten, which as far as I can tell is the way to inform LLVM that my target shall be Emscripten, but it fails with:
Error: unable to get target for 'asmjs-unknown-emscripten', see -version and -mtriple.
Any ideas?
Tried this before?

On an unrelated side note, how is that that when I run Clang on a .d file, it somehow invokes LDC?
> clang test.d -> doesn't complain about d source code, then errors about OPTLINK, which is not what I was expecting (I initially invoked Clang by accident). There's no Clang exe in the LDC distribution (Windows)... so I can't imagine where that logic comes from?

@dnadlinger
Copy link
Member

As far as I can tell, Emscripten appears to be an officially supported platform in LLVM these days

I haven't been following Emscripten in quite a while, so I'm not sure about its status. However, judging from the below results from LLVM trunk, it doesn't seem to be supported in the way you think at all:

$ fgrep -riI asmjs include
$ fgrep -riI emscripten include
include/llvm/ADT/Triple.h:    le32,       // le32: generic little-endian 32-bit CPU (PNaCl / Emscripten)
include/llvm/ADT/Triple.h:    le64,       // le64: generic little-endian 64-bit CPU (PNaCl / Emscripten)

On an unrelated side note, how is that that when I run Clang on a .d file, it somehow invokes LDC?

It does not.

clang test.d

My guess is that Clang interprets it as a linker script. At least that's what it seems to do on Linux, albeit with a warning.

OPTLINK

LDC doesn't use OPTLINK at all. Regarding your observation, Clang probably tries to invoke the Microsoft link.exe, but fails as your PATH is not set up correctly.

@TurkeyMan
Copy link
Author

Bummer :(

I have another opportunity to get D into use in my company, but I need to be able to target at least Emscripten, ideally nacl too. Library is not important; -betterc would be a perfectly acceptable starting point. I'm happy to flesh out the runtime/phobos ports for those platforms as I go if there was a working compiler available.

@Trass3r
Copy link
Contributor

Trass3r commented Jan 21, 2015

So why not just compile llvm yourself with the Emscripten backend included?

@TurkeyMan
Copy link
Author

Because I have no idea what I'm doing, and I don't have any free time to learn :(
I'd be stretching my work time budget as it is.

@yannick
Copy link

yannick commented Jul 4, 2017

close? see
#2144

@kinke
Copy link
Member

kinke commented Jul 29, 2018

Yeah, superseded by WebAssembly.

@kinke kinke closed this as completed Jul 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants