Skip to content

Commit 7b34166

Browse files
authored
Merge pull request moby#3080 from zeldin/ppc64
Add ppc64 to list of arches
2 parents c9a0f4d + c48cd2c commit 7b34166

File tree

8 files changed

+53
-1
lines changed

8 files changed

+53
-1
lines changed

client/llb/state.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,7 @@ var (
617617
LinuxArmel = Platform(ocispecs.Platform{OS: "linux", Architecture: "arm", Variant: "v6"})
618618
LinuxArm64 = Platform(ocispecs.Platform{OS: "linux", Architecture: "arm64"})
619619
LinuxS390x = Platform(ocispecs.Platform{OS: "linux", Architecture: "s390x"})
620+
LinuxPpc64 = Platform(ocispecs.Platform{OS: "linux", Architecture: "ppc64"})
620621
LinuxPpc64le = Platform(ocispecs.Platform{OS: "linux", Architecture: "ppc64le"})
621622
Darwin = Platform(ocispecs.Platform{OS: "darwin", Architecture: "amd64"})
622623
Windows = Platform(ocispecs.Platform{OS: "windows", Architecture: "amd64"})

solver/llbsolver/ops/exec_binfmt.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ var qemuArchMap = map[string]string{
2727
"riscv64": "riscv64",
2828
"arm": "arm",
2929
"s390x": "s390x",
30+
"ppc64": "ppc64",
3031
"ppc64le": "ppc64le",
3132
"386": "i386",
3233
}

util/archutil/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ FROM base AS exit-s390x
3636
COPY fixtures/exit.s390x.s .
3737
RUN s390x-linux-gnu-as --noexecstack -o exit.o exit.s390x.s && s390x-linux-gnu-ld -o exit -s exit.o
3838

39+
FROM base AS exit-ppc64
40+
COPY fixtures/exit.ppc64.s .
41+
RUN powerpc64le-linux-gnu-as -mbig --noexecstack -o exit.o exit.ppc64.s && powerpc64le-linux-gnu-ld -EB -o exit -s exit.o
42+
3943
FROM base AS exit-ppc64le
4044
COPY fixtures/exit.ppc64le.s .
4145
RUN powerpc64le-linux-gnu-as --noexecstack -o exit.o exit.ppc64le.s && powerpc64le-linux-gnu-ld -o exit -s exit.o
@@ -56,12 +60,13 @@ COPY --from=exit-arm64 /src/exit arm64
5660
COPY --from=exit-arm /src/exit arm
5761
COPY --from=exit-riscv64 /src/exit riscv64
5862
COPY --from=exit-s390x /src/exit s390x
63+
COPY --from=exit-ppc64 /src/exit ppc64
5964
COPY --from=exit-ppc64le /src/exit ppc64le
6065
COPY --from=exit-mips64le /src/exit mips64le
6166
COPY --from=exit-mips64 /src/exit mips64
6267
COPY generate.go .
6368

64-
RUN go run generate.go amd64 386 arm64 arm riscv64 s390x ppc64le mips64le mips64 && ls -l
69+
RUN go run generate.go amd64 386 arm64 arm riscv64 s390x ppc64 ppc64le mips64le mips64 && ls -l
6570

6671

6772
FROM scratch

util/archutil/detect.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ func SupportedPlatforms(noCache bool) []ocispecs.Platform {
4848
arr = append(arr, linux(p))
4949
}
5050
}
51+
if p := "ppc64"; def.Architecture != p {
52+
if _, err := ppc64Supported(); err == nil {
53+
arr = append(arr, linux(p))
54+
}
55+
}
5156
if p := "ppc64le"; def.Architecture != p {
5257
if _, err := ppc64leSupported(); err == nil {
5358
arr = append(arr, linux(p))
@@ -109,6 +114,11 @@ func WarnIfUnsupported(pfs []ocispecs.Platform) {
109114
printPlatformWarning(p, err)
110115
}
111116
}
117+
if p.Architecture == "ppc64" {
118+
if _, err := ppc64Supported(); err != nil {
119+
printPlatformWarning(p, err)
120+
}
121+
}
112122
if p.Architecture == "ppc64le" {
113123
if _, err := ppc64leSupported(); err != nil {
114124
printPlatformWarning(p, err)

util/archutil/fixtures/exit.ppc64.s

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.global _start
2+
.section ".opd","aw"
3+
_start:
4+
.quad .L.start,.TOC.@tocbase,0
5+
.text
6+
.abiversion 1
7+
.L.start:
8+
li %r0, 1
9+
li %r3, 0
10+
sc

util/archutil/ppc64_binary.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//go:build !ppc64
2+
// +build !ppc64
3+
4+
package archutil
5+
6+
// This file is generated by running make inside the archutil package.
7+
// Do not edit manually.
8+
9+
const Binaryppc64 = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\xec\xd0\xb1\x8a\x13\x51\x14\x06\xe0\xff\x8e\xd9\x45\xd0\x62\x2c\x84\x05\x9b\x3c\x40\x98\x7a\xcb\x14\x6a\x65\xa3\x2f\xa0\x2b\x89\x6c\x23\xca\xee\x14\x76\xfb\xb4\x81\xbc\x45\x24\x93\xc9\x64\x12\x89\xa4\xb0\x92\xef\x83\xdc\x73\x72\x66\x7e\xce\x65\x9e\xde\x7d\x78\x5f\x55\x25\x83\x2a\xaf\x93\x74\x83\xba\x6c\xd6\xfd\x74\xde\x9d\x25\xd3\xee\x9c\xe7\x36\x93\xcc\x73\x95\x49\xff\xee\x55\x46\xea\x93\x9a\x94\xd9\x51\x2d\xc3\x79\xbd\x9b\xef\xf6\xec\xf7\x8d\xf6\xde\x1c\xd5\x92\x2c\xda\xd5\xc7\x43\xee\x62\xf5\xa2\x5d\x7d\x4a\xba\xfb\x5e\xbe\x2f\x29\xb7\xdb\xdf\x97\xe4\xed\xf6\xcb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfc\x27\xea\x94\x69\x57\xab\xa7\xc3\xb0\x79\xbc\x7f\x6c\x1f\xda\xbb\xaf\x69\xda\xe5\xaf\x36\xcd\xf2\xfe\xf3\xb7\x87\xbb\xef\xcb\x34\x3f\x7e\x2e\xfe\xc5\xda\x17\x49\x4a\xdf\x5f\x8f\xef\x91\xa1\xe6\xe5\x49\xe6\xf9\xa8\x7f\x35\xca\x57\x7d\x7e\xd6\xe7\x67\x67\x76\x4e\x46\xfd\x9b\x51\xfe\x59\x97\x2f\x9b\xf5\xee\xef\xbe\xe6\xe6\x2f\xfb\xcb\x3e\xf7\x87\x32\x74\xd3\x73\x4f\x7e\x07\x00\x00\xff\xff\x5e\xe4\x1d\xbd\x60\x01\x01\x00"

util/archutil/ppc64_check.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//go:build !ppc64
2+
// +build !ppc64
3+
4+
package archutil
5+
6+
func ppc64Supported() (string, error) {
7+
return check("ppc64", Binaryppc64)
8+
}

util/archutil/ppc64_check_ppc64.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//go:build ppc64
2+
// +build ppc64
3+
4+
package archutil
5+
6+
func ppc64Supported() (string, error) {
7+
return "", nil
8+
}

0 commit comments

Comments
 (0)