加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 创业 > C语言 > 正文

用go1.4编译go1.6

发布时间:2020-12-15 00:40:06 所属栏目:C语言 来源:网络整理
导读:下载go1.4 binary,并解压到~/go1.4 下载go1.6 source,解压至/data/tools/go 执行src/all.bash执行编译,此时会自动执行构建和测试过程 编译好后把go放到/usr/local/go 配置环境变量 中间有一些不理解的地方,有warning,不知道是否有影响。暂时还是先使用
  1. 下载go1.4 binary,并解压到~/go1.4

  2. 下载go1.6 source,解压至/data/tools/go

  3. 执行src/all.bash执行编译,此时会自动执行构建和测试过程

  4. 编译好后把go放到/usr/local/go

  5. 配置环境变量

中间有一些不理解的地方,有warning,不知道是否有影响。暂时还是先使用官方binary。

[root@ctos src]# ./all.bash

Building Go bootstrap tool.

cmd/dist

Building Go toolchain using /root/go1.4.

bootstrap/internal/obj
bootstrap/internal/obj/arm
bootstrap/internal/obj/arm64
bootstrap/internal/obj/mips
bootstrap/internal/obj/ppc64
bootstrap/internal/obj/x86
bootstrap/asm/internal/arch
bootstrap/asm/internal/flags
bootstrap/asm/internal/lex
bootstrap/asm/internal/asm
bootstrap/asm
bootstrap/compile/internal/big
bootstrap/internal/gcprog
bootstrap/compile/internal/gc
bootstrap/compile/internal/amd64
bootstrap/compile/internal/arm
bootstrap/compile/internal/arm64
bootstrap/compile/internal/mips64
bootstrap/compile/internal/ppc64
bootstrap/compile/internal/x86
bootstrap/compile
bootstrap/link/internal/ld
bootstrap/link/internal/amd64
bootstrap/link/internal/arm
bootstrap/link/internal/arm64
bootstrap/link/internal/mips64
bootstrap/link/internal/ppc64
bootstrap/link/internal/x86
bootstrap/link

Building go_bootstrap for host,linux/amd64.

runtime/internal/sys
runtime/internal/atomic
runtime
encoding
errors
internal/race
internal/syscall/windows/sysdll
math
sort
sync/atomic
unicode
unicode/utf16
unicode/utf8
sync
container/heap
internal/singleflight
io
syscall
hash
hash/adler32
bytes
strings
strconv
bufio
path
internal/syscall/windows
internal/syscall/windows/registry
time
reflect
encoding/base64
crypto
regexp/syntax
crypto/sha1
os
regexp
encoding/binary
fmt
os/signal
path/filepath
io/ioutil
os/exec
flag
go/token
log
net/url
text/template/parse
compress/flate
encoding/json
debug/dwarf
go/scanner
go/ast
compress/zlib
text/template
debug/macho
debug/elf
go/parser
go/doc
go/build
cmd/go

Building packages and commands for linux/amd64.

runtime/internal/sys
runtime/internal/atomic
runtime
errors
internal/race
sync/atomic
sync
io
unicode
unicode/utf8
bytes
bufio
math
strconv
reflect
encoding/binary
syscall
time
os
fmt
sort
flag
log
strings
path/filepath
cmd/internal/obj
cmd/internal/goobj
cmd/internal/unvendor/golang.org/x/arch/arm/armasm
cmd/internal/unvendor/golang.org/x/arch/x86/x86asm
compress/flate
hash
hash/adler32
compress/zlib
path
debug/dwarf
debug/elf
debug/gosym
debug/macho
debug/pe
debug/plan9obj
regexp/syntax
regexp
text/tabwriter
cmd/internal/objfile
cmd/addr2line
io/ioutil
archive/tar
hash/crc32
archive/zip
compress/bzip2
compress/gzip
compress/lzw
container/heap
container/list
container/ring
crypto
crypto/subtle
crypto/cipher
crypto/aes
crypto/des
math/rand
math/big
crypto/dsa
crypto/elliptic
crypto/sha512
encoding/asn1
crypto/ecdsa
crypto/hmac
crypto/md5
internal/syscall/unix
crypto/rand
crypto/rc4
crypto/rsa
crypto/sha1
crypto/sha256
crypto/x509/pkix
encoding/hex
encoding/base64
encoding/pem
internal/singleflight
go/token
go/scanner
go/ast
go/parser
go/printer
os/exec
cmd/cgo
runtime/cgo
net
crypto/x509
crypto/tls
database/sql/driver
database/sql
encoding
encoding/ascii85
encoding/base32
encoding/csv
encoding/gob
unicode/utf16
encoding/json
encoding/xml
internal/golang.org/x/net/http2/hpack
mime
mime/quotedprintable
net/textproto
mime/multipart
net/http/internal
net/url
net/http
expvar
text/template/parse
text/template
go/doc
go/build
go/constant
go/format
go/types
text/scanner
go/internal/gccgoimporter
go/internal/gcimporter
go/importer
hash/crc64
hash/fnv
html
html/template
image/color
image
image/color/palette
image/internal/imageutil
image/draw
image/gif
image/jpeg
image/png
index/suffixarray
internal/syscall/windows/sysdll
runtime/debug
runtime/pprof
runtime/trace
testing
internal/testenv
internal/trace
log/syslog
math/cmplx
net/http/cgi
net/http/cookiejar
net/http/fcgi
net/http/httptest
net/http/httputil
net/http/pprof
net/internal/socktest
net/mail
net/rpc
net/rpc/jsonrpc
net/smtp
os/signal
os/user
runtime/race
testing/iotest
testing/quick
cmd/api
cmd/internal/obj/arm
cmd/internal/obj/arm64
cmd/internal/obj/mips
cmd/internal/obj/ppc64
cmd/internal/obj/x86
cmd/asm/internal/arch
cmd/asm/internal/flags
cmd/asm/internal/lex
cmd/asm/internal/asm
cmd/asm
cmd/compile/internal/big
cmd/internal/gcprog
cmd/compile/internal/gc
cmd/compile/internal/amd64
cmd/compile/internal/arm
cmd/compile/internal/arm64
cmd/compile/internal/mips64
cmd/compile/internal/ppc64
cmd/compile/internal/x86
cmd/compile
cmd/cover
cmd/dist
cmd/doc
cmd/fix
cmd/go
cmd/gofmt
cmd/link/internal/ld
cmd/link/internal/amd64
cmd/link/internal/arm
cmd/link/internal/arm64
cmd/link/internal/mips64
cmd/link/internal/ppc64
cmd/link/internal/x86
cmd/link
cmd/nm
cmd/objdump
cmd/pack
cmd/pprof/internal/profile
cmd/pprof/internal/plugin
cmd/pprof/internal/report
cmd/pprof/internal/svg
cmd/pprof/internal/tempfile
cmd/pprof/internal/commands
cmd/pprof/internal/driver
cmd/pprof/internal/fetch
cmd/pprof/internal/symbolizer
cmd/pprof/internal/symbolz
cmd/pprof
cmd/trace
cmd/vet/internal/whitelist
cmd/vet
cmd/yacc

Testing packages.

ok archive/tar 0.012s
ok archive/zip 0.042s
ok bufio 0.049s
ok bytes 0.061s
ok compress/bzip2 0.043s
ok compress/flate 0.109s
ok compress/gzip 0.007s
ok compress/lzw 0.003s
ok compress/zlib 0.012s
ok container/heap 0.002s
ok container/list 0.002s
ok container/ring 0.010s
ok crypto/aes 0.025s
ok crypto/cipher 0.003s
ok crypto/des 0.008s
ok crypto/dsa 0.004s
ok crypto/ecdsa 0.025s
ok crypto/elliptic 0.029s
ok crypto/hmac 0.003s
ok crypto/md5 0.004s
ok crypto/rand 0.023s
ok crypto/rc4 0.076s
ok crypto/rsa 0.067s
ok crypto/sha1 0.003s
ok crypto/sha256 0.003s
ok crypto/sha512 0.003s
ok crypto/subtle 0.004s
ok crypto/tls 0.548s
ok crypto/x509 0.980s
ok database/sql 0.031s
ok database/sql/driver 0.002s
ok debug/dwarf 0.005s
ok debug/elf 0.013s
ok debug/gosym 0.200s
ok debug/macho 0.002s
ok debug/pe 0.007s
ok debug/plan9obj 0.002s
ok encoding/ascii85 0.002s
ok encoding/asn1 0.004s
ok encoding/base32 0.003s
ok encoding/base64 0.003s
ok encoding/binary 0.003s
ok encoding/csv 0.003s
ok encoding/gob 0.029s
ok encoding/hex 0.002s
ok encoding/json 0.098s
ok encoding/pem 0.009s
ok encoding/xml 0.008s
ok errors 0.002s
ok expvar 0.004s
ok flag 0.002s
ok fmt 0.105s
ok go/ast 0.004s
ok go/build 0.050s
ok go/constant 0.004s
ok go/doc 0.025s
ok go/format 0.007s
ok go/internal/gccgoimporter 0.003s
ok go/internal/gcimporter 0.124s
ok go/parser 0.021s
ok go/printer 0.230s
ok go/scanner 0.003s
ok go/token 0.017s
ok go/types 0.379s
ok hash/adler32 0.005s
ok hash/crc32 0.003s
ok hash/crc64 0.002s
ok hash/fnv 0.002s
ok html 0.003s
ok html/template 0.025s
ok image 0.078s
ok image/color 0.058s
ok image/draw 0.049s
ok image/gif 0.058s
ok image/jpeg 0.101s
ok image/png 0.024s
ok index/suffixarray 0.007s
ok internal/golang.org/x/net/http2/hpack 0.004s
ok internal/singleflight 0.013s
ok internal/trace 0.002s
ok io 0.023s
ok io/ioutil 0.003s
ok log 0.003s
ok log/syslog 2.032s
ok math 0.003s
ok math/big 0.223s
ok math/cmplx 0.002s
ok math/rand 0.047s
ok mime 0.007s
ok mime/multipart 0.252s
ok mime/quotedprintable 0.091s
ok net 2.035s
ok net/http 9.900s
ok net/http/cgi 0.341s
ok net/http/cookiejar 0.005s
ok net/http/fcgi 0.004s
ok net/http/httptest 0.005s
ok net/http/httputil 0.019s
ok net/http/internal 0.002s
ok net/internal/socktest 0.002s
ok net/mail 0.004s
ok net/rpc 0.010s
ok net/rpc/jsonrpc 0.005s
ok net/smtp 0.026s
ok net/textproto 0.003s
ok net/url 0.004s
ok os 0.389s
ok os/exec 0.193s
ok os/signal 4.254s
ok os/user 0.003s
ok path 0.002s
ok path/filepath 0.012s
ok reflect 0.046s
ok regexp 0.085s
ok regexp/syntax 0.283s
ok runtime 21.176s
ok runtime/debug 0.004s
ok runtime/internal/atomic 0.057s
ok runtime/pprof 1.207s
ok runtime/trace 2.319s
ok sort 0.050s
ok strconv 0.373s
ok strings 0.068s
ok sync 0.105s
ok sync/atomic 0.153s
ok syscall 0.026s
ok testing 2.671s
ok testing/quick 0.029s
ok text/scanner 0.003s
ok text/tabwriter 0.003s
ok text/template 0.016s
ok text/template/parse 0.005s
ok time 2.556s
ok unicode 0.002s
ok unicode/utf16 0.002s
ok unicode/utf8 0.003s
ok cmd/addr2line 0.951s
ok cmd/api 0.005s
ok cmd/asm/internal/asm 0.113s
ok cmd/asm/internal/lex 0.003s
ok cmd/compile/internal/big 0.483s
ok cmd/compile/internal/gc 0.363s
ok cmd/cover 1.702s
ok cmd/doc 0.013s
ok cmd/fix 0.009s
ok cmd/go 46.844s
ok cmd/gofmt 0.019s
ok cmd/internal/goobj 0.002s
ok cmd/internal/obj 0.002s
ok cmd/internal/obj/x86 0.002s
ok cmd/internal/unvendor/golang.org/x/arch/arm/armasm 0.004s
ok cmd/internal/unvendor/golang.org/x/arch/x86/x86asm 0.145s
ok cmd/nm 0.904s
ok cmd/objdump 2.609s
ok cmd/pack 1.792s
ok cmd/pprof/internal/profile 0.002s
ok cmd/vet 2.533s

GOMAXPROCS=2 runtime -cpu=1,2,4

ok runtime 58.339s

Testing without libgcc.

ok crypto/x509 3.041s
ok net 0.016s
ok os/user 0.020s

sync -cpu=10

ok sync 0.146s

../misc/cgo/stdio
../misc/cgo/life
../misc/cgo/test

PASS
ok _/data/tools/go/misc/cgo/test 1.963s
PASS
ok _/data/tools/go/misc/cgo/test 1.970s
PASS
ok _/data/tools/go/misc/cgo/test 1.729s
PASS
ok _/data/tools/go/misc/cgo/testtls 0.014s
PASS
ok _/data/tools/go/misc/cgo/testtls 0.009s
PASS
ok _/data/tools/go/misc/cgo/testtls 0.002s
PASS
ok _/data/tools/go/misc/cgo/nocgo 0.009s
PASS
ok _/data/tools/go/misc/cgo/nocgo 0.011s
PASS
ok _/data/tools/go/misc/cgo/nocgo 0.020s
PASS
ok _/data/tools/go/misc/cgo/test 1.867s
PASS
ok _/data/tools/go/misc/cgo/testtls 0.011s
PASS
ok _/data/tools/go/misc/cgo/nocgo 0.019s

Testing race detector

ok runtime/race 7.050s
ok flag 1.026s
ok os/exec 2.043s
PASS
scatter = 0x644350
hello from C
sqrt is: 0
ok _/data/tools/go/misc/cgo/test 3.141s
ok flag 1.017s
ok os/exec 2.033s

../misc/cgo/testgodefs
../misc/cgo/testso
../misc/cgo/testsovar
../misc/cgo/testcarchive

which: no go_linux_amd64_exec in (/data/tools/go/bin:/data/node/bin:/usr/local/rvm/gems/ruby-2.2.1/bin:/usr/local/heroku/bin:/usr/local/rvm/gems/ruby-2.2.1/bin:/usr/local/rvm/gems/ruby-2.2.1@global/bin:/usr/local/rvm/rubies/ruby-2.2.1/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/rvm/bin:/root/bin:/usr/local/go/bin)
PASS
PASS
PASS
PASS
PASS
PASS

../misc/cgo/testcshared

ok

../misc/cgo/testshared

PASS
ok _/data/tools/go/misc/cgo/testshared 24.986s

../misc/cgo/testasan
../misc/cgo/testsanitizers

skipping msan test: -fsanitize=memory not supported

../misc/cgo/errors
../misc/cgo/testsigfwd
../test/bench/go1

testing: warning: no tests to run
PASS
ok _/data/tools/go/test/bench/go1 8.245s

../test
API check

Go version is "go1.6.2",ignoring -next /data/tools/go/api/next.txt

ALL TESTS PASSED


Installed Go for linux/amd64 in /data/tools/go
Installed commands in /data/tools/go/bin
* You need to add /data/tools/go/bin to your PATH.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读