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() {
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
......
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