From 6c2d94dfcfbbe7be89cff6a9b83083c42e02ae20 Mon Sep 17 00:00:00 2001 From: Andrew Hsieh Date: Thu, 4 Sep 2014 13:00:28 -0700 Subject: [PATCH] Add __gnuc_va_list in stdio.h to stop gcc from generating include-fixed/stdio.h When GCC is built bionic's stdio.h (among other headers) is fixed: __va_list is replaced with __gnuc_va_list, and put in include-fixed/stdio.h, unless stdio.h already contains __gnuc_va_list. When GCC is later used bionic's stdio.h is never included. The problem in the context of NDK is that all 32-bit Android toolchain are built with android-9 header and expect to work with all API levels sometime with sustantially different stdio.h. This CL stops GCC from generating include-fixed/stdio.h by putting __gnuc_va_list in it. See bionic df85f50b and b.android.com/73728 Change-Id: I7a490496efbd491a0376608b9ae6e9e2dfc15fb3 --- ndk/platforms/android-3/include/stdio.h | 8 ++++++++ ndk/platforms/android-8/include/stdio.h | 8 ++++++++ ndk/platforms/android-L/include/stdio.h | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/ndk/platforms/android-3/include/stdio.h b/ndk/platforms/android-3/include/stdio.h index a56faa2f3..a0bda7ef8 100644 --- a/ndk/platforms/android-3/include/stdio.h +++ b/ndk/platforms/android-3/include/stdio.h @@ -38,6 +38,14 @@ #ifndef _STDIO_H_ #define _STDIO_H_ +/* + * This file must contain a reference to __gnuc_va_list so that GCC's + * fixincludes knows that that's what's being used for va_list, and so + * to leave our alone. (fixincludes gets in the way of pointing + * one toolchain at various different sets of platform headers.) + * If you alter this comment, be sure to keep "__gnuc_va_list" in it! + */ + #include #include diff --git a/ndk/platforms/android-8/include/stdio.h b/ndk/platforms/android-8/include/stdio.h index 172c8d0dc..10f6969ba 100644 --- a/ndk/platforms/android-8/include/stdio.h +++ b/ndk/platforms/android-8/include/stdio.h @@ -38,6 +38,14 @@ #ifndef _STDIO_H_ #define _STDIO_H_ +/* + * This file must contain a reference to __gnuc_va_list so that GCC's + * fixincludes knows that that's what's being used for va_list, and so + * to leave our alone. (fixincludes gets in the way of pointing + * one toolchain at various different sets of platform headers.) + * If you alter this comment, be sure to keep "__gnuc_va_list" in it! + */ + #include #include diff --git a/ndk/platforms/android-L/include/stdio.h b/ndk/platforms/android-L/include/stdio.h index 4ff675345..9edf9d2ac 100644 --- a/ndk/platforms/android-L/include/stdio.h +++ b/ndk/platforms/android-L/include/stdio.h @@ -38,6 +38,14 @@ #ifndef _STDIO_H_ #define _STDIO_H_ +/* + * This file must contain a reference to __gnuc_va_list so that GCC's + * fixincludes knows that that's what's being used for va_list, and so + * to leave our alone. (fixincludes gets in the way of pointing + * one toolchain at various different sets of platform headers.) + * If you alter this comment, be sure to keep "__gnuc_va_list" in it! + */ + #include #include