Skip to content

Instantly share code, notes, and snippets.

@zbrdge
Last active August 20, 2016 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zbrdge/f8b18a6a8c6b80044a1398caa38793f7 to your computer and use it in GitHub Desktop.
Save zbrdge/f8b18a6a8c6b80044a1398caa38793f7 to your computer and use it in GitHub Desktop.
configure error section (zfs 0.6.5.7 on linux 4.7.1_2)
#!/bin/sh
# failing section from configure in /var/lib/dkms/zfs/0.6.5.7/build
export LINUX_OBJ=/usr/src/kernel-headers-4.7.1_2
cat confdefs.h - <<_ACEOF >conftest.c
#include <linux/xattr.h>
int get(struct inode *ip, const char *name,
void *buffer, size_t size) { return 0; }
static const struct xattr_handler
xops __attribute__ ((unused)) = {
.get = get,
};
int
main (void)
{
;
return 0;
}
_ACEOF
cat - <<_ACEOF >conftest.h
_ACEOF
mkdir -p build && touch build/conftest.mod.c
echo "obj-m := conftest.o" >build/Makefile
modpost_flag=''
cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment