Skip to content

Commit 029b911

Browse files
committed
unix: simplify configure nerfs during cross-compiling
All the override values here were the same for all triples. And forcing CROSS_COMPILING in more scenarios in recent commits appears to have tickled an issue on musl libc. So let's make the configs universal. AFAICT the risk with the /dev/pt* checks is minimal, as Python's `os.openpty()` should use a function from `pty.h` and not rely on the device handles. But there is a risk we're doing something subtly wrong. TBH I'm not sure why device presence is a configure time check. I would think this is the type of thing that should be a run-time check since different environments have different devices. So I suspect there's a CPython portability bug lingering in here...
1 parent bb6f562 commit 029b911

File tree

1 file changed

+3
-53
lines changed

1 file changed

+3
-53
lines changed

cpython-unix/build-cpython.sh

Lines changed: 3 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -797,60 +797,10 @@ if [ -n "${CROSS_COMPILING}" ]; then
797797
# configure doesn't like a handful of scenarios when cross-compiling.
798798
#
799799
# getaddrinfo buggy test fails for some reason. So we short-circuit it.
800-
#
800+
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_buggy_getaddrinfo=no"
801801
# The /dev/* check also fails for some reason.
802-
case "${TARGET_TRIPLE}" in
803-
*-apple-*)
804-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_buggy_getaddrinfo=no"
805-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_file__dev_ptc=no"
806-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_file__dev_ptmx=no"
807-
;;
808-
i686-unknown-linux-gnu)
809-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_buggy_getaddrinfo=no"
810-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_file__dev_ptc=no"
811-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_file__dev_ptmx=no"
812-
;;
813-
aarch64-unknown-linux-gnu)
814-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_buggy_getaddrinfo=no"
815-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_file__dev_ptc=no"
816-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_file__dev_ptmx=no"
817-
;;
818-
armv7-unknown-linux-gnueabi)
819-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_buggy_getaddrinfo=no"
820-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_file__dev_ptc=no"
821-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_file__dev_ptmx=no"
822-
;;
823-
armv7-unknown-linux-gnueabihf)
824-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_buggy_getaddrinfo=no"
825-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_file__dev_ptc=no"
826-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_file__dev_ptmx=no"
827-
;;
828-
mips-unknown-linux-gnu)
829-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_buggy_getaddrinfo=no"
830-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_file__dev_ptc=no"
831-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_file__dev_ptmx=no"
832-
;;
833-
mipsel-unknown-linux-gnu)
834-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_buggy_getaddrinfo=no"
835-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_file__dev_ptc=no"
836-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_file__dev_ptmx=no"
837-
;;
838-
mips64el-unknown-linux-gnuabi64)
839-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_buggy_getaddrinfo=no"
840-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_file__dev_ptc=no"
841-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_file__dev_ptmx=no"
842-
;;
843-
s390x-unknown-linux-gnu)
844-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_buggy_getaddrinfo=no"
845-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_file__dev_ptc=no"
846-
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_file__dev_ptmx=no"
847-
;;
848-
x86_64-unknown-linux-musl)
849-
;;
850-
*)
851-
echo "unhandled cross-compiling triple; may run into issues"
852-
;;
853-
esac
802+
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_file__dev_ptc=no"
803+
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_file__dev_ptmx=no"
854804
fi
855805

856806
CFLAGS=$CFLAGS CPPFLAGS=$CFLAGS LDFLAGS=$LDFLAGS \

0 commit comments

Comments
 (0)