From 57b77ff6922c4adb84b2861bc2b7a7bc2e8f9e33 Mon Sep 17 00:00:00 2001 From: Leonid Pliushch Date: Wed, 20 Mar 2019 15:37:12 +0200 Subject: [PATCH] update ndk-patches to prevent creation of *.orig files in ./sysroot/usr/include --- ndk-patches/linux-fcntl.h.patch | 8 ++++---- ndk-patches/pwd.h.patch | 15 +++++++-------- ndk-patches/stdlib.h.patch | 12 ++++++------ ndk-patches/sys-cdefs.h.patch | 8 ++++---- ndk-patches/sys-wait.h.patch | 8 ++++---- ndk-patches/syslog.patch | 14 +++++++------- 6 files changed, 32 insertions(+), 33 deletions(-) diff --git a/ndk-patches/linux-fcntl.h.patch b/ndk-patches/linux-fcntl.h.patch index 5614657ebb..421a39d033 100644 --- a/ndk-patches/linux-fcntl.h.patch +++ b/ndk-patches/linux-fcntl.h.patch @@ -1,7 +1,7 @@ -diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/linux/fcntl.h ./usr/include/linux/fcntl.h ---- /home/fornwall/lib/android-ndk/sysroot/usr/include/linux/fcntl.h 2017-11-09 09:57:12.000000000 +0100 -+++ ./usr/include/linux/fcntl.h 2017-11-15 11:49:10.709710452 +0100 -@@ -40,6 +40,12 @@ +diff -uNr sysroot.orig/usr/include/linux/fcntl.h sysroot/usr/include/linux/fcntl.h +--- sysroot.orig/usr/include/linux/fcntl.h 2019-02-12 16:12:24.000000000 +0000 ++++ sysroot/usr/include/linux/fcntl.h 2019-03-20 13:22:32.823142545 +0000 +@@ -50,6 +50,12 @@ #define DN_ATTRIB 0x00000020 #define DN_MULTISHOT 0x80000000 #define AT_FDCWD - 100 diff --git a/ndk-patches/pwd.h.patch b/ndk-patches/pwd.h.patch index d42a14bfb4..8ef4b0d137 100644 --- a/ndk-patches/pwd.h.patch +++ b/ndk-patches/pwd.h.patch @@ -1,7 +1,7 @@ -diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/pwd.h ./usr/include/pwd.h ---- /home/fornwall/lib/android-ndk/sysroot/usr/include/pwd.h 2017-06-20 17:41:56.000000000 +0200 -+++ ./usr/include/pwd.h 2017-06-26 11:45:26.036064547 +0200 -@@ -89,7 +91,6 @@ +diff -uNr sysroot.orig/usr/include/pwd.h sysroot/usr/include/pwd.h +--- sysroot.orig/usr/include/pwd.h 2019-02-12 16:12:24.000000000 +0000 ++++ sysroot/usr/include/pwd.h 2019-03-20 13:26:24.283060011 +0000 +@@ -89,13 +89,58 @@ struct passwd* getpwent(void) __INTRODUCED_IN(26); void setpwent(void) __INTRODUCED_IN(26); @@ -9,11 +9,9 @@ diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/pwd.h ./usr/includ #endif /* __ANDROID_API__ >= 26 */ -@@ -97,6 +98,52 @@ - int getpwnam_r(const char* __name, struct passwd* __pwd, char* __buf, size_t __n, struct passwd** __result) __INTRODUCED_IN(12); int getpwuid_r(uid_t __uid, struct passwd* __pwd, char* __buf, size_t __n, struct passwd** __result) __INTRODUCED_IN(12); -+ + +int access(const char* __path, int __mode); + +static void android_setup_pwd(struct passwd* pw) { @@ -59,6 +57,7 @@ diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/pwd.h ./usr/includ +#define getpwuid android_polyfill_getpwuid +#define getpwuid_r android_polyfill_getpwuid_r +static void endpwent(void) { /* Do nothing. */ } - ++ __END_DECLS + #endif diff --git a/ndk-patches/stdlib.h.patch b/ndk-patches/stdlib.h.patch index 791abe2deb..475d1ddd5a 100644 --- a/ndk-patches/stdlib.h.patch +++ b/ndk-patches/stdlib.h.patch @@ -1,15 +1,15 @@ -diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/stdlib.h ./usr/include/stdlib.h ---- /home/fornwall/lib/android-ndk/sysroot/usr/include/stdlib.h 2017-11-09 09:57:12.000000000 +0100 -+++ ./usr/include/stdlib.h 2017-11-15 12:49:51.790799140 +0100 -@@ -35,6 +35,7 @@ - #include +diff -uNr sysroot.orig/usr/include/stdlib.h sysroot/usr/include/stdlib.h +--- sysroot.orig/usr/include/stdlib.h 2019-02-12 16:12:24.000000000 +0000 ++++ sysroot/usr/include/stdlib.h 2019-03-20 13:23:48.870108924 +0000 +@@ -33,6 +33,7 @@ + #include #include #include +#include #include #include -@@ -205,8 +206,7 @@ +@@ -211,8 +212,7 @@ size_t wcstombs(char* __dst, const wchar_t* __src, size_t __n); #if __ANDROID_API__ >= __ANDROID_API_L__ diff --git a/ndk-patches/sys-cdefs.h.patch b/ndk-patches/sys-cdefs.h.patch index a1cbd87044..66b536dfb6 100644 --- a/ndk-patches/sys-cdefs.h.patch +++ b/ndk-patches/sys-cdefs.h.patch @@ -1,7 +1,7 @@ -diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/sys/cdefs.h ./usr/include/sys/cdefs.h ---- /home/fornwall/lib/android-ndk/sysroot/usr/include/sys/cdefs.h 2017-07-21 11:04:10.000000000 +0200 -+++ ./usr/include/sys/cdefs.h 2017-08-07 22:50:14.093361547 +0200 -@@ -218,7 +218,11 @@ +diff -uNr sysroot.orig/usr/include/sys/cdefs.h sysroot/usr/include/sys/cdefs.h +--- sysroot.orig/usr/include/sys/cdefs.h 2019-02-12 16:12:24.000000000 +0000 ++++ sysroot/usr/include/sys/cdefs.h 2019-03-20 13:27:29.977876824 +0000 +@@ -206,7 +206,11 @@ * _FILE_OFFSET_BITS 64 support. * See https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md */ diff --git a/ndk-patches/sys-wait.h.patch b/ndk-patches/sys-wait.h.patch index 86ec88eb54..eab9902131 100644 --- a/ndk-patches/sys-wait.h.patch +++ b/ndk-patches/sys-wait.h.patch @@ -1,7 +1,7 @@ -diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/sys/wait.h ./usr/include/sys/wait.h ---- /home/fornwall/lib/android-ndk/sysroot/usr/include/sys/wait.h 2017-06-07 01:07:52.000000000 +0200 -+++ ./usr/include/sys/wait.h 2017-06-18 02:11:22.268075841 +0200 -@@ -57,6 +57,9 @@ +diff -uNr sysroot.orig/usr/include/sys/wait.h sysroot/usr/include/sys/wait.h +--- sysroot.orig/usr/include/sys/wait.h 2019-02-12 16:12:24.000000000 +0000 ++++ sysroot/usr/include/sys/wait.h 2019-03-20 13:28:06.689331544 +0000 +@@ -46,6 +46,9 @@ // Implemented as a static inline before 18. #endif diff --git a/ndk-patches/syslog.patch b/ndk-patches/syslog.patch index 67a1dc6244..95f59cad47 100644 --- a/ndk-patches/syslog.patch +++ b/ndk-patches/syslog.patch @@ -1,7 +1,7 @@ -diff -Nur /Users/fornwall/lib/android-ndk/platforms/android-18/arch-arm/usr/include/syslog.h ./usr/include/syslog.h ---- /Users/fornwall/lib/android-ndk/platforms/android-18/arch-arm/usr/include/syslog.h 2012-08-21 07:23:12.000000000 +0200 -+++ ./usr/include/syslog.h 2014-01-29 17:51:55.000000000 +0100 -@@ -31,6 +31,8 @@ +diff -uNr sysroot.orig/usr/include/syslog.h sysroot/usr/include/syslog.h +--- sysroot.orig/usr/include/syslog.h 2019-02-12 16:12:24.000000000 +0000 ++++ sysroot/usr/include/syslog.h 2019-03-20 13:19:44.315965728 +0000 +@@ -32,6 +32,8 @@ #include #include #include @@ -10,9 +10,9 @@ diff -Nur /Users/fornwall/lib/android-ndk/platforms/android-18/arch-arm/usr/incl __BEGIN_DECLS -@@ -111,6 +112,64 @@ - extern void syslog_r(int, struct syslog_data *, const char *, ...); - extern void vsyslog_r(int, struct syslog_data *, const char *, va_list); +@@ -92,6 +94,64 @@ + void syslog(int __priority, const char* __fmt, ...) __printflike(2, 3); + void vsyslog(int __priority, const char* __fmt, va_list __args) __printflike(2, 0); +extern /*const*/ char* __progname; +static __inline__ void android_polyfill_openlog(const char* a, int b, int c) {