Skip to content

Commit d40b4f7

Browse files
authored
Revert "Remove building ppc (#504) (#513)" (#582)
1 parent 96a300d commit d40b4f7

File tree

8 files changed

+109
-3
lines changed

8 files changed

+109
-3
lines changed

.github/release-drafter.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ template: |
5353
- `docker.elastic.co/beats-dev/golang-crossbuild:$RESOLVED_VERSION-main-debian11` - linux/i386, linux/amd64, windows/amd64
5454
- `docker.elastic.co/beats-dev/golang-crossbuild:$RESOLVED_VERSION-main-debian12` - linux/i386, linux/amd64, windows/amd64
5555
- `docker.elastic.co/beats-dev/golang-crossbuild:$RESOLVED_VERSION-mips-debian12` - linux/mips64, linux/mips64el
56+
- `docker.elastic.co/beats-dev/golang-crossbuild:$RESOLVED_VERSION-ppc-debian12` - linux/ppc64, linux/ppc64le
5657
- `docker.elastic.co/beats-dev/golang-crossbuild:$RESOLVED_VERSION-s390x-debian12` - linux/s390x
5758
5859
### Changes

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ Replace `<GOLANG_VERSION>` with the version you would like to use, for instance:
6767
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-mips-debian11` - linux/mips64, linux/mips64el
6868
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-mips-debian12` - linux/mips64, linux/mips64el
6969
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-mips32` - linux/mips, linux/mipsle **NOTE**: it does not exist from Golang versions > `1.18.5`/`1.17.12`.
70-
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-ppc-debian12` - linux/ppc64, linux/ppc64le **NOTE**: it does not exist from Golang versions >= `1.23.6`.
70+
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-ppc-debian11` - linux/ppc64, linux/ppc64le
71+
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-ppc-debian12` - linux/ppc64, linux/ppc64le
7172
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-s390x-debian11` - linux/s390x
7273
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-s390x-debian12` - linux/s390x
7374

@@ -81,7 +82,7 @@ Replace `<GOLANG_VERSION>` with the version you would like to use, for instance:
8182

8283
## Old Build Tags
8384

84-
Until Golang version `1.15`
85+
Until Golang version 1.15
8586

8687
| Description | Tags for 1.10 | Tags for 1.11 | Tags for 1.12 | Tags for 1.13 | Tags for 1.14 | Tags for 1.15 |
8788
| ------------- | -----| ------- | ----- | ------ | ------ | ------ |
@@ -344,6 +345,11 @@ It is used to cross compile for `linux/mips`. This Docker image is based on the
344345
The `mips32` image is the base image for the `mips32` architecture, it is build for Debian 11+.
345346
It is used to cross compile for `linux/mips32`. This Docker image is based on the `base` image.
346347

348+
## go/ppc Docker image
349+
350+
The `ppc` image is the base image for the `ppc` architecture, it is build for Debian 12+.
351+
It is used to cross compile for `linux/ppc`. This Docker image is based on the `base` image.
352+
347353
## go/s390x Docker image
348354

349355
The `s390x` image is the base image for the `s390x` architecture, it is build for Debian 12+.

go/Makefile.debian12

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
IMAGES := base main darwin armhf armel mips s390x npcap
1+
IMAGES := base main darwin armhf armel mips ppc s390x npcap
22
ARM_IMAGES := base-arm darwin-arm64
33
DEBIAN_VERSION := 12
44
TAG_EXTENSION := -debian12

go/ppc/.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Makefile

go/ppc/Dockerfile.tmpl

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
ARG REPOSITORY
2+
ARG VERSION
3+
ARG TAG_EXTENSION=''
4+
FROM ${REPOSITORY}/golang-crossbuild:${VERSION}-base${TAG_EXTENSION}
5+
6+
RUN dpkg --add-architecture ppc64el \
7+
&& apt update -y --no-install-recommends \
8+
&& apt upgrade -y --no-install-recommends \
9+
&& apt full-upgrade -y --no-install-recommends \
10+
&& apt install -qq -y --no-install-recommends \
11+
g++-powerpc64-linux-gnu \
12+
gcc-powerpc64-linux-gnu \
13+
crossbuild-essential-ppc64el
14+
15+
RUN apt install -qq -y \
16+
libc-dev:ppc64el \
17+
libpopt-dev:ppc64el \
18+
linux-libc-dev:ppc64el
19+
20+
{{- if eq .DEBIAN_VERSION "9" }}
21+
RUN apt install -qq -y \
22+
libelf1:ppc64el \
23+
libicu-dev:ppc64el \
24+
libicu57:ppc64el \
25+
librpm-dev:ppc64el \
26+
libxml2-dev:ppc64el \
27+
libxml2:ppc64el \
28+
librpm3:ppc64el \
29+
librpmio3:ppc64el \
30+
librpmbuild3:ppc64el \
31+
librpmsign3:ppc64el \
32+
libsqlite3-dev:ppc64el \
33+
libnss3:ppc64el \
34+
libsqlite3-0:ppc64el
35+
36+
# RUN apt install -y \
37+
# libsystemd-dev:ppc64el libsystemd0:ppc64el liblz4-1:ppc64el
38+
{{- end }}
39+
40+
{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11") (eq .DEBIAN_VERSION "12")}}
41+
# librpm-dev
42+
RUN apt install -y \
43+
librpm-dev:ppc64el
44+
45+
# libsystemd-dev
46+
RUN apt install -y \
47+
libsystemd-dev:ppc64el
48+
{{- end }}
49+
50+
RUN rm -rf /var/lib/apt/lists/*
51+
52+
COPY rootfs /
53+
54+
# Basic test
55+
RUN cd / \
56+
&& powerpc64le-linux-gnu-gcc helloWorld.c -o helloWorld \
57+
&& file helloWorld \
58+
&& readelf -h helloWorld \
59+
&& readelf -h helloWorld | grep -c 'PowerPC64' \
60+
&& readelf -h helloWorld | grep -c 'ELF64' \
61+
&& readelf -h helloWorld | grep -c "little endian" \
62+
&& rm helloWorld.c helloWorld
63+
64+
RUN cd /libpcap/libpcap-1.8.1 \
65+
&& cp -R /libpcap/libpcap-1.8.1 /libpcap/libpcap-1.8.1-ppc64 \
66+
&& cp -R /libpcap/libpcap-1.8.1 /libpcap/libpcap-1.8.1-ppc64el \
67+
&& cd /libpcap/libpcap-1.8.1-ppc64 \
68+
&& CC=powerpc64-linux-gnu-gcc ./configure --enable-usb=no --enable-bluetooth=no --enable-dbus=no --host=ppc64-unknown-linux-gnu --with-pcap=linux \
69+
&& make \
70+
&& cd /libpcap/libpcap-1.8.1-ppc64el \
71+
&& CC=powerpc64le-linux-gnu-gcc ./configure --enable-usb=no --enable-bluetooth=no --enable-dbus=no --host=ppc64el-unknown-linux-gnu --with-pcap=linux \
72+
&& make
73+
74+
# Build-time metadata as defined at http://label-schema.org.
75+
ARG BUILD_DATE
76+
ARG IMAGE
77+
ARG VCS_REF
78+
ARG VCS_URL
79+
LABEL org.label-schema.build-date=$BUILD_DATE \
80+
org.label-schema.name=$IMAGE \
81+
org.label-schema.vcs-ref=$VCS_REF \
82+
org.label-schema.vcs-url=$VCS_URL \
83+
org.label-schema.schema-version="1.0"

go/ppc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include ../Makefile.common

go/ppc/rootfs/compilers.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
3+
linux:
4+
ppc64:
5+
CC: powerpc64-linux-gnu-gcc
6+
CXX: powerpc64-linux-gnu-g++
7+
ppc64le:
8+
CC: powerpc64le-linux-gnu-gcc
9+
CXX: powerpc64le-linux-gnu-g++

go/ppc/rootfs/helloWorld.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#include <stdio.h>
2+
int main() {
3+
printf("Hello, World!");
4+
return 0;
5+
}

0 commit comments

Comments
 (0)