Avoid ndk patch used only by elfutils
authorFredrik Fornwall <fredrik@fornwall.net>
Sun, 9 Jul 2017 21:35:21 +0000 (23:35 +0200)
committerFredrik Fornwall <fredrik@fornwall.net>
Sun, 9 Jul 2017 21:35:21 +0000 (23:35 +0200)
ndk-patches/string.h.patch
packages/elfutils/build.sh
packages/elfutils/config.h.in.patch

index 44b2b5c..7754e57 100644 (file)
@@ -33,18 +33,3 @@ diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/string.h ./usr/inc
  char* basename(const char* _Nonnull) __RENAME(__gnu_basename) __INTRODUCED_IN(23);
  #endif /* __ANDROID_API__ >= 23 */
  
-@@ -737,6 +737,14 @@
- #pragma clang diagnostic pop
- #endif
-+/* Termux: Patched support for GNU extension function mempcpy(3): */
-+#if defined(_GNU_SOURCE) && defined(TERMUX_EXPOSE_MEMPCPY)
-+static void* mempcpy(void* dest, void const* src, size_t n)
-+{
-+      return memcpy(dest, src, n) + n;
-+}
-+#endif
-+
- __END_DECLS
- #endif /* _STRING_H */
index 41f8201..7b4417d 100644 (file)
@@ -15,7 +15,7 @@ TERMUX_PKG_RM_AFTER_INSTALL="bin/eu-ar"
 
 termux_step_pre_configure() {
        LDFLAGS+=" -lintl"
-       CFLAGS+=" -DTERMUX_EXPOSE_MEMPCPY=1 -Wno-error=unused-value -Wno-error=format-nonliteral -Wno-error"
+       CFLAGS+=" -Wno-error=unused-value -Wno-error=format-nonliteral -Wno-error"
 
        # Exposes ACCESSPERMS in <sys/stat.h> which elfutils uses:
        CFLAGS+=" -D__USE_BSD"
index 6d833c8..f9cc61f 100644 (file)
@@ -1,6 +1,6 @@
-diff -u -r ../elfutils-0.166/config.h.in ./config.h.in
---- ../elfutils-0.166/config.h.in      2016-03-31 04:59:09.000000000 -0400
-+++ ./config.h.in      2016-05-04 13:36:44.002345307 -0400
+diff -u -r ../elfutils-0.168/config.h.in ./config.h.in
+--- ../elfutils-0.168/config.h.in      2016-12-28 10:33:20.000000000 +0100
++++ ./config.h.in      2017-07-09 23:32:21.305290105 +0200
 @@ -1,4 +1,7 @@
  /* config.h.in.  Generated from configure.ac by autoheader.  */
 +#include <libgen.h> /* for basename(3) */
@@ -9,3 +9,18 @@ diff -u -r ../elfutils-0.166/config.h.in ./config.h.in
  
  /* Building with -fsanitize=undefined or not */
  #undef CHECK_UNDEFINED
+@@ -117,4 +120,14 @@
+ /* Define for large files, on AIX-style hosts. */
+ #undef _LARGE_FILES
++#ifdef __ANDROID__
++# ifndef ANDROID_MEMPCPY
++# define ANDROID_MEMPCPY 1
++static __inline__ void* mempcpy(void* dest, void const* src, size_t n)
++{
++      return memcpy(dest, src, n) + n;
++}
++# endif
++#endif
++
+ #include <eu-config.h>