[libc] Add getpwnam and getpwuid entrypoints (#221169)
Added non-reentrant getpwnam and getpwuid functions using the shared
process-global buffer.
* Implemented getpwnam and getpwuid entrypoints
* Added non-reentrant find_by_name and find_by_uid lookups
* Added function specifications to include/pwd.yaml
* Registered entrypoints in config/linux/*/entrypoints.txt
* Added unit tests in libc/test/src/pwd/getpwnam_test.cpp and
libc/test/src/pwd/getpwuid_test.cpp
Assisted-by: Automated tooling, human reviewed.
[clang] remove unused NestedNameSpecifier 'Invalid' constructor (#221128)
These invalid NNS were used as thombstone keys for DenseMap, but the
DenseMap implementation changed and that's not needed anymore.
[X86] Remove TEST after SHL by 1..3 when the shifted operand dies (#220744)
optimizeCompareInstr refuses to reuse the flags of a SHL by 1..3 so that
TwoAddressInstructionPass may still convert the shift into an LEA, which
sets no flags. That conversion exists to avoid a register copy, so it
can only pay off while the shifted operand has further uses; when the
shift is the operand's sole user, the reservation costs a TEST (2-3
bytes and a uop) for nothing. Allow the conversion in that case, as
already done for SHR, SAR, and larger SHL counts.
An x86lint audit of Firefox's libxul.so counted 4,369 redundant TESTs
after immediate shifts, dominated by single-use left shifts by a small
count feeding a compare against zero, e.g. Rust's Layout size checks
(shl $1; test; je). This also composes with dda2c12275e5: 63-bit lowmask
compares shrunken to SHL by 2 now drop their TEST as well.
[libc][netdb] Implement gai_strerror POSIX function. (#221138)
`gai_strerror` is defined in POSIX and used to provide human-readable
strings for `EAI_*` error codes returned by
`getaddrinfo` and `getnameinfo`.
Provide our implementation via simple switch. Provide string values
based on the POSIX documentation for `EAI_`
values in
https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/netdb.h.html,
but shorten them for brevity.
[libc++][pstl] Implementation of parallel std::min_element() based on parallel reduce (#219876)
This PR adds an implementation of parallel `std::min_element()` based on
parallel reduce.
`std::max_element()` is also added, implemented as a "one-liner" over
`min_element`.
The implementation formulates `min_element` as a reduction of iterators
over the input range.
The reduction is provided in two forms: 2-element reduction that picks
the iterator pointing to a smaller value, and a range-based reduction
with init value. The latter delegates the heavy-lifting to the serial
implementation of `std::min_element()`.
Part of #99938.
textproc/goldendict: Schedule for removal
Depends on deprecated Qt5 WebEngine, consider to use textproc/goldendict-ng
PR: 296230
(cherry picked from commit 3b45f9f3ba7052b114891568aeb8308a7770fc55)
audio/musescore3: Schedule for removal
Depends on deprecated Qt5 WebEngine, consider to use audio/musescore
PR: 296230
(cherry picked from commit 133164b3fe084b53861cabf62c881cc6aee10161)
ntsync(4): do not double-free the alert event when a dup was detected for WAIT_ALL
Reported by: Andrew Griffiths <andrew at calif.io>
Reported by: Chris Jarrett-Davies <chrisjd at openai.com>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
[NFCI] Extract out some functions into CodeGenUtils. (#221001)
I need to use these for CIR (see #220946). Also, its been a long-time
coming that we had a way to share stuff between both CodeGens.
This patch does (hopefully) the infrastructure work to get this running
right.
I asked Claude to help me with the CMake files, and best I can tell it
looks right? But if someone knows better, please let me know. I suspect
we might need to add dependencies along the way as we add new things,
but this seems to work at the moment?
Otherwise, this just moves a handful of trivial utilities that seemed
like a good starting point, plus one I need for CIR right away.