diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2015-09-18 12:05:32 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-09-18 12:06:02 +0200 |
commit | 72fa9857b7e53dbd6d3a8d2f34fc451ec41a157c (patch) | |
tree | 410dbeb846036f5181102b0e16af2ef924f08e1b | |
parent | 44e8828165d3ea92a6e786ce4308b7da462a1c4c (diff) | |
download | aports-72fa9857b7e53dbd6d3a8d2f34fc451ec41a157c.tar.bz2 aports-72fa9857b7e53dbd6d3a8d2f34fc451ec41a157c.tar.xz |
testing/zfs-grsec: upgerade to 0.6.5
-rw-r--r-- | testing/zfs-grsec/APKBUILD | 30 | ||||
-rw-r--r-- | testing/zfs-grsec/musl-fixes.patch | 530 |
2 files changed, 305 insertions, 255 deletions
diff --git a/testing/zfs-grsec/APKBUILD b/testing/zfs-grsec/APKBUILD index 63c11a1de8..7164a0540a 100644 --- a/testing/zfs-grsec/APKBUILD +++ b/testing/zfs-grsec/APKBUILD @@ -9,8 +9,8 @@ _kpkg=linux-$_flavor _kver=3.18.21 _kpkgrel=0 -_realver=0.6.4.2 -_mypkgrel=0 +_realver=0.6.5 +_mypkgrel=1 # source the kernel version if [ -f ../../main/linux-$_flavor/APKBUILD ]; then @@ -36,9 +36,10 @@ makedepends="$depends_dev automake autoconf libtool linux-headers" install="" subpackages="$pkgname-dev $pkgname-doc zfs-utils:utils" source="http://archive.zfsonlinux.org/downloads/zfsonlinux/zfs/zfs-$_realver.tar.gz - musl-fixes.patch + musl-fixes.patch " + _builddir="$srcdir/$_realname-$_realver" prepare() { @@ -49,14 +50,14 @@ prepare() { *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; esac done + autoreconf -vif || return 1 } build() { cd "$_builddir" - ./autogen.sh || return 1 export LIBS="$LIBS -lintl" ./configure --prefix=/usr \ - --enable-musl \ + --with-tirpc \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ @@ -91,18 +92,11 @@ utils() { mkdir -p "$pkgdir"/lib mv "$subpkgdir"/lib/modules \ "$pkgdir"/lib || return 1 - rm -f "$subpkgdir"/etc/init.d/zfs - install -m755 -D "$_builddir"/etc/init.d/zfs.gentoo.in \ - "$subpkgdir"/etc/init.d/zfs - sed -i -e "s/@sbindir@/\/usr\/sbin/g" \ - "$subpkgdir"/etc/init.d/zfs || return 1 - sed -i -e "s/@sysconfdir@/\/etc/g" \ - "$subpkgdir"/etc/init.d/zfs || return 1 } -md5sums="6655619ddb1fed858c241f1ed3204fce zfs-0.6.4.2.tar.gz -4ac9600c0cc0ffa70adb957c6ffcafc6 musl-fixes.patch" -sha256sums="1da5e7b56f31f01d30fcf1c9f0ef2ab6276c3ffe5f8d72fc79627f6acc72d03d zfs-0.6.4.2.tar.gz -5c65e46bd8b072fa39fd9fd71f0ec52f92a8f083fcb9385d52ed781f77282c79 musl-fixes.patch" -sha512sums="f016d82b40e0c3cb158d38e3f4334c58de10ad7e4572b831bae57adc8f45b72a4775f0f725866685b9ac77077dde2c1b2a68020aa7eb7422fd903ec08bc138d1 zfs-0.6.4.2.tar.gz -224ed364a4d924bd9194d82429f0ce316689d09873209a395a76d909a6b8c605dd3130810262fa79d7b6af73da02157377d95d9fe5859dbf70c92503bf77eb53 musl-fixes.patch" +md5sums="76a3675a56acce7c9fd36578173304e4 zfs-0.6.5.tar.gz +68b420d0dd707921701d3d2c9544df90 musl-fixes.patch" +sha256sums="b38e9c04e9e7e1930adbc16b694f2401812e7674ae3bb526098a2a7c6435534d zfs-0.6.5.tar.gz +bc4ccb90eb93de774f5d935b3ea734e11be617faa78be76d6ecebcbe8b61524f musl-fixes.patch" +sha512sums="e6749ebfb8aefc31ec88ab7de5224e7148daa883ea2beed1c9b38e98ec7495da6fb62fc1b6a393fdb168ca5eb204b1bb940f13af6ed9e80fdd5c39436856295c zfs-0.6.5.tar.gz +aff25fd556911d64ac426fc15fd16dd1a49f55d90936607d5093bdc70970b3cf5559a1b0c531b15a64c48ad540986ed0a6ee3c5260984b9c3b4a1ca3911d9143 musl-fixes.patch" diff --git a/testing/zfs-grsec/musl-fixes.patch b/testing/zfs-grsec/musl-fixes.patch index aa4558b1fe..f174f3a737 100644 --- a/testing/zfs-grsec/musl-fixes.patch +++ b/testing/zfs-grsec/musl-fixes.patch @@ -1,142 +1,306 @@ -diff -urw src/zfs-0.6.3/cmd/mount_zfs/Makefile.am src.new/cmd/mount_zfs/Makefile.am ---- src/zfs-0.6.3/cmd/mount_zfs/Makefile.am 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/cmd/mount_zfs/Makefile.am 2014-09-13 18:40:03.625178898 +0000 -@@ -19,4 +19,5 @@ +diff --git a/cmd/mount_zfs/Makefile.am b/cmd/mount_zfs/Makefile.am +index b1d9389..4be1135 100644 +--- a/cmd/mount_zfs/Makefile.am ++++ b/cmd/mount_zfs/Makefile.am +@@ -19,4 +19,5 @@ mount_zfs_LDADD = \ $(top_builddir)/lib/libuutil/libuutil.la \ $(top_builddir)/lib/libzpool/libzpool.la \ $(top_builddir)/lib/libzfs/libzfs.la \ - $(top_builddir)/lib/libzfs_core/libzfs_core.la + $(top_builddir)/lib/libzfs_core/libzfs_core.la \ + $(TIRPC_LIBS) -diff -urw src/zfs-0.6.3/cmd/mount_zfs/mount_zfs.c src.new/cmd/mount_zfs/mount_zfs.c ---- src/zfs-0.6.3/cmd/mount_zfs/mount_zfs.c 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/cmd/mount_zfs/mount_zfs.c 2014-09-13 18:40:03.625178898 +0000 -@@ -31,6 +31,7 @@ +diff --git a/cmd/mount_zfs/mount_zfs.c b/cmd/mount_zfs/mount_zfs.c +index e3e8cfc..91efda6 100644 +--- a/cmd/mount_zfs/mount_zfs.c ++++ b/cmd/mount_zfs/mount_zfs.c +@@ -32,6 +32,7 @@ #include <sys/stat.h> #include <libzfs.h> #include <locale.h> +#include <fcntl.h> - libzfs_handle_t *g_zfs; - -diff -urw src/zfs-0.6.3/cmd/zdb/Makefile.am src.new/cmd/zdb/Makefile.am ---- src/zfs-0.6.3/cmd/zdb/Makefile.am 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/cmd/zdb/Makefile.am 2014-09-13 18:40:03.679346705 +0000 -@@ -17,4 +17,4 @@ + #define ZS_COMMENT 0x00000000 /* comment */ + #define ZS_ZFSUTIL 0x00000001 /* caller is zfs(8) */ +diff --git a/cmd/zdb/Makefile.am b/cmd/zdb/Makefile.am +index bc47cff..b8200da 100644 +--- a/cmd/zdb/Makefile.am ++++ b/cmd/zdb/Makefile.am +@@ -17,4 +17,4 @@ zdb_LDADD = \ $(top_builddir)/lib/libzfs/libzfs.la \ $(top_builddir)/lib/libzfs_core/libzfs_core.la -zdb_LDADD += $(ZLIB) +zdb_LDADD += $(ZLIB) $(TIRPC_LIBS) -diff -urw src/zfs-0.6.3/cmd/zfs/Makefile.am src.new/cmd/zfs/Makefile.am ---- src/zfs-0.6.3/cmd/zfs/Makefile.am 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/cmd/zfs/Makefile.am 2014-09-13 18:40:03.701013827 +0000 -@@ -19,5 +19,5 @@ +diff --git a/cmd/zed/Makefile.am b/cmd/zed/Makefile.am +index 70e4f7f..ce16ceb 100644 +--- a/cmd/zed/Makefile.am ++++ b/cmd/zed/Makefile.am +@@ -30,7 +30,8 @@ zed_LDADD = \ + $(top_builddir)/lib/libspl/libspl.la \ + $(top_builddir)/lib/libzpool/libzpool.la \ + $(top_builddir)/lib/libzfs/libzfs.la \ +- $(top_builddir)/lib/libzfs_core/libzfs_core.la ++ $(top_builddir)/lib/libzfs_core/libzfs_core.la \ ++ $(TIRPC_LIBS) + + zedconfdir = $(sysconfdir)/zfs/zed.d + +diff --git a/cmd/zfs/Makefile.am b/cmd/zfs/Makefile.am +index 3cac73d..2554011 100644 +--- a/cmd/zfs/Makefile.am ++++ b/cmd/zfs/Makefile.am +@@ -19,5 +19,5 @@ zfs_LDADD = \ $(top_builddir)/lib/libzfs/libzfs.la \ $(top_builddir)/lib/libzfs_core/libzfs_core.la -zfs_LDADD += $(ZLIB) +zfs_LDADD += $(ZLIB) $(TIRPC_LIBS) zfs_LDFLAGS = -pthread -diff -urw src/zfs-0.6.3/cmd/zhack/Makefile.am src.new/cmd/zhack/Makefile.am ---- src/zfs-0.6.3/cmd/zhack/Makefile.am 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/cmd/zhack/Makefile.am 2014-09-13 18:40:03.679346705 +0000 -@@ -16,4 +16,4 @@ +diff --git a/cmd/zhack/Makefile.am b/cmd/zhack/Makefile.am +index 53e3241..07b5fab 100644 +--- a/cmd/zhack/Makefile.am ++++ b/cmd/zhack/Makefile.am +@@ -16,4 +16,4 @@ zhack_LDADD = \ $(top_builddir)/lib/libzfs/libzfs.la \ $(top_builddir)/lib/libzfs_core/libzfs_core.la -zhack_LDADD += $(ZLIB) +zhack_LDADD += $(ZLIB) $(TIRPC_LIBS) -diff -urw src/zfs-0.6.3/cmd/zinject/Makefile.am src.new/cmd/zinject/Makefile.am ---- src/zfs-0.6.3/cmd/zinject/Makefile.am 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/cmd/zinject/Makefile.am 2014-09-13 18:40:03.679346705 +0000 -@@ -16,4 +16,5 @@ +diff --git a/cmd/zinject/Makefile.am b/cmd/zinject/Makefile.am +index 2500bee..2d069d3 100644 +--- a/cmd/zinject/Makefile.am ++++ b/cmd/zinject/Makefile.am +@@ -16,4 +16,5 @@ zinject_LDADD = \ $(top_builddir)/lib/libuutil/libuutil.la \ $(top_builddir)/lib/libzpool/libzpool.la \ $(top_builddir)/lib/libzfs/libzfs.la \ - $(top_builddir)/lib/libzfs_core/libzfs_core.la + $(top_builddir)/lib/libzfs_core/libzfs_core.la \ + $(TIRPC_LIBS) -diff -urw src/zfs-0.6.3/cmd/zpool/Makefile.am src.new/cmd/zpool/Makefile.am ---- src/zfs-0.6.3/cmd/zpool/Makefile.am 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/cmd/zpool/Makefile.am 2014-09-13 18:40:03.679346705 +0000 -@@ -19,4 +19,4 @@ +diff --git a/cmd/zpool/Makefile.am b/cmd/zpool/Makefile.am +index c11951b..a59bf32 100644 +--- a/cmd/zpool/Makefile.am ++++ b/cmd/zpool/Makefile.am +@@ -19,4 +19,4 @@ zpool_LDADD = \ $(top_builddir)/lib/libzpool/libzpool.la \ $(top_builddir)/lib/libzfs/libzfs.la \ $(top_builddir)/lib/libzfs_core/libzfs_core.la \ - $(LIBBLKID) + $(LIBBLKID) $(TIRPC_LIBS) -diff -urw src/zfs-0.6.3/cmd/zstreamdump/Makefile.am src.new/cmd/zstreamdump/Makefile.am ---- src/zfs-0.6.3/cmd/zstreamdump/Makefile.am 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/cmd/zstreamdump/Makefile.am 2014-09-13 18:40:03.581844652 +0000 -@@ -16,4 +16,4 @@ +diff --git a/cmd/zstreamdump/Makefile.am b/cmd/zstreamdump/Makefile.am +index 654863a..f800a8e 100644 +--- a/cmd/zstreamdump/Makefile.am ++++ b/cmd/zstreamdump/Makefile.am +@@ -16,4 +16,4 @@ zstreamdump_LDADD = \ $(top_builddir)/lib/libzfs/libzfs.la \ $(top_builddir)/lib/libzfs_core/libzfs_core.la -zstreamdump_LDADD += $(ZLIB) +zstreamdump_LDADD += $(ZLIB) $(TIRPC_LIBS) -diff -urw src/zfs-0.6.3/cmd/ztest/Makefile.am src.new/cmd/ztest/Makefile.am ---- src/zfs-0.6.3/cmd/ztest/Makefile.am 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/cmd/ztest/Makefile.am 2014-09-13 18:40:03.679346705 +0000 -@@ -18,4 +18,4 @@ +diff --git a/cmd/ztest/Makefile.am b/cmd/ztest/Makefile.am +index ef4d99f..3c1ae75 100644 +--- a/cmd/ztest/Makefile.am ++++ b/cmd/ztest/Makefile.am +@@ -18,4 +18,4 @@ ztest_LDADD = \ $(top_builddir)/lib/libzfs/libzfs.la \ $(top_builddir)/lib/libzfs_core/libzfs_core.la -ztest_LDADD += -lm -ldl +ztest_LDADD += -lm -ldl $(TIRPC_LIBS) -diff -urw src/zfs-0.6.3/config/user.m4 src.new/config/user.m4 ---- src/zfs-0.6.3/config/user.m4 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/config/user.m4 2014-09-13 18:40:03.766015196 +0000 -@@ -13,6 +13,7 @@ +diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c +index afe6faa..40524ed 100644 +--- a/cmd/ztest/ztest.c ++++ b/cmd/ztest/ztest.c +@@ -123,7 +123,7 @@ + #include <math.h> + #include <sys/fs/zfs.h> + #include <libnvpair.h> +-#ifdef __GNUC__ ++#ifdef __GLIBC__ + #include <execinfo.h> /* for backtrace() */ + #endif + +@@ -490,7 +490,7 @@ _umem_logging_init(void) + static void sig_handler(int signo) + { + struct sigaction action; +-#ifdef __GNUC__ /* backtrace() is a GNU extension */ ++#ifdef __GLIBC__ /* backtrace() is a GNU extension */ + int nptrs; + void *buffer[BACKTRACE_SZ]; + +diff --git a/config/tirpc.m4 b/config/tirpc.m4 +new file mode 100644 +index 0000000..ec15785 +--- /dev/null ++++ b/config/tirpc.m4 +@@ -0,0 +1,17 @@ ++dnl ++dnl musl support ++dnl ++ ++AC_DEFUN([ZFS_AC_CONFIG_USER_TIRPC], [ ++AH_TEMPLATE([WITH_TIRPC], ++ [Define to 1 if libtirpc is being used as the RPC library]) ++AC_ARG_WITH(tirpc, ++AC_HELP_STRING([--with-tirpc], [compile with libtirpc]), ++[if test x$withval = xyes; then ++ AC_DEFINE([WITH_TIRPC], 1, [Define if you have musl]) ++ PKG_CHECK_MODULES([TIRPC],[libtirpc]) ++ AC_DEFINE([WITH_TIRPC], 1, [Define if you have libtirpc]) ++ AC_SUBST(TIRPC_CFLAGS) ++ AC_SUBST(TIRPC_LIBS) ++fi]) ++]) +diff --git a/config/user.m4 b/config/user.m4 +index 7f79420..820b8d3 100644 +--- a/config/user.m4 ++++ b/config/user.m4 +@@ -13,6 +13,7 @@ AC_DEFUN([ZFS_AC_CONFIG_USER], [ ZFS_AC_CONFIG_USER_LIBBLKID ZFS_AC_CONFIG_USER_FRAME_LARGER_THAN ZFS_AC_CONFIG_USER_RUNSTATEDIR -+ ZFS_AC_CONFIG_USER_MUSL ++ ZFS_AC_CONFIG_USER_TIRPC dnl # dnl # Checks for library functions AC_CHECK_FUNCS([mlockall]) -diff -urw src/zfs-0.6.3/include/sys/zfs_context.h src.new/include/sys/zfs_context.h ---- src/zfs-0.6.3/include/sys/zfs_context.h 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/include/sys/zfs_context.h 2014-09-13 18:40:03.809349441 +0000 -@@ -118,6 +118,10 @@ - #include <sys/sunddi.h> - #include <sys/debug.h> - -+#ifndef RLIM64_INFINITY -+#define RLIM64_INFINITY (~0ULL) -+#endif -+ - /* - * Stack - */ -@@ -614,7 +618,11 @@ - #define minclsyspri 60 - #define maxclsyspri 99 - -+#ifdef HAVE_MUSL +diff --git a/config/zfs-build.m4 b/config/zfs-build.m4 +index f93c5b5..ebcb1c2 100644 +--- a/config/zfs-build.m4 ++++ b/config/zfs-build.m4 +@@ -266,6 +266,8 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [ + VENDOR=ubuntu ; + elif test -f /etc/debian_version ; then + VENDOR=debian ; ++ elif test -f /etc/alpine-release ; then ++ VENDOR=alpine ; + else + VENDOR= ; + fi +@@ -278,6 +280,7 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [ + redhat) DEFAULT_PACKAGE=rpm ;; + fedora) DEFAULT_PACKAGE=rpm ;; + gentoo) DEFAULT_PACKAGE=tgz ;; ++ alpine) DEFAULT_PACKAGE=tgz ;; + arch) DEFAULT_PACKAGE=tgz ;; + sles) DEFAULT_PACKAGE=rpm ;; + slackware) DEFAULT_PACKAGE=tgz ;; +@@ -299,7 +302,8 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [ + toss) DEFAULT_INIT_SCRIPT=redhat ;; + redhat) DEFAULT_INIT_SCRIPT=redhat ;; + fedora) DEFAULT_INIT_SCRIPT=fedora ;; +- gentoo) DEFAULT_INIT_SCRIPT=gentoo ;; ++ alpine) DEFAULT_INIT_SCRIPT=openrc ;; ++ gentoo) DEFAULT_INIT_SCRIPT=openrc ;; + arch) DEFAULT_INIT_SCRIPT=lsb ;; + sles) DEFAULT_INIT_SCRIPT=lsb ;; + slackware) DEFAULT_INIT_SCRIPT=lsb ;; +@@ -313,6 +317,7 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [ + + AC_MSG_CHECKING([default init config direectory]) + case "$VENDOR" in ++ alpine) DEFAULT_INITCONF_DIR=/etc/conf.d ;; + gentoo) DEFAULT_INITCONF_DIR=/etc/conf.d ;; + toss) DEFAULT_INITCONF_DIR=/etc/sysconfig ;; + redhat) DEFAULT_INITCONF_DIR=/etc/sysconfig ;; +diff --git a/etc/init.d/Makefile.am b/etc/init.d/Makefile.am +index 5f70fc6..c6e29d1 100644 +--- a/etc/init.d/Makefile.am ++++ b/etc/init.d/Makefile.am +@@ -21,7 +21,7 @@ $(init_SCRIPTS) $(initconf_SCRIPTS) $(initcommon_SCRIPTS): $(EXTRA_DIST) + else \ + NFS_SRV=nfs; \ + fi; \ +- if [ -e /etc/gentoo-release ]; then \ ++ if [ -e /sbin/openrc-run ]; then \ + SHELL=/sbin/runscript; \ + else \ + SHELL=/bin/sh; \ +diff --git a/etc/init.d/zfs-import.in b/etc/init.d/zfs-import.in +index a3d6c14..7f65797 100755 +--- a/etc/init.d/zfs-import.in ++++ b/etc/init.d/zfs-import.in +@@ -334,7 +334,7 @@ do_stop() + + # ---------------------------------------------------- + +-if [ ! -e /etc/gentoo-release ] ++if [ ! -e /sbin/openrc-run ] + then + case "$1" in + start) +diff --git a/etc/init.d/zfs-mount.in b/etc/init.d/zfs-mount.in +index 95aefd6..08b6146 100755 +--- a/etc/init.d/zfs-mount.in ++++ b/etc/init.d/zfs-mount.in +@@ -207,7 +207,7 @@ do_stop() + + # ---------------------------------------------------- + +-if [ ! -e /etc/gentoo-release ] ++if [ ! -e /sbin/openrc-run ] + then + case "$1" in + start) +diff --git a/etc/init.d/zfs-share.in b/etc/init.d/zfs-share.in +index 2b66afe..f88fbba 100755 +--- a/etc/init.d/zfs-share.in ++++ b/etc/init.d/zfs-share.in +@@ -66,7 +66,7 @@ do_stop() + + # ---------------------------------------------------- + +-if [ ! -e /etc/gentoo-release ]; then ++if [ ! -e /sbin/openrc-run ]; then + case "$1" in + start) + do_start +diff --git a/etc/init.d/zfs-zed.in b/etc/init.d/zfs-zed.in +index 0f900b2..2863491 100755 +--- a/etc/init.d/zfs-zed.in ++++ b/etc/init.d/zfs-zed.in +@@ -96,7 +96,7 @@ do_reload() + + # ---------------------------------------------------- + +-if [ ! -e /etc/gentoo-release ]; then ++if [ ! -e /sbin/openrc-run ]; then + case "$1" in + start) + do_start +diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h +index 4f7e328..78e33e1 100644 +--- a/include/sys/zfs_context.h ++++ b/include/sys/zfs_context.h +@@ -623,7 +623,7 @@ extern void delay(clock_t ticks); + #define maxclsyspri -20 + #define defclsyspri 0 + +-#define CPU_SEQID (pthread_self() & (max_ncpus - 1)) +#define CPU_SEQID ((uintptr_t)pthread_self() & (max_ncpus - 1)) -+#else - #define CPU_SEQID (pthread_self() & (max_ncpus - 1)) -+#endif #define kcred NULL #define CRED() NULL -diff -urw src/zfs-0.6.3/lib/libnvpair/Makefile.am src.new/lib/libnvpair/Makefile.am ---- src/zfs-0.6.3/lib/libnvpair/Makefile.am 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/lib/libnvpair/Makefile.am 2014-09-13 18:40:03.711847389 +0000 -@@ -1,6 +1,6 @@ - include $(top_srcdir)/config/Rules.am +diff --git a/lib/libnvpair/Makefile.am b/lib/libnvpair/Makefile.am +index c9ac1f1..985285a 100644 +--- a/lib/libnvpair/Makefile.am ++++ b/lib/libnvpair/Makefile.am +@@ -4,7 +4,7 @@ VPATH = \ + $(top_srcdir)/module/nvpair \ + $(top_srcdir)/lib/libnvpair -AM_CFLAGS += $(DEBUG_STACKFLAGS) $(FRAME_LARGER_THAN) +AM_CFLAGS += $(DEBUG_STACKFLAGS) $(FRAME_LARGER_THAN) $(TIRPC_CFLAGS) DEFAULT_INCLUDES += \ -I$(top_srcdir)/include \ -diff -urw src/zfs-0.6.3/lib/libspl/Makefile.am src.new/lib/libspl/Makefile.am ---- src/zfs-0.6.3/lib/libspl/Makefile.am 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/lib/libspl/Makefile.am 2014-09-13 18:40:03.722680950 +0000 -@@ -1,12 +1,12 @@ - include $(top_srcdir)/config/Rules.am +diff --git a/lib/libspl/Makefile.am b/lib/libspl/Makefile.am +index a569446..9cedfaa 100644 +--- a/lib/libspl/Makefile.am ++++ b/lib/libspl/Makefile.am +@@ -4,13 +4,13 @@ VPATH = \ + $(top_srcdir)/lib/libspl \ + $(top_srcdir)/lib/libspl/$(TARGET_ASM_DIR) -AM_CFLAGS += $(DEBUG_STACKFLAGS) $(FRAME_LARGER_THAN) +AM_CFLAGS += $(DEBUG_STACKFLAGS) $(FRAME_LARGER_THAN) $(TIRPC_CFLAGS) @@ -150,21 +314,29 @@ diff -urw src/zfs-0.6.3/lib/libspl/Makefile.am src.new/lib/libspl/Makefile.am AM_CCASFLAGS = \ -I$(top_srcdir)/lib/libspl/include -@@ -30,4 +30,4 @@ - $(top_srcdir)/lib/libspl/include/sys/list.h \ - $(top_srcdir)/lib/libspl/include/sys/list_impl.h +@@ -42,6 +42,6 @@ nodist_libspl_la_SOURCES = \ + $(USER_ASM) \ + $(KERNEL_C) -libspl_la_LIBADD = -lrt +libspl_la_LIBADD = -lrt $(TIRPC_LDFLAGS) -diff -urw src/zfs-0.6.3/lib/libspl/include/assert.h src.new/lib/libspl/include/assert.h ---- src/zfs-0.6.3/lib/libspl/include/assert.h 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/lib/libspl/include/assert.h 2014-09-13 18:40:03.755181634 +0000 -@@ -42,6 +42,12 @@ + + EXTRA_DIST = $(USER_C) +diff --git a/lib/libspl/include/assert.h b/lib/libspl/include/assert.h +index 52924e8..63ca9dd 100644 +--- a/lib/libspl/include/assert.h ++++ b/lib/libspl/include/assert.h +@@ -42,6 +42,17 @@ __assert_c99(const char *expr, const char *file, int line, const char *func) } #endif /* __assert_c99 */ +#ifndef __assert -+#define __assert(expr, file, line) abort() ++static inline void ++__assert(const char *expr, const char *file, int line) ++{ ++ fprintf(stderr, "%s:%i: %s: Assertion failed.\n", file, line, expr); ++ abort(); ++} +#else +extern void __assert(const char *, const char *, int); +#endif @@ -172,53 +344,44 @@ diff -urw src/zfs-0.6.3/lib/libspl/include/assert.h src.new/lib/libspl/include/a #ifndef verify #if defined(__STDC__) #if __STDC_VERSION__ - 0 >= 199901L -@@ -61,8 +67,6 @@ +@@ -61,8 +72,6 @@ __assert_c99(const char *expr, const char *file, int line, const char *func) #define VERIFY verify #define ASSERT assert -extern void __assert(const char *, const char *, int); - - /* BEGIN CSTYLED */ - #define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE) do { \ - const TYPE __left = (TYPE)(LEFT); \ -diff -urw src/zfs-0.6.3/lib/libspl/include/devid.h src.new/lib/libspl/include/devid.h ---- src/zfs-0.6.3/lib/libspl/include/devid.h 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/lib/libspl/include/devid.h 2014-09-13 18:40:03.722680950 +0000 -@@ -28,6 +28,7 @@ + static inline int + assfail(const char *buf, const char *file, int line) + { +diff --git a/lib/libspl/include/devid.h b/lib/libspl/include/devid.h +index 5406c33..4b346da 100644 +--- a/lib/libspl/include/devid.h ++++ b/lib/libspl/include/devid.h +@@ -27,6 +27,7 @@ + #ifndef _LIBSPL_DEVID_H #define _LIBSPL_DEVID_H - #include <stdlib.h> +#include <sys/types.h> + #include <stdlib.h> typedef int ddi_devid_t; - -diff -urw src/zfs-0.6.3/lib/libspl/include/rpc/xdr.h src.new/lib/libspl/include/rpc/xdr.h ---- src/zfs-0.6.3/lib/libspl/include/rpc/xdr.h 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/lib/libspl/include/rpc/xdr.h 2014-09-13 18:40:03.737125699 +0000 -@@ -60,6 +60,8 @@ +diff --git a/lib/libspl/include/rpc/xdr.h b/lib/libspl/include/rpc/xdr.h +index 99500d6..cd2d17a 100644 +--- a/lib/libspl/include/rpc/xdr.h ++++ b/lib/libspl/include/rpc/xdr.h +@@ -60,6 +60,8 @@ typedef struct xdr_bytesrec { #define XDR_RDMAGET 4 #define XDR_RDMASET 5 -+#ifndef HAVE_TIRPC ++#ifndef WITH_TIRPC extern bool_t xdr_control(XDR *xdrs, int request, void *info); +#endif #endif -diff -urw src/zfs-0.6.3/lib/libspl/include/sys/inttypes.h src.new/lib/libspl/include/sys/inttypes.h ---- src/zfs-0.6.3/lib/libspl/include/sys/inttypes.h 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/lib/libspl/include/sys/inttypes.h 2014-09-13 18:40:03.751570447 +0000 -@@ -31,4 +31,8 @@ - - #define _INT64_TYPE - -+#ifndef RLIM64_INFINITY -+#define RLIM64_INFINITY (~0ULL) -+#endif -+ - #endif -diff -urw src/zfs-0.6.3/lib/libspl/include/sys/time.h src.new/lib/libspl/include/sys/time.h ---- src/zfs-0.6.3/lib/libspl/include/sys/time.h 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/lib/libspl/include/sys/time.h 2014-09-13 18:40:03.755181634 +0000 +diff --git a/lib/libspl/include/sys/time.h b/lib/libspl/include/sys/time.h +index f0da440..aa96c39 100644 +--- a/lib/libspl/include/sys/time.h ++++ b/lib/libspl/include/sys/time.h @@ -58,6 +58,11 @@ #define NSEC2MSEC(n) ((n) / (NANOSEC / MILLISEC)) #endif @@ -231,70 +394,47 @@ diff -urw src/zfs-0.6.3/lib/libspl/include/sys/time.h src.new/lib/libspl/include extern hrtime_t gethrtime(void); extern void gethrestime(timestruc_t *); -diff -urw src/zfs-0.6.3/lib/libspl/include/sys/types.h src.new/lib/libspl/include/sys/types.h ---- src/zfs-0.6.3/lib/libspl/include/sys/types.h 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/lib/libspl/include/sys/types.h 2014-09-13 18:40:03.751570447 +0000 -@@ -30,7 +30,6 @@ - #include <sys/isa_defs.h> - #include <sys/feature_tests.h> - #include_next <sys/types.h> --#include <sys/param.h> /* for NBBY */ - #include <sys/types32.h> - #include <sys/va_list.h> - -@@ -60,6 +59,7 @@ - typedef longlong_t hrtime_t; - typedef struct timespec timestruc_t; - typedef struct timespec timespec_t; -+#define HAVE_HR_TYPES - - typedef short pri_t; - -@@ -96,4 +96,6 @@ - } lloff_t; - #endif - -+#include <sys/param.h> /* for NBBY */ -+ - #endif -diff -urw src/zfs-0.6.3/lib/libspl/timestamp.c src.new/lib/libspl/timestamp.c ---- src/zfs-0.6.3/lib/libspl/timestamp.c 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/lib/libspl/timestamp.c 2014-09-13 18:40:03.722680950 +0000 +diff --git a/lib/libspl/timestamp.c b/lib/libspl/timestamp.c +index a4f4cf4..a177270 100644 +--- a/lib/libspl/timestamp.c ++++ b/lib/libspl/timestamp.c @@ -28,6 +28,10 @@ #include <langinfo.h> #include "statcommon.h" +#ifndef _DATE_FMT -+#define _DATE_FMT "%+" ++#define _DATE_FMT D_FMT +#endif + /* * Print timestamp as decimal reprentation of time_t value (-T u was specified) * or in date(1) format (-T d was specified). -diff -urw src/zfs-0.6.3/lib/libspl/xdr.c src.new/lib/libspl/xdr.c ---- src/zfs-0.6.3/lib/libspl/xdr.c 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/lib/libspl/xdr.c 2014-09-13 18:40:03.722680950 +0000 +diff --git a/lib/libspl/xdr.c b/lib/libspl/xdr.c +index 288a338..f122496 100644 +--- a/lib/libspl/xdr.c ++++ b/lib/libspl/xdr.c @@ -29,6 +29,7 @@ * under license from the Regents of the University of California. */ -+#ifndef HAVE_TIRPC ++#ifndef WITH_TIRPC #include <rpc/xdr.h> /* -@@ -76,3 +77,4 @@ +@@ -76,3 +77,4 @@ xdr_control(XDR *xdrs, int request, void *info) } return (FALSE); } +#endif -diff -urw src/zfs-0.6.3/module/nvpair/nvpair.c src.new/module/nvpair/nvpair.c ---- src/zfs-0.6.3/module/nvpair/nvpair.c 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/module/nvpair/nvpair.c 2014-09-13 18:40:03.491564974 +0000 -@@ -3251,8 +3251,12 @@ +diff --git a/module/nvpair/nvpair.c b/module/nvpair/nvpair.c +index 1eca0fe..efd6287 100644 +--- a/module/nvpair/nvpair.c ++++ b/module/nvpair/nvpair.c +@@ -3251,8 +3251,12 @@ nvs_xdr_nvpair(nvstream_t *nvs, nvpair_t *nvp, size_t *size) return (0); /* sanity check the size parameter */ -+#ifndef HAVE_TIRPC ++#ifndef WITH_TIRPC if (!xdr_control(xdr, XDR_GET_BYTES_AVAIL, &bytesrec)) return (EFAULT); +#else @@ -303,87 +443,3 @@ diff -urw src/zfs-0.6.3/module/nvpair/nvpair.c src.new/module/nvpair/nvpair.c if (*size > NVS_XDR_MAX_LEN(bytesrec.xc_num_avail)) return (EFAULT); -diff -urw src/zfs-0.6.3/module/zcommon/zfs_uio.c src.new/module/zcommon/zfs_uio.c ---- src/zfs-0.6.3/module/zcommon/zfs_uio.c 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/module/zcommon/zfs_uio.c 2014-09-13 18:40:03.509620910 +0000 -@@ -44,6 +44,7 @@ - */ - #ifdef _KERNEL - -+#include <sys/param.h> - #include <sys/types.h> - #include <sys/uio_impl.h> - -diff --git a/config/musl.m4 b/config/musl.m4 -new file mode 100644 -index 0000000..fb4d2c4 ---- /dev/null 2014-06-12 20:58:09.000000000 +0000 -+++ src.new/config/musl.m4 2014-08-16 14:27:37.866666884 +0000 -@@ -0,0 +1,19 @@ -+dnl -+dnl musl support -+dnl -+ -+AC_DEFUN([ZFS_AC_CONFIG_USER_MUSL], [ -+AH_TEMPLATE([HAVE_MUSL], -+ [Define to 1 if musl is being used as the C library]) -+AH_TEMPLATE([HAVE_TIRPC], -+ [Define to 1 if libtirpc is being used as the RPC library]) -+AC_ARG_ENABLE(musl, -+AC_HELP_STRING([--enable-musl], [compile with musl as the C library]), -+[if test x$enableval = xyes; then -+ AC_DEFINE([HAVE_MUSL], 1, [Define if you have musl]) -+ PKG_CHECK_MODULES([TIRPC],[libtirpc]) -+ AC_DEFINE([HAVE_TIRPC], 1, [Define if you have libtirpc]) -+ AC_SUBST(TIRPC_CFLAGS) -+ AC_SUBST(TIRPC_LIBS) -+fi]) -+]) ---- ./cmd/zed/Makefile.am.orig -+++ ./cmd/zed/Makefile.am -@@ -28,7 +28,8 @@ - $(top_builddir)/lib/libspl/libspl.la \ - $(top_builddir)/lib/libzpool/libzpool.la \ - $(top_builddir)/lib/libzfs/libzfs.la \ -- $(top_builddir)/lib/libzfs_core/libzfs_core.la -+ $(top_builddir)/lib/libzfs_core/libzfs_core.la \ -+ $(TIRPC_LIBS) - - zedconfdir = $(sysconfdir)/zfs/zed.d - ---- ./lib/libspl/include/sys/param.h.orig -+++ ./lib/libspl/include/sys/param.h -@@ -58,7 +58,12 @@ - #define MAXPROJID MAXUID /* max project id */ - - #ifndef PAGESIZE --#define PAGESIZE (sysconf(_SC_PAGESIZE)) -+#define PAGESIZE PAGE_SIZE - #endif /* PAGESIZE */ -+ -+#ifndef HZ -+#define HZ 100 -+#endif -+ - - #endif ---- ./cmd/ztest/ztest.c.orig -+++ ./cmd/ztest/ztest.c -@@ -123,7 +123,7 @@ - #include <math.h> - #include <sys/fs/zfs.h> - #include <libnvpair.h> --#ifdef __GNUC__ -+#ifdef __GLIBC__ - #include <execinfo.h> /* for backtrace() */ - #endif - -@@ -490,7 +490,7 @@ - static void sig_handler(int signo) - { - struct sigaction action; --#ifdef __GNUC__ /* backtrace() is a GNU extension */ -+#ifdef __GLIBC__ /* backtrace() is a GNU extension */ - int nptrs; - void *buffer[BACKTRACE_SZ]; - |