aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorSerapheim Dimitropoulos <[email protected]>2020-07-10 15:30:31 -0700
committerGitHub <[email protected]>2020-07-10 15:30:31 -0700
commit6f1db5f37ede685ebe55d1549c635e0aef4661b5 (patch)
tree61f9cb5eb43972eda9a8512717e7d4d0bad4bef8 /cmd
parentf040a7b0f8bad1cea97b0148076608db0c183d2a (diff)
Unconditionally enable debugging for libzpool
We already enable -DDEBUG unconditionally (meaning regardless of this is a debug build or a performance build) for zdb and ztest as they are mostly used for development and debugging. This patch enables -DDEBUG for libzpool extending the debugging checks for zdb, ztest, and a couple of other test utilities. In addition to passing -DDEBUG we also enable -DZFS_DEBUG so all assertion checks work s expected. We do so not only in libzpool but in every utility that links to it, even if the utility doesn't directly use any functionality wrapped in ZFS_DEBUG macro definitions. The reason is that these utilities may still include headers that contain structs that have more fields when ZFS_DEBUG is defined. This can be a problem as enabling that flag for libzpool but not for zdb can lead into random problems (e.g. segmentation faults) as zdb may be have an incorrect view of a struct passed to it by libzpool. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Matthew Ahrens <[email protected]> Signed-off-by: Serapheim Dimitropoulos <[email protected]> Closes #10549
Diffstat (limited to 'cmd')
-rw-r--r--cmd/raidz_test/Makefile.am2
-rw-r--r--cmd/zdb/Makefile.am2
-rw-r--r--cmd/zhack/Makefile.am3
-rw-r--r--cmd/ztest/Makefile.am2
4 files changed, 6 insertions, 3 deletions
diff --git a/cmd/raidz_test/Makefile.am b/cmd/raidz_test/Makefile.am
index ccfa7019c..72c914e64 100644
--- a/cmd/raidz_test/Makefile.am
+++ b/cmd/raidz_test/Makefile.am
@@ -4,7 +4,7 @@ include $(top_srcdir)/config/Rules.am
AM_CFLAGS += $(FRAME_LARGER_THAN)
# Unconditionally enable ASSERTs
-AM_CPPFLAGS += -DDEBUG -UNDEBUG
+AM_CPPFLAGS += -DDEBUG -UNDEBUG -DZFS_DEBUG
bin_PROGRAMS = raidz_test
diff --git a/cmd/zdb/Makefile.am b/cmd/zdb/Makefile.am
index 7a29e54f6..b325cb060 100644
--- a/cmd/zdb/Makefile.am
+++ b/cmd/zdb/Makefile.am
@@ -1,7 +1,7 @@
include $(top_srcdir)/config/Rules.am
# Unconditionally enable debugging for zdb
-AM_CPPFLAGS += -DDEBUG -UNDEBUG
+AM_CPPFLAGS += -DDEBUG -UNDEBUG -DZFS_DEBUG
sbin_PROGRAMS = zdb
diff --git a/cmd/zhack/Makefile.am b/cmd/zhack/Makefile.am
index 6c5b5d096..5cddac32b 100644
--- a/cmd/zhack/Makefile.am
+++ b/cmd/zhack/Makefile.am
@@ -1,5 +1,8 @@
include $(top_srcdir)/config/Rules.am
+# Unconditionally enable debugging for zhack
+AM_CPPFLAGS += -DDEBUG -UNDEBUG -DZFS_DEBUG
+
sbin_PROGRAMS = zhack
zhack_SOURCES = \
diff --git a/cmd/ztest/Makefile.am b/cmd/ztest/Makefile.am
index 40d029d9f..6042b44d1 100644
--- a/cmd/ztest/Makefile.am
+++ b/cmd/ztest/Makefile.am
@@ -7,7 +7,7 @@ AM_CFLAGS += $(NO_FORMAT_TRUNCATION)
AM_CFLAGS += $(FRAME_LARGER_THAN)
# Unconditionally enable ASSERTs
-AM_CPPFLAGS += -DDEBUG -UNDEBUG
+AM_CPPFLAGS += -DDEBUG -UNDEBUG -DZFS_DEBUG
sbin_PROGRAMS = ztest