diff --git a/srcpkgs/btrfs-progs/patches/includes.patch b/srcpkgs/btrfs-progs/patches/includes.patch new file mode 100644 index 0000000000..fed8192eb8 --- /dev/null +++ b/srcpkgs/btrfs-progs/patches/includes.patch @@ -0,0 +1,39 @@ +diff --git a/bitops.h b/bitops.h +index 323c571..7f30b06 100644 +--- bitops.h ++++ bitops.h +@@ -65,6 +65,9 @@ static inline unsigned long hweight_long(unsigned long w) + } + + #define BITOP_WORD(nr) ((nr) / BITS_PER_LONG) ++#ifndef __always_inline ++#define __always_inline inline __attribute__((always_inline)) ++#endif + + /** + * __ffs - find first bit in word. +diff --git a/kerncompat.h.orig b/kerncompat.h +index bb03194e127e..28f832a2e625 100644 +--- kerncompat.h ++++ kerncompat.h +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + #include + + #define ptr_to_u64(x) ((u64)(uintptr_t)x) +--- rbtree.h ++++ rbtree.h +@@ -38,6 +38,10 @@ + extern "C" { + #endif + ++#ifndef __always_inline ++#define __always_inline inline __attribute__((always_inline)) ++#endif ++ + struct rb_node { + unsigned long __rb_parent_color; + struct rb_node *rb_right; diff --git a/srcpkgs/btrfs-progs/patches/musl-compat.patch b/srcpkgs/btrfs-progs/patches/musl-compat.patch new file mode 100644 index 0000000000..dbe5466e56 --- /dev/null +++ b/srcpkgs/btrfs-progs/patches/musl-compat.patch @@ -0,0 +1,23 @@ +--- utils.c ++++ utils.c +@@ -833,13 +833,19 @@ + { + int ret; + FILE *f; ++ struct stat stat_buf; + char fmt[20]; + char p[PATH_MAX]; + char real_loop_dev[PATH_MAX]; + + if (!realpath(loop_dev, real_loop_dev)) + return -errno; +- snprintf(p, PATH_MAX, "/sys/block/%s/loop/backing_file", strrchr(real_loop_dev, '/')); ++ ++ if (stat(real_loop_dev, &stat_buf) || !S_ISBLK(stat_buf.st_mode)) ++ return -errno; ++ ++ snprintf(p, PATH_MAX, "/sys/dev/block/%d:%d/loop/backing_file", ++ major(stat_buf.st_rdev), minor(stat_buf.st_rdev)); + if (!(f = fopen(p, "r"))) + return -errno; + diff --git a/srcpkgs/btrfs-progs/template b/srcpkgs/btrfs-progs/template index 64fd714b38..fd496b98b6 100644 --- a/srcpkgs/btrfs-progs/template +++ b/srcpkgs/btrfs-progs/template @@ -1,6 +1,6 @@ # Template file for 'btrfs-progs' pkgname=btrfs-progs -_distver=3.17 +_distver=3.17.1 # DO NOT MODIFY DATEVER! _datever=20141006 version=${_datever}.${_distver} @@ -16,7 +16,7 @@ do_fetch() { git clone -b v${_distver} git://git.kernel.org/pub/scm/linux/kernel/git/kdave/${pkgname}.git ${pkgname}-${version} } do_build() { - make CC="$CC" CFLAGS="$CFLAGS" ${makejobs} + make DISABLE_BACKTRACE=1 CC="$CC" CFLAGS="$CFLAGS" ${makejobs} } do_install() { sed -i '/LNS/d' Documentation/Makefile