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
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
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
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 (ee3ca711a8988c98e6b1a7f31a2a4fc8ce1b) 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]
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 (ee3ca711a8988c98e6b1a7f31a2a4fc8ce1b) 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]
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 (ee3ca711a8988c98e6b1a7f31a2a4fc8ce1b) 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]
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 (ee3ca711a8988c98e6b1a7f31a2a4fc8ce1b) 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]
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 (ee3ca711a8988c98e6b1a7f31a2a4fc8ce1b) 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]
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 (ee3ca711a8988c98e6b1a7f31a2a4fc8ce1b) 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]
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.
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
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
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
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
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
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
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
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)
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]
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]
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)