From: Brandon Mercer Subject: llvm-20.1.8 aarch64 fix To: ports@openbsd.org Date: Thu, 4 Sep 2025 19:28:10 -0400 I was building llvm-20.1.8 for the zig port and noticed there is a breakage on aarch64. This diff fixes it. OK? bmercer@ diff --git a/devel/llvm/20/patches/patch-lldb_source_Plugins_Process_OpenBSD_NativeRegisterContextOpenBSD_arm64_cpp b/devel/llvm/20/patches/patch-lldb_source_Plugins_Process_OpenBSD_NativeRegisterContextOpenBSD_arm64_cpp index 698604b07..1f5eeedcd 100644 --- a/devel/llvm/20/patches/patch-lldb_source_Plugins_Process_OpenBSD_NativeRegisterContextOpenBSD_arm64_cpp +++ b/devel/llvm/20/patches/patch-lldb_source_Plugins_Process_OpenBSD_NativeRegisterContextOpenBSD_arm64_cpp @@ -109,7 +109,7 @@ Index: lldb/source/Plugins/Process/OpenBSD/NativeRegisterContextOpenBSD_arm64.cp + Log *log = GetLog(POSIXLog::Registers); + + if (!reg_info) { -+ error.SetErrorString("reg_info NULL"); ++ error.FromErrorString("reg_info NULL"); + return error; + } + @@ -117,7 +117,7 @@ Index: lldb/source/Plugins/Process/OpenBSD/NativeRegisterContextOpenBSD_arm64.cp + if (reg == LLDB_INVALID_REGNUM) { + // This is likely an internal register for lldb use only and should not be + // directly queried. -+ error.SetErrorStringWithFormat("register \"%s\" is an internal-only lldb " ++ error.FromErrorStringWithFormat("register \"%s\" is an internal-only lldb " + "register, cannot read directly", + reg_info->name); + return error; @@ -127,7 +127,7 @@ Index: lldb/source/Plugins/Process/OpenBSD/NativeRegisterContextOpenBSD_arm64.cp + if (set == -1) { + // This is likely an internal register for lldb use only and should not be + // directly queried. -+ error.SetErrorStringWithFormat("register \"%s\" is in unrecognized set", ++ error.FromErrorStringWithFormat("register \"%s\" is in unrecognized set", + reg_info->name); + return error; + } @@ -135,7 +135,7 @@ Index: lldb/source/Plugins/Process/OpenBSD/NativeRegisterContextOpenBSD_arm64.cp + if (ReadRegisterSet(set) != 0) { + // This is likely an internal register for lldb use only and should not be + // directly queried. -+ error.SetErrorStringWithFormat( ++ error.FromErrorStringWithFormat( + "reading register set for register \"%s\" failed", reg_info->name); + return error; + } @@ -258,7 +258,7 @@ Index: lldb/source/Plugins/Process/OpenBSD/NativeRegisterContextOpenBSD_arm64.cp + Log *log = GetLog(POSIXLog::Registers); + + if (!reg_info) { -+ error.SetErrorString("reg_info NULL"); ++ error.FromErrorString("reg_info NULL"); + return error; + } + @@ -266,7 +266,7 @@ Index: lldb/source/Plugins/Process/OpenBSD/NativeRegisterContextOpenBSD_arm64.cp + if (reg == LLDB_INVALID_REGNUM) { + // This is likely an internal register for lldb use only and should not be + // directly queried. -+ error.SetErrorStringWithFormat("register \"%s\" is an internal-only lldb " ++ error.FromErrorStringWithFormat("register \"%s\" is an internal-only lldb " + "register, cannot read directly", + reg_info->name); + return error; @@ -276,7 +276,7 @@ Index: lldb/source/Plugins/Process/OpenBSD/NativeRegisterContextOpenBSD_arm64.cp + if (set == -1) { + // This is likely an internal register for lldb use only and should not be + // directly queried. -+ error.SetErrorStringWithFormat("register \"%s\" is in unrecognized set", ++ error.FromErrorStringWithFormat("register \"%s\" is in unrecognized set", + reg_info->name); + return error; + } @@ -284,7 +284,7 @@ Index: lldb/source/Plugins/Process/OpenBSD/NativeRegisterContextOpenBSD_arm64.cp + if (ReadRegisterSet(set) != 0) { + // This is likely an internal register for lldb use only and should not be + // directly queried. -+ error.SetErrorStringWithFormat( ++ error.FromErrorStringWithFormat( + "reading register set for register \"%s\" failed", reg_info->name); + return error; + } @@ -383,7 +383,7 @@ Index: lldb/source/Plugins/Process/OpenBSD/NativeRegisterContextOpenBSD_arm64.cp + } + + if (WriteRegisterSet(set) != 0) -+ error.SetErrorStringWithFormat("failed to write register set"); ++ error.FromErrorStringWithFormat("failed to write register set"); + + return error; +} @@ -394,7 +394,7 @@ Index: lldb/source/Plugins/Process/OpenBSD/NativeRegisterContextOpenBSD_arm64.cp + + data_sp.reset(new DataBufferHeap(REG_CONTEXT_SIZE, 0)); + if (!data_sp) { -+ error.SetErrorStringWithFormat( ++ error.FromErrorStringWithFormat( + "failed to allocate DataBufferHeap instance of size %zu", + REG_CONTEXT_SIZE); + return error; @@ -410,7 +410,7 @@ Index: lldb/source/Plugins/Process/OpenBSD/NativeRegisterContextOpenBSD_arm64.cp + + uint8_t *dst = data_sp->GetBytes(); + if (dst == nullptr) { -+ error.SetErrorStringWithFormat("DataBufferHeap instance of size %zu" ++ error.FromErrorStringWithFormat("DataBufferHeap instance of size %zu" + " returned a null pointer", + REG_CONTEXT_SIZE); + return error; @@ -430,14 +430,14 @@ Index: lldb/source/Plugins/Process/OpenBSD/NativeRegisterContextOpenBSD_arm64.cp + Status error; + + if (!data_sp) { -+ error.SetErrorStringWithFormat( ++ error.FromErrorStringWithFormat( + "NativeRegisterContextOpenBSD_arm64::%s invalid data_sp provided", + __FUNCTION__); + return error; + } + + if (data_sp->GetByteSize() != REG_CONTEXT_SIZE) { -+ error.SetErrorStringWithFormat( ++ error.FromErrorStringWithFormat( + "NativeRegisterContextOpenBSD_arm64::%s data_sp contained mismatched " + "data size, expected %zu, actual %llu", + __FUNCTION__, REG_CONTEXT_SIZE, data_sp->GetByteSize()); @@ -446,7 +446,7 @@ Index: lldb/source/Plugins/Process/OpenBSD/NativeRegisterContextOpenBSD_arm64.cp + + const uint8_t *src = data_sp->GetBytes(); + if (src == nullptr) { -+ error.SetErrorStringWithFormat("NativeRegisterContextOpenBSD_arm64::%s " ++ error.FromErrorStringWithFormat("NativeRegisterContextOpenBSD_arm64::%s " + "DataBuffer::GetBytes() returned a null " + "pointer", + __FUNCTION__);