Skip to content

Commit de2e002

Browse files
committed
a
1 parent bc4e62e commit de2e002

1 file changed

Lines changed: 16 additions & 15 deletions

File tree

patches/gcc-2.9/0007-gcc-also-set-POSIX-xm_defines-for-Android-hosts.patch

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,52 @@
1-
From 528470c4ab4919e4d90b58f421bf0a8db8a684e1 Mon Sep 17 00:00:00 2001
1+
From 8ef031958781e230765ef9ea4c0cd490c9afa848 Mon Sep 17 00:00:00 2001
22
From: Kartatz <105828205+Kartatz@users.noreply.github.com>
33
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
55

66
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.
1213

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.
1516
---
1617
gcc/configure | 4 ++--
1718
gcc/configure.in | 4 ++--
1819
2 files changed, 4 insertions(+), 4 deletions(-)
1920

2021
diff --git a/gcc/configure b/gcc/configure
21-
index 9810e80..82a0642 100755
22+
index 9810e80..010e159 100755
2223
--- a/gcc/configure
2324
+++ b/gcc/configure
2425
@@ -2962,9 +2962,9 @@ for machine in $build $host $target; do
2526
tm_file=${cpu_type}/${cpu_type}.h
2627
xm_file=${cpu_type}/xm-${cpu_type}.h
2728

2829
- # 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
3031
case $machine in
3132
- *-*-linux-gnu*)
32-
+ *-*-linux-gnu* | *-*-linux-android*)
33+
+ *-*-linux-*)
3334
xm_defines="HAVE_ATEXIT POSIX BSTRING"
3435
;;
3536
*-*-openbsd*)
3637
diff --git a/gcc/configure.in b/gcc/configure.in
37-
index b177082..79ace1f 100644
38+
index b177082..c2da6b8 100644
3839
--- a/gcc/configure.in
3940
+++ b/gcc/configure.in
4041
@@ -528,9 +528,9 @@ changequote([,])dnl
4142
tm_file=${cpu_type}/${cpu_type}.h
4243
xm_file=${cpu_type}/xm-${cpu_type}.h
4344

4445
- # 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
4647
case $machine in
4748
- *-*-linux-gnu*)
48-
+ *-*-linux-gnu* | *-*-linux-android*)
49+
+ *-*-linux-*)
4950
xm_defines="HAVE_ATEXIT POSIX BSTRING"
5051
;;
5152
*-*-openbsd*)

0 commit comments

Comments
 (0)