Go llvm/emscripten ?

agolangf · · 492 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Did anyone tried to compile Go code to llvm bitcode and then to javascript?</p> <p>I can&#39;t use gopherjs because my library uses CGO, and C code already supports emscripten (includes emscripten.h where necessary etc.).</p> <p>I managed to compile emscripten fork of llvm/clang with latest llgo from svn (it is moved to llvm.org), and I can get bitcode like this <em>llgo -c -emit-llvm hello.go -o hello.bc</em></p> <p>But <em>emcc hello.bc -o hello.js</em> then complains about different targets/triples , asmjs-unknown-emscripten vs x86_64-linux-unknown .</p> <p>Is something like this possible? I only found some info about llvm that in theory it should be possible.</p> <hr/>**评论:**<br/><br/>allowthere: <pre><p><a href="http://llvm.org/svn/llvm-project/llgo/trunk/README.TXT" rel="nofollow">http://llvm.org/svn/llvm-project/llgo/trunk/README.TXT</a></p> <blockquote> <p>llgo is currently only supported on the x86-64 Linux platform. Contributions that add support for other platforms are welcome.</p> </blockquote> <p>There are two components which would need to be ported to new platforms: the compiler and the runtime library. The compiler has little platform-specific code; the most significant is in irgen/cabi.go. The main limiting factor for new platforms is the runtime library in third_party/gofrontend/libgo, which inherits some support for other platforms from the gc compiler&#39;s runtime library, but this support tends to be incomplete.</p></pre>umpahblah: <pre><p>Thanks, I missed to read that README.</p></pre>

入群交流(和以上内容无关):Go中文网 QQ 交流群:798786647 或加微信入微信群:274768166 备注:入群;关注公众号:Go语言中文网

492 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传