diff options
Diffstat (limited to 'share')
-rw-r--r-- | share/man/man4/ata.4 | 4 | ||||
-rw-r--r-- | share/man/man4/tap.4 | 15 | ||||
-rw-r--r-- | share/man/man4/tun.4 | 15 | ||||
-rw-r--r-- | share/man/man4/umb.4 | 28 | ||||
-rw-r--r-- | share/man/man4/vtnet.4 | 142 | ||||
-rw-r--r-- | share/mk/Makefile | 1 | ||||
-rw-r--r-- | share/mk/bsd.README | 1 | ||||
-rw-r--r-- | share/mk/bsd.debug.mk | 68 | ||||
-rw-r--r-- | share/mk/bsd.lib.mk | 52 | ||||
-rw-r--r-- | share/mk/bsd.opts.mk | 1 | ||||
-rw-r--r-- | share/mk/bsd.own.mk | 7 | ||||
-rw-r--r-- | share/mk/bsd.prog.mk | 55 |
12 files changed, 278 insertions, 111 deletions
diff --git a/share/man/man4/ata.4 b/share/man/man4/ata.4 index feea1dd3cc85..29b6bbef6838 100644 --- a/share/man/man4/ata.4 +++ b/share/man/man4/ata.4 @@ -155,7 +155,9 @@ The .Va hw.ata.ata_dma_check_80pin tunable can be set to 0 to disable this check. .Sh HARDWARE -The currently supported ATA/SATA controller chips are: +The +.Nm +driver supports the IDE interface on the following ATA/SATA controllers: .Pp .Bl -tag -width "Silicon Image:" -compact .It Acard: diff --git a/share/man/man4/tap.4 b/share/man/man4/tap.4 index 95a681a923d2..a4fe98cdfecf 100644 --- a/share/man/man4/tap.4 +++ b/share/man/man4/tap.4 @@ -203,6 +203,21 @@ The argument should be a pointer to a The interface name will be returned in the .Va ifr_name field. +.It Dv TAPSTRANSIENT +The argument should be a pointer to an +.Va int ; +this sets the transient flag on +the +.Nm +device. +A transient +.Nm +will be destroyed upon last close. +.It Dv TAPGTRANSIENT +The argument should be a pointer to an +.Va int ; +this stores the current state (enabled or disabled) of the transient flag into +it. .It Dv FIONBIO Turn non-blocking I/O for reads off or on, according as the argument .Va int Ns 's diff --git a/share/man/man4/tun.4 b/share/man/man4/tun.4 index 58f67cb20acb..1c5bd35f0ab8 100644 --- a/share/man/man4/tun.4 +++ b/share/man/man4/tun.4 @@ -282,6 +282,21 @@ The argument should be a pointer to an the ioctl sets the value to one if the device is in .Dq multi-af mode, and zero otherwise. +.It Dv TUNSTRANSIENT +The argument should be a pointer to an +.Va int ; +this sets the transient flag on +the +.Nm +device. +A transient +.Nm +will be destroyed upon last close. +.It Dv TUNGTRANSIENT +The argument should be a pointer to an +.Va int ; +this stores the current state (enabled or disabled) of the transient flag into +it. .It Dv FIONBIO Turn non-blocking I/O for reads off or on, according as the argument .Vt int Ns 's diff --git a/share/man/man4/umb.4 b/share/man/man4/umb.4 index 7ecc9a39c1ca..311a50faf8e7 100644 --- a/share/man/man4/umb.4 +++ b/share/man/man4/umb.4 @@ -17,34 +17,34 @@ .\" .\" $NetBSD: umb.4,v 1.4 2019/08/30 09:22:17 wiz Exp $ .\" -.Dd May 11, 2025 +.Dd August 4, 2025 .Dt UMB 4 .Os .Sh NAME .Nm umb .Nd USB Mobile Broadband Interface Model (MBIM) cellular modem driver .Sh SYNOPSIS -To compile this driver into the kernel, -place the following lines in your -kernel configuration file: -.Bd -ragged -offset indent +.Cd "device netmap" .Cd "device usb" .Cd "device umb" -.Ed .Pp -Alternatively, to load the driver as a -module at boot time, place the following line in +In .Xr loader.conf 5 : -.Bd -literal -offset indent -umb_load="YES" -.Ed -.Pp -If neither of the above is done, the driver will automatically be loaded -by devd(8) when the device is connected. +.Cd umb_load="YES" .Sh DESCRIPTION The .Nm driver provides support for USB MBIM devices. +If the appropriate hardware is detected, +the driver will be loaded automatically by +.Xr devmatch 8 . +To load the driver manually, +.Cm load +it in +.Xr loader.conf 5 +or at the +.Xr loader 8 +prompt. .Pp MBIM devices establish connections via cellular networks such as GPRS, UMTS, and LTE. diff --git a/share/man/man4/vtnet.4 b/share/man/man4/vtnet.4 index 8b99cd9f17b9..b6f10ddd87cb 100644 --- a/share/man/man4/vtnet.4 +++ b/share/man/man4/vtnet.4 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 29, 2025 +.Dd August 21, 2025 .Dt VTNET 4 .Os .Sh NAME @@ -68,20 +68,29 @@ prompt before booting the kernel or stored in .Bl -tag -width "xxxxxx" .It Va hw.vtnet.csum_disable .It Va hw.vtnet. Ns Ar X Ns Va .csum_disable -This tunable disables receive and send checksum offload. +This tunable disables receive and transmit checksum offloading for TCP and +UDP. +This also implies that TCP segmentation offloading and large receive offload +are disabled. The default value is 0. .It Va hw.vtnet.fixup_needs_csum .It Va hw.vtnet. Ns Ar X Ns Va .fixup_needs_csum -This tunable enforces the calculation of a valid checksum for NEEDS_CSUM -packets. +This tunable enforces the calculation of a valid TCP or UDP checksum for +packets received with +.Dv VIRTIO_NET_HDR_F_NEEDS_CSUM +being set in the +.Va flags +field of the structure +.Vt struct virtio_net_hdr . +It also marks the checksum as being correct in the mbuf packet header. The default value is 0. .It Va hw.vtnet.tso_disable .It Va hw.vtnet. Ns Ar X Ns Va .tso_disable -This tunable disables TSO. +This tunable disables TCP segmentation offloading. The default value is 0. .It Va hw.vtnet.lro_disable .It Va hw.vtnet. Ns Ar X Ns Va .lro_disable -This tunable disables LRO. +This tunable disables large receive offload. The default value is 0. .It Va hw.vtnet.mq_disable .It Va hw.vtnet. Ns Ar X Ns Va .mq_disable @@ -117,6 +126,127 @@ This tunable disables ALTQ support, allowing the use of multiqueue instead. This option applies to all interfaces. The default value is 0. .El +.Sh TRANSMIT QUEUE STATISTICS +.Bl -tag -width "xxxxxx" +For each transmit queue of each interface the following read-only statistics +are provided: +.Bl -tag -width "xxxxxx" +.It Va dev.vtnet. Ns Ar X Ns Va .txq Ns Ar Y Ns Va .rescheduled +The number of times the transmit interrupt handler was rescheduled. +.It Va dev.vtnet. Ns Ar X Ns Va .txq Ns Ar Y Ns Va .tso +The number of times TCP segment offloading was performed. +.It Va dev.vtnet. Ns Ar X Ns Va .txq Ns Ar Y Ns Va .csum +The number of times transmit checksum offloading for UDP or TCP was +performed. +.It Va dev.vtnet. Ns Ar X Ns Va .txq Ns Ar Y Ns Va .omcasts +The number of multicast packets that were transmitted. +.It Va dev.vtnet. Ns Ar X Ns Va .txq Ns Ar Y Ns Va .obytes +The number of bytes that were transmitted (based on Ethernet frames). +.It Va dev.vtnet. Ns Ar X Ns Va .txq Ns Ar Y Ns Va .opackets +The number of packets that were transmitted (Ethernet frames). +.El +.Sh RECEIVE QUEUE STATISTICS +For each receive queue of each interface the following read-only statistics +are provided: +.Bl -tag -width "xxxxxx" +.It Va dev.vtnet. Ns Ar X Ns Va .rxq Ns Ar Y Ns Va .rescheduled +The number of times the receive interrupt handler was rescheduled. +.It Va dev.vtnet. Ns Ar X Ns Va .rxq Ns Ar Y Ns Va .host_lro +The number of times TCP large receive offload was performed. +.It Va dev.vtnet. Ns Ar X Ns Va .rxq Ns Ar Y Ns Va .csum_failed +Currently not used. +.It Va dev.vtnet. Ns Ar X Ns Va .rxq Ns Ar Y Ns Va .csum +The number of times receive checksum offloading for UDP or TCP was performed. +.It Va dev.vtnet. Ns Ar X Ns Va .rxq Ns Ar Y Ns Va .ierrors +The number of times an error occurred during input processing. +.It Va dev.vtnet. Ns Ar X Ns Va .rxq Ns Ar Y Ns Va .iqdrops +The number of times a packet was dropped during input processing. +.It Va dev.vtnet. Ns Ar X Ns Va .rxq Ns Ar Y Ns Va .ibytes +The number of bytes that were received (based on Ethernet frames). +.It Va dev.vtnet. Ns Ar X Ns Va .rxq Ns Ar Y Ns Va .ipackets +The number of packets that were received (Ethernet frames). +.El +.Sh INTERFACE TRANSMIT STATISTICS +For each interface the following read-only transmit statistics are provided: +.Bl -tag -width "xxxxxx" +.It Va dev.vtnet. Ns Ar X Ns Va .tx_task_rescheduled +The sum of +.Va dev.vtnet. Ns Ar X Ns Va .txq Ns Ar Y Ns Va .rescheduled +over all transmit queues of the interface. +.It Va dev.vtnet. Ns Ar X Ns Va .tx_tso_offloaded +The sum of +.Va dev.vtnet. Ns Ar X Ns Va .txq Ns Ar Y Ns Va .tso +over all transmit queues of the interface. +.It Va dev.vtnet. Ns Ar X Ns Va .tx_csum_offloaded +The sum of +.Va dev.vtnet. Ns Ar X Ns Va .txq Ns Ar Y Ns Va .csum +over all transmit queues of the interface. +.It Va dev.vtnet. Ns Ar X Ns Va .tx_defrag_failed +The number of times an attempt to defragment an mbuf chain failed during a +transmit operation. +.It Va dev.vtnet. Ns Ar X Ns Va .tx_defragged +The number of times an mbuf chain was defragmented during a transmit operation. +.It Va dev.vtnet. Ns Ar X Ns Va .tx_tso_without_csum +The number of times TCP segment offloading was attempted without transmit +checksum offloading. +.It Va dev.vtnet. Ns Ar X Ns Va .tx_tso_not_tcp +The number of times TCP segment offloading was attempted for a non-TCP packet. +.It Va dev.vtnet. Ns Ar X Ns Va .tx_csum_proto_mismatch +The number of times the IP protocol version of the transmit checksum +offloading request did not match the IP protocol version of the packet. +.It Va dev.vtnet. Ns Ar X Ns Va .tx_csum_unknown_ethtype +The number of times a transmit offload operation was requested for an +ethernet frame for which the EtherType was neither IPv4 nor IPv6 +(considering simple VLAN tagging). +.El +.Sh INTERFACE RECEIVE STATISTICS +For each interface the following read-only receive statistics are provided: +.Bl -tag -width "xxxxxx" +.It Va dev.vtnet. Ns Ar X Ns Va .rx_task_rescheduled +The sum of +.Va dev.vtnet. Ns Ar X Ns Va .rxq Ns Ar Y Ns Va .rescheduled +over all receive queues of the interface. +.It Va dev.vtnet. Ns Ar X Ns Va .rx_csum_offloaded +The sum of +.Va dev.vtnet. Ns Ar X Ns Va .rxq Ns Ar Y Ns Va .csum +over all receive queues of the interface. +.It Va dev.vtnet. Ns Ar X Ns Va .rx_csum_failed +The sum of +.Va dev.vtnet. Ns Ar X Ns Va .rxq Ns Ar Y Ns Va .csum_failed +over all receive queues of the interface. +.It Va dev.vtnet. Ns Ar X Ns Va .rx_csum_bad_proto +Currently unused. +.It Va dev.vtnet. Ns Ar X Ns Va .rx_csum_bad_offset +Currently unused. +.It Va dev.vtnet. Ns Ar X Ns Va .rx_csum_bad_ipproto +Currently unused. +.It Va dev.vtnet. Ns Ar X Ns Va .rx_csum_bad_ethtype +The number of times fixing the checksum required by +.Va hw.vtnet.fixup_needs_csum +or +.Va hw.vtnet. Ns Ar X Ns Va .fixup_needs_csum +was attempted for a packet with an EtherType other than IPv4 or IPv6. +.It Va dev.vtnet. Ns Ar X Ns Va .rx_mergeable_failed +The number of times receiving a mergable buffer failed. +.It Va dev.vtnet. Ns Ar X Ns Va .rx_enq_replacement_failed +The number of times the enqueuing the replacement receive mbuf chain failed. +.It Va dev.vtnet. Ns Ar X Ns Va .rx_frame_too_large +The number of times the frame was loger than the mbuf chain during large +receive offload without mergeable buffers. +.It Va dev.vtnet. Ns Ar X Ns Va .mbuf_alloc_failed +The number of times an mbuf cluster allocation for the receive buffer failed. +.El +.Sh INTERFACE CONFIGURATION PARAMETER +For each interface the following read-only configuration parameters are +provided: +.Bl -tag -width "xxxxxx" +.It Va dev.vtnet. Ns Ar X Ns Va .act_vq_pairs +The number of active virtqueue pairs. +.It Va dev.vtnet. Ns Ar X Ns Va .req_vq_pairs +The number of requested virtqueue pairs. +.It Va dev.vtnet. Ns Ar X Ns Va .max_vq_pairs +The maximum number of supported virtqueue pairs. +.El .Sh SEE ALSO .Xr arp 4 , .Xr netintro 4 , diff --git a/share/mk/Makefile b/share/mk/Makefile index 4ab5c8cc314b..0e786b381fe2 100644 --- a/share/mk/Makefile +++ b/share/mk/Makefile @@ -22,6 +22,7 @@ FILES= \ bsd.confs.mk \ bsd.cpu.mk \ bsd.crunchgen.mk \ + bsd.debug.mk \ bsd.dep.mk \ bsd.dirs.mk \ bsd.doc.mk \ diff --git a/share/mk/bsd.README b/share/mk/bsd.README index 4820bf12c72d..89ee8527895e 100644 --- a/share/mk/bsd.README +++ b/share/mk/bsd.README @@ -20,6 +20,7 @@ bsd.compiler.mk - defined based on current compiler bsd.confs.mk - install of configuration files bsd.cpu.mk - sets CPU/arch-related variables (included from sys.mk) bsd.crunchgen.mk - building crunched binaries using crunchgen(1) +bsd.debug.mk - handling debug options for bsd.{prog,lib}.mk bsd.dep.mk - handle Makefile dependencies bsd.dirs.mk - handle directory creation bsd.doc.mk - building troff system documents diff --git a/share/mk/bsd.debug.mk b/share/mk/bsd.debug.mk new file mode 100644 index 000000000000..cf2fb4356aef --- /dev/null +++ b/share/mk/bsd.debug.mk @@ -0,0 +1,68 @@ +# +# This file configures debug options for compiled targets. It is meant +# to consolidate common logic in bsd.prog.mk and bsd.lib.mk. It should +# not be included directly by Makefiles. +# + +.include <bsd.opts.mk> + +.if ${MK_ASSERT_DEBUG} == "no" +CFLAGS+= -DNDEBUG +# XXX: shouldn't we ensure that !asserts marks potentially unused variables as +# __unused instead of disabling -Werror globally? +MK_WERROR= no +.endif + +# If reproducible build mode is enabled, map the root of the source +# directory to /usr/src and the root of the object directory to +# /usr/obj. +.if ${MK_REPRODUCIBLE_BUILD} != "no" && !defined(DEBUG_PREFIX) +.if defined(SRCTOP) +DEBUG_PREFIX+= ${SRCTOP:S,/$,,}=/usr/src +.endif +.if defined(OBJROOT) +# Strip off compat subdirectories, e.g., /usr/obj/usr/src/amd64.amd64/obj-lib32 +# becomes /usr/obj/usr/src/amd64.amd64, since object files compiled there might +# refer to something outside the root. +DEBUG_PREFIX+= ${OBJROOT:S,/$,,:C,/obj-[^/]*$,,}=/usr/obj +.endif +.endif + +.if defined(DEBUG_PREFIX) +.for map in ${DEBUG_PREFIX} +CFLAGS+= -ffile-prefix-map=${map} +CXXFLAGS+= -ffile-prefix-map=${map} +.endfor +.endif + +.if defined(DEBUG_FLAGS) +CFLAGS+=${DEBUG_FLAGS} +CXXFLAGS+=${DEBUG_FLAGS} + +.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" +CTFFLAGS+= -g +.endif +.else +STRIP?= -s +.endif + +.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ + empty(DEBUG_FLAGS:M-gdwarf*) +.if !${COMPILER_FEATURES:Mcompressed-debug} +CFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*} +CXXFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*} +.else +CFLAGS+= ${DEBUG_FILES_CFLAGS} +CXXFLAGS+= ${DEBUG_FILES_CFLAGS} +.endif +CTFFLAGS+= -g +.endif + +_debuginstall: +.if ${MK_DEBUG_FILES} != "no" && defined(DEBUGFILE) +.if defined(DEBUGMKDIR) + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -d ${DESTDIR}${DEBUGFILEDIR}/ +.endif + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \ + ${DEBUGFILE} ${DESTDIR}${DEBUGFILEDIR}/${DEBUGFILE} +.endif diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 3013f32c2b36..fa851984df91 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -1,4 +1,3 @@ - .include <bsd.init.mk> .include <bsd.compiler.mk> .include <bsd.linker.mk> @@ -45,23 +44,6 @@ SONAME?= ${SHLIB_NAME} CFLAGS+= ${CRUNCH_CFLAGS} .endif -.if ${MK_ASSERT_DEBUG} == "no" -CFLAGS+= -DNDEBUG -# XXX: shouldn't we ensure that !asserts marks potentially unused variables as -# __unused instead of disabling -Werror globally? -MK_WERROR= no -.endif - -.if defined(DEBUG_FLAGS) -CFLAGS+= ${DEBUG_FLAGS} - -.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" -CTFFLAGS+= -g -.endif -.else -STRIP?= -s -.endif - .for _libcompat in ${_ALL_libcompats} .if ${SHLIBDIR:M*/lib${_libcompat}} || ${SHLIBDIR:M*/lib${_libcompat}/*} TAGS+= lib${_libcompat} @@ -130,18 +112,6 @@ CXXFLAGS+= -fzero-call-used-regs=${ZEROREG_TYPE} # bsd.sanitizer.mk is not installed, so don't require it (e.g. for ports). .sinclude "bsd.sanitizer.mk" -.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ - empty(DEBUG_FLAGS:M-gdwarf*) -.if !${COMPILER_FEATURES:Mcompressed-debug} -CFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*} -CXXFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*} -.else -CFLAGS+= ${DEBUG_FILES_CFLAGS} -CXXFLAGS+= ${DEBUG_FILES_CFLAGS} -.endif -CTFFLAGS+= -g -.endif - .if ${MACHINE_CPUARCH} == "riscv" && ${LINKER_FEATURES:Mriscv-relaxations} == "" CFLAGS += -mno-relax .endif @@ -156,6 +126,7 @@ _SHLIBDIR:=${SHLIBDIR} .if defined(SHLIB_NAME) .if ${MK_DEBUG_FILES} != "no" SHLIB_NAME_FULL=${SHLIB_NAME}.full +DEBUGFILE= ${SHLIB_NAME}.debug # Use ${DEBUGDIR} for base system debug files, else .debug subdirectory .if ${_SHLIBDIR} == "/boot" ||\ ${SHLIBDIR:C%/lib(/.*)?$%/lib%} == "/lib" ||\ @@ -272,16 +243,16 @@ ${SHLIB_NAME_FULL}: ${SOBJS} .endif .if ${MK_DEBUG_FILES} != "no" -CLEANFILES+= ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug -${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug - ${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.debug \ +CLEANFILES+= ${SHLIB_NAME_FULL} ${DEBUGFILE} +${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${DEBUGFILE} + ${OBJCOPY} --strip-debug --add-gnu-debuglink=${DEBUGFILE} \ ${SHLIB_NAME_FULL} ${.TARGET} .if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) # Note: This uses ln instead of ${INSTALL_LIBSYMLINK} since we are in OBJDIR @${LN:Uln} -fs ${SHLIB_NAME} ${SHLIB_LINK} .endif -${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} +${DEBUGFILE}: ${SHLIB_NAME_FULL} ${OBJCOPY} --only-keep-debug ${SHLIB_NAME_FULL} ${.TARGET} .endif .endif #defined(SHLIB_NAME) @@ -392,8 +363,8 @@ installpcfiles-${pcfile}: ${pcfile} installpcfiles: .PHONY .if !defined(INTERNALLIB) -realinstall: _libinstall installpcfiles -.ORDER: beforeinstall _libinstall +realinstall: _libinstall installpcfiles _debuginstall +.ORDER: beforeinstall _libinstall _debuginstall _libinstall: .if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no" ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ @@ -403,14 +374,6 @@ _libinstall: ${INSTALL} ${TAG_ARGS} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \ ${SHLIB_NAME} ${DESTDIR}${_SHLIBDIR}/ -.if ${MK_DEBUG_FILES} != "no" -.if defined(DEBUGMKDIR) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -d ${DESTDIR}${DEBUGFILEDIR}/ -.endif - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -o ${LIBOWN} -g ${LIBGRP} -m ${DEBUGMODE} \ - ${_INSTALLFLAGS} \ - ${SHLIB_NAME}.debug ${DESTDIR}${DEBUGFILEDIR}/ -.endif .if defined(SHLIB_LINK) .if commands(${SHLIB_LINK:R}.ld) ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -S -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ @@ -501,6 +464,7 @@ SUBDIR_TARGETS+= check TESTS_LD_LIBRARY_PATH+= ${.OBJDIR} .endif +.include <bsd.debug.mk> .include <bsd.dep.mk> .include <bsd.clang-analyze.mk> .include <bsd.obj.mk> diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk index 85247d733a14..439924d0d596 100644 --- a/share/mk/bsd.opts.mk +++ b/share/mk/bsd.opts.mk @@ -78,6 +78,7 @@ __DEFAULT_NO_OPTIONS = \ CCACHE_BUILD \ CTF \ INSTALL_AS_USER \ + REPRODUCIBLE_BUILD \ RETPOLINE \ RUN_TESTS \ STALE_STAGED \ diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 00a048fedc1d..4dffe9723a9e 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -44,6 +44,10 @@ # # DEBUGMODE Mode for debug files. [${NOBINMODE}] # +# DEBUGOWN Owner for debug info files. [root] +# +# DEBUGGRP Group for debug info files. [wheel] +# # # KMODDIR Base path for loadable kernel modules # (see kld(4)). [/boot/modules] @@ -197,7 +201,8 @@ LIBMODE?= ${NOBINMODE} DEBUGDIR?= /usr/lib/debug DEBUGMODE?= ${NOBINMODE} - +DEBUGOWN?= ${BINOWN} +DEBUGGRP?= ${BINGRP} # Share files SHAREDIR?= /usr/share diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 9350d4786cec..10e1c177e2b2 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -12,22 +12,6 @@ CFLAGS+=${COPTS} .endif -.if ${MK_ASSERT_DEBUG} == "no" -CFLAGS+= -DNDEBUG -# XXX: shouldn't we ensure that !asserts marks potentially unused variables as -# __unused instead of disabling -Werror globally? -MK_WERROR= no -.endif - -.if defined(DEBUG_FLAGS) -CFLAGS+=${DEBUG_FLAGS} -CXXFLAGS+=${DEBUG_FLAGS} - -.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" -CTFFLAGS+= -g -.endif -.endif - .if defined(PROG_CXX) PROG= ${PROG_CXX} .endif @@ -109,20 +93,6 @@ CFLAGS += -mno-relax .if defined(CRUNCH_CFLAGS) CFLAGS+=${CRUNCH_CFLAGS} -.else -.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ - empty(DEBUG_FLAGS:M-gdwarf-*) -.if !${COMPILER_FEATURES:Mcompressed-debug} -CFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*} -.else -CFLAGS+= ${DEBUG_FILES_CFLAGS} -.endif -CTFFLAGS+= -g -.endif -.endif - -.if !defined(DEBUG_FLAGS) -STRIP?= -s .endif .if defined(NO_ROOT) @@ -159,6 +129,9 @@ PROG_FULL= ${PROG} .if defined(PROG) PROGNAME?= ${PROG} +.if ${MK_DEBUG_FILES} != "no" +DEBUGFILE= ${PROGNAME}.debug +.endif .if defined(SRCS) @@ -223,11 +196,12 @@ ${PROG_FULL}: ${OBJS} .endif # !defined(SRCS) .if ${MK_DEBUG_FILES} != "no" -${PROG}: ${PROG_FULL} ${PROGNAME}.debug - ${OBJCOPY} --strip-debug --add-gnu-debuglink=${PROGNAME}.debug \ +CLEANFILES+= ${PROG_FULL} ${DEBUGFILE} +${PROG}: ${PROG_FULL} ${DEBUGFILE} + ${OBJCOPY} --strip-debug --add-gnu-debuglink=${DEBUGFILE} \ ${PROG_FULL} ${.TARGET} -${PROGNAME}.debug: ${PROG_FULL} +${DEBUGFILE}: ${PROG_FULL} ${OBJCOPY} --only-keep-debug ${PROG_FULL} ${.TARGET} .endif @@ -266,9 +240,6 @@ all: all-man .if defined(PROG) CLEANFILES+= ${PROG} ${PROG}.bc ${PROG}.ll -.if ${MK_DEBUG_FILES} != "no" -CLEANFILES+= ${PROG_FULL} ${PROGNAME}.debug -.endif .endif .if defined(OBJS) @@ -308,19 +279,12 @@ _INSTALLFLAGS:= ${_INSTALLFLAGS${ie}} .endfor .if !target(realinstall) && !defined(INTERNALPROG) -realinstall: _proginstall -.ORDER: beforeinstall _proginstall +realinstall: _proginstall _debuginstall +.ORDER: beforeinstall _proginstall _debuginstall _proginstall: .if defined(PROG) ${INSTALL} ${TAG_ARGS} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${BINDIR}/${PROGNAME} -.if ${MK_DEBUG_FILES} != "no" -.if defined(DEBUGMKDIR) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -d ${DESTDIR}${DEBUGFILEDIR}/ -.endif - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -o ${BINOWN} -g ${BINGRP} -m ${DEBUGMODE} \ - ${PROGNAME}.debug ${DESTDIR}${DEBUGFILEDIR}/${PROGNAME}.debug -.endif .endif .endif # !target(realinstall) @@ -391,6 +355,7 @@ TESTS_PATH+= ${.OBJDIR} OBJS_DEPEND_GUESS+= ${SRCS:M*.h} .endif +.include <bsd.debug.mk> .include <bsd.dep.mk> .include <bsd.clang-analyze.mk> .include <bsd.obj.mk> |