mirror of
https://github.com/golang/go
synced 2024-11-23 16:20:04 -07:00
cmd/compile, cmd/go, cmd/link: enable -buildmode=shared and related flags on linux/arm64
Change-Id: Ibddbbf6f4a5bd336a8b234d40fad0fcea574cd6e Reviewed-on: https://go-review.googlesource.com/13994 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
c34fb3cfc6
commit
51586aadfb
@ -227,7 +227,8 @@ func Main() {
|
||||
if Thearch.Thechar == '6' {
|
||||
obj.Flagcount("largemodel", "generate code that assumes a large memory model", &flag_largemodel)
|
||||
}
|
||||
if Thearch.Thechar == '5' || Thearch.Thechar == '6' || Thearch.Thechar == '8' || Thearch.Thechar == '9' {
|
||||
switch Thearch.Thechar {
|
||||
case '5', '6', '7', '8', '9':
|
||||
flag.BoolVar(&flag_dynlink, "dynlink", false, "support references to Go symbols defined in other shared libraries")
|
||||
}
|
||||
obj.Flagstr("cpuprofile", "write cpu profile to `file`", &cpuprofile)
|
||||
|
@ -388,7 +388,7 @@ func buildModeInit() {
|
||||
codegenArg = "-fPIC"
|
||||
} else {
|
||||
switch platform {
|
||||
case "linux/386", "linux/amd64", "linux/arm":
|
||||
case "linux/386", "linux/amd64", "linux/arm", "linux/arm64":
|
||||
buildAsmflags = append(buildAsmflags, "-D=shared=1")
|
||||
default:
|
||||
fatalf("-buildmode=shared not supported on %s\n", platform)
|
||||
@ -407,7 +407,7 @@ func buildModeInit() {
|
||||
codegenArg = "-fPIC"
|
||||
} else {
|
||||
switch platform {
|
||||
case "linux/386", "linux/amd64", "linux/arm":
|
||||
case "linux/386", "linux/amd64", "linux/arm", "linux/arm64":
|
||||
buildAsmflags = append(buildAsmflags, "-D=shared=1")
|
||||
default:
|
||||
fatalf("-buildmode=shared not supported on %s\n", platform)
|
||||
|
@ -104,7 +104,7 @@ func archinit() {
|
||||
break
|
||||
}
|
||||
|
||||
if ld.Buildmode == ld.BuildmodeCShared {
|
||||
if ld.Buildmode == ld.BuildmodeCShared || ld.DynlinkingGo() {
|
||||
ld.Linkmode = ld.LinkExternal
|
||||
}
|
||||
|
||||
|
@ -321,7 +321,7 @@ func (mode *BuildMode) Set(s string) error {
|
||||
}
|
||||
*mode = BuildmodeCShared
|
||||
case "shared":
|
||||
if goos != "linux" || (goarch != "386" && goarch != "amd64" && goarch != "arm") {
|
||||
if goos != "linux" || (goarch != "386" && goarch != "amd64" && goarch != "arm" && goarch != "arm64") {
|
||||
return badmode()
|
||||
}
|
||||
*mode = BuildmodeShared
|
||||
|
Loading…
Reference in New Issue
Block a user