pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/lang



Module Name:    pkgsrc
Committed By:   tnn
Date:           Wed Sep 16 11:00:40 UTC 2026

Modified Files:
        pkgsrc/lang/llvm: Makefile distinfo
        pkgsrc/lang/rust: Makefile distinfo
Added Files:
        pkgsrc/lang/llvm/patches:
            patch-lib_ObjCopy_MachO_MachOLayoutBuilder.cpp
            patch-lib_ObjCopy_MachO_MachOWriter.cpp
        pkgsrc/lang/rust/patches:
            patch-src_llvm-project_llvm_lib_ObjCopy_MachO_MachOLayoutBuilder.cpp
            patch-src_llvm-project_llvm_lib_ObjCopy_MachO_MachOWriter.cpp

Log Message:
llvm,rust: backport fix for macOS 27 dyld __LINKEDIT alignment issue


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 pkgsrc/lang/llvm/Makefile
cvs rdiff -u -r1.50 -r1.51 pkgsrc/lang/llvm/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/lang/llvm/patches/patch-lib_ObjCopy_MachO_MachOLayoutBuilder.cpp \
    pkgsrc/lang/llvm/patches/patch-lib_ObjCopy_MachO_MachOWriter.cpp
cvs rdiff -u -r1.363 -r1.364 pkgsrc/lang/rust/Makefile
cvs rdiff -u -r1.201 -r1.202 pkgsrc/lang/rust/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/lang/rust/patches/patch-src_llvm-project_llvm_lib_ObjCopy_MachO_MachOLayoutBuilder.cpp \
    pkgsrc/lang/rust/patches/patch-src_llvm-project_llvm_lib_ObjCopy_MachO_MachOWriter.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/lang/llvm/Makefile
diff -u pkgsrc/lang/llvm/Makefile:1.115 pkgsrc/lang/llvm/Makefile:1.116
--- pkgsrc/lang/llvm/Makefile:1.115     Wed Mar 25 22:56:27 2026
+++ pkgsrc/lang/llvm/Makefile   Wed Sep 16 11:00:39 2026
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.115 2026/03/25 22:56:27 wiz Exp $
+# $NetBSD: Makefile,v 1.116 2026/09/16 11:00:39 tnn Exp $
 #
 # When updating this, please also update:
 # devel/include-what-you-use
@@ -26,6 +26,7 @@
 .include "version.mk"
 
 PKGNAME=       llvm-${LLVM_VERSION}
+PKGREVISION=   1
 CATEGORIES=    lang devel
 
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost

Index: pkgsrc/lang/llvm/distinfo
diff -u pkgsrc/lang/llvm/distinfo:1.50 pkgsrc/lang/llvm/distinfo:1.51
--- pkgsrc/lang/llvm/distinfo:1.50      Tue Sep 15 21:10:06 2026
+++ pkgsrc/lang/llvm/distinfo   Wed Sep 16 11:00:39 2026
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.50 2026/09/15 21:10:06 tnn Exp $
+$NetBSD: distinfo,v 1.51 2026/09/16 11:00:39 tnn Exp $
 
 BLAKE2s (llvm-project-21.1.8.src.tar.xz) = e6db98fed167ddd56b49c7eb46c4de7e7e8e08158e9c99ae79806983bcb60ae9
 SHA512 (llvm-project-21.1.8.src.tar.xz) = cae4c44e7bf678071723da63ad5839491d717a7233e7f4791aa408207f3ea42f52de939ad15189b112c02a0770f1bb8d59bae6ad31ef53417a6eea7770fe52ab
@@ -10,6 +10,8 @@ SHA1 (patch-include_llvm-c_DataTypes.h) 
 SHA1 (patch-include_llvm_CodeGen_RDFGraph.h) = 057a04619997fd7812b93dafa52f00e85faed27a
 SHA1 (patch-include_llvm_CodeGen_RDFRegisters.h) = 906be4b85954ca4a1dc4b34946a7bfcbf6c4758a
 SHA1 (patch-lib_CodeGen_RDFLiveness.cpp) = 1baf8a89f5f0e6b346f6e848cebefcf794d56eb5
+SHA1 (patch-lib_ObjCopy_MachO_MachOLayoutBuilder.cpp) = ecfffdb53cbc53fbb304f478fb908bfe703dfa2b
+SHA1 (patch-lib_ObjCopy_MachO_MachOWriter.cpp) = 73e6d111214cc8a8928457e2efdd1775ede27be4
 SHA1 (patch-lib_Target_Hexagon_RDFCopy.cpp) = e91e07d53455a3e6e24e69556efd13b2e6480011
 SHA1 (patch-lib_Target_Hexagon_RDFCopy.h) = a8161a00d03080b6f513f5bb27177e9c0e260d63
 SHA1 (patch-tools_llvm-shlib_CMakeLists.txt) = 92558f2d7d87b7a26f7f3a2b3b3dc539ae13e672

Index: pkgsrc/lang/rust/Makefile
diff -u pkgsrc/lang/rust/Makefile:1.363 pkgsrc/lang/rust/Makefile:1.364
--- pkgsrc/lang/rust/Makefile:1.363     Wed Sep  2 19:03:14 2026
+++ pkgsrc/lang/rust/Makefile   Wed Sep 16 11:00:39 2026
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.363 2026/09/02 19:03:14 wiz Exp $
+# $NetBSD: Makefile,v 1.364 2026/09/16 11:00:39 tnn Exp $
 
 DISTNAME=      rustc-1.96.1-src
 PKGNAME=       ${DISTNAME:S/rustc/rust/:S/-src//}
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    lang
 MASTER_SITES=  https://static.rust-lang.org/dist/
 

Index: pkgsrc/lang/rust/distinfo
diff -u pkgsrc/lang/rust/distinfo:1.201 pkgsrc/lang/rust/distinfo:1.202
--- pkgsrc/lang/rust/distinfo:1.201     Tue Jun 30 15:13:10 2026
+++ pkgsrc/lang/rust/distinfo   Wed Sep 16 11:00:39 2026
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.201 2026/06/30 15:13:10 adam Exp $
+$NetBSD: distinfo,v 1.202 2026/09/16 11:00:39 tnn Exp $
 
 BLAKE2s (rust-1.95.0-aarch64-apple-darwin.tar.gz) = a81f78cd68fd2e8002b7c81d783144fed183f115c38dd1e21ee2e5ff31e1013c
 SHA512 (rust-1.95.0-aarch64-apple-darwin.tar.gz) = 588fffe89e51dae5566fac16630fc40849e2c33e842a7e92bbe98ec0e7148d88068fdc522f7cf6d301d3d08cd094b3d24fb864d7450c23a5b126c27777800bfa
@@ -132,6 +132,8 @@ SHA1 (patch-src_llvm-project_llvm_CMakeL
 SHA1 (patch-src_llvm-project_llvm_cmake_modules_AddLLVM.cmake) = 29438700020db4f5beaf747645ba1977f2f0865e
 SHA1 (patch-src_llvm-project_llvm_include_llvm-c_DataTypes.h) = cb011fc19957883c01725797f7c85ed1b20f96f1
 SHA1 (patch-src_llvm-project_llvm_include_llvm_Analysis_ConstantFolding.h) = 75019dcb3dbca6cda33ba329dbe483101dcf48e7
+SHA1 (patch-src_llvm-project_llvm_lib_ObjCopy_MachO_MachOLayoutBuilder.cpp) = b2e1cb919c7316c9f92f1dbbc25d45cdc8e910d2
+SHA1 (patch-src_llvm-project_llvm_lib_ObjCopy_MachO_MachOWriter.cpp) = 1680319cad3fd6a5c51bccf820f592b92635fe62
 SHA1 (patch-src_llvm-project_llvm_utils_FileCheck_FileCheck.cpp) = 2587c2f4d11ad8f75bf8a16de625135b26bacc15
 SHA1 (patch-src_tools_cargo_src_bin_cargo_commands_help.rs) = e76c6746470959487a2ae9178dbd76c1a59ea64e
 SHA1 (patch-src_tools_cargo_src_cargo_core_profiles.rs) = e1af7fde97416e0a269ee34efd37f4f47fcf7a95

Added files:

Index: pkgsrc/lang/llvm/patches/patch-lib_ObjCopy_MachO_MachOLayoutBuilder.cpp
diff -u /dev/null pkgsrc/lang/llvm/patches/patch-lib_ObjCopy_MachO_MachOLayoutBuilder.cpp:1.1
--- /dev/null   Wed Sep 16 11:00:40 2026
+++ pkgsrc/lang/llvm/patches/patch-lib_ObjCopy_MachO_MachOLayoutBuilder.cpp     Wed Sep 16 11:00:39 2026
@@ -0,0 +1,169 @@
+$NetBSD: patch-lib_ObjCopy_MachO_MachOLayoutBuilder.cpp,v 1.1 2026/09/16 11:00:39 tnn Exp $
+
+Fix llvm-objcopy producing mis-aligned __LINKEDIT segment.
+ld on xcode 27 rejects such dylibs. This breaks notably rustc.
+Patch via https://github.com/llvm/llvm-project/pull/203680
+
+--- lib/ObjCopy/MachO/MachOLayoutBuilder.cpp.orig      2025-12-12 10:35:47.000000000 +0000
++++ lib/ObjCopy/MachO/MachOLayoutBuilder.cpp
+@@ -236,24 +236,27 @@
+          "Incorrect tail offset");
+   Offset = std::max(Offset, HeaderSize + O.Header.SizeOfCmds);
+ 
++  const uint64_t LinkEditAlign = Is64Bit ? 8 : 4;
++  Offset = alignToPowerOf2(Offset, LinkEditAlign);
++
+   // The exports trie can be in either LC_DYLD_INFO or in
+   // LC_DYLD_EXPORTS_TRIE, but not both.
+-  size_t DyldInfoExportsTrieSize = 0;
+-  size_t DyldExportsTrieSize = 0;
++  uint64_t DyldInfoExportsTrieRawSize = 0;
++  uint64_t DyldExportsTrieRawSize = 0;
+   for (const auto &LC : O.LoadCommands) {
+     switch (LC.MachOLoadCommand.load_command_data.cmd) {
+     case MachO::LC_DYLD_INFO:
+     case MachO::LC_DYLD_INFO_ONLY:
+-      DyldInfoExportsTrieSize = O.Exports.Trie.size();
++      DyldInfoExportsTrieRawSize = O.Exports.Trie.size();
+       break;
+     case MachO::LC_DYLD_EXPORTS_TRIE:
+-      DyldExportsTrieSize = O.Exports.Trie.size();
++      DyldExportsTrieRawSize = O.Exports.Trie.size();
+       break;
+     default:
+       break;
+     }
+   }
+-  assert((DyldInfoExportsTrieSize == 0 || DyldExportsTrieSize == 0) &&
++  assert((DyldInfoExportsTrieRawSize == 0 || DyldExportsTrieRawSize == 0) &&
+          "Export trie in both LCs");
+ 
+   uint64_t NListSize = Is64Bit ? sizeof(MachO::nlist_64) : sizeof(MachO::nlist);
+@@ -264,28 +267,43 @@
+   // trie, chained fixups, dyld exports trie, function starts, data-in-code,
+   // symbol table, indirect symbol table, symbol table strings,
+   // dylib codesign drs, and code signature.
+-  auto updateOffset = [&Offset](size_t Size) {
++  auto updateOffset = [&Offset, LinkEditAlign](uint64_t Size) {
+     uint64_t PreviousOffset = Offset;
+-    Offset += Size;
+-    return PreviousOffset;
++    // Match ld64 and lld-macho behavior by aligning all LINKEDIT entries to
++    // pointer size. This is safe because zero padding is valid for all entries.
++    uint64_t PaddedSize = alignToPowerOf2(Size, LinkEditAlign);
++    Offset += PaddedSize;
++    return std::make_pair(PreviousOffset, PaddedSize);
+   };
+ 
+-  uint64_t StartOfRebaseInfo = updateOffset(O.Rebases.Opcodes.size());
+-  uint64_t StartOfBindingInfo = updateOffset(O.Binds.Opcodes.size());
+-  uint64_t StartOfWeakBindingInfo = updateOffset(O.WeakBinds.Opcodes.size());
+-  uint64_t StartOfLazyBindingInfo = updateOffset(O.LazyBinds.Opcodes.size());
+-  uint64_t StartOfExportTrie = updateOffset(DyldInfoExportsTrieSize);
+-  uint64_t StartOfChainedFixups = updateOffset(O.ChainedFixups.Data.size());
+-  uint64_t StartOfDyldExportsTrie = updateOffset(DyldExportsTrieSize);
+-  uint64_t StartOfFunctionStarts = updateOffset(O.FunctionStarts.Data.size());
+-  uint64_t StartOfDataInCode = updateOffset(O.DataInCode.Data.size());
+-  uint64_t StartOfLinkerOptimizationHint =
+-      updateOffset(O.LinkerOptimizationHint.Data.size());
+-  uint64_t StartOfSymbols = updateOffset(NListSize * O.SymTable.Symbols.size());
++  auto [StartOfRebaseInfo, RebaseInfoSize] =
++      updateOffset(O.Rebases.Opcodes.size());
++  auto [StartOfBindingInfo, BindingInfoSize] =
++      updateOffset(O.Binds.Opcodes.size());
++  auto [StartOfWeakBindingInfo, WeakBindingInfoSize] =
++      updateOffset(O.WeakBinds.Opcodes.size());
++  auto [StartOfLazyBindingInfo, LazyBindingInfoSize] =
++      updateOffset(O.LazyBinds.Opcodes.size());
++  auto [StartOfExportTrie, ExportTrieSize] =
++      updateOffset(DyldInfoExportsTrieRawSize);
++  auto [StartOfChainedFixups, ChainedFixupsSize] =
++      updateOffset(O.ChainedFixups.Data.size());
++  auto [StartOfDyldExportsTrie, DyldExportsTrieSize] =
++      updateOffset(DyldExportsTrieRawSize);
++  auto [StartOfFunctionStarts, FunctionStartsSize] =
++      updateOffset(O.FunctionStarts.Data.size());
++  auto [StartOfDataInCode, DataInCodeSize] =
++      updateOffset(O.DataInCode.Data.size());
++  auto [StartOfLinkerOptimizationHint, LinkerOptimizationHintSize] =
++      updateOffset(O.LinkerOptimizationHint.Data.size());
++  uint64_t StartOfSymbols =
++      updateOffset(NListSize * O.SymTable.Symbols.size()).first;
+   uint64_t StartOfIndirectSymbols =
+-      updateOffset(sizeof(uint32_t) * O.IndirectSymTable.Symbols.size());
+-  uint64_t StartOfSymbolStrings = updateOffset(StrTableBuilder.getSize());
+-  uint64_t StartOfDylibCodeSignDRs = updateOffset(O.DylibCodeSignDRs.Data.size());
++      updateOffset(sizeof(uint32_t) * O.IndirectSymTable.Symbols.size()).first;
++  auto [StartOfSymbolStrings, SymbolStringsSize] =
++      updateOffset(StrTableBuilder.getSize());
++  auto [StartOfDylibCodeSignDRs, DylibCodeSignDRsSize] =
++      updateOffset(O.DylibCodeSignDRs.Data.size());
+ 
+   uint64_t StartOfCodeSignature = Offset;
+   uint32_t CodeSignatureSize = 0;
+@@ -344,13 +362,13 @@
+       break;
+     case MachO::LC_DYLIB_CODE_SIGN_DRS:
+       MLC.linkedit_data_command_data.dataoff = StartOfDylibCodeSignDRs;
+-      MLC.linkedit_data_command_data.datasize = O.DylibCodeSignDRs.Data.size();
++      MLC.linkedit_data_command_data.datasize = DylibCodeSignDRsSize;
+       break;
+     case MachO::LC_SYMTAB:
+       MLC.symtab_command_data.symoff = StartOfSymbols;
+       MLC.symtab_command_data.nsyms = O.SymTable.Symbols.size();
+       MLC.symtab_command_data.stroff = StartOfSymbolStrings;
+-      MLC.symtab_command_data.strsize = StrTableBuilder.getSize();
++      MLC.symtab_command_data.strsize = SymbolStringsSize;
+       break;
+     case MachO::LC_DYSYMTAB: {
+       if (MLC.dysymtab_command_data.ntoc != 0 ||
+@@ -369,20 +387,19 @@
+     }
+     case MachO::LC_DATA_IN_CODE:
+       MLC.linkedit_data_command_data.dataoff = StartOfDataInCode;
+-      MLC.linkedit_data_command_data.datasize = O.DataInCode.Data.size();
++      MLC.linkedit_data_command_data.datasize = DataInCodeSize;
+       break;
+     case MachO::LC_LINKER_OPTIMIZATION_HINT:
+       MLC.linkedit_data_command_data.dataoff = StartOfLinkerOptimizationHint;
+-      MLC.linkedit_data_command_data.datasize =
+-          O.LinkerOptimizationHint.Data.size();
++      MLC.linkedit_data_command_data.datasize = LinkerOptimizationHintSize;
+       break;
+     case MachO::LC_FUNCTION_STARTS:
+       MLC.linkedit_data_command_data.dataoff = StartOfFunctionStarts;
+-      MLC.linkedit_data_command_data.datasize = O.FunctionStarts.Data.size();
++      MLC.linkedit_data_command_data.datasize = FunctionStartsSize;
+       break;
+     case MachO::LC_DYLD_CHAINED_FIXUPS:
+       MLC.linkedit_data_command_data.dataoff = StartOfChainedFixups;
+-      MLC.linkedit_data_command_data.datasize = O.ChainedFixups.Data.size();
++      MLC.linkedit_data_command_data.datasize = ChainedFixupsSize;
+       break;
+     case MachO::LC_DYLD_EXPORTS_TRIE:
+       MLC.linkedit_data_command_data.dataoff = StartOfDyldExportsTrie;
+@@ -392,19 +409,19 @@
+     case MachO::LC_DYLD_INFO_ONLY:
+       MLC.dyld_info_command_data.rebase_off =
+           O.Rebases.Opcodes.empty() ? 0 : StartOfRebaseInfo;
+-      MLC.dyld_info_command_data.rebase_size = O.Rebases.Opcodes.size();
++      MLC.dyld_info_command_data.rebase_size = RebaseInfoSize;
+       MLC.dyld_info_command_data.bind_off =
+           O.Binds.Opcodes.empty() ? 0 : StartOfBindingInfo;
+-      MLC.dyld_info_command_data.bind_size = O.Binds.Opcodes.size();
++      MLC.dyld_info_command_data.bind_size = BindingInfoSize;
+       MLC.dyld_info_command_data.weak_bind_off =
+           O.WeakBinds.Opcodes.empty() ? 0 : StartOfWeakBindingInfo;
+-      MLC.dyld_info_command_data.weak_bind_size = O.WeakBinds.Opcodes.size();
++      MLC.dyld_info_command_data.weak_bind_size = WeakBindingInfoSize;
+       MLC.dyld_info_command_data.lazy_bind_off =
+           O.LazyBinds.Opcodes.empty() ? 0 : StartOfLazyBindingInfo;
+-      MLC.dyld_info_command_data.lazy_bind_size = O.LazyBinds.Opcodes.size();
++      MLC.dyld_info_command_data.lazy_bind_size = LazyBindingInfoSize;
+       MLC.dyld_info_command_data.export_off =
+           O.Exports.Trie.empty() ? 0 : StartOfExportTrie;
+-      MLC.dyld_info_command_data.export_size = DyldInfoExportsTrieSize;
++      MLC.dyld_info_command_data.export_size = ExportTrieSize;
+       break;
+     // Note that LC_ENCRYPTION_INFO.cryptoff despite its name and the comment in
+     // <mach-o/loader.h> is not an offset in the binary file, instead, it is a
Index: pkgsrc/lang/llvm/patches/patch-lib_ObjCopy_MachO_MachOWriter.cpp
diff -u /dev/null pkgsrc/lang/llvm/patches/patch-lib_ObjCopy_MachO_MachOWriter.cpp:1.1
--- /dev/null   Wed Sep 16 11:00:40 2026
+++ pkgsrc/lang/llvm/patches/patch-lib_ObjCopy_MachO_MachOWriter.cpp    Wed Sep 16 11:00:39 2026
@@ -0,0 +1,131 @@
+$NetBSD: patch-lib_ObjCopy_MachO_MachOWriter.cpp,v 1.1 2026/09/16 11:00:39 tnn Exp $
+
+Fix llvm-objcopy producing mis-aligned __LINKEDIT segment.
+ld on xcode 27 rejects such dylibs. This breaks notably rustc.
+Patch via https://github.com/llvm/llvm-project/pull/203680
+
+--- lib/ObjCopy/MachO/MachOWriter.cpp.orig     2025-12-12 10:35:47.000000000 +0000
++++ lib/ObjCopy/MachO/MachOWriter.cpp
+@@ -24,6 +24,12 @@
+ using namespace llvm::objcopy::macho;
+ using namespace llvm::support::endian;
+ 
++#ifndef NDEBUG
++static uint64_t paddedLinkEditEntrySize(uint64_t Size, bool Is64Bit) {
++  return alignToPowerOf2(Size, Is64Bit ? 8 : 4);
++}
++#endif
++
+ size_t MachOWriter::headerSize() const {
+   return Is64Bit ? sizeof(MachO::mach_header_64) : sizeof(MachO::mach_header);
+ }
+@@ -55,29 +61,34 @@
+         O.LoadCommands[*O.DyLdInfoCommandIndex]
+             .MachOLoadCommand.dyld_info_command_data;
+     if (DyLdInfoCommand.rebase_off) {
+-      assert((DyLdInfoCommand.rebase_size == O.Rebases.Opcodes.size()) &&
++      assert((DyLdInfoCommand.rebase_size ==
++              paddedLinkEditEntrySize(O.Rebases.Opcodes.size(), Is64Bit)) &&
+              "Incorrect rebase opcodes size");
+       Ends.push_back(DyLdInfoCommand.rebase_off + DyLdInfoCommand.rebase_size);
+     }
+     if (DyLdInfoCommand.bind_off) {
+-      assert((DyLdInfoCommand.bind_size == O.Binds.Opcodes.size()) &&
++      assert((DyLdInfoCommand.bind_size ==
++              paddedLinkEditEntrySize(O.Binds.Opcodes.size(), Is64Bit)) &&
+              "Incorrect bind opcodes size");
+       Ends.push_back(DyLdInfoCommand.bind_off + DyLdInfoCommand.bind_size);
+     }
+     if (DyLdInfoCommand.weak_bind_off) {
+-      assert((DyLdInfoCommand.weak_bind_size == O.WeakBinds.Opcodes.size()) &&
++      assert((DyLdInfoCommand.weak_bind_size ==
++              paddedLinkEditEntrySize(O.WeakBinds.Opcodes.size(), Is64Bit)) &&
+              "Incorrect weak bind opcodes size");
+       Ends.push_back(DyLdInfoCommand.weak_bind_off +
+                      DyLdInfoCommand.weak_bind_size);
+     }
+     if (DyLdInfoCommand.lazy_bind_off) {
+-      assert((DyLdInfoCommand.lazy_bind_size == O.LazyBinds.Opcodes.size()) &&
++      assert((DyLdInfoCommand.lazy_bind_size ==
++              paddedLinkEditEntrySize(O.LazyBinds.Opcodes.size(), Is64Bit)) &&
+              "Incorrect lazy bind opcodes size");
+       Ends.push_back(DyLdInfoCommand.lazy_bind_off +
+                      DyLdInfoCommand.lazy_bind_size);
+     }
+     if (DyLdInfoCommand.export_off) {
+-      assert((DyLdInfoCommand.export_size == O.Exports.Trie.size()) &&
++      assert((DyLdInfoCommand.export_size ==
++              paddedLinkEditEntrySize(O.Exports.Trie.size(), Is64Bit)) &&
+              "Incorrect trie size");
+       Ends.push_back(DyLdInfoCommand.export_off + DyLdInfoCommand.export_size);
+     }
+@@ -320,7 +331,8 @@
+       O.LoadCommands[*O.DyLdInfoCommandIndex]
+           .MachOLoadCommand.dyld_info_command_data;
+   char *Out = (char *)Buf->getBufferStart() + DyLdInfoCommand.rebase_off;
+-  assert((DyLdInfoCommand.rebase_size == O.Rebases.Opcodes.size()) &&
++  assert((DyLdInfoCommand.rebase_size ==
++          paddedLinkEditEntrySize(O.Rebases.Opcodes.size(), Is64Bit)) &&
+          "Incorrect rebase opcodes size");
+   memcpy(Out, O.Rebases.Opcodes.data(), O.Rebases.Opcodes.size());
+ }
+@@ -332,7 +344,8 @@
+       O.LoadCommands[*O.DyLdInfoCommandIndex]
+           .MachOLoadCommand.dyld_info_command_data;
+   char *Out = (char *)Buf->getBufferStart() + DyLdInfoCommand.bind_off;
+-  assert((DyLdInfoCommand.bind_size == O.Binds.Opcodes.size()) &&
++  assert((DyLdInfoCommand.bind_size ==
++          paddedLinkEditEntrySize(O.Binds.Opcodes.size(), Is64Bit)) &&
+          "Incorrect bind opcodes size");
+   memcpy(Out, O.Binds.Opcodes.data(), O.Binds.Opcodes.size());
+ }
+@@ -344,7 +357,8 @@
+       O.LoadCommands[*O.DyLdInfoCommandIndex]
+           .MachOLoadCommand.dyld_info_command_data;
+   char *Out = (char *)Buf->getBufferStart() + DyLdInfoCommand.weak_bind_off;
+-  assert((DyLdInfoCommand.weak_bind_size == O.WeakBinds.Opcodes.size()) &&
++  assert((DyLdInfoCommand.weak_bind_size ==
++          paddedLinkEditEntrySize(O.WeakBinds.Opcodes.size(), Is64Bit)) &&
+          "Incorrect weak bind opcodes size");
+   memcpy(Out, O.WeakBinds.Opcodes.data(), O.WeakBinds.Opcodes.size());
+ }
+@@ -356,7 +370,8 @@
+       O.LoadCommands[*O.DyLdInfoCommandIndex]
+           .MachOLoadCommand.dyld_info_command_data;
+   char *Out = (char *)Buf->getBufferStart() + DyLdInfoCommand.lazy_bind_off;
+-  assert((DyLdInfoCommand.lazy_bind_size == O.LazyBinds.Opcodes.size()) &&
++  assert((DyLdInfoCommand.lazy_bind_size ==
++          paddedLinkEditEntrySize(O.LazyBinds.Opcodes.size(), Is64Bit)) &&
+          "Incorrect lazy bind opcodes size");
+   memcpy(Out, O.LazyBinds.Opcodes.data(), O.LazyBinds.Opcodes.size());
+ }
+@@ -368,7 +383,8 @@
+       O.LoadCommands[*O.DyLdInfoCommandIndex]
+           .MachOLoadCommand.dyld_info_command_data;
+   char *Out = (char *)Buf->getBufferStart() + DyLdInfoCommand.export_off;
+-  assert((DyLdInfoCommand.export_size == O.Exports.Trie.size()) &&
++  assert((DyLdInfoCommand.export_size ==
++          paddedLinkEditEntrySize(O.Exports.Trie.size(), Is64Bit)) &&
+          "Incorrect export trie size");
+   memcpy(Out, O.Exports.Trie.data(), O.Exports.Trie.size());
+ }
+@@ -398,7 +414,8 @@
+   const MachO::linkedit_data_command &LinkEditDataCommand =
+       O.LoadCommands[*LCIndex].MachOLoadCommand.linkedit_data_command_data;
+   char *Out = (char *)Buf->getBufferStart() + LinkEditDataCommand.dataoff;
+-  assert((LinkEditDataCommand.datasize == LD.Data.size()) &&
++  assert((LinkEditDataCommand.datasize ==
++          paddedLinkEditEntrySize(LD.Data.size(), Is64Bit)) &&
+          "Incorrect data size");
+   memcpy(Out, LD.Data.data(), LD.Data.size());
+ }
+@@ -575,7 +592,8 @@
+       O.LoadCommands[*O.ExportsTrieCommandIndex]
+           .MachOLoadCommand.linkedit_data_command_data;
+   char *Out = (char *)Buf->getBufferStart() + ExportsTrieCmd.dataoff;
+-  assert((ExportsTrieCmd.datasize == O.Exports.Trie.size()) &&
++  assert((ExportsTrieCmd.datasize ==
++          paddedLinkEditEntrySize(O.Exports.Trie.size(), Is64Bit)) &&
+          "Incorrect export trie size");
+   memcpy(Out, O.Exports.Trie.data(), O.Exports.Trie.size());
+ }

Index: pkgsrc/lang/rust/patches/patch-src_llvm-project_llvm_lib_ObjCopy_MachO_MachOLayoutBuilder.cpp
diff -u /dev/null pkgsrc/lang/rust/patches/patch-src_llvm-project_llvm_lib_ObjCopy_MachO_MachOLayoutBuilder.cpp:1.1
--- /dev/null   Wed Sep 16 11:00:40 2026
+++ pkgsrc/lang/rust/patches/patch-src_llvm-project_llvm_lib_ObjCopy_MachO_MachOLayoutBuilder.cpp       Wed Sep 16 11:00:40 2026
@@ -0,0 +1,169 @@
+$NetBSD: patch-src_llvm-project_llvm_lib_ObjCopy_MachO_MachOLayoutBuilder.cpp,v 1.1 2026/09/16 11:00:40 tnn Exp $
+
+Fix llvm-objcopy producing mis-aligned __LINKEDIT segment.
+ld on xcode 27 rejects such dylibs. This breaks notably rustc.
+Patch via https://github.com/llvm/llvm-project/pull/203680
+
+--- src/llvm-project/llvm/lib/ObjCopy/MachO/MachOLayoutBuilder.cpp.orig        2026-06-26 21:46:14.000000000 +0000
++++ src/llvm-project/llvm/lib/ObjCopy/MachO/MachOLayoutBuilder.cpp
+@@ -235,24 +235,27 @@
+          "Incorrect tail offset");
+   Offset = std::max(Offset, HeaderSize + O.Header.SizeOfCmds);
+ 
++  const uint64_t LinkEditAlign = Is64Bit ? 8 : 4;
++  Offset = alignToPowerOf2(Offset, LinkEditAlign);
++
+   // The exports trie can be in either LC_DYLD_INFO or in
+   // LC_DYLD_EXPORTS_TRIE, but not both.
+-  size_t DyldInfoExportsTrieSize = 0;
+-  size_t DyldExportsTrieSize = 0;
++  uint64_t DyldInfoExportsTrieRawSize = 0;
++  uint64_t DyldExportsTrieRawSize = 0;
+   for (const auto &LC : O.LoadCommands) {
+     switch (LC.MachOLoadCommand.load_command_data.cmd) {
+     case MachO::LC_DYLD_INFO:
+     case MachO::LC_DYLD_INFO_ONLY:
+-      DyldInfoExportsTrieSize = O.Exports.Trie.size();
++      DyldInfoExportsTrieRawSize = O.Exports.Trie.size();
+       break;
+     case MachO::LC_DYLD_EXPORTS_TRIE:
+-      DyldExportsTrieSize = O.Exports.Trie.size();
++      DyldExportsTrieRawSize = O.Exports.Trie.size();
+       break;
+     default:
+       break;
+     }
+   }
+-  assert((DyldInfoExportsTrieSize == 0 || DyldExportsTrieSize == 0) &&
++  assert((DyldInfoExportsTrieRawSize == 0 || DyldExportsTrieRawSize == 0) &&
+          "Export trie in both LCs");
+ 
+   uint64_t NListSize = Is64Bit ? sizeof(MachO::nlist_64) : sizeof(MachO::nlist);
+@@ -263,28 +266,43 @@
+   // trie, chained fixups, dyld exports trie, function starts, data-in-code,
+   // symbol table, indirect symbol table, symbol table strings,
+   // dylib codesign drs, and code signature.
+-  auto updateOffset = [&Offset](size_t Size) {
++  auto updateOffset = [&Offset, LinkEditAlign](uint64_t Size) {
+     uint64_t PreviousOffset = Offset;
+-    Offset += Size;
+-    return PreviousOffset;
++    // Match ld64 and lld-macho behavior by aligning all LINKEDIT entries to
++    // pointer size. This is safe because zero padding is valid for all entries.
++    uint64_t PaddedSize = alignToPowerOf2(Size, LinkEditAlign);
++    Offset += PaddedSize;
++    return std::make_pair(PreviousOffset, PaddedSize);
+   };
+ 
+-  uint64_t StartOfRebaseInfo = updateOffset(O.Rebases.Opcodes.size());
+-  uint64_t StartOfBindingInfo = updateOffset(O.Binds.Opcodes.size());
+-  uint64_t StartOfWeakBindingInfo = updateOffset(O.WeakBinds.Opcodes.size());
+-  uint64_t StartOfLazyBindingInfo = updateOffset(O.LazyBinds.Opcodes.size());
+-  uint64_t StartOfExportTrie = updateOffset(DyldInfoExportsTrieSize);
+-  uint64_t StartOfChainedFixups = updateOffset(O.ChainedFixups.Data.size());
+-  uint64_t StartOfDyldExportsTrie = updateOffset(DyldExportsTrieSize);
+-  uint64_t StartOfFunctionStarts = updateOffset(O.FunctionStarts.Data.size());
+-  uint64_t StartOfDataInCode = updateOffset(O.DataInCode.Data.size());
+-  uint64_t StartOfLinkerOptimizationHint =
+-      updateOffset(O.LinkerOptimizationHint.Data.size());
+-  uint64_t StartOfSymbols = updateOffset(NListSize * O.SymTable.Symbols.size());
++  auto [StartOfRebaseInfo, RebaseInfoSize] =
++      updateOffset(O.Rebases.Opcodes.size());
++  auto [StartOfBindingInfo, BindingInfoSize] =
++      updateOffset(O.Binds.Opcodes.size());
++  auto [StartOfWeakBindingInfo, WeakBindingInfoSize] =
++      updateOffset(O.WeakBinds.Opcodes.size());
++  auto [StartOfLazyBindingInfo, LazyBindingInfoSize] =
++      updateOffset(O.LazyBinds.Opcodes.size());
++  auto [StartOfExportTrie, ExportTrieSize] =
++      updateOffset(DyldInfoExportsTrieRawSize);
++  auto [StartOfChainedFixups, ChainedFixupsSize] =
++      updateOffset(O.ChainedFixups.Data.size());
++  auto [StartOfDyldExportsTrie, DyldExportsTrieSize] =
++      updateOffset(DyldExportsTrieRawSize);
++  auto [StartOfFunctionStarts, FunctionStartsSize] =
++      updateOffset(O.FunctionStarts.Data.size());
++  auto [StartOfDataInCode, DataInCodeSize] =
++      updateOffset(O.DataInCode.Data.size());
++  auto [StartOfLinkerOptimizationHint, LinkerOptimizationHintSize] =
++      updateOffset(O.LinkerOptimizationHint.Data.size());
++  uint64_t StartOfSymbols =
++      updateOffset(NListSize * O.SymTable.Symbols.size()).first;
+   uint64_t StartOfIndirectSymbols =
+-      updateOffset(sizeof(uint32_t) * O.IndirectSymTable.Symbols.size());
+-  uint64_t StartOfSymbolStrings = updateOffset(StrTableBuilder.getSize());
+-  uint64_t StartOfDylibCodeSignDRs = updateOffset(O.DylibCodeSignDRs.Data.size());
++      updateOffset(sizeof(uint32_t) * O.IndirectSymTable.Symbols.size()).first;
++  auto [StartOfSymbolStrings, SymbolStringsSize] =
++      updateOffset(StrTableBuilder.getSize());
++  auto [StartOfDylibCodeSignDRs, DylibCodeSignDRsSize] =
++      updateOffset(O.DylibCodeSignDRs.Data.size());
+ 
+   uint64_t StartOfCodeSignature = Offset;
+   uint32_t CodeSignatureSize = 0;
+@@ -343,13 +361,13 @@
+       break;
+     case MachO::LC_DYLIB_CODE_SIGN_DRS:
+       MLC.linkedit_data_command_data.dataoff = StartOfDylibCodeSignDRs;
+-      MLC.linkedit_data_command_data.datasize = O.DylibCodeSignDRs.Data.size();
++      MLC.linkedit_data_command_data.datasize = DylibCodeSignDRsSize;
+       break;
+     case MachO::LC_SYMTAB:
+       MLC.symtab_command_data.symoff = StartOfSymbols;
+       MLC.symtab_command_data.nsyms = O.SymTable.Symbols.size();
+       MLC.symtab_command_data.stroff = StartOfSymbolStrings;
+-      MLC.symtab_command_data.strsize = StrTableBuilder.getSize();
++      MLC.symtab_command_data.strsize = SymbolStringsSize;
+       break;
+     case MachO::LC_DYSYMTAB: {
+       if (MLC.dysymtab_command_data.ntoc != 0 ||
+@@ -368,20 +386,19 @@
+     }
+     case MachO::LC_DATA_IN_CODE:
+       MLC.linkedit_data_command_data.dataoff = StartOfDataInCode;
+-      MLC.linkedit_data_command_data.datasize = O.DataInCode.Data.size();
++      MLC.linkedit_data_command_data.datasize = DataInCodeSize;
+       break;
+     case MachO::LC_LINKER_OPTIMIZATION_HINT:
+       MLC.linkedit_data_command_data.dataoff = StartOfLinkerOptimizationHint;
+-      MLC.linkedit_data_command_data.datasize =
+-          O.LinkerOptimizationHint.Data.size();
++      MLC.linkedit_data_command_data.datasize = LinkerOptimizationHintSize;
+       break;
+     case MachO::LC_FUNCTION_STARTS:
+       MLC.linkedit_data_command_data.dataoff = StartOfFunctionStarts;
+-      MLC.linkedit_data_command_data.datasize = O.FunctionStarts.Data.size();
++      MLC.linkedit_data_command_data.datasize = FunctionStartsSize;
+       break;
+     case MachO::LC_DYLD_CHAINED_FIXUPS:
+       MLC.linkedit_data_command_data.dataoff = StartOfChainedFixups;
+-      MLC.linkedit_data_command_data.datasize = O.ChainedFixups.Data.size();
++      MLC.linkedit_data_command_data.datasize = ChainedFixupsSize;
+       break;
+     case MachO::LC_DYLD_EXPORTS_TRIE:
+       MLC.linkedit_data_command_data.dataoff = StartOfDyldExportsTrie;
+@@ -391,19 +408,19 @@
+     case MachO::LC_DYLD_INFO_ONLY:
+       MLC.dyld_info_command_data.rebase_off =
+           O.Rebases.Opcodes.empty() ? 0 : StartOfRebaseInfo;
+-      MLC.dyld_info_command_data.rebase_size = O.Rebases.Opcodes.size();
++      MLC.dyld_info_command_data.rebase_size = RebaseInfoSize;
+       MLC.dyld_info_command_data.bind_off =
+           O.Binds.Opcodes.empty() ? 0 : StartOfBindingInfo;
+-      MLC.dyld_info_command_data.bind_size = O.Binds.Opcodes.size();
++      MLC.dyld_info_command_data.bind_size = BindingInfoSize;
+       MLC.dyld_info_command_data.weak_bind_off =
+           O.WeakBinds.Opcodes.empty() ? 0 : StartOfWeakBindingInfo;
+-      MLC.dyld_info_command_data.weak_bind_size = O.WeakBinds.Opcodes.size();
++      MLC.dyld_info_command_data.weak_bind_size = WeakBindingInfoSize;
+       MLC.dyld_info_command_data.lazy_bind_off =
+           O.LazyBinds.Opcodes.empty() ? 0 : StartOfLazyBindingInfo;
+-      MLC.dyld_info_command_data.lazy_bind_size = O.LazyBinds.Opcodes.size();
++      MLC.dyld_info_command_data.lazy_bind_size = LazyBindingInfoSize;
+       MLC.dyld_info_command_data.export_off =
+           O.Exports.Trie.empty() ? 0 : StartOfExportTrie;
+-      MLC.dyld_info_command_data.export_size = DyldInfoExportsTrieSize;
++      MLC.dyld_info_command_data.export_size = ExportTrieSize;
+       break;
+     // Note that LC_ENCRYPTION_INFO.cryptoff despite its name and the comment in
+     // <mach-o/loader.h> is not an offset in the binary file, instead, it is a
Index: pkgsrc/lang/rust/patches/patch-src_llvm-project_llvm_lib_ObjCopy_MachO_MachOWriter.cpp
diff -u /dev/null pkgsrc/lang/rust/patches/patch-src_llvm-project_llvm_lib_ObjCopy_MachO_MachOWriter.cpp:1.1
--- /dev/null   Wed Sep 16 11:00:40 2026
+++ pkgsrc/lang/rust/patches/patch-src_llvm-project_llvm_lib_ObjCopy_MachO_MachOWriter.cpp      Wed Sep 16 11:00:40 2026
@@ -0,0 +1,131 @@
+$NetBSD: patch-src_llvm-project_llvm_lib_ObjCopy_MachO_MachOWriter.cpp,v 1.1 2026/09/16 11:00:40 tnn Exp $
+
+Fix llvm-objcopy producing mis-aligned __LINKEDIT segment.
+ld on xcode 27 rejects such dylibs. This breaks notably rustc.
+Patch via https://github.com/llvm/llvm-project/pull/203680
+
+--- src/llvm-project/llvm/lib/ObjCopy/MachO/MachOWriter.cpp.orig       2026-06-26 21:46:14.000000000 +0000
++++ src/llvm-project/llvm/lib/ObjCopy/MachO/MachOWriter.cpp
+@@ -24,6 +24,12 @@
+ using namespace llvm::objcopy::macho;
+ using namespace llvm::support::endian;
+ 
++#ifndef NDEBUG
++static uint64_t paddedLinkEditEntrySize(uint64_t Size, bool Is64Bit) {
++  return alignToPowerOf2(Size, Is64Bit ? 8 : 4);
++}
++#endif
++
+ size_t MachOWriter::headerSize() const {
+   return Is64Bit ? sizeof(MachO::mach_header_64) : sizeof(MachO::mach_header);
+ }
+@@ -55,29 +61,34 @@
+         O.LoadCommands[*O.DyLdInfoCommandIndex]
+             .MachOLoadCommand.dyld_info_command_data;
+     if (DyLdInfoCommand.rebase_off) {
+-      assert((DyLdInfoCommand.rebase_size == O.Rebases.Opcodes.size()) &&
++      assert((DyLdInfoCommand.rebase_size ==
++              paddedLinkEditEntrySize(O.Rebases.Opcodes.size(), Is64Bit)) &&
+              "Incorrect rebase opcodes size");
+       Ends.push_back(DyLdInfoCommand.rebase_off + DyLdInfoCommand.rebase_size);
+     }
+     if (DyLdInfoCommand.bind_off) {
+-      assert((DyLdInfoCommand.bind_size == O.Binds.Opcodes.size()) &&
++      assert((DyLdInfoCommand.bind_size ==
++              paddedLinkEditEntrySize(O.Binds.Opcodes.size(), Is64Bit)) &&
+              "Incorrect bind opcodes size");
+       Ends.push_back(DyLdInfoCommand.bind_off + DyLdInfoCommand.bind_size);
+     }
+     if (DyLdInfoCommand.weak_bind_off) {
+-      assert((DyLdInfoCommand.weak_bind_size == O.WeakBinds.Opcodes.size()) &&
++      assert((DyLdInfoCommand.weak_bind_size ==
++              paddedLinkEditEntrySize(O.WeakBinds.Opcodes.size(), Is64Bit)) &&
+              "Incorrect weak bind opcodes size");
+       Ends.push_back(DyLdInfoCommand.weak_bind_off +
+                      DyLdInfoCommand.weak_bind_size);
+     }
+     if (DyLdInfoCommand.lazy_bind_off) {
+-      assert((DyLdInfoCommand.lazy_bind_size == O.LazyBinds.Opcodes.size()) &&
++      assert((DyLdInfoCommand.lazy_bind_size ==
++              paddedLinkEditEntrySize(O.LazyBinds.Opcodes.size(), Is64Bit)) &&
+              "Incorrect lazy bind opcodes size");
+       Ends.push_back(DyLdInfoCommand.lazy_bind_off +
+                      DyLdInfoCommand.lazy_bind_size);
+     }
+     if (DyLdInfoCommand.export_off) {
+-      assert((DyLdInfoCommand.export_size == O.Exports.Trie.size()) &&
++      assert((DyLdInfoCommand.export_size ==
++              paddedLinkEditEntrySize(O.Exports.Trie.size(), Is64Bit)) &&
+              "Incorrect trie size");
+       Ends.push_back(DyLdInfoCommand.export_off + DyLdInfoCommand.export_size);
+     }
+@@ -320,7 +331,8 @@
+       O.LoadCommands[*O.DyLdInfoCommandIndex]
+           .MachOLoadCommand.dyld_info_command_data;
+   char *Out = Buf->getBufferStart() + DyLdInfoCommand.rebase_off;
+-  assert((DyLdInfoCommand.rebase_size == O.Rebases.Opcodes.size()) &&
++  assert((DyLdInfoCommand.rebase_size ==
++          paddedLinkEditEntrySize(O.Rebases.Opcodes.size(), Is64Bit)) &&
+          "Incorrect rebase opcodes size");
+   memcpy(Out, O.Rebases.Opcodes.data(), O.Rebases.Opcodes.size());
+ }
+@@ -332,7 +344,8 @@
+       O.LoadCommands[*O.DyLdInfoCommandIndex]
+           .MachOLoadCommand.dyld_info_command_data;
+   char *Out = Buf->getBufferStart() + DyLdInfoCommand.bind_off;
+-  assert((DyLdInfoCommand.bind_size == O.Binds.Opcodes.size()) &&
++  assert((DyLdInfoCommand.bind_size ==
++          paddedLinkEditEntrySize(O.Binds.Opcodes.size(), Is64Bit)) &&
+          "Incorrect bind opcodes size");
+   memcpy(Out, O.Binds.Opcodes.data(), O.Binds.Opcodes.size());
+ }
+@@ -344,7 +357,8 @@
+       O.LoadCommands[*O.DyLdInfoCommandIndex]
+           .MachOLoadCommand.dyld_info_command_data;
+   char *Out = Buf->getBufferStart() + DyLdInfoCommand.weak_bind_off;
+-  assert((DyLdInfoCommand.weak_bind_size == O.WeakBinds.Opcodes.size()) &&
++  assert((DyLdInfoCommand.weak_bind_size ==
++          paddedLinkEditEntrySize(O.WeakBinds.Opcodes.size(), Is64Bit)) &&
+          "Incorrect weak bind opcodes size");
+   memcpy(Out, O.WeakBinds.Opcodes.data(), O.WeakBinds.Opcodes.size());
+ }
+@@ -356,7 +370,8 @@
+       O.LoadCommands[*O.DyLdInfoCommandIndex]
+           .MachOLoadCommand.dyld_info_command_data;
+   char *Out = Buf->getBufferStart() + DyLdInfoCommand.lazy_bind_off;
+-  assert((DyLdInfoCommand.lazy_bind_size == O.LazyBinds.Opcodes.size()) &&
++  assert((DyLdInfoCommand.lazy_bind_size ==
++          paddedLinkEditEntrySize(O.LazyBinds.Opcodes.size(), Is64Bit)) &&
+          "Incorrect lazy bind opcodes size");
+   memcpy(Out, O.LazyBinds.Opcodes.data(), O.LazyBinds.Opcodes.size());
+ }
+@@ -368,7 +383,8 @@
+       O.LoadCommands[*O.DyLdInfoCommandIndex]
+           .MachOLoadCommand.dyld_info_command_data;
+   char *Out = Buf->getBufferStart() + DyLdInfoCommand.export_off;
+-  assert((DyLdInfoCommand.export_size == O.Exports.Trie.size()) &&
++  assert((DyLdInfoCommand.export_size ==
++          paddedLinkEditEntrySize(O.Exports.Trie.size(), Is64Bit)) &&
+          "Incorrect export trie size");
+   memcpy(Out, O.Exports.Trie.data(), O.Exports.Trie.size());
+ }
+@@ -398,7 +414,8 @@
+   const MachO::linkedit_data_command &LinkEditDataCommand =
+       O.LoadCommands[*LCIndex].MachOLoadCommand.linkedit_data_command_data;
+   char *Out = Buf->getBufferStart() + LinkEditDataCommand.dataoff;
+-  assert((LinkEditDataCommand.datasize == LD.Data.size()) &&
++  assert((LinkEditDataCommand.datasize ==
++          paddedLinkEditEntrySize(LD.Data.size(), Is64Bit)) &&
+          "Incorrect data size");
+   memcpy(Out, LD.Data.data(), LD.Data.size());
+ }
+@@ -575,7 +592,8 @@
+       O.LoadCommands[*O.ExportsTrieCommandIndex]
+           .MachOLoadCommand.linkedit_data_command_data;
+   char *Out = Buf->getBufferStart() + ExportsTrieCmd.dataoff;
+-  assert((ExportsTrieCmd.datasize == O.Exports.Trie.size()) &&
++  assert((ExportsTrieCmd.datasize ==
++          paddedLinkEditEntrySize(O.Exports.Trie.size(), Is64Bit)) &&
+          "Incorrect export trie size");
+   memcpy(Out, O.Exports.Trie.data(), O.Exports.Trie.size());
+ }



Home | Main Index | Thread Index | Old Index