[libc] Fix load_aligned big-endian handling. (#185937)
The variadic template helper `load_aligned` performs a specific case of
an unaligned integer load, by loading a sequence of integers from memory
at addresses expected to be aligned, and glues the results back together
with shifts and ORs into an output.
The implementation works by performing the first load, recursing on a
shorter parameter type list for the rest, and recombining via
first | (rest << size_of_first) // if little-endian
(first << size_of_first) | rest // if big-endian
But the big-endian case is wrong: it should shift left by the size of
the _rest_ of the types, not the size of the first. In the case where
you load 8, 16 and 8 bits from an odd address, you want
(first_byte << 24) | (middle_halfword << 8) | (last_byte)
[5 lines not shown]
[LowerMemIntrinsics][AMDGPU] Optimize memset.pattern lowering
This patch changes the lowering of the [experimental.memset.pattern intrinsic](https://llvm.org/docs/LangRef.html#llvm-experimental-memset-pattern-intrinsic)
to match the optimized memset and memcpy lowering when possible. (The tl;dr of
memset.pattern is that it is like memset, except that you can use it to set
values that are wider than a single byte.)
The memset.pattern lowering now queries `TTI::getMemcpyLoopLoweringType` for a
preferred memory access type. If the size of that type is a multiple of the set
value's type, and if both types have consistent store and alloc sizes (since
memset.pattern behaves in a way that is not well suitable for access widening
if store and alloc size differ), the memset.pattern is lowered into two loops:
a main loop that stores a sufficiently wide vector splat of the SetValue with
the preferred memory access type and a residual loop that covers the remaining
set values individually.
In contrast to the memset lowering, this patch doesn't include a specialized
lowering for residual loops with known constant lengths. Loops that are
statically known to be unreachable will not be emitted.
[7 lines not shown]
[LowerMemIntrinsics] Avoid emitting unreachable loops in insertLoopExpansion (#185900)
This patch refactors insertLoopExpansion and allows it to skip loops that are
statically known to be unreachable and make conditional branches with a
statically known condition unconditional. Those situations arise when the loop
count is a known constant.
These cases don't occur at the existing call sites in the memcpy and memset
lowering, since they have custom handling for constant loop sizes anyway. They
will however occur in a follow-up patch that uses insertLoopExpansion for
memset.pattern, where similar custom handling for constant loop sizes would
make less sense.
This is mostly NFC with the current use except for slight changes in the branch
weight computation from profiling data (which causes the included test
changes).
[LLD] [ELF] Make -z gcs=always implicitly warn on missing GCS, like force-bti (#186203)
This matches GNU ld, where gcs=always makes it implicitly warn about
missing GCS flags, by matching the existing code pattern used for BTI
and IBT.
Also test that warnings can be printed for both missing BTI and GCS for
the same object file.
This fixes #186173.
[DebugInfo] Add Verifier check for local enums in CU's enums field (#185228)
Since #165032, DwarfDebug asserts if function-local enums are present in
the enums field of DICompileUnit.
This patch adds a check to the Verifier to detect such invalid IR
earlier.
Incorrect occurence of a local enum in DICompileUnit's enums field in
`llvm/test/DebugInfo/COFF/enum-co.ll` is fixed.
This change is extracted from https://reviews.llvm.org/D144008.
devel/catch: fix build with clang 21, take 2
Move the separate patches into patch-clang21, as requested by the
maintainer.
PR: 293446
Approved by: sunpoet (maintainer)
MFH: 2026Q1
(cherry picked from commit 9c2cb42fd6cfda42888e61feb6e287661125edcc)
devel/catch: fix build with clang 21, take 2
Move the separate patches into patch-clang21, as requested by the
maintainer.
PR: 293446
Approved by: sunpoet (maintainer)
MFH: 2026Q1
science/py-tensorflow: fix build with libc++ 21
With libc++ 21 science/py-tensorflow fails to build, with errors similar
to:
In file included from tensorflow/tsl/framework/allocator_registry.cc:16:
In file included from ./tensorflow/tsl/framework/allocator_registry.h:23:
In file included from ./tensorflow/tsl/framework/allocator.h:28:
./tensorflow/tsl/framework/type_traits.h:96:8: error: 'is_signed' cannot be specialized: Users are not allowed to specialize this standard library entity [-Winvalid-specialization]
96 | struct is_signed<tsl::qint8> : public is_signed<tsl::int8> {};
| ^
/usr/include/c++/v1/__type_traits/is_signed.h:25:8: note: marked '_Clang::no_specializations' here
25 | struct _LIBCPP_NO_SPECIALIZATIONS is_signed : _BoolConstant<__is_signed(_Tp)> {};
| ^
/usr/include/c++/v1/__config:1167:9: note: expanded from macro '_LIBCPP_NO_SPECIALIZATIONS'
1167 | [[_Clang::__no_specializations__("Users are not allowed to specialize this standard library entity")]]
| ^
and later:
[23 lines not shown]
comms/bladerf: fix build with clang 21
With clang 21 comms/bladerf fails to build, with errors similar to:
/wrkdirs/usr/ports/comms/bladerf/work/bladeRF-2025.10/host/utilities/bladeRF-cli/src/cmd/flash_image.c:71:35: error: overlapping comparisons always evaluate to true [-Werror,-Wtautological-overlap-compare]
71 | if (val[i] >= 'a' || val[i] <= 'f') {
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
This is a logic error: the logical operator should be `&&` here. It has
been proposed as an upstream pull request:
https://github.com/Nuand/bladeRF/pull/1045, but it is not yet merged.
PR: 293393
Approved by: maintainer timeout (2 weeks)
MFH: 2026Q1
[StaticAnalyzer] Remove FIXME from InnerPointerBRVisitor (#186303)
Removed the FIXME based on the discussion in #185796 . The code path
only happens during bug reporting therefore it is not performance
sensitive.
science/py-tensorflow: fix build with libc++ 21
With libc++ 21 science/py-tensorflow fails to build, with errors similar
to:
In file included from tensorflow/tsl/framework/allocator_registry.cc:16:
In file included from ./tensorflow/tsl/framework/allocator_registry.h:23:
In file included from ./tensorflow/tsl/framework/allocator.h:28:
./tensorflow/tsl/framework/type_traits.h:96:8: error: 'is_signed' cannot be specialized: Users are not allowed to specialize this standard library entity [-Winvalid-specialization]
96 | struct is_signed<tsl::qint8> : public is_signed<tsl::int8> {};
| ^
/usr/include/c++/v1/__type_traits/is_signed.h:25:8: note: marked '_Clang::no_specializations' here
25 | struct _LIBCPP_NO_SPECIALIZATIONS is_signed : _BoolConstant<__is_signed(_Tp)> {};
| ^
/usr/include/c++/v1/__config:1167:9: note: expanded from macro '_LIBCPP_NO_SPECIALIZATIONS'
1167 | [[_Clang::__no_specializations__("Users are not allowed to specialize this standard library entity")]]
| ^
and later:
[21 lines not shown]
py-blessed: updated to 1.33.0
1.33
* bugfix: :class:`blessed.line_editor.LineEditor` exceed limit when using Yank (Ctrl+Y).
* bugfix: :meth:`~.Terminal.async_inkey` no longer raises NotImplementedError on Windows.
1.32
* bugfix: :meth:`~.Terminal.get_kitty_keyboard_state` should not check for
:attr:`~.Terminal.does_styling` as a requirement.
* bugfix: :meth:`~.Terminal.get_fgcolor` and :meth:`~.Terminal.get_bgcolor` now
return "no support" value, ``(-1, -1, -1)`` when :attr:`~.Terminal.does_styling` is False.
* introduced: :meth:`~.Terminal.does_kitty_clipboard`,
:meth:`~.Terminal.does_kitty_pointer_shapes`, and :meth:`~.Terminal.does_text_sizing`
* introduced: :meth:`~.DecModeResponse.to_dict` and ``DecPrivateMode.BRACKETED_PASTE_MIME``
constant (mode 5522).
1.31
* bugfix: :meth:`~.cbreak` and :meth:`~.raw` should use ``TCSADRAIN`` to preserve keystrokes
buffered during mode switches, previously ``TCSAFLUSH`` was used which discarded unread input,
[14 lines not shown]
textproc/lttoolbox: fix build with libc++ 21
With libc++ 21 textproc/lttoolbox fails to build, with errors similar to:
In file included from /wrkdirs/usr/ports/textproc/lttoolbox/work/lttoolbox-3.8.0/lttoolbox/acx.cc:17:
In file included from /wrkdirs/usr/ports/textproc/lttoolbox/work/lttoolbox-3.8.0/lttoolbox/acx.h:20:
In file included from /wrkdirs/usr/ports/textproc/lttoolbox/work/lttoolbox-3.8.0/lttoolbox/sorted_vector.hpp:25:
In file included from /usr/include/c++/v1/iterator:698:
/usr/include/c++/v1/__iterator/ostream_iterator.h:62:20: error: invalid operands to binary expression ('ostream_type' (aka 'basic_ostream<char, std::char_traits<char>>') and 'const char')
62 | *__out_stream_ << __value;
| ~~~~~~~~~~~~~~ ^ ~~~~~~~
/usr/local/include/utf8cpp/utf8/core.h:358:25: note: in instantiation of member function 'std::ostream_iterator<char>::operator=' requested here
358 | *(result++) = static_cast<octet_type>(cp);
| ^
/usr/local/include/utf8cpp/utf8/core.h:398:16: note: in instantiation of function template specialization 'utf8::internal::append<std::ostream_iterator<char>, char8_t>' requested here
398 | return append<octet_iterator, utfchar8_t>(cp, result);
| ^
/usr/local/include/utf8cpp/utf8/checked.h:79:26: note: in instantiation of function template specialization 'utf8::internal::append<std::ostream_iterator<char>>' requested here
79 | return internal::append(cp, result);
[18 lines not shown]
textproc/lttoolbox: fix build with libc++ 21
With libc++ 21 textproc/lttoolbox fails to build, with errors similar to:
In file included from /wrkdirs/usr/ports/textproc/lttoolbox/work/lttoolbox-3.8.0/lttoolbox/acx.cc:17:
In file included from /wrkdirs/usr/ports/textproc/lttoolbox/work/lttoolbox-3.8.0/lttoolbox/acx.h:20:
In file included from /wrkdirs/usr/ports/textproc/lttoolbox/work/lttoolbox-3.8.0/lttoolbox/sorted_vector.hpp:25:
In file included from /usr/include/c++/v1/iterator:698:
/usr/include/c++/v1/__iterator/ostream_iterator.h:62:20: error: invalid operands to binary expression ('ostream_type' (aka 'basic_ostream<char, std::char_traits<char>>') and 'const char')
62 | *__out_stream_ << __value;
| ~~~~~~~~~~~~~~ ^ ~~~~~~~
/usr/local/include/utf8cpp/utf8/core.h:358:25: note: in instantiation of member function 'std::ostream_iterator<char>::operator=' requested here
358 | *(result++) = static_cast<octet_type>(cp);
| ^
/usr/local/include/utf8cpp/utf8/core.h:398:16: note: in instantiation of function template specialization 'utf8::internal::append<std::ostream_iterator<char>, char8_t>' requested here
398 | return append<octet_iterator, utfchar8_t>(cp, result);
| ^
/usr/local/include/utf8cpp/utf8/checked.h:79:26: note: in instantiation of function template specialization 'utf8::internal::append<std::ostream_iterator<char>>' requested here
79 | return internal::append(cp, result);
[16 lines not shown]
math/symengine: fix build with libc++ 21
With libc++ 21 math/symengine fails to build, with errors similar to:
In file included from
/wrkdirs/usr/ports/math/symengine/work/symengine-0.14.0/cmake/checkcxx11.cpp:1:
In file included from /usr/include/c++/v1/unordered_map:589:
In file included from /usr/include/c++/v1/__algorithm/is_permutation.h:13:
In file included from /usr/include/c++/v1/__algorithm/comp.h:14:
In file included from /usr/include/c++/v1/__type_traits/is_integral.h:14:
/usr/include/c++/v1/__type_traits/remove_cv.h:22:32: error: unknown type
name '__remove_cv'; did you mean 'remove_cv'?
using type _LIBCPP_NODEBUG = __remove_cv(_Tp);
^
/usr/include/c++/v1/__type_traits/remove_cv.h:21:35: note: 'remove_cv'
declared here
struct _LIBCPP_NO_SPECIALIZATIONS remove_cv {
^
[12 lines not shown]
science/mmdb2: fix build with libc++ 21
With libc++ 21 science/mmdb2 fails to build, with errors similar to:
In file included from mmdb2/mmdb_machine_.cpp:41:
mmdb2/mmdb_machine_.h:296:13: error: unknown type name 'size_t'; did you mean 'std::size_t'?
296 | typedef size_t fpstr_size_t;
| ^~~~~~
| std::size_t
/usr/include/c++/v1/__cstddef/size_t.h:20:7: note: 'std::size_t' declared here
20 | using size_t = decltype(sizeof(int));
| ^
This is because mmdb2 apparently relies on transitive includes getting
the declaration of size_t, but with libc++ 21 this no longer works. Add
an include of <stddef.h> to work around it.
PR: 293180
Approved by: maintainer timeout (2 weeks)
[3 lines not shown]
science/mmdb2: fix build with libc++ 21
With libc++ 21 science/mmdb2 fails to build, with errors similar to:
In file included from mmdb2/mmdb_machine_.cpp:41:
mmdb2/mmdb_machine_.h:296:13: error: unknown type name 'size_t'; did you mean 'std::size_t'?
296 | typedef size_t fpstr_size_t;
| ^~~~~~
| std::size_t
/usr/include/c++/v1/__cstddef/size_t.h:20:7: note: 'std::size_t' declared here
20 | using size_t = decltype(sizeof(int));
| ^
This is because mmdb2 apparently relies on transitive includes getting
the declaration of size_t, but with libc++ 21 this no longer works. Add
an include of <stddef.h> to work around it.
PR: 293180
Approved by: maintainer timeout (2 weeks)
MFH: 2026Q1