diff --git a/src/cmd/link/internal/ld/config.go b/src/cmd/link/internal/ld/config.go index b404f1897d17a3..dff83d9d0eb09f 100644 --- a/src/cmd/link/internal/ld/config.go +++ b/src/cmd/link/internal/ld/config.go @@ -247,9 +247,6 @@ func determineLinkMode(ctxt *Link) { } ctxt.LinkMode = LinkInternal case "1": - if objabi.GOARCH == "ppc64" && objabi.GOOS != "aix" { - Exitf("external linking requested via GO_EXTLINK_ENABLED but not supported for %s/ppc64", objabi.GOOS) - } ctxt.LinkMode = LinkExternal default: if needed, _ := mustLinkExternal(ctxt); needed { @@ -261,17 +258,10 @@ func determineLinkMode(ctxt *Link) { } else { ctxt.LinkMode = LinkInternal } - if objabi.GOARCH == "ppc64" && objabi.GOOS != "aix" && ctxt.LinkMode == LinkExternal { - Exitf("external linking is not supported for %s/ppc64", objabi.GOOS) - } } case LinkInternal: if needed, reason := mustLinkExternal(ctxt); needed { Exitf("internal linking requested but external linking required: %s", reason) } - case LinkExternal: - if objabi.GOARCH == "ppc64" && objabi.GOOS != "aix" { - Exitf("external linking not supported for %s/ppc64", objabi.GOOS) - } } } diff --git a/src/runtime/asm_ppc64x.s b/src/runtime/asm_ppc64x.s index 8b850683f71d67..4a41a70b01b63f 100644 --- a/src/runtime/asm_ppc64x.s +++ b/src/runtime/asm_ppc64x.s @@ -10,7 +10,7 @@ #include "textflag.h" #include "asm_ppc64x.h" -#ifdef GOOS_aix +#ifdef GOARCH_ppc64 #define cgoCalleeStackSize 48 #else #define cgoCalleeStackSize 32 @@ -562,7 +562,7 @@ TEXT gosave<>(SB),NOSPLIT|NOFRAME,$0 BL runtime·badctxt(SB) RET -#ifdef GOOS_aix +#ifdef GOARCH_ppc64 #define asmcgocallSaveOffset cgoCalleeStackSize + 8 #else #define asmcgocallSaveOffset cgoCalleeStackSize diff --git a/src/runtime/rt0_linux_ppc64.s b/src/runtime/rt0_linux_ppc64.s index 1265b158532f8f..fc1f172aa74957 100644 --- a/src/runtime/rt0_linux_ppc64.s +++ b/src/runtime/rt0_linux_ppc64.s @@ -18,6 +18,7 @@ TEXT _main<>(SB),NOSPLIT,$-8 // There is no TLS base pointer. // // TODO(austin): Support ABI v1 dynamic linking entry point + XOR R0, R0 // following functions assume R0 is zero MOVD $runtime·rt0_go(SB), R12 MOVD R12, CTR MOVBZ runtime·iscgo(SB), R5