I compile a go application which uses sqlite and treesitter native libraries. It all works fine on other platforms but the arm64 binaries for the new Macs gets immediately killed. The x86 darwin version works fine on the arm Mac.
I somewhere read that static binaries do not work on on the arm Macs.
Is there some specific option I have to set to get this working?
ipsw macho info mzbinary-darwin-arm64
Magic = 64-bit MachO
Type = EXECUTE
CPU = AARCH64, ARM64
Commands = 25 (Size: 3616)
Flags = NoUndefs, DyldLink, TwoLevel, WeakDefines, BindsToWeak, PIE
000: LC_SEGMENT_64 sz=0x00000000 off=0x00000000-0x00000000 addr=0x000000000-0x100000000 ---/--- __PAGEZERO
001: LC_SEGMENT_64 sz=0x0112c000 off=0x00000000-0x0112c000 addr=0x100000000-0x10112c000 r-x/r-x __TEXT
sz=0x00abe478 off=0x00003b10-0x00ac1f88 addr=0x100003b10-0x100ac1f88 __TEXT.__text PureInstructions|SomeInstructions
sz=0x00000a68 off=0x00ac1f88-0x00ac29f0 addr=0x100ac1f88-0x100ac29f0 __TEXT.__stubs PureInstructions|SomeInstructions (SymbolStubs)
sz=0x00000a68 off=0x00ac29f0-0x00ac3458 addr=0x100ac29f0-0x100ac3458 __TEXT.__stub_helper PureInstructions|SomeInstructions
sz=0x004a1438 off=0x00ac3460-0x00f64898 addr=0x100ac3460-0x100f64898 __TEXT.__rodata
sz=0x00000078 off=0x00f64898-0x00f64910 addr=0x100f64898-0x100f64910 __TEXT.__objc_methname
(CstringLiterals)
sz=0x001b9678 off=0x00f64910-0x0111df88 addr=0x100f64910-0x10111df88 __TEXT.__const
sz=0x0000c50a off=0x0111df88-0x0112a492 addr=0x10111df88-0x10112a492 __TEXT.__cstring
(CstringLiterals)
sz=0x00000470 off=0x0112a494-0x0112a904 addr=0x10112a494-0x10112a904 __TEXT.__gcc_except_tab
sz=0x00001628 off=0x0112a904-0x0112bf2c addr=0x10112a904-0x10112bf2c __TEXT.__unwind_info
sz=0x000000b4 off=0x0112bf30-0x0112bfe4 addr=0x10112bf30-0x10112bfe4 __TEXT.__eh_frame
002: LC_SEGMENT_64 sz=0x009c4000 off=0x0112c000-0x01af0000 addr=0x10112c000-0x101af0000 rw-/rw- __DATA_CONST ReadOnly
sz=0x00000058 off=0x0112c000-0x0112c058 addr=0x10112c000-0x10112c058 __DATA_CONST.__got
(NonLazySymbolPointers)
sz=0x00000008 off=0x0112c058-0x0112c060 addr=0x10112c058-0x10112c060 __DATA_CONST.__mod_init_func
(ModInitFuncPointers)
sz=0x00005910 off=0x0112c060-0x01131970 addr=0x10112c060-0x101131970 __DATA_CONST.__const
sz=0x00000008 off=0x01131970-0x01131978 addr=0x101131970-0x101131978 __DATA_CONST.__objc_imageinfo
sz=0x0052e230 off=0x01131980-0x0165fbb0 addr=0x101131980-0x10165fbb0 __DATA_CONST.__rodata
sz=0x000049a4 off=0x0165fbc0-0x01664564 addr=0x10165fbc0-0x101664564 __DATA_CONST.__typelink
sz=0x00001898 off=0x01664580-0x01665e18 addr=0x101664580-0x101665e18 __DATA_CONST.__itablink
sz=0x00000000 off=0x01665e18-0x01665e18 addr=0x101665e18-0x101665e18 __DATA_CONST.__gosymtab
sz=0x00489590 off=0x01665e20-0x01aef3b0 addr=0x101665e20-0x101aef3b0 __DATA_CONST.__gopclntab
003: LC_SEGMENT_64 sz=0x00160000 off=0x01af0000-0x01c50000 addr=0x101af0000-0x101c9c000 rw-/rw- __DATA
sz=0x000006f0 off=0x01af0000-0x01af06f0 addr=0x101af0000-0x101af06f0 __DATA.__la_symbol_ptr
(LazySymbolPointers)
sz=0x00000040 off=0x01af06f0-0x01af0730 addr=0x101af06f0-0x101af0730 __DATA.__objc_selrefs NoDeadStrip (LiteralPointers)
sz=0x00000010 off=0x01af0730-0x01af0740 addr=0x101af0730-0x101af0740 __DATA.__objc_classrefs NoDeadStrip
sz=0x00001260 off=0x01af0740-0x01af19a0 addr=0x101af0740-0x101af19a0 __DATA.__go_buildinfo
sz=0x00099ba0 off=0x01af19a0-0x01b8b540 addr=0x101af19a0-0x101b8b540 __DATA.__noptrdata
sz=0x000c13f8 off=0x01b8b540-0x01c4c938 addr=0x101b8b540-0x101c4c938 __DATA.__data
sz=0x0003d3e0 off=0x00000000-0x0003d3e0 addr=0x101c4c940-0x101c89d20 __DATA.__bss
(Zerofill)
sz=0x0000e870 off=0x00000000-0x0000e870 addr=0x101c89d20-0x101c98590 __DATA.__noptrbss
(Zerofill)
sz=0x00000020 off=0x00000000-0x00000020 addr=0x101c98590-0x101c985b0 __DATA.__common
(Zerofill)
004: LC_SEGMENT_64 sz=0x00201e92 off=0x01c50000-0x01e51e92 addr=0x101c9c000-0x101e9de92 r--/r-- __LINKEDIT
005: LC_DYLD_INFO_ONLY
Rebase info: 54752 bytes at offset: 0x01C50000 -> 0x01C5D5E0
Bind info: 712 bytes at offset: 0x01C5D5E0 -> 0x01C5D8A8
Weak info: 72 bytes at offset: 0x01C5D8A8 -> 0x01C5D8F0
Lazy info: 4656 bytes at offset: 0x01C5D8F0 -> 0x01C5EB20
Export info: 14968 bytes at offset: 0x01C5EB20 -> 0x01C62598
006: LC_SYMTAB Symbol offset=0x01C6BC98, Num Syms: 29509, String offset=0x01CDF808-0x01E10718
007: LC_DYSYMTAB
Local Syms: 28568 at 0
External Syms: 705 at 28568
Undefined Syms: 236 at 29273
TOC: No
Modtab: No
External symtab Entries: None
Indirect symtab Entries: 455 at 0x01cdf0e8
External Reloc Entries: None
Local Reloc Entries: None
008: LC_LOAD_DYLINKER /usr/lib/dyld
009: LC_UUID F488848D-1E55-3D09-8B69-7659721A80AF
010: LC_BUILD_VERSION Platform: macOS, SDK: 11.3.0, Tool: ld (609.0.0)
011: LC_SOURCE_VERSION 0.0.0.0.0
012: LC_MAIN Entry Point: 0x000000000006f400, Stack Size: 0x0
013: LC_LOAD_DYLIB /usr/lib/libc++.1.dylib (905.6.0)
014: LC_LOAD_DYLIB /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (1775.118.101)
015: LC_LOAD_DYLIB /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (23.0.0)
016: LC_LOAD_DYLIB /usr/lib/libobjc.A.dylib (228.0.0)
017: LC_LOAD_DYLIB /usr/lib/libresolv.9.dylib (1.0.0)
018: LC_LOAD_DYLIB /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (1775.118.101)
019: LC_LOAD_DYLIB /System/Library/Frameworks/Security.framework/Versions/A/Security (59754.100.106)
020: LC_LOAD_DYLIB /usr/lib/libSystem.B.dylib (1292.100.5)
021: LC_LOAD_DYLIB /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (2022.44.149)
022: LC_FUNCTION_STARTS offset=0x01c62598-0x01c6bc98 size=38656
023: LC_DATA_IN_CODE offset=0x01c6bc98-0x01c6bc98 size= 0 entries=0
024: LC_CODE_SIGNATURE offset=0x01e10720-0x01e51e92 size=268146