cvs commit: src/sys/conf kern.post.mk

David O'Brien obrien at FreeBSD.org
Tue Sep 13 10:56:17 PDT 2005


On Tue, Sep 13, 2005 at 11:58:48AM +0300, Ruslan Ermilov wrote:
> To address all of this, I suggest to revert kern.post.mk to rev. 1.83
> and just make INSTALL_DEBUG the default in HEAD when DEBUG is also
> set.  Should this be also true for modules, I'm not sure.
..
> The only change in behavior would be that installkernel.debug now
> installs *both* normal and debug versions, while previously it only
> installed debug versions.

1. We can still have the confusion of how to provide a usable traceback.
The poster will have to know to kgdb kernel.debug vs. kernel.
2. Why install a file that is a complete copy of another and then extra
needed information?  Instead just install the fuller copy.  Those
suffering from small / partitions will have even more pressure installing
an extra 6.7MB.

Please remember the purpose of this is to get better bug reports on
-CURRENT.  While still trying to strike a balance with disk space and
usability.

Here is a patch that separates out the symbols into its own file and
installs them beside the now stripped kernel executable.  I've minimally
tested in on i386 with 'kgdb' and 'gdb6 -k'.

Index: kern.post.mk
===================================================================
RCS file: /home/ncvs/src/sys/conf/kern.post.mk,v
retrieving revision 1.84
diff -u -u -2 -r1.84 kern.post.mk
--- kern.post.mk	11 Sep 2005 00:22:21 -0000	1.84
+++ kern.post.mk	13 Sep 2005 17:46:48 -0000
@@ -83,7 +83,7 @@
 	@echo linking ${.TARGET}
 	${SYSTEM_LD}
-.if !defined(DEBUG)
+	${OBJCOPY} --only-keep-debug ${.TARGET} ${.TARGET}.symbols
 	${OBJCOPY} --strip-debug ${.TARGET}
-.endif
+	${OBJCOPY} --add-gnu-debuglink=${.TARGET}.symbols ${.TARGET}
 	${SYSTEM_LD_TAIL}
 
@@ -181,4 +181,10 @@
 .endif
 
+.if defined(DEBUG) && !defined(NO_INSTALL_KERNEL_SYMBOLS)
+KERNEL_FILES=	${KERNEL_KO} ${KERNEL_KO}.symbols
+.else
+KERNEL_FILES=	${KERNEL_KO}
+.endif
+
 kernel-install:
 	@if [ ! -f ${KERNEL_KO} ] ; then \
@@ -201,5 +207,5 @@
 .endif
 	mkdir -p ${DESTDIR}${KODIR}
-	${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_KO} ${DESTDIR}${KODIR}
+	${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_FILES} ${DESTDIR}${KODIR}
 
 kernel-reinstall:

-- 
-- David  (obrien at FreeBSD.org)


More information about the cvs-src mailing list