Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 9c039ae5a29eaaeb140385abba4186169b541310b3f6fb3ce4ec4d1922fac028
Ticket: 6fbabfe1661c22e7990bb917e9fa49cc16e016ea
Tkinter: Cannot find a usable init.tcl with recent core-9-0-branch
User & Date: marc_culler on 2025-10-01 13:25:23
Changes

  1. icomment:
    I believe that the issue with the zipfs build on macOS is related to two
    things: code signatures and the structure of a mach-O binary.
    
    The code signature is required to be at the end of a thin mach-O binary
    and at the end of each arch segment in a fat binary.  Code signatures are
    required for arm64 CPUs and an ad-hoc signature is added automatically by
    the Apple linker on ARM systems.
    
    The gatekeeper checks whether some or all mach-O load commands have the
    size which is reported in the mach-O header, meaning in particular that
    the last load command must extend to the end of the file, but also that
    the zipfile cannot be attached to the end of another load command unless
    the header is adjusted accordingly.  The last load command is the code
    signature, so a zipfile cannot be added after the signature.  Also,
    adding a zipfile destroys the signature, so the file must be re-signed
    after adding the zipfile.  This requires that the codesign program be
    able to find the correct place to add the signature, for which it can
    only use the mach-O header.
    
    We had a workaround which worked for a while on Intel only.  That involved
    adding a new fake arch segment as the last arch in the dylib.  I don't
    think that ever worked on ARM systems, and I think it stopped working on
    Intel, possibly due to changes to the gatekeeper. Adding a new arch segment
    to a thin mach-O binary requires adding a a fat header while adding a new
    arch to a fat binary requires rewriting and expanding the fat header.  I
    suspect that the workaround may not ever have worked correctly in all of
    those cases.  I would have to check the macher code to refresh my memory.
    
  2. login: "marc_culler"
  3. mimetype: "text/plain"
  4. username: "Marc Culler"