From 590c9a09946939a389e1f01dadd27efb4b2fe8fd Mon Sep 17 00:00:00 2001 From: Gvozden Neskovic Date: Wed, 29 Jun 2016 22:31:25 +0200 Subject: [PATCH] Allow building with `CFLAGS="-O0"` If compiled with -O0, gcc doesn't do any stack frame coalescing and -Wframe-larger-than=1024 is triggered in debug mode. Starting with gcc 4.8, new opt level -Og is introduced for debugging, which does not trigger this warning. Fix bench zio size, using SPA_OLD_MAXBLOCKSHIFT Signed-off-by: Gvozden Neskovic Signed-off-by: Brian Behlendorf Closes #4799 --- module/zfs/vdev_raidz_math.c | 2 +- module/zfs/vdev_raidz_math_scalar.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/module/zfs/vdev_raidz_math.c b/module/zfs/vdev_raidz_math.c index 2d94860878..57f8d0b801 100644 --- a/module/zfs/vdev_raidz_math.c +++ b/module/zfs/vdev_raidz_math.c @@ -271,7 +271,7 @@ init_raidz_kstat(raidz_impl_kstat_t *rs, const char *name) #define BENCH_D_COLS (8ULL) #define BENCH_COLS (BENCH_D_COLS + PARITY_PQR) -#define BENCH_ZIO_SIZE (2ULL << 17) /* 128 kiB */ +#define BENCH_ZIO_SIZE (1ULL << SPA_OLD_MAXBLOCKSHIFT) /* 128 kiB */ #define BENCH_NS MSEC2NSEC(25) /* 25ms */ typedef void (*benchmark_fn)(raidz_map_t *rm, const int fn); diff --git a/module/zfs/vdev_raidz_math_scalar.c b/module/zfs/vdev_raidz_math_scalar.c index 39b90a3446..846b2e5e45 100644 --- a/module/zfs/vdev_raidz_math_scalar.c +++ b/module/zfs/vdev_raidz_math_scalar.c @@ -211,6 +211,14 @@ static const struct { #include "vdev_raidz_math_impl.h" +/* + * If compiled with -O0, gcc doesn't do any stack frame coalescing + * and -Wframe-larger-than=1024 is triggered in debug mode. + * Starting with gcc 4.8, new opt level -Og is introduced for debugging, which + * does not trigger this warning. + */ +#pragma GCC diagnostic ignored "-Wframe-larger-than=" + DEFINE_GEN_METHODS(scalar); DEFINE_REC_METHODS(scalar);