Commit 51586aad authored by Michael Hudson-Doyle's avatar Michael Hudson-Doyle

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/13994Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent c34fb3cf
...@@ -227,7 +227,8 @@ func Main() { ...@@ -227,7 +227,8 @@ func Main() {
if Thearch.Thechar == '6' { if Thearch.Thechar == '6' {
obj.Flagcount("largemodel", "generate code that assumes a large memory model", &flag_largemodel) 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") 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) obj.Flagstr("cpuprofile", "write cpu profile to `file`", &cpuprofile)
......
...@@ -388,7 +388,7 @@ func buildModeInit() { ...@@ -388,7 +388,7 @@ func buildModeInit() {
codegenArg = "-fPIC" codegenArg = "-fPIC"
} else { } else {
switch platform { switch platform {
case "linux/386", "linux/amd64", "linux/arm": case "linux/386", "linux/amd64", "linux/arm", "linux/arm64":
buildAsmflags = append(buildAsmflags, "-D=shared=1") buildAsmflags = append(buildAsmflags, "-D=shared=1")
default: default:
fatalf("-buildmode=shared not supported on %s\n", platform) fatalf("-buildmode=shared not supported on %s\n", platform)
...@@ -407,7 +407,7 @@ func buildModeInit() { ...@@ -407,7 +407,7 @@ func buildModeInit() {
codegenArg = "-fPIC" codegenArg = "-fPIC"
} else { } else {
switch platform { switch platform {
case "linux/386", "linux/amd64", "linux/arm": case "linux/386", "linux/amd64", "linux/arm", "linux/arm64":
buildAsmflags = append(buildAsmflags, "-D=shared=1") buildAsmflags = append(buildAsmflags, "-D=shared=1")
default: default:
fatalf("-buildmode=shared not supported on %s\n", platform) fatalf("-buildmode=shared not supported on %s\n", platform)
......
...@@ -104,7 +104,7 @@ func archinit() { ...@@ -104,7 +104,7 @@ func archinit() {
break break
} }
if ld.Buildmode == ld.BuildmodeCShared { if ld.Buildmode == ld.BuildmodeCShared || ld.DynlinkingGo() {
ld.Linkmode = ld.LinkExternal ld.Linkmode = ld.LinkExternal
} }
......
...@@ -321,7 +321,7 @@ func (mode *BuildMode) Set(s string) error { ...@@ -321,7 +321,7 @@ func (mode *BuildMode) Set(s string) error {
} }
*mode = BuildmodeCShared *mode = BuildmodeCShared
case "shared": case "shared":
if goos != "linux" || (goarch != "386" && goarch != "amd64" && goarch != "arm") { if goos != "linux" || (goarch != "386" && goarch != "amd64" && goarch != "arm" && goarch != "arm64") {
return badmode() return badmode()
} }
*mode = BuildmodeShared *mode = BuildmodeShared
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment