链接器可以与任意的目标文件(汇编文件)一起使用。

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

Link Go with arbitrary object files (assembly)?

问题

我想让我写的汇编函数在我的Go代码中可用。我已经看到了使用Go汇编语法链接函数的方法,或者使用gccgo工具链链接目标文件的方法。

然而,理想情况下,我希望能够使用NASM和"gc"工具链。我已经尝试了cgo/6g/6l,但是到目前为止没有成功。

英文:

I would like to make functions written in assembly available to my Go code. I have seen methods for linking functions written in Go assembler's syntax or linking object files using the gccgo toolchain.

However, ideally, I would like to be able to use NASM and the "gc" toolchain. I have been messing around with cgo/6g/6l, but had no luck so far.

答案1

得分: 1

你可以按照https://code.google.com/p/go-wiki/wiki/GcToolchainTricks中所述的方法使用syso文件,但是关于它的资源几乎没有。

英文:

You can use syso files as outlined in https://code.google.com/p/go-wiki/wiki/GcToolchainTricks, however there are next to no resources about it.

huangapple
  • 本文由 发表于 2014年9月21日 22:27:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/25960217.html
匿名

发表评论

匿名网友

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

确定