Subject: Kernel link failure with sources retrieved earlier today.
To: None <current-users@netbsd.org>
From: Monroe Williams <monroe@indirect.org>
List: current-users
Date: 08/23/2002 01:34:11
Building a kernel with all the raidframe options enabled, I get:

[...]
ld -N -Ttext 0x100000 -e __start -S -o netbsd ${SYSTEM_OBJ} vers.o
rf_evenodd.o: In function `rf_VerifyParityEvenOdd':
rf_evenodd.o(.text+0xf84): undefined reference to `rf_PrintDAGList'
rf_evenodd.o(.text+0x11d4): undefined reference to `rf_PrintDAGList'
rf_evenodd.o(.text+0x1348): undefined reference to `rf_PrintDAGList'
rf_paritylogDiskMgr.o: In function `ReadRegionParity':
rf_paritylogDiskMgr.o(.text+0x660): undefined reference to `rf_ValidateDAG'
*** Error code 1

Stop.
make: stopped in /mount/ide/netcvs/src/sys/arch/macppc/compile/INDIRECT


It looks like rf_PrintDAGList and rf_ValidateDAG are defined in
rf_dagutils.c inside "#if RF_DEBUG_VALIDATE_DAG", while not all
calls to them are likewise guarded.  Here's a patch that worked
for me:

----- snip -----
Index: rf_evenodd.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/raidframe/rf_evenodd.c,v
retrieving revision 1.7
diff -u -r1.7 rf_evenodd.c
--- rf_evenodd.c	2001/11/13 07:11:14	1.7
+++ rf_evenodd.c	2002/08/23 08:27:22
@@ -433,10 +433,12 @@
 	memset((char *) &tracerec, 0, sizeof(tracerec));
 	rd_dag_h->tracerec = &tracerec;
 
+#if RF_DEBUG_VALIDATE_DAG
 	if (rf_verifyParityDebug) {
 		printf("Parity verify read dag:\n");
 		rf_PrintDAGList(rd_dag_h);
 	}
+#endif
 	RF_LOCK_MUTEX(mcpair->mutex);
 	mcpair->flag = 0;
 	rf_DispatchDAG(rd_dag_h, (void (*) (void *)) rf_MCPairWakeupFunc,
@@ -493,10 +495,12 @@
 		wrBlock->succedents[0]->params[3].v = RF_CREATE_PARAM3(RF_IO_NORMAL_PRIORITY, 0, 0, which_ru);
 		memset((char *) &tracerec, 0, sizeof(tracerec));
 		wr_dag_h->tracerec = &tracerec;
+#if RF_DEBUG_VALIDATE_DAG
 		if (rf_verifyParityDebug) {
 			printf("Parity verify write dag:\n");
 			rf_PrintDAGList(wr_dag_h);
 		}
+#endif
 		RF_LOCK_MUTEX(mcpair->mutex);
 		mcpair->flag = 0;
 		rf_DispatchDAG(wr_dag_h, (void (*) (void *)) rf_MCPairWakeupFunc,
@@ -522,10 +526,12 @@
 		wrBlock->succedents[0]->params[3].v = RF_CREATE_PARAM3(RF_IO_NORMAL_PRIORITY, 0, 0, which_ru);
 		memset((char *) &tracerec, 0, sizeof(tracerec));
 		wr_dag_h->tracerec = &tracerec;
+#if RF_DEBUG_VALIDATE_DAG
 		if (rf_verifyParityDebug) {
 			printf("Dag of write new second redundant information in parity verify :\n");
 			rf_PrintDAGList(wr_dag_h);
 		}
+#endif
 		RF_LOCK_MUTEX(mcpair->mutex);
 		mcpair->flag = 0;
 		rf_DispatchDAG(wr_dag_h, (void (*) (void *)) rf_MCPairWakeupFunc,
Index: rf_paritylogDiskMgr.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/raidframe/rf_paritylogDiskMgr.c,v
retrieving revision 1.13
diff -u -r1.13 rf_paritylogDiskMgr.c
--- rf_paritylogDiskMgr.c	2001/11/13 07:11:15	1.13
+++ rf_paritylogDiskMgr.c	2002/08/23 08:27:23
@@ -262,8 +262,10 @@
 	prd_rdNode->params[2].v = 0;
 	prd_rdNode->params[3].v = RF_CREATE_PARAM3(RF_IO_NORMAL_PRIORITY, 
 						   0, 0, 0);
+#if RF_DEBUG_VALIDATE_DAG
 	if (rf_validateDAGDebug)
 		rf_ValidateDAG(*prd_dag_h);
+#endif
 	/* launch region parity read dag */
 	rf_DispatchDAG(*prd_dag_h, (void (*) (void *)) rf_MCPairWakeupFunc,
 	    (void *) prd_mcpair);
----- snip -----

-- monroe
------------------------------------------------------------------------
Monroe Williams                                         monroe@pobox.com