dtr32221
2016-10-21 09:10
浏览 306
已采纳

Golang运行时重新编译

Well ,I sooooo flesh for the Golang . And I get a mission to recompile the Golang 's runtime via this blog.

One way is to change this default number in the GO runtime (GCC-GO or GC) and recompile the runtime. In proc.go, you can change the line sched.maxmcount = 10000 to a number that is appropriate.

First: recompile the whole golang.

I follow this Installing Go from source ,and execute this cmd:

./all.bash

Output is :

Building Go bootstrap tool.
cmd/dist
import cycle not allowed
package cmd/dist
    imports bytes
    imports errors
    imports runtime
    imports runtime/internal/atomic
    imports unsafe
    imports runtime

It seems everything work well, but while I check about the go cmd,it's the same. Also ,I can't find any change to bin or pkg dir.

Then ,try to build pkg

go install src/runtime

Also, it doesn't come out any error and I can't find any target build.

I have no any idea how to do it :(

Any suggestion well so appresiate !

图片转代码服务由CSDN问答提供 功能建议

好吧,我为Golang补充了肉。 我的任务是通过此博客

一种方法是在GO运行时(GCC-GO或GC)中更改此默认数字并重新编译 运行时。 在proc.go中,您可以将sched.maxmcount = 10000行更改为适当的数字。

首先:重新编译整个golang。

我遵循以下从源代码安装Go 并执行此cmd:< / p>

./ all.bash

输出为:

  正在构建Go引导程序工具。
cmd / dist 
不允许导入周期
package cmd / dist 
导入字节
导入错误
导入运行时
导入运行时/内部/原子
导入不安全
导入运行时
 <  / code>  
 
 

似乎一切正常,但是当我检查 go cmd时,它是相同的。 另外,我找不到对bin或pkg目录的任何更改。

然后,尝试构建pkg

去安装src / 运行时

此外,它不会出现任何错误,我也找不到任何目标构建。

我不知道该怎么做:(

任何建议都很好,很感谢!

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dsk49208 2016-10-21 17:20
    已采纳

    You install packages by their import path, so you don't use the src/ prefix.

    To recompile the runtime package, use:

    $ go install -a -v runtime
    runtime/internal/sys
    runtime/internal/atomic
    runtime
    
    已采纳该答案
    打赏 评论

相关推荐 更多相似问题