btrfs-progs: ioctl: make build-time structure size checks optional

Temporarily make the build checks optional. The structure sizes could
change on arches due to alignment requirements or padding inserted into
the structures. We need more extensive tests to make sure we'd not break
ioctls.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2016-10-10 09:59:18 +02:00
parent 805ac27248
commit 5aade6f9c3
2 changed files with 9 additions and 0 deletions

View File

@ -19,6 +19,7 @@
# all - shortcut for all of the above # all - shortcut for all of the above
# asan - enable address sanitizer compiler feature # asan - enable address sanitizer compiler feature
# ubsan - undefined behaviour sanitizer compiler feature # ubsan - undefined behaviour sanitizer compiler feature
# bcheck - extended build checks
# W=123 build with warnings (default: off) # W=123 build with warnings (default: off)
# DEBUG_CFLAGS additional compiler flags for debugging build # DEBUG_CFLAGS additional compiler flags for debugging build
# EXTRA_CFLAGS additional compiler flags # EXTRA_CFLAGS additional compiler flags
@ -161,6 +162,10 @@ ifneq (,$(findstring ubsan,$(D)))
DEBUG_CFLAGS_INTERNAL += -fsanitize=undefined DEBUG_CFLAGS_INTERNAL += -fsanitize=undefined
endif endif
ifneq (,$(findstring bcheck,$(D)))
DEBUG_CFLAGS_INTERNAL += -DDEBUG_BUILD_CHECKS
endif
MAKEOPTS = --no-print-directory Q=$(Q) MAKEOPTS = --no-print-directory Q=$(Q)
# build all by default # build all by default

View File

@ -70,7 +70,11 @@
#define __token_glue(a,b,c) ___token_glue(a,b,c) #define __token_glue(a,b,c) ___token_glue(a,b,c)
#define ___token_glue(a,b,c) a ## b ## c #define ___token_glue(a,b,c) a ## b ## c
#ifdef DEBUG_BUILD_CHECKS
#define BUILD_ASSERT(x) extern int __token_glue(compile_time_assert_,__LINE__,__COUNTER__)[1-2*!(x)] __attribute__((unused)) #define BUILD_ASSERT(x) extern int __token_glue(compile_time_assert_,__LINE__,__COUNTER__)[1-2*!(x)] __attribute__((unused))
#else
#define BUILD_ASSERT(x)
#endif
#ifndef BTRFS_DISABLE_BACKTRACE #ifndef BTRFS_DISABLE_BACKTRACE
#define MAX_BACKTRACE 16 #define MAX_BACKTRACE 16