FreeBSD/src 44e8934lib/libgcc_s Symbol.map Versions.def

libgcc_s: expose __divmoddi4 on i386

GCC has used this for some time (since 7.0) and apparently we were
getting away with using the hidden symbol, but when linking with
--no-undefined-version we get an error unless it's properly exported.
(For anyone who wonders at the assymetry, __udivmoddi4 is indeed much
older and was introduced with GCC 3.0.)

MFC after:      3 days
Reviewed by:    dim
Differential Revision:  https://reviews.freebsd.org/D44878
DeltaFile
+6-0lib/libgcc_s/Symbol.map
+3-0lib/libgcc_s/Versions.def
+9-02 files

FreeBSD/src 0b9e358lib/libgcc_eh Makefile.inc

libgcc_{eh,s}: restore __*_frame_info symbols post llvm18

The upstream llvm commit 5eb44df1b64d made the addition of these GCC
compatability symbols dependent on build configuration rather than
hardcoded for amd64, i386, and powerpc.  Reenable them.

Reviewed by:    dim
Differential Revision:  https://reviews.freebsd.org/D44877
DeltaFile
+3-0lib/libgcc_eh/Makefile.inc
+3-01 files

FreeBSD/src f0bd655lib/libc/quad Symbol.map

libc/quad: further narrow list of i386 symbols

It's unclear to me why lld didn't complain about these are they aren't
present and haven't been.  Instead ld.bfd complained.

Reviewed by:    dim
Fixes:          6e6cd03c911c libc/quad: narrow list of symbols exposed on i386
Differential Revision:  https://reviews.freebsd.org/D44879
DeltaFile
+4-4lib/libc/quad/Symbol.map
+4-41 files

FreeBSD/src 2569672usr.bin/patch inp.c pch.c

patch: use getline() instead of fgetln()

This replaces fgetln() with getline(). The main reason for this is
portability, making things easier for people who want to compile these
tools on non-FreeBSD systems.

I appreciate that's probably not the top concern for FreeBSD base tools,
but fgetln() is impossible to port to most platforms, as concurrent
access is essentially impossible to implement fully correct without the
line buffer on the FILE struct. Other than this, many generic FreeBSD
tools compile fairly cleanly on Linux with a few small changes.

Most uses of fgetln() pre-date getline() support (added in 2009 with
69099ba2ec8b), and there's been some previous patches (ee3ca711a898
8c98e6b1a7f3 1a2a4fc8ce1b) for other tools.

Obtained from:  https://github.com/dcantrell/bsdutils and
                https://github.com/chimera-linux/chimerautils
Signed-off-by: Martin Tournoij <martin at arp242.net>

    [2 lines not shown]
DeltaFile
+7-12usr.bin/patch/inp.c
+10-7usr.bin/patch/pch.c
+17-192 files

FreeBSD/src d3643c9usr.bin/join join.c

join: use getline() instead of fgetln()

This replaces fgetln() with getline(). The main reason for this is
portability, making things easier for people who want to compile these
tools on non-FreeBSD systems.

I appreciate that's probably not the top concern for FreeBSD base tools,
but fgetln() is impossible to port to most platforms, as concurrent
access is essentially impossible to implement fully correct without the
line buffer on the FILE struct. Other than this, many generic FreeBSD
tools compile fairly cleanly on Linux with a few small changes.

Most uses of fgetln() pre-date getline() support (added in 2009 with
69099ba2ec8b), and there's been some previous patches (ee3ca711a898
8c98e6b1a7f3 1a2a4fc8ce1b) for other tools.

Obtained from:  https://github.com/dcantrell/bsdutils and
                https://github.com/chimera-linux/chimerautils
Signed-off-by: Martin Tournoij <martin at arp242.net>

    [2 lines not shown]
DeltaFile
+10-8usr.bin/join/join.c
+10-81 files

FreeBSD/src 3abcc79usr.bin/head head.c

head: use getline() instead of fgetln()

This replaces fgetln() with getline(). The main reason for this is
portability, making things easier for people who want to compile these
tools on non-FreeBSD systems.

I appreciate that's probably not the top concern for FreeBSD base tools,
but fgetln() is impossible to port to most platforms, as concurrent
access is essentially impossible to implement fully correct without the
line buffer on the FILE struct. Other than this, many generic FreeBSD
tools compile fairly cleanly on Linux with a few small changes.

Most uses of fgetln() pre-date getline() support (added in 2009 with
69099ba2ec8b), and there's been some previous patches (ee3ca711a898
8c98e6b1a7f3 1a2a4fc8ce1b) for other tools.

Obtained from:  https://github.com/dcantrell/bsdutils and
                https://github.com/chimera-linux/chimerautils
Signed-off-by: Martin Tournoij <martin at arp242.net>

    [2 lines not shown]
DeltaFile
+5-4usr.bin/head/head.c
+5-41 files

FreeBSD/src 5fbdcd6usr.bin/xargs xargs.c

xargs: use getline() instead of fgetln()

This replaces fgetln() with getline(). The main reason for this is
portability, making things easier for people who want to compile these
tools on non-FreeBSD systems.

I appreciate that's probably not the top concern for FreeBSD base tools,
but fgetln() is impossible to port to most platforms, as concurrent
access is essentially impossible to implement fully correct without the
line buffer on the FILE struct. Other than this, many generic FreeBSD
tools compile fairly cleanly on Linux with a few small changes.

Most uses of fgetln() pre-date getline() support (added in 2009 with
69099ba2ec8b), and there's been some previous patches (ee3ca711a898
8c98e6b1a7f3 1a2a4fc8ce1b) for other tools.

Obtained from:  https://github.com/dcantrell/bsdutils and
                https://github.com/chimera-linux/chimerautils
Signed-off-by: Martin Tournoij <martin at arp242.net>

    [2 lines not shown]
DeltaFile
+4-4usr.bin/xargs/xargs.c
+4-41 files

FreeBSD/src b057859usr.bin/cut cut.c

cut: use getline() instead of fgetln()

This replaces fgetln() with getline(). The main reason for this is
portability, making things easier for people who want to compile these
tools on non-FreeBSD systems.

I appreciate that's probably not the top concern for FreeBSD base tools,
but fgetln() is impossible to port to most platforms, as concurrent
access is essentially impossible to implement fully correct without the
line buffer on the FILE struct. Other than this, many generic FreeBSD
tools compile fairly cleanly on Linux with a few small changes.

Most uses of fgetln() pre-date getline() support (added in 2009 with
69099ba2ec8b), and there's been some previous patches (ee3ca711a898
8c98e6b1a7f3 1a2a4fc8ce1b) for other tools.

Obtained from:  https://github.com/dcantrell/bsdutils and
                https://github.com/chimera-linux/chimerautils
Signed-off-by: Martin Tournoij <martin at arp242.net>

    [2 lines not shown]
DeltaFile
+20-17usr.bin/cut/cut.c
+20-171 files

FreeBSD/src 9744821usr.bin/diff diff.c

diff: use getline() instead of fgetln()

This replaces fgetln() with getline(). The main reason for this is
portability, making things easier for people who want to compile these
tools on non-FreeBSD systems.

I appreciate that's probably not the top concern for FreeBSD base tools,
but fgetln() is impossible to port to most platforms, as concurrent
access is essentially impossible to implement fully correct without the
line buffer on the FILE struct. Other than this, many generic FreeBSD
tools compile fairly cleanly on Linux with a few small changes.

Most uses of fgetln() pre-date getline() support (added in 2009 with
69099ba2ec8b), and there's been some previous patches (ee3ca711a898
8c98e6b1a7f3 1a2a4fc8ce1b) for other tools.

Obtained from:  https://github.com/dcantrell/bsdutils and
                https://github.com/chimera-linux/chimerautils
Signed-off-by: Martin Tournoij <martin at arp242.net>

    [2 lines not shown]
DeltaFile
+10-7usr.bin/diff/diff.c
+10-71 files

FreeBSD/src 04e0313sys/contrib/openzfs/cmd ztest.c

ztest: use ASSERT3P to compare pointers

Fixes i386-gcc13 build.  Direct commit while waiting for upstream.

Pull Request: https://github.com/openzfs/zfs/pull/16115
DeltaFile
+1-1sys/contrib/openzfs/cmd/ztest.c
+1-11 files

FreeBSD/src 6e83504lib/libc/sys openat.c setcontext.c, lib/libsys Symbol.sys.map

Revert "lib{c,sys}: normalize export of openat, setcontext, and swapcontext"

I put the symbols in the wrong file (should have been
lib/libc/sys/Symbol.map), added a duplicate pdfork entry due to a botch
rebase, and there seems to be a issue with gcc13/binutils not exposing
the symbols so revert the whole thing while I debug.

This reverts commit ee632fb9eb4a060a4087a7f5425bfe36e65cda61.
DeltaFile
+0-4lib/libsys/Symbol.sys.map
+1-0lib/libc/sys/openat.c
+1-0lib/libc/sys/setcontext.c
+1-0lib/libc/sys/swapcontext.c
+3-44 files

FreeBSD/src 68a3a7fsys/kern kern_fork.c

kasan: fix false-positive kasan_report upon thread reuse

In fork1(), if a thread is reused and thread_alloc_stack() is not
called, mark the reused thread's kstack pages clean in the KASAN shadow
buffer.

Sponsored by:   Juniper Networks, Inc.
MFC after:      3 days
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D44875
DeltaFile
+5-0sys/kern/kern_fork.c
+5-01 files

FreeBSD/src 2cb0fcesys/dev/iicbus if_ic.c, sys/dev/wg if_wg.c

bpf: Make BPF interop consistent with if_loop

The pseudo_AF_HDRCMPLT check is already being done in if_loop and
just needed to be ported over to if_ic, if_wg, if_disc, if_gif,
if_gre, if_me, if_tuntap and ng_iface.  This is needed in order to
allow these interfaces to work properly with e.g., tcpreplay.

PR:             256587
Reviewed by:    markj
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/876
DeltaFile
+2-2sys/dev/iicbus/if_ic.c
+2-1sys/dev/wg/if_wg.c
+2-1sys/net/if_gif.c
+2-1sys/net/if_gre.c
+2-1sys/net/if_me.c
+1-1sys/net/if_tuntap.c
+11-72 files not shown
+13-98 files

FreeBSD/src 2f44f86usr.bin/xinstall xinstall.c

install: Fix a compiler warning when bootstrapping

Fixes:          4336161cc9c6 ("install: Don't skip syncing in the common case.")
Reviewed by:    imp, des
Differential Revision:  https://reviews.freebsd.org/D44866
DeltaFile
+2-0usr.bin/xinstall/xinstall.c
+2-01 files

FreeBSD/src 87b0195usr.bin/ctags C.c ctags.c

ctags: Use C99 bool instead of defining our own

Use stdbool.h definitions instead of defining non-standard ones.

Signed-off-by: Collin Funk <collin.funk1 at gmail.com>

Reviewed by:    markj
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1107
DeltaFile
+38-38usr.bin/ctags/C.c
+11-11usr.bin/ctags/ctags.c
+6-6usr.bin/ctags/fortran.c
+5-6usr.bin/ctags/ctags.h
+5-5usr.bin/ctags/yacc.c
+4-4usr.bin/ctags/lisp.c
+69-701 files not shown
+70-717 files

FreeBSD/src e1e6361tests/atf_python/sys Makefile, tests/atf_python/sys/net Makefile

tests: move atf_python/sys/ into the tests package

Reviewed by:    markj
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1174
DeltaFile
+1-0tests/atf_python/sys/net/Makefile
+1-0tests/atf_python/sys/Makefile
+1-0tests/atf_python/sys/netlink/Makefile
+1-0tests/atf_python/sys/netpfil/Makefile
+1-0tests/atf_python/sys/netpfil/ipfw/Makefile
+5-05 files

FreeBSD/src 563c72esys/compat/linuxkpi/common/include/linux utsname.h

LinuxKPI: utsname.h add missing SPDX-License-Identifier

Reported by:    markj (2023-05-24; sorry took me a while)
MFC after:      3 days
DeltaFile
+2-0sys/compat/linuxkpi/common/include/linux/utsname.h
+2-01 files

FreeBSD/src d3b6d70usr.sbin/freebsd-update freebsd-update.sh

freebsd-update(8): Use kern.module_path

Instead of tailored configuration files to look for module_path entries.

Reported by:            kevans@
Reviewed by:            kevans, imp, zlei
Approved by:            kevans,zlei
Differential Revision:  https://reviews.freebsd.org/D44797
DeltaFile
+5-9usr.sbin/freebsd-update/freebsd-update.sh
+5-91 files

FreeBSD/src 48aa10esrc/arm64/exynos exynosautov920-pinctrl.dtsi, src/arm64/exynos/google gs101-pinctrl.dtsi

Import device-tree files from Linux 6.8
DeltaFile
+6,013-0src/arm64/qcom/sm8650.dtsi
+3,527-0src/arm64/qcom/x1e80100.dtsi
+1,266-0src/arm64/exynos/exynosautov920-pinctrl.dtsi
+1,249-0src/arm64/exynos/google/gs101-pinctrl.dtsi
+1,115-9src/arm64/qcom/sa8775p.dtsi
+956-0src/arm64/mediatek/mt8188.dtsi
+14,126-91,268 files not shown
+68,563-6,9541,274 files

FreeBSD/src 1fcc28bsrc/arm64/mediatek mt8395-genio-1200-evk.dts, src/arm64/qcom qcm6490-fairphone-fp5.dts

Import device-tree files from Linux 6.7
DeltaFile
+2,000-0src/riscv/sophgo/sg2042-cpus.dtsi
+1,137-0src/arm64/rockchip/rk3588-quartzpro64.dts
+902-0src/arm64/mediatek/mt8395-genio-1200-evk.dts
+848-0src/arm64/rockchip/rk3588-orangepi-5-plus.dts
+757-9src/arm64/ti/k3-am62p-main.dtsi
+667-0src/arm64/qcom/qcm6490-fairphone-fp5.dts
+6,311-91,058 files not shown
+43,112-4,1901,064 files

FreeBSD/src dbacf41src/arm/aspeed aspeed-bmc-ibm-everest.dts ibm-power10-quad.dtsi, src/arm/samsung exynos4212-tab3.dtsi

Import device-tree files from Linux 6.6
DeltaFile
+1,588-1,295src/arm/aspeed/aspeed-bmc-ibm-everest.dts
+77-2,078src/arm64/nvidia/tegra234-p3737-0000+p3701-0000.dts
+1,991-0src/arm64/nvidia/tegra234-p3701.dtsi
+1,310-0src/arm/samsung/exynos4212-tab3.dtsi
+1,305-0src/arm/aspeed/ibm-power10-quad.dtsi
+888-0src/arm64/rockchip/rk3588-nanopc-t6.dts
+7,159-3,3731,665 files not shown
+53,931-12,6551,671 files

FreeBSD/src 8993d78usr.bin/expand expand.1

expand.1: Fix markup for the '-t' option

When viewing the manpage the '-t' option is shown as follows

    -t -Sm tab1, tab2, ..., tabn Sm

with the markup '\&Sm' included within '.It Fl t', which doesn't
makes any sense.

So just remove it.

PR:     274897
MFC after:      3 days
DeltaFile
+1-1usr.bin/expand/expand.1
+1-11 files

FreeBSD/src 170d088usr.sbin/adduser adduser.sh

adduser: Overhaul.

Most importantly:

* Make local variables local.
* Use `$()` instead of backticks.
* Avoid unsafe use of `-a` and `-o` operators in `test` expressions.
* Remove a hack intended to ease the transition from Perl 22 years ago.

MFC after:      1 week
Reviewed by:    allanjude
Differential Revision:  https://reviews.freebsd.org/D44863
DeltaFile
+93-132usr.sbin/adduser/adduser.sh
+93-1321 files

FreeBSD/src f221df6sbin/ldconfig elfhints.c

ldconfig: use little-endian hints file on all architectures

Remove the test for building on a big-endian architecture, which
preserved the previous default of creating the ELF hints file in
native byte-order of the respective architecture.

Support for little-endian hints files has been added to the
run-time linker and the pkg command.

This is a step towards architecture independent little-endian hints
files, but support for big-endian hints files shall only be removed
from the run-time linker (and ldconfig and pkg) when the last release
that defaulted to hints files in host-byte has been declared EOL.

Reviewed by:    kib
Tested by:      tuexen
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D44734
DeltaFile
+3-3sbin/ldconfig/elfhints.c
+3-31 files

FreeBSD/src 6b13e4csbin/ldconfig elfhints.c

ldconfig: small optimization

Swap which side of a comparison is byte-swapped by be32toh()
on little-endian architectures.

The be32toh() macro just returns the operand and big-endian
architectures and returns it byte-swapped on little-endian
architectures.

When operating on a constant argument, the compiler can perform
the swap operation at build time instead of swapping the data
read from the hints file at run time.

Reviewed by:    kib
Tested by:      tuexen
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D44734
DeltaFile
+1-1sbin/ldconfig/elfhints.c
+1-11 files

FreeBSD/src 7929371sys/dev/sound/pci/hda hdac.c hdac.h

snd_hda: Add the full Intel Meteor/Arrow/Lunar Lake HD Audio PCI IDs

This is based off the Linux file sound/hda/intel-dsp-config.c.

Tested on:              Lenovo Thinkbook 16 G6+ IMH
MFC after:              3 days
Reviewed by:            markj, christos
Differential Revision:  https://reviews.freebsd.org/D44777
Sponsored by:           Postgres Professional

(cherry picked from commit 1dd1a696c58fb275aa0e01666d57861eeb51878d)
DeltaFile
+4-0sys/dev/sound/pci/hda/hdac.c
+4-0sys/dev/sound/pci/hda/hdac.h
+8-02 files

FreeBSD/src e7a1904sys/dev/sound/pci/hda hdacc.c

snd_hda: fix "duplicated free" on module unloading

This is trivial fix of hdacc_detach to avoid duplicated free on snd_hda
unloading.

The first try of detaching (kldunload) may results into "device busy" error,
but codec->fgs is freed by detach. Second try attempts to free codec->fgs again
and system panicks.

Here is example:

pcm0: unregister: channel pcm0:virtual:dsp0.vp0 busy (pid 3428)
pulseaudio[3428] [oss] module-oss.c: DSP shutdown.
pcm0: detached
hdaa0: detached
panic: Duplicate free of 0xfffff80412ee7d20 from zone 0xfffffe006bc0ba00
(malloc-32) slab 0xfffff80412ee7fc8(105)
cpuid = 6
time = 1712999565

    [24 lines not shown]
DeltaFile
+3-2sys/dev/sound/pci/hda/hdacc.c
+3-21 files

FreeBSD/src 178cf4bsys/arm/arm gic.c

arm: Fix a typo in a KASSERT message

- s/resoure/resource/

MFC after:      5 days
DeltaFile
+1-1sys/arm/arm/gic.c
+1-11 files

FreeBSD/src 2a66844sys/dev/sound/pci/hda hdacc.c

snd_hda: fix "duplicated free" on module unloading

This is trivial fix of hdacc_detach to avoid duplicated free on snd_hda
unloading.

The first try of detaching (kldunload) may results into "device busy" error,
but codec->fgs is freed by detach. Second try attempts to free codec->fgs again
and system panicks.

Here is example:

pcm0: unregister: channel pcm0:virtual:dsp0.vp0 busy (pid 3428)
pulseaudio[3428] [oss] module-oss.c: DSP shutdown.
pcm0: detached
hdaa0: detached
panic: Duplicate free of 0xfffff80412ee7d20 from zone 0xfffffe006bc0ba00
(malloc-32) slab 0xfffff80412ee7fc8(105)
cpuid = 6
time = 1712999565

    [24 lines not shown]
DeltaFile
+3-2sys/dev/sound/pci/hda/hdacc.c
+3-21 files

FreeBSD/src 0a902d7sys/dev/sound/pci/hda hdac.c hdac.h

snd_hda: Add the full Intel Meteor/Arrow/Lunar Lake HD Audio PCI IDs

This is based off the Linux file sound/hda/intel-dsp-config.c.

Tested on:              Lenovo Thinkbook 16 G6+ IMH
MFC after:              3 days
Reviewed by:            markj, christos
Differential Revision:  https://reviews.freebsd.org/D44777
Sponsored by:           Postgres Professional

(cherry picked from commit 1dd1a696c58fb275aa0e01666d57861eeb51878d)
DeltaFile
+4-0sys/dev/sound/pci/hda/hdac.c
+4-0sys/dev/sound/pci/hda/hdac.h
+8-02 files