douhui8025 2019-05-31 11:28
浏览 30

是否可以在没有操作系统的情况下在没有内置库的情况下编译go代码而无需内置库

Like C compile flags -fno-pic -O -nostdinc -c -static -fno-builtin -fno-strict-aliasing -m32 -fno-stack-protector can compile codes into pure ELF without library rely on unique system. Is there a possible way GO can do that?

  • 写回答

1条回答 默认 最新

  • dsjz1119 2019-05-31 12:37
    关注

    Simple answer is no. Go relies on the operating system (Windows, linux, macOS, BSD). Go has a runtime designed to work on specific environments https://github.com/golang/go/wiki/MinimumRequirements.

    There are some open source projects that will help you achieve it, but I wouldn't put them in production as they support a limited number of hardware chips and they are not supported in the same way as the standard library. Some examples are:

    https://github.com/ziutek/emgo

    https://github.com/tinygo-org/tinygo

    These frameworks/libraries will help you run Go code on bare metal.

    评论

报告相同问题?

悬赏问题

  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程