Skip to content

Commit bc133da

Browse files
committed
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
1 parent d970886 commit bc133da

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

autoconf/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ 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 revisions of https://git.savannah.gnu.org/git/config.git
7+
# for config.guess and config.sub.
8+
ARG CONFIG_GUESS_REV="9428e344e65176b03b69e4bf4ed0d0fc51d4c26f"
9+
ARG CONFIG_SUB_REV="948ae97ca5703224bd3eada06b7a69f40dd15a02"
610

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

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

autoconf/config.sub.patch

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
From bee7bb3310b356e99e3a0f75f23efbc97f1b0a24 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 | 5 ++++-
29+
1 file changed, 4 insertions(+), 1 deletion(-)
30+
31+
diff --git a/config.sub b/config.sub
32+
index 2c6a07a..1bb6a05 100755
33+
--- a/config.sub
34+
+++ b/config.sub
35+
@@ -4,6 +4,7 @@
36+
37+
# shellcheck disable=SC2006,SC2268 # see below for rationale
38+
39+
+# Patched 2024-02-03 to include support for arm64_32 and iOS/tvOS/watchOS simulators
40+
timestamp='2024-01-01'
41+
42+
# This file is free software; you can redistribute it and/or modify it
43+
@@ -1127,7 +1128,7 @@ case $cpu-$vendor in
44+
xscale-* | xscalee[bl]-*)
45+
cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
46+
;;
47+
- arm64-* | aarch64le-*)
48+
+ arm64-* | aarch64le-* | arm64_32-*)
49+
cpu=aarch64
50+
;;
51+
52+
@@ -1866,6 +1867,8 @@ case $kernel-$os-$obj in
53+
;;
54+
*-eabi*- | *-gnueabi*-)
55+
;;
56+
+ ios*-simulator- | tvos*-simulator- | watchos*-simulator- )
57+
+ ;;
58+
none--*)
59+
# None (no kernel, i.e. freestanding / bare metal),
60+
# can be paired with an machine code file format
61+
--
62+
2.47.1
63+

0 commit comments

Comments
 (0)