|
1 | | -From 528470c4ab4919e4d90b58f421bf0a8db8a684e1 Mon Sep 17 00:00:00 2001 |
| 1 | +From 8ef031958781e230765ef9ea4c0cd490c9afa848 Mon Sep 17 00:00:00 2001 |
2 | 2 | From: Kartatz <105828205+Kartatz@users.noreply.github.com> |
3 | 3 | Date: Sun, 9 Aug 2026 19:18:37 +0000 |
4 | | -Subject: [PATCH] gcc: also set POSIX xm_defines for Android hosts |
| 4 | +Subject: [PATCH] gcc: set POSIX xm_defines for any Linux host |
5 | 5 |
|
6 | 6 | The second pass of the cpu_type loop registers HAVE_ATEXIT/POSIX/BSTRING |
7 | | -for hosts whose triple matches "*-*-linux-gnu*". Android host triples |
8 | | -are "*-*-linux-android*" (e.g. aarch64-unknown-linux-android21), so they |
9 | | -slipped through this case and POSIX was left undefined for the build/host. |
10 | | -Code like protoize.c then took the non-POSIX branch (using the |
11 | | -<sys/dir.h> include that bionic does not provide), breaking the build. |
| 7 | +only for hosts whose triple matches "*-*-linux-gnu*". Other Linux-based |
| 8 | +hosts whose triple doesn't end in "-linux-gnu*" (e.g. Android's |
| 9 | +aarch64-unknown-linux-android21, or any *-*-linux-* host) slip through this |
| 10 | +case and POSIX is left undefined -- code like protoize.c then took the |
| 11 | +non-POSIX branch (using <sys/dir.h>, which bionic does not provide), |
| 12 | +breaking the build. |
12 | 13 |
|
13 | | -Extend the pattern to also match "*-*-linux-android*", treating Android |
14 | | -like the other GNU/Linux hosts it shares a POSIX kernel interface with. |
| 14 | +Match "*-*-linux-*" instead, so every Linux-based host picks up the |
| 15 | +POSIX defs. |
15 | 16 | --- |
16 | 17 | gcc/configure | 4 ++-- |
17 | 18 | gcc/configure.in | 4 ++-- |
18 | 19 | 2 files changed, 4 insertions(+), 4 deletions(-) |
19 | 20 |
|
20 | 21 | diff --git a/gcc/configure b/gcc/configure |
21 | | -index 9810e80..82a0642 100755 |
| 22 | +index 9810e80..010e159 100755 |
22 | 23 | --- a/gcc/configure |
23 | 24 | +++ b/gcc/configure |
24 | 25 | @@ -2962,9 +2962,9 @@ for machine in $build $host $target; do |
25 | 26 | tm_file=${cpu_type}/${cpu_type}.h |
26 | 27 | xm_file=${cpu_type}/xm-${cpu_type}.h |
27 | 28 |
|
28 | 29 | - # Common parts for linux-gnu and openbsd systems |
29 | | -+ # Common parts for Linux (glibc/Android) and openbsd systems |
| 30 | ++ # Common parts for Linux and openbsd systems |
30 | 31 | case $machine in |
31 | 32 | - *-*-linux-gnu*) |
32 | | -+ *-*-linux-gnu* | *-*-linux-android*) |
| 33 | ++ *-*-linux-*) |
33 | 34 | xm_defines="HAVE_ATEXIT POSIX BSTRING" |
34 | 35 | ;; |
35 | 36 | *-*-openbsd*) |
36 | 37 | diff --git a/gcc/configure.in b/gcc/configure.in |
37 | | -index b177082..79ace1f 100644 |
| 38 | +index b177082..c2da6b8 100644 |
38 | 39 | --- a/gcc/configure.in |
39 | 40 | +++ b/gcc/configure.in |
40 | 41 | @@ -528,9 +528,9 @@ changequote([,])dnl |
41 | 42 | tm_file=${cpu_type}/${cpu_type}.h |
42 | 43 | xm_file=${cpu_type}/xm-${cpu_type}.h |
43 | 44 |
|
44 | 45 | - # Common parts for linux-gnu and openbsd systems |
45 | | -+ # Common parts for Linux (glibc/Android) and openbsd systems |
| 46 | ++ # Common parts for Linux and openbsd systems |
46 | 47 | case $machine in |
47 | 48 | - *-*-linux-gnu*) |
48 | | -+ *-*-linux-gnu* | *-*-linux-android*) |
| 49 | ++ *-*-linux-*) |
49 | 50 | xm_defines="HAVE_ATEXIT POSIX BSTRING" |
50 | 51 | ;; |
51 | 52 | *-*-openbsd*) |
|
0 commit comments