Skip to content

Building on M1 Mac #50

@thomaslima

Description

@thomaslima

Hi @Kazzz-S ,

I wonder if I could borrow your advice for an issue I have building Mac images on my MacBook (M1). I followed these steps:

  • I installed qt@5, ruby@3.2, and python@3.9 from homebrew
  • I ran ./macbuild/python3HB.py -v 3.9
  • I added the QMAKE_CXXFLAGS += -fdeclspec line to klayout.pri (for some reason your script didn't patch automatically.
  • Then I ran the following script:
#!/bin/bash
set -e

export QMAKE_CCACHE=1

# run ./macbuild/python3HB.py -v 3.9

./build4mac.py -p HB39 -r HB32 -q Qt5Brew
./build4mac.py -p HB39 -r HB32 -q Qt5Brew -y
  • This produced HW-qt5Brew.pkg.macos-Ventura-release-Rhb32Phb39/klayout.app. When I tried to open it, it crashed with the following log dump. Am I doing something wrong? I feel like I forgot some step.

Do you have any idea of what's going on?

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               klayout [4163]
Path:                  /Users/USER/*/klayout.app/Contents/MacOS/klayout
Identifier:            de.klayout
Version:               0.28.5 (0.28.5)
Code Type:             ARM-64 (Native)
Parent Process:        launchd [1]
User ID:               8803

Date/Time:             2023-02-16 10:21:42.0242 -0500
OS Version:            macOS 13.0.1 (22A400)
Report Version:        12
Anonymous UUID:        D2931AAD-F46B-72AF-9649-1D8A6B9062D6

Sleep/Wake UUID:       F9256465-18A2-45BA-B26C-EF90F5F8420B

Time Awake Since Boot: 660000 seconds
Time Since Wake:       4203 seconds

System Integrity Protection: enabled

Crashed Thread:        0

Exception Type:        EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))
Exception Codes:       UNKNOWN_0x32 at 0x0000000100b6c000
Exception Codes:       0x0000000000000032, 0x0000000100b6c000

Termination Reason:    Namespace CODESIGNING, Code 2 Invalid Page

VM Region Info: 0x100b6c000 is in 0x100b6c000-0x101044000;  bytes after start: 0  bytes before end: 5079039
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      mapped file                 100b04000-100b6c000    [  416K] r--/rwx SM=COW  ...t_id=9abb3401
--->  mapped file                 100b6c000-101044000    [ 4960K] r--/rwx SM=COW  ...t_id=99848d01
      GAP OF 0x6a9d4000 BYTES
      Stack Guard                 16ba18000-16f21c000    [ 56.0M] ---/rwx SM=NUL  

Thread 0 Crashed:
0   dyld                          	       0x18bcee3b0 dyld3::MachOFile::hasMachOMagic() const + 0
1   dyld                          	       0x18bcc56c4 dyld4::SyscallDelegate::mapFileReadOnly(Diagnostics&, char const*, unsigned long*, dyld4::FileID*, bool*, char*) const + 228
2   dyld                          	       0x18bcc5028 dyld4::SyscallDelegate::withReadOnlyMappedFile(Diagnostics&, char const*, bool, void (void const*, unsigned long, bool, dyld4::FileID const&, char const*) block_pointer) const + 88
3   dyld                          	       0x18bcbe184 dyld4::JustInTimeLoader::makeJustInTimeLoaderDisk(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, bool, unsigned int, mach_o::Layout const*) + 208
4   dyld                          	       0x18bcb510c invocation function for block in dyld4::Loader::getLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&) + 1260
5   dyld                          	       0x18bcb43b4 dyld4::Loader::forEachResolvedAtPathVar(dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, dyld4::ProcessConfig::PathOverrides::Type, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer) + 184
6   dyld                          	       0x18bca29b4 dyld4::ProcessConfig::PathOverrides::forEachPathVariant(char const*, dyld3::Platform, bool, bool, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer) const + 688
7   dyld                          	       0x18bcb413c dyld4::Loader::forEachPath(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer) + 248
8   dyld                          	       0x18bcb488c dyld4::Loader::getLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&) + 584
9   dyld                          	       0x18bcbc174 invocation function for block in dyld4::JustInTimeLoader::loadDependents(Diagnostics&, dyld4::RuntimeState&, dyld4::Loader::LoadOptions const&) + 408
10  dyld                          	       0x18bceeb64 invocation function for block in dyld3::MachOFile::forEachDependentDylib(void (char const*, bool, bool, bool, unsigned int, unsigned int, bool&) block_pointer) const + 148
11  dyld                          	       0x18bc9c2d8 dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const + 296
12  dyld                          	       0x18bcee9ac dyld3::MachOFile::forEachDependentDylib(void (char const*, bool, bool, bool, unsigned int, unsigned int, bool&) block_pointer) const + 172
13  dyld                          	       0x18bcbbec0 dyld4::JustInTimeLoader::loadDependents(Diagnostics&, dyld4::RuntimeState&, dyld4::Loader::LoadOptions const&) + 164
14  dyld                          	       0x18bca0500 dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 1236
15  dyld                          	       0x18bc9fdc4 start + 2404


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000100b6c000   x1: 0x0000000000000000   x2: 0x000000016fa15af8   x3: 0x0000000000040002
    x4: 0x0000000000000003   x5: 0x0000000000000000   x6: 0x000000016fa15af8   x7: 0x0000000000000b30
    x8: 0x000000016fa15990   x9: 0x000000016fa15998  x10: 0x000000000100000f  x11: 0x0000000000000001
   x12: 0x000000016fa16122  x13: 0x0000000000000000  x14: 0x0000000226f8bd2a  x15: 0x0000000000008000
   x16: 0x000000000000005c  x17: 0x000000018bc9de7c  x18: 0x0000000000000000  x19: 0x000000016fa16020
   x20: 0x0000000000000003  x21: 0x000000016fa15acf  x22: 0x0000000100b6c000  x23: 0x000000016fa15af8
   x24: 0x000000016fa15ad0  x25: 0x000000016fa15af0  x26: 0x000000016fa15f90  x27: 0x0000000000000000
   x28: 0x0000000000000000   fp: 0x000000016fa15ab0   lr: 0x000000018bcc56c4
    sp: 0x000000016fa15990   pc: 0x000000018bcee3b0 cpsr: 0x80001000
   far: 0x0000000100b6c000  esr: 0x92000007 (Data Abort) byte read Translation fault

Binary Images:
       0x18bc9a000 -        0x18bd244bf dyld (*) <de46dd52-4994-3fd8-b4b4-e352a1a19354> /usr/lib/dyld
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=763.0M resident=0K(0%) swapped_out_or_unallocated=763.0M(100%)
Writable regions: Total=8832K written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=8832K(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
STACK GUARD                       56.0M        1 
Stack                             8176K        1 
VM_ALLOCATE (reserved)             144K        1         reserved VM address space (unallocated)
__DATA                              27K        2 
__DATA_CONST                        38K        2 
__DATA_DIRTY                         7K        1 
__LINKEDIT                       762.4M        2 
__TEXT                             636K        2 
dyld private memory                512K        2 
mapped file                       8416K        4 
===========                     =======  ======= 
TOTAL                            836.0M       18 
TOTAL, minus reserved VM space   835.8M       18 


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions