1
0
mirror of https://github.com/openbsd/src.git synced 2026-06-19 07:43:34 +02:00
Commit Graph

4665 Commits

Author SHA1 Message Date
kettenis 8beb114a13 Update clzdi2.c to pull in the following commit neede because of a change
in clang brought in with the llvm 22 update:

commit 5d0e26e571c08dc4c0b2a25ed6c9f845f054fa76
Author: Koakuma <koachan@protonmail.com>
Date:   Tue Apr 29 07:36:32 2025 +0700

    [compiler-rt] Make sure __clzdi2 doesn't call itself recursively on sparc64 (#136737)

    On 64-bit platforms, libgcc doesn't ship with __clzsi2, so __builtin_clz
    gets lowered to __clzdi2. A check already exists for GCC, but as of
    commit 8210ca019839fc5430b3a95d7caf5c829df3232a clang also lowers
    __builtin_clz to __clzdi2 on sparc64.

    Update the check so that building __clzdi2 with clang/sparc64 also
    works.

ok tb@, deraadt@
2026-05-29 19:54:16 +00:00
gkoehler a909ce865e Unbreak and update powerpc retguard for llvm 22
For RETGUARD_LOAD_COOKIE when -fno-pie (as in macppc kernels), change
a relocation in -fno-pie (as in macppc kernels) from unusual S_HIGHA
"__retguard_3671@higha" to usual S_HA "__retguard_3671@ha".  This
prevents an error from lld 22,

ld: error: rasops15.o:(function rasops15_init: .text+0x2): unknown \
relocation (111) against symbol __retguard_3671

For RETGUARD_LOAD_PC in PIC code, change an instruction from 'bl .+4'
to 'bcl 20,31,.+4' to fix branch prediction.  This follows the same
change in upstream llvm,
https://github.com/llvm/llvm-project/issues/128644

ok jca@ naddy@
2026-05-29 19:32:41 +00:00
robert 01dd9eb5f3 revert upstream commit 947b9f55b5f327e14368a48fb6ce10242ea29bf3
It breaks cpp -traditional -dM

https://github.com/llvm/llvm-project/issues/200085
2026-05-29 11:53:08 +00:00
robert 8c47df8d06 add SipHash.h from llvm-22.1.6 which is shipped as a third party header 2026-05-29 11:52:13 +00:00
robert fb5f5ea15f update build infrastructure for llvm-21.1.6
thanks for all the help with testing and fixing things up
2026-05-29 11:18:29 +00:00
robert 4f961aa651 merge lldb-21.1.6 2026-05-29 11:07:21 +00:00
robert 7715a8ca53 import lldb from LLVM-21.1.6 2026-05-29 11:06:49 +00:00
robert a7e9300def merge lld-21.1.6 2026-05-29 11:06:20 +00:00
robert 61e157d395 import lld from LLVM-21.1.6 2026-05-29 11:05:54 +00:00
robert 8b3cbedc09 merge clang-21.1.6 2026-05-29 11:05:26 +00:00
robert d3ce770b47 import clang from LLVM-21.1.6 2026-05-29 11:04:28 +00:00
robert e916227ab7 merge llvm-21.1.6 2026-05-29 11:03:37 +00:00
robert d93fb232b2 import llvm from LLVM-21.1.6 2026-05-29 11:00:35 +00:00
robert b2f9966e67 lower std::deque blocksize if _LIBCPP_USE_LOWER_DEQUE_BLOCK_SIZE is defined
defining _LIBCPP_USE_LOWER_DEQUE_BLOCK_SIZE will make std::deque behave
more in line with what libstdc++ is doing by using 512 byte blocks instead
of 4096 to waste less memory

this can be used by llvm-tblgen to reduce the memory usage of some
operations which completely blow up with llvm22, so let's prepare now

https://github.com/llvm/llvm-project/issues/31782
https://chromium.googlesource.com/android_ndk/+/eecd8c2d681b019efca486f92fdda9a93f52328f%5E%21/#F0

ok deraadt@
2026-05-07 09:28:48 +00:00
jca 008d370469 Respect DEBUG so we can build perl with debug symbols
Adding -DEBUGGING in CONFIGURE_ARGS activates debug code,
-DEBUGGING=-g passes -g in CFLAGS (only -g is supported),
and -DEBUGGING=both does... both.  This is a bit confusing.
IMO DEBUG=-g should only add -g and disable executable stripping, but
not change the code that is built.  So use -Doptimize which lets us pass
arbitrary compiler flags (eg -g3), just like DEBUG does in our system
Makefiles.

Hints and ok afresh1@
2026-04-07 16:41:33 +00:00
afresh1 8eafb9a57f Update to perl 5.42.2
The two main changes are both from 5.42.1, a timezone fix and a
corner case for auto-vivification.

The CVE from 5.42.1 we had already patched and the zlib update in
5.42.2 is in code we don't use because we link against the system
zlib.

https://metacpan.org/release/SHAY/perl-5.42.1/view/pod/perldelta.pod
https://metacpan.org/release/SHAY/perl-5.42.2/view/pod/perldelta.pod

I'm not concerned -- sthen@
I think you can just commit this -- naddy@
good timing -- deraadt@
OK -- blumh@
2026-04-01 23:20:53 +00:00
afresh1 03db75a2bd Improve OpenBSD::Unveil POD
The choice of variable names made it somewhat unclear what arguments
to pass and made it seem the interface might differ from unveil(2).

ok dgl@
2026-03-30 00:00:04 +00:00
kettenis 7850a610d3 amd64 needs the quad-precision support functions as well (for __float128
support).  From Brad (with a small comment tweak).

ok rsadowski@
2026-03-02 20:33:49 +00:00
deraadt 3ae6636769 replace pledge "stdio rpath tmppath" with unveil "/tmp" "rwc" to satisfy
mktemp(3) type operations, unveil "/" "r" for reading all over the tree,
and pledge "stdio rpath wpath cpath" to permit both unveils subject to
their own limitations.
2026-02-23 16:45:16 +00:00
deraadt 0bcd6e0c21 This was using pledge "tmppath" with "rpath wpath cpath".
The "tmppath" is not needed.
ok semarie and others
2026-02-18 20:43:58 +00:00
rsadowski ab79de310e Fix PSTL backend (names) in __config_site
Upstream libc++ renamed these macros in the following commit:
https://github.com/llvm/llvm-project/commit/d423d80

We had the correct names in the libcxx* makefiles, so no ABI changes are
required.

Reported by c2qd and also provided the __config_site diff. OK robert@
2026-02-07 15:59:32 +00:00
afresh1 50ae83fbdd Apply upstream patch to fix segfault with multi-arg for loops
This is documented upstream https://github.com/perl/perl5/issues/23405

A simple trigger is

  perl -c -wE 'for my ($x, $y) (Bar->foo) {}'

Suggested by James Cook <falsifian () falsifian ! org>
Tested and OK gkoehler@
2026-01-10 23:20:43 +00:00
afresh1 bb2c65927d Delete unused syscall_emulator.c
This file is generated in the obj directory during build,
so this outdated copy should never be used.

Noticed by miod@
2026-01-10 23:16:23 +00:00
jca 0ff6482635 Install arm_neon_sve_bridge.h on aarch64
From Brad, similar diff proposed recently by jsg@, ok kettenis@
2026-01-06 22:27:48 +00:00
jca 5597866b8b Backport aarch64 SVE compile fix from upstream
From Brad, ok kettenis@
2026-01-06 22:24:03 +00:00
afresh1 cfd030a03a Apply pre-built unicore patch - perl-5.42.0
ok bluhm@
Whenever you are ready deraadt@
2025-12-26 22:16:21 +00:00
afresh1 24fd63f938 Apply local patches - perl-5.42.0
ok bluhm@
Whenever you are ready deraadt@
2025-12-26 22:15:22 +00:00
afresh1 2c27e31520 Fix merge issues, remove excess files - match perl-5.42.0 dist
ok bluhm@
Whenever you are ready deraadt@
2025-12-26 22:14:12 +00:00
afresh1 077d0dbde0 Import perl-5.42.0
ok bluhm@
Whenever you are ready deraadt@
2025-12-26 22:12:24 +00:00
sthen b46de5080d when using install-info on compressed info files, uncompress from stdin
rather than passing "< filename" to the shell. from espie, ok tb.
leaks, but so does the surrounding code.
2025-12-14 12:37:28 +00:00
robert 55bee3f78c remove special handling of __string/* headers
we had to add special handling for the __string directory because CVS
cannot handle file to directory transitions so we had to move this
directory to __string.d and copy files over at install time, however
when libcxx19 was imported this directory was actually commited, making
rendering the handling of the special directory obsolete, but it was kept
there and it was installing files to the wrong directory
2025-12-06 09:27:54 +00:00
miod 8720e5dd16 Switch m88k to PIE by default.
ok aoyama@
2025-11-17 16:06:09 +00:00
gnezdo 077d2ea485 Fix llvm x86 frame lowering for -msave-args
The problem only shows up with KASAN builds where it causes registers
saved below SP leading to fills not finding what was spilled.

go for it dlg@
2025-11-14 09:57:02 +00:00
jca baa29930eb The libunwind guts used by libexecinfo no longer need "new" from libcxx
check_sym says: No dynamic export changes

Noticed and checked by rsadowski@
2025-11-04 13:17:05 +00:00
jca d387f9c1e6 take 2: re-apply two commits that were lost while merging the 19.1.7 update
Reintroduce a tweaked version of the IP-based caching implementation.
Implementing a custom "new" operator has the two following desirable
properties:
- make the code more standalone, not depending on "new" from libcxx.
- teach this allocator to return nullptr on memory shortage ("noexcept")
  so it can fail gracefully. If we can't allocate an item, we just don't
  cache it.
That should be more resilient to memory shortages and thus more usable
from libexecinfo.

ok rsadowski@ robert@
2025-11-04 13:09:23 +00:00
jca 2da7e0886e take 2: re-apply one commit that was lost while merging the 19.1.7 update
I've been overzealous when backing out some unrelated changes.
Re-apply requested by robert@
-------------------
    Linux still doesn't actually implement IBT for userland.  And by the pace
    things are going, it will take another decade before it does.  But OpenBSD
    has it enabled *by default* already.

    Drop the #ifdef __linux__.  This should hurt other OSes when they finally
    catch up with us.

    ok robert@, tb@
2025-11-03 20:21:23 +00:00
jca 7abb703a82 Backout previous, the reintroduced code leads to a missing symbol
regress:
cc  -Wl,--export-dynamic  -o t_backtrace t_backtrace.o atf-c.o -lexecinfo
ld: error: undefined reference: operator new(unsigned long)
>>> referenced by /usr/lib/libexecinfo.so.4.0 (disallowed by --no-allow-shlib-undefined)

ok tb@
2025-11-03 18:33:06 +00:00
robert 36632bb0f3 re-apply three commits that were lost while merging the 19.1.7 update
-------------------
    Linux still doesn't actually implement IBT for userland.  And by the pace
    things are going, it will take another decade before it does.  But OpenBSD
    has it enabled *by default* already.

    Drop the #ifdef __linux__.  This should hurt other OSes when they finally
    catch up with us.

    ok robert@, tb@
-------------------
    Initial IP-based caching implementation with O(logn) lookup.

    Caching implemented via red-black trees, this can be improved and
    further work is on-going to bring it closer to GNU's performance that
    uses a LRU-MRU 8-entries based caching algorithm.

    Prompted by robert@ who run into a runtime of an executed macro of
    5 minutes in libreoffice. With this the execution is reduced to 58 seconds.

    C++11 tips from espie@, rsadowski@
    Tested by robert@
    OK mortimer@, kettenis@.

--------------------
    Make the unwind cache tread-safe by declaring it thread_local. Solves
    segfaults seen on exception handling.  ok kettenis@
--------------------
2025-11-03 09:20:19 +00:00
miod 4959bc61fd Undo a bad mistake; spotted by brynet@ 2025-10-23 20:42:52 +00:00
miod 54449f37da Don't try to install {,un}protoize manpages, they no longer exist. 2025-10-23 19:35:56 +00:00
miod 9069d57f4c gcc3 is leaving the building. 2025-10-23 19:10:32 +00:00
miod acc7c06d1c gcc3 is leaving the building.
(removal done in several commits to avoid hitting
 "Protocol error: too many arguments" errors)
2025-10-23 19:09:49 +00:00
miod 43de91522a gcc3 is leaving the building. 2025-10-23 19:08:32 +00:00
miod 27664962f0 Prepare for gcc 3 leaving the building, COMPILER_VERSION can no longer get
set to "gcc3".
2025-10-23 19:06:09 +00:00
miod 67aa317b5c Remove gcc3 workaround in UVCHR_IS_INVARIANT(). 2025-10-23 18:50:38 +00:00
miod 22e0e8faf4 Tweak the ld guts under OpenBSD/hppa to prevent enabling the options (and
code) allowing for inter-space thunks to be generated
(i.e. ld --multi-subspace), just to be sure we can sleep soundly.

ok jca@
2025-10-22 18:47:12 +00:00
miod f752a3e5bd The __builtin_return_address() internal logic, on PA-Risc, tries to read the
code at the tentative return address in order to check for a possible
inter-space thunk ("export stub" as called by HP), and in this case, unfolds
a bit more to retrieve the stub return address.

When the code pages are not readable, which is the case by default under
OpenBSD/hppa, this causes an immediate segmentation fault. But there is no
use of multiple space registers under OpenBSD either, so such thunks are
never created by ld(1). We can therefore override the logic by simply
returning the tentative return address, which is correct and does not require
read permission on the code pages.

ok jca@
2025-10-22 18:44:06 +00:00
miod 11390e98b6 The per-target adjust_cost hook only gets invoked if recog_memoized (insn)
succeeds, no need to perform this check again.
2025-10-21 18:35:35 +00:00
anton 571348cc06 Teach clang to emit an error when enabling UBSan with execute-only.
UBSan and execute-only are mutually exclusive as -fsanitize=function
implied by UBSan sanitizes indirect function calls in which a
destination is only considered valid if preceded by a well known
sequence (0xc105cafe). This of course requires being able to read the
text segment, making it incompatible with execute-only.

Running UBSan on OpenBSD now requires the options:

	-fsanitize=undefined -fsanitize-minimal-runtime Wl,--no-execute-only

ok sthen@, tb@
2025-10-20 17:38:36 +00:00
miod ffa4f20d55 Add ctzsi2 and clzzi2 insn, enabling better __builtin_clz and __builtin_ctz
code generation on 32-bit width integers.
2025-10-15 18:41:36 +00:00