Skip to content

Commit 5a9a739

Browse files
committed
Add C++ and libstdc++ to cross-compiling Docker images
This is a follow-on from #512 / d0ed97f where we started always setting the CXX environment variable to ensure we don't accidentally try and use the host (non-cross-compiling) C++ compiler. In attempting to upgrade to a more modern s509x minimum arch-level (z10), we found that the configure script for bdb fails. It tries to check the C++ compiler is working (respecting the CXX environment variable that is set), but fails to run the pre-processor with `$CXX -E` (as the C++ compiler isn't actually installed). It then falls back to `/lib/cpp`, which up until now has been working fine. Now that we're specifying `-march=z10` this fails as `/lib/cpp` doesn't know about `z10`. I don't know if we actually need to use the C++ compiler, but I'm adding it in to at least satisfy the configure script, and do the correct thing should we need it (rather than the incorrect thing of falling back to the host compiler).
1 parent 9bd86fa commit 5a9a739

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

cpython-unix/build.cross-riscv64.Dockerfile

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ RUN apt-get install \
4848

4949
# Cross-building.
5050
RUN apt-get install \
51+
g++-aarch64-linux-gnu \
52+
g++-arm-linux-gnueabi \
53+
g++-arm-linux-gnueabihf \
54+
g++-mips-linux-gnu \
55+
g++-mips64el-linux-gnuabi64 \
56+
g++-mipsel-linux-gnu \
57+
g++-powerpc64le-linux-gnu \
58+
g++-riscv64-linux-gnu \
59+
g++-s390x-linux-gnu \
5160
gcc-aarch64-linux-gnu \
5261
gcc-arm-linux-gnueabi \
5362
gcc-arm-linux-gnueabihf \
@@ -65,4 +74,13 @@ RUN apt-get install \
6574
libc6-dev-mipsel-cross \
6675
libc6-dev-ppc64el-cross \
6776
libc6-dev-riscv64-cross \
68-
libc6-dev-s390x-cross
77+
libc6-dev-s390x-cross \
78+
libstdc++-6-dev-arm64-cross \
79+
libstdc++-6-dev-armel-cross \
80+
libstdc++-6-dev-armhf-cross \
81+
libstdc++-6-dev-mips-cross \
82+
libstdc++-6-dev-mips64el-cross \
83+
libstdc++-6-dev-mipsel-cross \
84+
libstdc++-6-dev-ppc64el-cross \
85+
libstdc++-6-dev-riscv64-cross \
86+
libstdc++-6-dev-s390x-cross \

cpython-unix/build.cross.Dockerfile

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ RUN apt-get install \
5151

5252
# Cross-building.
5353
RUN apt-get install \
54+
g++-aarch64-linux-gnu \
55+
g++-arm-linux-gnueabi \
56+
g++-arm-linux-gnueabihf \
57+
g++-mips-linux-gnu \
58+
g++-mips64el-linux-gnuabi64 \
59+
g++-mipsel-linux-gnu \
60+
g++-powerpc64le-linux-gnu \
61+
g++-s390x-linux-gnu \
5462
gcc-aarch64-linux-gnu \
5563
gcc-arm-linux-gnueabi \
5664
gcc-arm-linux-gnueabihf \
@@ -66,4 +74,12 @@ RUN apt-get install \
6674
libc6-dev-mips64el-cross \
6775
libc6-dev-mipsel-cross \
6876
libc6-dev-ppc64el-cross \
69-
libc6-dev-s390x-cross
77+
libc6-dev-s390x-cross \
78+
libstdc++-6-dev-arm64-cross \
79+
libstdc++-6-dev-armel-cross \
80+
libstdc++-6-dev-armhf-cross \
81+
libstdc++-6-dev-mips-cross \
82+
libstdc++-6-dev-mips64el-cross \
83+
libstdc++-6-dev-mipsel-cross \
84+
libstdc++-6-dev-ppc64el-cross \
85+
libstdc++-6-dev-s390x-cross

0 commit comments

Comments
 (0)