构建 Go 链接器作为独立工具

huangapple go评论80阅读模式
英文:

Building go linker as a stand alone tool

问题

我正在浏览 Go 源代码,并且想将其构建为一个独立的链接器,用于在 macOS 上生成 Mach-O 文件。有没有办法实现这个目标?

英文:

I was browsing the go source and I wanted to build it as a standalone linker for osx that can generate mach-o files. Is there anyway to do this?

答案1

得分: 1

链接器已经是一个独立的工具。你可以通过运行以下命令来查看它的位置:

go tool -n 6l

这将打印出6l(x86 64位链接器)可执行文件的位置。

6l的源代码可以在GOROOT/src/cmd/6l中找到。

在该目录中,你可以使用make来构建它。

英文:

The linker is already a standalone tool. You can see it by running

go tool -n 6l

which will print the location of the 6l (x86 64 bit linker) executable.

The source code of 6l can be found in GOROOT/src/cmd/6l.

In that directory you can use make to build it.

huangapple
  • 本文由 发表于 2014年5月16日 23:10:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/23698744.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定