Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Jul 2009 19:59:15 -0700
From:      Brian Somers <brian@FreeBSD.org>
To:        hackers@FreeBSD.org
Subject:   make {,re}installkernel{,.debug}
Message-ID:  <20090709195915.35556269@dev.lan.Awfulhak.org>

next in thread | raw e-mail | index | archive | help
--Sig_/r7KTIQKnPquhHVBxoigDG.q
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Hi,

I'd like to change the way ``make {,re}installkernel{,.debug}''
works.


Currently we have this:

    - GENERIC contains ``makeoptions DEBUG=3D-g''.  This puts DEBUG=3D-g
      into /usr/obj/usr/src/sys/GENERIC/Makefile
    - ``make {,re}installkernel'' installs *.ko.symbols if DEBUG is set
      (which it is - as per above).
    - ``make {,re}installkernel'' ignores *.ko.symbols if INSTALL_NODEBUG
      is set.
    - ``make {,re}installkernel.debug'' does the same as the non-.debug
      version but if DEBUG is defined, also installs .gdbinit and support
      files into /usr/obj/usr/src/sys/GENERIC/.


I find this a little odd.  My proposed change (see below) does this:

    - GENERIC contains ``makeoptions DEBUG=3D-g'' as before.
    - ``make {,re}installkernel'' ignores *.ko.symbols
    - ``make {,re}installkernel.debug'' installs *.ko.symbols and puts
     .gdbinit & friends into /usr/obj/usr/src/sys/GENERIC/ as before -
      if available (ie., if DEBUG is set).
    - INSTALL_NODEBUG goes away.


I think this is much clearer.  The net result would be that those
of us who currently "make installkernel" will go back to having no
symbol files (as was the case in FreeBSD-6 if INSTALL_DEBUG wasn't
defined).

One might argue that *not* installing .gdbinit & friends into a
kernel object directory that has symbols is a mistake, but AFAIR
that conversation included too many opinions last time it was
discussed.


Opinions?

Index: tools/tools/nanobsd/gateworks/common
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tools/tools/nanobsd/gateworks/common	(revision 195527)
+++ tools/tools/nanobsd/gateworks/common	(working copy)
@@ -156,7 +156,6 @@ install_kernel()
=20
 	cd ${NANO_SRC}
 	env TARGET_ARCH=3D${NANO_ARCH} ${NANO_PMAKE} installkernel \
-		INSTALL_NODEBUG=3Dtrue \
 		DESTDIR=3D${NANO_WORLDDIR} \
 		__MAKE_CONF=3D${NANO_MAKE_CONF} KERNCONF=3D`basename ${NANO_KERNEL}` \
 		> ${MAKEOBJDIRPREFIX}/_.ik 2>&1
Index: sys/conf/kern.post.mk
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/conf/kern.post.mk	(revision 195516)
+++ sys/conf/kern.post.mk	(working copy)
@@ -18,13 +18,13 @@ MKMODULESENV+=3D	KERNBUILDDIR=3D"${.CURDIR}" SYSDIR=3D"$
 .MAIN: all
=20
 .for target in all clean cleandepend cleandir clobber depend install \
-    obj reinstall tags
+    install.debug obj reinstall reinstall.debug tags
 ${target}: kernel-${target}
 .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists($S/modu=
les)
 ${target}: modules-${target}
 modules-${target}:
 	cd $S/modules; ${MKMODULESENV} ${MAKE} \
-	    ${target:S/^reinstall$/install/:S/^clobber$/cleandir/}
+	    ${target:S/^reinstall$/install/:S/^reinstall.debug$/install.debug/:S/=
^clobber$/cleandir/}
 .endif
 .endfor
=20
@@ -69,7 +69,6 @@ ${KERNEL_KO}: ${FULLKERNEL} ${KERNEL_KO}.symbols
 ${KERNEL_KO}.symbols: ${FULLKERNEL}
 	${OBJCOPY} --only-keep-debug ${FULLKERNEL} ${.TARGET}
 install.debug reinstall.debug: gdbinit
-	cd ${.CURDIR}; ${MAKE} ${.TARGET:R}
=20
 # Install gdbinit files for kernel debugging.
 gdbinit:
@@ -197,7 +196,7 @@ kernel-tags:
 	@[ -f .depend ] || { echo "you must make depend first"; exit 1; }
 	sh $S/conf/systags.sh
=20
-kernel-install:
+kernel-install kernel-install.debug:
 	@if [ ! -f ${KERNEL_KO} ] ; then \
 		echo "You must build a kernel first." ; \
 		exit 1 ; \
@@ -218,7 +217,7 @@ kernel-tags:
 .endif
 	mkdir -p ${DESTDIR}${KODIR}
 	${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO} ${DESTDIR}$=
{KODIR}
-.if defined(DEBUG) && !defined(INSTALL_NODEBUG)
+.if defined(DEBUG) && ${.TARGET:E} =3D=3D .debug
 	${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO}.symbols ${D=
ESTDIR}${KODIR}
 .endif
 .if defined(KERNEL_EXTRA_INSTALL)
@@ -227,10 +226,10 @@ kernel-tags:
=20
=20
=20
-kernel-reinstall:
+kernel-reinstall kernel-reinstall.debug:
 	@-chflags -R noschg ${DESTDIR}${KODIR}
 	${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO} ${DESTDIR}$=
{KODIR}
-.if defined(DEBUG) && !defined(INSTALL_NODEBUG)
+.if defined(DEBUG) && ${.TARGET:E} =3D=3D .debug
 	${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO}.symbols ${D=
ESTDIR}${KODIR}
 .endif
=20
Index: sys/conf/kmod.mk
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/conf/kmod.mk	(revision 195516)
+++ sys/conf/kmod.mk	(working copy)
@@ -46,6 +46,10 @@
 #
 # +++ targets +++
 #
+# 	install.debug:
+#		Depends on install, then installs the kernel module with
+#		symbols.
+#
 # 	install:
 #               install the kernel module; if the Makefile
 #               does not itself define the target install, the targets
@@ -269,10 +273,6 @@ realinstall: _kmodinstall
 _kmodinstall:
 	${INSTALL} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \
 	    ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${KMODDIR}
-.if defined(DEBUG_FLAGS) && !defined(INSTALL_NODEBUG)
-	${INSTALL} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \
-	    ${_INSTALLFLAGS} ${PROG}.symbols ${DESTDIR}${KMODDIR}
-.endif
=20
 .include <bsd.links.mk>
=20
@@ -290,6 +290,16 @@ _kldxref:
=20
 .endif # !target(install)
=20
+.if !target(install.debug)
+install.debug:
+.if defined(DEBUG_FLAGS)
+	${INSTALL} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \
+	    ${_INSTALLFLAGS} ${PROG}.symbols ${DESTDIR}${KMODDIR}
+.endif
+.endif # !target(install.debug)
+
+install.debug: install
+
 .if !target(load)
 load: ${PROG}
 	${KMODLOAD} -v ${.OBJDIR}/${PROG}
Index: UPDATING
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- UPDATING	(revision 195527)
+++ UPDATING	(working copy)
@@ -22,6 +22,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.x IS SLOW:
 	to maximize performance.  (To disable malloc debugging, run
 	ln -s aj /etc/malloc.conf.)
=20
+20090709:
+	The use of INSTALL_NODEBUG has been deprecated and symbol files
+	are no longer installed by default.  To install kernel and
+	module symbol files, use the {,re}installkernel.debug target.
+
 20090630:
 	The NFS_LEGACYRPC option has been removed along with the old
 	kernel RPC implementation that this option selected. Kernel
Index: Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- Makefile	(revision 195527)
+++ Makefile	(working copy)
@@ -11,9 +11,9 @@
 # world               - buildworld + installworld, no kernel.
 # buildkernel         - Rebuild the kernel and the kernel-modules.
 # installkernel       - Install the kernel and the kernel-modules.
-# installkernel.debug
+# installkernel.debug - Also install kernel and module symbols.
 # reinstallkernel     - Reinstall the kernel and the kernel-modules.
-# reinstallkernel.debug
+# reinstallkernel.debug - Also reinstall kernel and module symbols.
 # kernel              - buildkernel + installkernel.
 # doxygen             - Build API documentation of the kernel, needs doxyg=
en.
 # update              - Convenient way to update your source tree (cvs).
Index: Makefile.inc1
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- Makefile.inc1	(revision 195527)
+++ Makefile.inc1	(working copy)
@@ -682,6 +682,9 @@ distrib-dirs distribution:
 # for building kernels and only the first of these is designated
 # as the one being installed.
 #
+# If your kernel is built with DEBUG set, installkernel.debug
+# will additionally install kernel and module symbols.
+#
 # Note that we have to use TARGET instead of TARGET_ARCH when
 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
 # be set to cross-build, we have to make sure TARGET is set
Index: share/mk/bsd.subdir.mk
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- share/mk/bsd.subdir.mk	(revision 195516)
+++ share/mk/bsd.subdir.mk	(working copy)
@@ -67,7 +67,7 @@ ${SUBDIR}: .PHONY
=20
 .for __target in all all-man checkdpadd clean cleandepend cleandir \
     depend distribute lint maninstall manlint \
-    obj objlink realinstall regress tags \
+    obj objlink realinstall install.debug regress tags \
     ${SUBDIR_TARGETS}
 ${__target}: _SUBDIR
 .endfor


--=20
Brian Somers                                          <brian@Awfulhak.org>
Don't _EVER_ lose your sense of humour !               <brian@FreeBSD.org>

--Sig_/r7KTIQKnPquhHVBxoigDG.q
Content-Type: application/pgp-signature; name=signature.asc
Content-Disposition: attachment; filename=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (FreeBSD)

iQCVAwUBSlauig7tvOdmanQhAQLX1gP6A/w7s8+I/O4G8eg6JWz5/F615QgR2DfC
2rYwHqncxfyuq47S3uNhYpLAH0Lxir7iQI3Fis5jc5SMtmDLjeZz0AdSIOpFYGlT
3NwIcYyPbEvcF2YmXNb6izYEM27frfnGH3vmDbjfpQXGMA1GNAGFS1gcIHwG/8+X
d6d6/n9k5MI=
=dDYK
-----END PGP SIGNATURE-----

--Sig_/r7KTIQKnPquhHVBxoigDG.q--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090709195915.35556269>