From: John Marino Date: Tue, 30 Oct 2012 18:14:57 +0000 (+0100) Subject: bug #2442: Fix bmake regression of kernel build X-Git-Tag: v3.4.0rc~935 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/9c9078b1c22ba5b3b33389aecc1b70d4706c4002 bug #2442: Fix bmake regression of kernel build Kernel modules such as acpi.ko didn't load due to missing symbols after bmake replaced legacy make. The cause was traced back to a badly generated header which in turn was caused by the file kern.fwd.mk. That file contained ":U" modifiers that should have been converted to ":tu" modifiers. The actual cause of the missing symbols were due to atomic.h not getting included into atomic.c twice. Case sensitivity prevented a macro from being properly unset. The modifiers in question turn everything to upper case. A full kernel build is required to fix the module loading. --- diff --git a/sys/conf/kern.fwd.mk b/sys/conf/kern.fwd.mk index 71dcb65ed6..9d32eaaec8 100644 --- a/sys/conf/kern.fwd.mk +++ b/sys/conf/kern.fwd.mk @@ -1,5 +1,3 @@ -# $DragonFly: src/sys/conf/kern.fwd.mk,v 1.7 2007/01/10 16:41:37 corecode Exp $ - # Create forwarding headers for ${SYSDIR}/cpu/${MACHINE_ARCH}/*.h in # ${_MACHINE_FWD}/include/machine and share the directory among module build # directories. @@ -44,6 +42,19 @@ ${FORWARD_HEADERS_COOKIE}: ${_MACHINE_FWD}/include/machine ${_FWDHDRS} ${_LHDRS} @touch ${.TARGET} ${_FWDHDRS}: +.if defined(.PARSEDIR) + @(echo "creating machine/ forwarding header ${.TARGET}" 1>&2; \ + echo "/*" ; \ + echo " * CONFIG-GENERATED FILE, DO NOT EDIT" ; \ + echo " */" ; \ + echo ; \ + echo "#ifndef _MACHINE_${.TARGET:T:S/./_/g:tu}_" ; \ + echo "#define _MACHINE_${.TARGET:T:S/./_/g:tu}_" ; \ + echo "#include " ; \ + echo "#endif" ; \ + echo) > ${.TARGET} +.else + # LEGACY MAKE - REMOVE FOR DFLY 3.6 @(echo "creating machine/ forwarding header ${.TARGET}" 1>&2; \ echo "/*" ; \ echo " * CONFIG-GENERATED FILE, DO NOT EDIT" ; \ @@ -54,8 +65,22 @@ ${_FWDHDRS}: echo "#include " ; \ echo "#endif" ; \ echo) > ${.TARGET} +.endif ${_LHDRS}: +.if defined(.PARSEDIR) + @(echo "creating sys/ forwarding header ${.TARGET}" 1>&2; \ + echo "/*" ; \ + echo " * CONFIG-GENERATED FILE, DO NOT EDIT" ; \ + echo " */" ; \ + echo ; \ + echo "#ifndef _${.TARGET:T:S/./_/g:tu}_" ; \ + echo "#define _${.TARGET:T:S/./_/g:tu}_" ; \ + echo "#include " ; \ + echo "#endif" ; \ + echo) > ${.TARGET} +.else + # LEGACY MAKE - REMOVE FOR DFLY 3.6 @(echo "creating sys/ forwarding header ${.TARGET}" 1>&2; \ echo "/*" ; \ echo " * CONFIG-GENERATED FILE, DO NOT EDIT" ; \ @@ -66,4 +91,5 @@ ${_LHDRS}: echo "#include " ; \ echo "#endif" ; \ echo) > ${.TARGET} +.endif