ASR_BASE

Change-Id: Icf3719cc0afe3eeb3edc7fa80a2eb5199ca9dda1
diff --git a/external/subpack/utils/xfsprogs/patches/110-subdirs.patch b/external/subpack/utils/xfsprogs/patches/110-subdirs.patch
new file mode 100644
index 0000000..ad57d60
--- /dev/null
+++ b/external/subpack/utils/xfsprogs/patches/110-subdirs.patch
@@ -0,0 +1,12 @@
+--- a/Makefile
++++ b/Makefile
+@@ -62,8 +62,7 @@ HDR_SUBDIRS = include libxfs
+ LIBFROG_SUBDIR = libfrog
+ DLIB_SUBDIRS = libxlog libxcmd libhandle
+ LIB_SUBDIRS = libxfs $(DLIB_SUBDIRS)
+-TOOL_SUBDIRS = copy db estimate fsck fsr growfs io logprint mkfs quota \
+-		mdrestore repair rtcp m4 man doc debian spaceman
++TOOL_SUBDIRS = db fsck growfs io mkfs repair
+ 
+ ifeq ("$(ENABLE_SCRUB)","yes")
+ TOOL_SUBDIRS += scrub
diff --git a/external/subpack/utils/xfsprogs/patches/120-disable_assert.patch b/external/subpack/utils/xfsprogs/patches/120-disable_assert.patch
new file mode 100644
index 0000000..5bde4fb
--- /dev/null
+++ b/external/subpack/utils/xfsprogs/patches/120-disable_assert.patch
@@ -0,0 +1,12 @@
+--- a/libxfs/libxfs_priv.h
++++ b/libxfs/libxfs_priv.h
+@@ -87,9 +87,6 @@ struct iomap;
+ /* for all the support code that uses progname in error messages */
+ extern char    *progname;
+ 
+-#undef ASSERT
+-#define ASSERT(ex) assert(ex)
+-
+ /*
+  * We have no need for the "linux" dev_t in userspace, so these
+  * are no-ops, and an xfs_dev_t is stored in VFS_I(ip)->i_rdev
diff --git a/external/subpack/utils/xfsprogs/patches/130-db-malloc-Use-posix_memalign-instead-of-deprecated-v.patch b/external/subpack/utils/xfsprogs/patches/130-db-malloc-Use-posix_memalign-instead-of-deprecated-v.patch
new file mode 100644
index 0000000..a9ab4d3
--- /dev/null
+++ b/external/subpack/utils/xfsprogs/patches/130-db-malloc-Use-posix_memalign-instead-of-deprecated-v.patch
@@ -0,0 +1,26 @@
+From 930f9aa8f08759fa739dd6e615ba8b3a1890008d Mon Sep 17 00:00:00 2001
+From: Rosen Penev <rosenp@gmail.com>
+Date: Mon, 6 May 2019 13:56:13 -0700
+Subject: [PATCH] db/malloc: Use posix_memalign instead of deprecated valloc
+
+valloc is not available with uClibc-ng as well as being deprecated, which
+causes compilation errors. aligned_alloc is not available before C11 so
+used posix_memalign.'
+
+Signed-off-by: Rosen Penev <rosenp@gmail.com>
+---
+ db/malloc.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/db/malloc.c
++++ b/db/malloc.c
+@@ -44,8 +44,7 @@ xmalloc(
+ {
+ 	void	*ptr;
+ 
+-	ptr = valloc(size);
+-	if (ptr)
++	if(!posix_memalign(&ptr, sysconf(_SC_PAGESIZE), size))
+ 		return ptr;
+ 	badmalloc();
+ 	/* NOTREACHED */
diff --git a/external/subpack/utils/xfsprogs/patches/140-mman.patch b/external/subpack/utils/xfsprogs/patches/140-mman.patch
new file mode 100644
index 0000000..fef5d50
--- /dev/null
+++ b/external/subpack/utils/xfsprogs/patches/140-mman.patch
@@ -0,0 +1,17 @@
+--- a/io/mmap.c
++++ b/io/mmap.c
+@@ -11,6 +11,14 @@
+ #include "init.h"
+ #include "io.h"
+ 
++#ifndef MAP_SYNC
++#define MAP_SYNC 0
++#endif
++
++#ifndef MAP_SHARED_VALIDATE
++#define MAP_SHARED_VALIDATE 0x03
++#endif
++
+ static cmdinfo_t mmap_cmd;
+ static cmdinfo_t mread_cmd;
+ static cmdinfo_t msync_cmd;