diff options
author | dim <dim@FreeBSD.org> | 2015-09-24 21:48:04 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-09-24 21:48:04 +0000 |
commit | 5c80b187639f9d0f9013ea4068039582c115f9f8 (patch) | |
tree | 1bcad8efc17a77f9140e1a6bdc016fcf18546365 /sys/conf | |
parent | 86e5497c676342d8d53c9f1035bc44653cab1fee (diff) | |
parent | 47a49e1e6cd1f4b2d0c68abdf3186595a39423c1 (diff) | |
download | FreeBSD-src-5c80b187639f9d0f9013ea4068039582c115f9f8.zip FreeBSD-src-5c80b187639f9d0f9013ea4068039582c115f9f8.tar.gz |
Merge ^/head r288126 through r288196.
Diffstat (limited to 'sys/conf')
-rw-r--r-- | sys/conf/kern.post.mk | 26 | ||||
-rw-r--r-- | sys/conf/kmod.mk | 13 |
2 files changed, 26 insertions, 13 deletions
diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk index 137e72c..0703cc8 100644 --- a/sys/conf/kern.post.mk +++ b/sys/conf/kern.post.mk @@ -23,6 +23,11 @@ MKMODULESENV+= CONF_CFLAGS="${CONF_CFLAGS}" MKMODULESENV+= WITH_CTF="${WITH_CTF}" .endif +# Allow overriding the kernel debug directory, so kernel and user debug may be +# installed in different directories. Setting it to "" restores the historical +# behavior of installing debug files in the kernel directory. +KERN_DEBUGDIR?= ${DEBUGDIR} + .MAIN: all .for target in all clean cleandepend cleandir clobber depend install \ @@ -101,11 +106,11 @@ modules-all modules-depend: modules-obj .if !defined(DEBUG) FULLKERNEL= ${KERNEL_KO} .else -FULLKERNEL= ${KERNEL_KO}.debug -${KERNEL_KO}: ${FULLKERNEL} ${KERNEL_KO}.symbols - ${OBJCOPY} --strip-debug --add-gnu-debuglink=${KERNEL_KO}.symbols\ +FULLKERNEL= ${KERNEL_KO}.full +${KERNEL_KO}: ${FULLKERNEL} ${KERNEL_KO}.debug + ${OBJCOPY} --strip-debug --add-gnu-debuglink=${KERNEL_KO}.debug \ ${FULLKERNEL} ${.TARGET} -${KERNEL_KO}.symbols: ${FULLKERNEL} +${KERNEL_KO}.debug: ${FULLKERNEL} ${OBJCOPY} --only-keep-debug ${FULLKERNEL} ${.TARGET} install.debug reinstall.debug: gdbinit cd ${.CURDIR}; ${MAKE} ${.TARGET:R} @@ -151,7 +156,7 @@ ${mfile:T:S/.m$/.h/}: ${mfile} kernel-clean: rm -f *.o *.so *.So *.ko *.s eddep errs \ - ${FULLKERNEL} ${KERNEL_KO} ${KERNEL_KO}.symbols \ + ${FULLKERNEL} ${KERNEL_KO} ${KERNEL_KO}.debug \ linterrs tags vers.c \ vnode_if.c vnode_if.h vnode_if_newproto.h vnode_if_typedef.h \ ${MFILES:T:S/.m$/.c/} ${MFILES:T:S/.m$/.h/} \ @@ -249,19 +254,26 @@ kernel-install: if [ ! "`dirname "$$thiskernel"`" -ef ${DESTDIR}${KODIR} ] ; then \ chflags -R noschg ${DESTDIR}${KODIR} ; \ rm -rf ${DESTDIR}${KODIR} ; \ + rm -rf ${DESTDIR}${KERN_DEBUGDIR}${KODIR} ; \ else \ if [ -d ${DESTDIR}${KODIR}.old ] ; then \ chflags -R noschg ${DESTDIR}${KODIR}.old ; \ rm -rf ${DESTDIR}${KODIR}.old ; \ fi ; \ mv ${DESTDIR}${KODIR} ${DESTDIR}${KODIR}.old ; \ + if [ -n "${KERN_DEBUGDIR}" -a \ + -d ${DESTDIR}${KERN_DEBUGDIR}${KODIR} ]; then \ + rm -rf ${DESTDIR}${KERN_DEBUGDIR}${KODIR}.old ; \ + mv ${DESTDIR}${KERN_DEBUGDIR}${KODIR} ${DESTDIR}${KERN_DEBUGDIR}${KODIR}.old ; \ + fi ; \ sysctl kern.bootfile=${DESTDIR}${KODIR}.old/"`basename "$$thiskernel"`" ; \ fi .endif mkdir -p ${DESTDIR}${KODIR} ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO} ${DESTDIR}${KODIR} .if defined(DEBUG) && !defined(INSTALL_NODEBUG) && ${MK_KERNEL_SYMBOLS} != "no" - ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO}.symbols ${DESTDIR}${KODIR} + mkdir -p ${DESTDIR}${KERN_DEBUGDIR}${KODIR} + ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO}.debug ${DESTDIR}${KERN_DEBUGDIR}${KODIR} .endif .if defined(KERNEL_EXTRA_INSTALL) ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_EXTRA_INSTALL} ${DESTDIR}${KODIR} @@ -273,7 +285,7 @@ kernel-reinstall: @-chflags -R noschg ${DESTDIR}${KODIR} ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO} ${DESTDIR}${KODIR} .if defined(DEBUG) && !defined(INSTALL_NODEBUG) && ${MK_KERNEL_SYMBOLS} != "no" - ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO}.symbols ${DESTDIR}${KODIR} + ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO}.debug ${DESTDIR}${KERN_DEBUGDIR}${KODIR} .endif config.o env.o hints.o vers.o vnode_if.o: diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index 7e3bc43..47bc593 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -172,11 +172,11 @@ PROG= ${KMOD}.ko .if !defined(DEBUG_FLAGS) FULLPROG= ${PROG} .else -FULLPROG= ${PROG}.debug -${PROG}: ${FULLPROG} ${PROG}.symbols - ${OBJCOPY} --strip-debug --add-gnu-debuglink=${PROG}.symbols\ +FULLPROG= ${PROG}.full +${PROG}: ${FULLPROG} ${PROG}.debug + ${OBJCOPY} --strip-debug --add-gnu-debuglink=${PROG}.debug \ ${FULLPROG} ${.TARGET} -${PROG}.symbols: ${FULLPROG} +${PROG}.debug: ${FULLPROG} ${OBJCOPY} --only-keep-debug ${FULLPROG} ${.TARGET} .endif @@ -266,7 +266,7 @@ ${_ILINKS}: CLEANFILES+= ${PROG} ${KMOD}.kld ${OBJS} .if defined(DEBUG_FLAGS) -CLEANFILES+= ${FULLPROG} ${PROG}.symbols +CLEANFILES+= ${FULLPROG} ${PROG}.debug .endif .if !target(install) @@ -277,6 +277,7 @@ _INSTALLFLAGS:= ${_INSTALLFLAGS${ie}} .endfor .if !target(realinstall) +KERN_DEBUGDIR?= ${DEBUGDIR} realinstall: _kmodinstall .ORDER: beforeinstall _kmodinstall _kmodinstall: @@ -284,7 +285,7 @@ _kmodinstall: ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${KMODDIR} .if defined(DEBUG_FLAGS) && !defined(INSTALL_NODEBUG) && ${MK_KERNEL_SYMBOLS} != "no" ${INSTALL} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ - ${_INSTALLFLAGS} ${PROG}.symbols ${DESTDIR}${KMODDIR} + ${_INSTALLFLAGS} ${PROG}.debug ${DESTDIR}${KERN_DEBUGDIR}${KMODDIR} .endif .include <bsd.links.mk> |