The recent change to db_variables.c to not include sys/systm.h revealed
a missing include that breaks kernel builds on macppc (and possibly
other arches). The problem is that db_variables.c makes use of
strcmp(9), which requires lib/libkern/libkern.h, and that was being
included via systm.h.

This problem doesn't manifest on amd64, i386 or sparc64 because their
machdep/db_machdep.h includes libkern.h via a different route
(uvm/uvm_extern.h -> uvm/uvm_map.h -> sys/systm.h).

The below diff is tested on macppc:

Index: sys/ddb/db_variables.c
===================================================================
RCS file: /cvs/src/sys/ddb/db_variables.c,v
retrieving revision 1.16
diff -u -p -r1.16 db_variables.c
--- sys/ddb/db_variables.c      14 Mar 2015 03:38:46 -0000      1.16
+++ sys/ddb/db_variables.c      14 Mar 2015 05:34:55 -0000
@@ -38,6 +38,8 @@
 #include <ddb/db_extern.h>
 #include <ddb/db_var.h>
 
+#include <lib/libkern/libkern.h>
+
 struct db_variable db_vars[] = {
        { "radix",      (long *)&db_radix, db_var_rw_int },
        { "maxoff",     (long *)&db_maxoff, db_var_rw_int },

Reply via email to