Skip to content

Commit f624de4

Browse files
authored
autoconf: Sync config.guess, config.sub with CPython repo, update to latest (#36)
* autoconf: Sync config.guess, config.sub with CPython repo `config.sub.patch` is derived from: python/cpython@bee7bb3 https://lists.gnu.org/archive/html/config-patches/2024-02/msg00001.html * autoconf: Update config.guess and config.sub Also refresh `config.sub.patch` to match <https://lists.gnu.org/archive/html/config-patches/2025-01/msg00003.html>. * autoconf: Force overwrite the `--install` files Also, use `set -x` to make troubleshooting easier.
1 parent 63cf6cb commit f624de4

File tree

3 files changed

+84
-0
lines changed

3 files changed

+84
-0
lines changed

autoconf/Dockerfile

+12
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ FROM docker.io/library/ubuntu:24.04
33
ARG AUTOCONF_VERSION="2.72"
44
ARG AUTOCONF_ARCHIVE_VERSION="2023.02.20"
55
ARG AUTOMAKE_VERSION="1.16.5"
6+
# Specific revision of https://git.savannah.gnu.org/git/config.git
7+
# for config.guess and config.sub.
8+
ARG CONFIG_GIT_REV="00b15927496058d23e6258a28d8996f87cf1f191"
69

710
LABEL org.opencontainers.image.source="https://github.com/python/cpython-devcontainers"
811
LABEL org.opencontainers.image.base.name="docker.io/library/ubuntu:22.04"
@@ -40,6 +43,15 @@ RUN PATCH_VERBOSE=1 curl https://ftp.gnu.org/gnu/autoconf-archive/autoconf-archi
4043
&& ./configure --prefix=/usr/local \
4144
&& make \
4245
&& make install
46+
ADD --chmod=755 https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=${CONFIG_GIT_REV} \
47+
/usr/local/share/autoconf/build-aux/config.guess
48+
ADD --chmod=755 https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=${CONFIG_GIT_REV} \
49+
/usr/local/share/autoconf/build-aux/config.sub
50+
COPY config.sub.patch .
51+
RUN p=$(pwd)/config.sub.patch \
52+
&& cd /usr/local/share/autoconf/build-aux \
53+
&& patch -p1 <$p \
54+
&& rm "$p"
4355

4456
# https://stackoverflow.com/questions/8811381/possibly-undefined-macro-ac-msg-error/49103418#49103418
4557
RUN cp /usr/local/share/aclocal/*.m4 /usr/share/aclocal \

autoconf/config.sub.patch

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
From 7a7c6fc48512405ede8b2db440b702e866364b00 Mon Sep 17 00:00:00 2001
2+
From: Russell Keith-Magee <[email protected]>
3+
Date: Mon, 26 Feb 2024 09:21:10 +0800
4+
Subject: [PATCH] config.sub: Include support for arm64_32 and iOS/tvOS/watchOS
5+
simulators
6+
7+
* Normalise the watchOS CPU architecture descriptor used by
8+
Apple (`arm64_32`).
9+
* Accept the `-simulator` suffix for descriptors for iOS, tvOS and
10+
watchOS.
11+
12+
The following is the list of compiler triples generated by Apple's
13+
clang toolchains for iOS 12.0, tvOS 9.0, and watchOS 4.0:
14+
15+
* `arm64-apple-ios12.0`
16+
* `x86_64-apple-ios12.0-simulator`
17+
* `arm64-apple-ios12.0-simulator`
18+
* `arm64-apple-tvos9.0`
19+
* `x86_64-apple-tvos9.0-simulator`
20+
* `arm64-apple-tvos9.0-simulator`
21+
* `arm64_32-apple-watchos4.0`
22+
* `arm64-apple-watchos4.0-simulator`
23+
24+
The `-simulator` suffix is significant because iOS devices and iOS
25+
simulators have a different ABI. It is therefore essential that these
26+
can be differentiated in a compiler triple.
27+
---
28+
config.sub | 6 ++++--
29+
1 file changed, 4 insertions(+), 2 deletions(-)
30+
31+
diff --git a/config.sub b/config.sub
32+
index 4aaae46..335706d 100755
33+
--- a/config.sub
34+
+++ b/config.sub
35+
@@ -4,7 +4,7 @@
36+
37+
# shellcheck disable=SC2006,SC2268,SC2162 # see below for rationale
38+
39+
-timestamp='2024-05-27'
40+
+timestamp='2025-01-06'
41+
42+
# This file is free software; you can redistribute it and/or modify it
43+
# under the terms of the GNU General Public License as published by
44+
@@ -1194,7 +1194,7 @@ case $cpu-$vendor in
45+
xscale-* | xscalee[bl]-*)
46+
cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
47+
;;
48+
- arm64-* | aarch64le-*)
49+
+ arm64-* | aarch64le-* | arm64_32-*)
50+
cpu=aarch64
51+
;;
52+
53+
@@ -2249,6 +2249,8 @@ case $kernel-$os-$obj in
54+
;;
55+
*-eabi*- | *-gnueabi*-)
56+
;;
57+
+ ios*-simulator- | tvos*-simulator- | watchos*-simulator- )
58+
+ ;;
59+
none--*)
60+
# None (no kernel, i.e. freestanding / bare metal),
61+
# can be paired with an machine code file format
62+
--
63+
2.47.1
64+

autoconf/entry.sh

+8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ if [ "$#" = "0" ]; then
2222
fi
2323

2424
echo "Rebuilding configure script using $($AUTOCONF --version | head -n 1)"
25+
set -x
26+
# autoreconf's '--force' option doesn't affect any of the files installed
27+
# by the '--install' option. Remove the files to truly force them to be
28+
# updated so that the CPython repo doesn't drift from this repo.
29+
rm -f /src/aclocal.m4
30+
rm -f /src/config.guess
31+
rm -f /src/config.sub
32+
rm -f /src/install-sh
2533
exec $AUTORECONF -ivf -Werror $@
2634
fi
2735

0 commit comments

Comments
 (0)