From nobody Mon Jul 18 15:01:50 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4LmlYC0276z4TNtY; Mon, 18 Jul 2022 15:01:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LmlYB6fChz3D91; Mon, 18 Jul 2022 15:01:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658156510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VzQpLZdsC1y176qyPz7g6vxdy2qyFRAT8LMeDE5Zt1M=; b=hNh0YNkq5rwoCS0Z88NCy9pPi5FBnsygoiccctIfUnp/XVfahQkLM8chjWBVx0gBH14Ya6 jfd8IzompZpMSP+/kW9JWn3Z3WFl1o15XeUUin2KeGOH/sug8Cp3ejv9bb+7IgZGmBtUgg lRt1JpzrUozqbBVPsiHda7vppyWHgOmopvQITfshOp/UmmHOVlE0DFewLSQosSDgti5gvU RQukbv3UIr2gP+ZbbZKWTSxaLVcPge7GeQtx3KAu5Agt01mDp/s4/S9RokfwCLq19KJXrA 2+qH4qzdRwMO5LiQuiFgtK/2ZfsrK/zdNeceVbfjoj069hZbaDOEW7ZfHizfKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4LmlYB5jD4zjjK; Mon, 18 Jul 2022 15:01:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26IF1o2i071444; Mon, 18 Jul 2022 15:01:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26IF1oN8071431; Mon, 18 Jul 2022 15:01:50 GMT (envelope-from git) Date: Mon, 18 Jul 2022 15:01:50 GMT Message-Id: <202207181501.26IF1oN8071431@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 0c4d13c521aa - stable/13 - Add SPLIT_KERNEL_DEBUG knob List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0c4d13c521aaa56725e31d5a052760b9effd2dd5 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658156510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VzQpLZdsC1y176qyPz7g6vxdy2qyFRAT8LMeDE5Zt1M=; b=AjMoQ8/1ww3JP1A+sj63wWL+gX1zS5wFSQ+FrAphpVlLi8dwZaPGKs61cYuSsIeFADlqXG mx/jpkakt9y70LRKnxpj1CYTG/ysMjqHxjSu/1d2R54MJHXoqPvwhARWqrsGJwhv7s93cm /YriZtHZEUxfOBz8kyJb68k2HU5m79bVKSGjHQuN+3+teNbSOtmeORKL3s+wRs8h0g8uLg i73iqSSB/3zeNJMlHV/G4mpYJMr5XRyrjzmQGMMqj1f00MLUiCBhSYL0r/iRE2U7MyzjYs zrep/bdjkzxkTu7tmy86NMvPeb76B1ZSVgWigMJtxQ4IxcK8b/ovxKrijTPgHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658156510; a=rsa-sha256; cv=none; b=f9XbvJLeULyHscQcoVehlxwqPEGJy2uOicMy7M01FHeV8YmxHd9XcSI4x5WVqeHN0biChy 4ITTfZ/o7+5tXPtRtHYkBTBTp75rrFoeSJjFU3wT/7cTEJo62xqZJgcgzQiZqtaUeVz6DF hzpoetvHv31FXc19eWeJbCZpwZI7D6Fy9x9vjwWS1Q0zERxvQCbRXw54NrVc/Cwn7xhZ5U 8oK3ygqfhu9prJOWXKkiC+EShgGkm89fgB8Haz422CuxjkZrFSEGzTDXdnEPoL9UGWi8Sd xO1W32CiIhM8gCmMw+lHiY48dl4l1SARSBbnQhOMghm20OYl7tIdwszPuSQdPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0c4d13c521aaa56725e31d5a052760b9effd2dd5 commit 0c4d13c521aaa56725e31d5a052760b9effd2dd5 Author: Ed Maste AuthorDate: 2022-06-07 14:20:39 +0000 Commit: Ed Maste CommitDate: 2022-07-18 15:01:23 +0000 Add SPLIT_KERNEL_DEBUG knob Prior to 9b6edf364eb0 WITHOUT_KERNEL_SYMBOLS split kernel debug data into standalone debug files at build time, but did not install those files. As of 9b6edf364eb0 it stopped splitting the debug data, leaving it in the kernel and modules (the default kernel configs include DEBUG=-g). Revert 9b6edf364eb0 and introduce a new build-time SPLIT_KERNEL_DEBUG knob, as some people rely on the pre-9b6edf364eb0 WITHOUT_KERNEL_SYMBOLS behaviour and that was imp's original intent. PR: 264433 Reviewed by: eugen, imp MFC after: 3 weeks Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D35437 (cherry picked from commit 92fc5822a8301d0c20d292e97d1661b25f5035bc) (cherry picked from commit e3709cfe6a2a1f7d345db2870be175c9cf2a8979) (cherry picked from commit a7bd57de86372d834cf9312fcc4c39070653e009) --- share/man/man5/src.conf.5 | 15 +++++++++++++-- sys/conf/kern.opts.mk | 5 +++++ sys/conf/kmod.mk | 4 ++-- tools/build/options/WITHOUT_KERNEL_SYMBOLS | 3 ++- tools/build/options/WITHOUT_SPLIT_KERNEL_DEBUG | 3 +++ 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index a879dc352830..272ad1cb9e71 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd June 13, 2022 +.Dd July 18, 2022 .Dt SRC.CONF 5 .Os .Sh NAME @@ -817,7 +817,8 @@ and Enable the "retpoline" mitigation for CVE-2017-5715 in the kernel build. .It Va WITHOUT_KERNEL_SYMBOLS -Do not install kernel debug symbol files. +Do not install standalone kernel debug symbol files. +This option has no effect at build time. .It Va WITHOUT_KVM Do not build the .Nm libkvm @@ -1470,6 +1471,16 @@ When set, it enforces these options: Do not build kernel modules that include sourceless native code for host CPU. .It Va WITHOUT_SOURCELESS_UCODE Do not build kernel modules that include sourceless microcode. +.It Va WITHOUT_SPLIT_KERNEL_DEBUG +Do not build standalone kernel debug files. +Debug data (if enabled by the kernel configuration file) +will be included in the kernel and modules. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_KERNEL_SYMBOLS +.El .It Va WITHOUT_SSP Do not build world with propolice stack smashing protection. .Pp diff --git a/sys/conf/kern.opts.mk b/sys/conf/kern.opts.mk index 7361cdd70076..a6e0a48d3272 100644 --- a/sys/conf/kern.opts.mk +++ b/sys/conf/kern.opts.mk @@ -46,6 +46,7 @@ __DEFAULT_YES_OPTIONS = \ SCTP_SUPPORT \ SOURCELESS_HOST \ SOURCELESS_UCODE \ + SPLIT_KERNEL_DEBUG \ TESTS \ USB_GADGET_EXAMPLES \ ZFS @@ -173,6 +174,10 @@ MK_${var}_SUPPORT:= yes .endif .endfor +.if ${MK_SPLIT_KERNEL_DEBUG} == "no" +MK_KERNEL_SYMBOLS:= no +.endif + # Some modules only compile successfully if option FDT is set, due to #ifdef FDT # wrapped around declarations. Module makefiles can optionally compile such # things using .if !empty(OPT_FDT) diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index 5a7199091096..16174983bb32 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -219,7 +219,7 @@ OBJS+= ${SRCS:N*.h:R:S/$/.o/g} PROG= ${KMOD}.ko .endif -.if !defined(DEBUG_FLAGS) || ${MK_KERNEL_SYMBOLS} == "no" +.if !defined(DEBUG_FLAGS) || ${MK_SPLIT_KERNEL_DEBUG} == "no" FULLPROG= ${PROG} .else FULLPROG= ${PROG}.full @@ -323,7 +323,7 @@ ${_ILINKS}: CLEANFILES+= ${PROG} ${KMOD}.kld ${OBJS} -.if defined(DEBUG_FLAGS) && ${MK_KERNEL_SYMBOLS} != "no" +.if defined(DEBUG_FLAGS) && ${MK_SPLIT_KERNEL_DEBUG} != "no" CLEANFILES+= ${FULLPROG} ${PROG}.debug .endif diff --git a/tools/build/options/WITHOUT_KERNEL_SYMBOLS b/tools/build/options/WITHOUT_KERNEL_SYMBOLS index 33fa2c4f1c97..c56359d9fa6b 100644 --- a/tools/build/options/WITHOUT_KERNEL_SYMBOLS +++ b/tools/build/options/WITHOUT_KERNEL_SYMBOLS @@ -1,2 +1,3 @@ .\" $FreeBSD$ -Do not install kernel debug symbol files. +Do not install standalone kernel debug symbol files. +This option has no effect at build time. diff --git a/tools/build/options/WITHOUT_SPLIT_KERNEL_DEBUG b/tools/build/options/WITHOUT_SPLIT_KERNEL_DEBUG new file mode 100644 index 000000000000..a23bcd5ffdb6 --- /dev/null +++ b/tools/build/options/WITHOUT_SPLIT_KERNEL_DEBUG @@ -0,0 +1,3 @@ +Do not build standalone kernel debug files. +Debug data (if enabled by the kernel configuration file) +will be included in the kernel and modules.