Skip to content

Commit 6284af1

Browse files
committed
Add C++ 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 6284af1

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

cpython-unix/build.cross-riscv64.Dockerfile

Lines changed: 9 additions & 0 deletions
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 \

cpython-unix/build.cross.Dockerfile

Lines changed: 8 additions & 0 deletions
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 \

0 commit comments

Comments
 (0)