Xcode 15 RC Release Notes
Linking
New Features
A new linker has been written to significantly speed up static linking. It’s the default for all macOS, iOS, tvOS and visionOS binaries and anyone using the “Mergeable Libraries” feature. The classic linker can still be explicitly requested using -ld64, and will be removed in a future release.
(108915312)
Known Issues
Binaries using symbols with a weak definition crash at runtime on iOS 14/macOS 12 or older. This impacts primarily C++ projects due to their extensive use of weak symbols. (114813650) (FB13097713)
Workaround: Bump the minimum deployment target to iOS 15, macOS 12, watchOS 8 or tvOS 15, or add -Wl,-ld_classic to the OTHER_LDFLAGS build setting.
Post
Replies
Boosts
Views
Activity
Related issue: https://developer.apple.com/forums/thread/731089
But it fixed in Xcode 15 beta 2, it is a linker issue.
a workground from @jiehaowu: Adding -ld64 to the other linker flag in Xcode's build setting solves this problem
Is it same issue ?
https://developer.apple.com/forums/thread/736572
take a look this issue:
https://developer.apple.com/forums/thread/736970
@eskimo It is an optimization bug ?
App crashes only when launched via Xcode.
And it is ok to use Xcode to attach debugging after the app is launched
It's weird, this code doesn't crash in an empty project, tested in Xcode 15 beta 8 + iOS 13.6
struct St {
};
int main(int argc, char *argv[]) {
@autoreleasepool {
auto ptr = new St;
NSLog(@"%p", ptr);
delete ptr;
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
Same issue: https://developer.apple.com/forums/thread/736203
I hope it is fixed in Xcode 15 final version...
Crash on new and reason is EXC_BAD_ACCESS (code=1, address=0x0)
0x1051d0f7c <+0>: stp x24, x23, [sp, #-0x40]!
0x1051d0f80 <+4>: stp x22, x21, [sp, #0x10]
0x1051d0f84 <+8>: stp x20, x19, [sp, #0x20]
0x1051d0f88 <+12>: stp x29, x30, [sp, #0x30]
0x1051d0f8c <+16>: add x29, sp, #0x30
0x1051d0f90 <+20>: mov w0, #0x18
0x1051d0f94 <+24>: bl 0x105526a18 ; symbol stub for: operator new(unsigned long)
-> 0x1051d0f98 <+28>: mov x19, x0
0x1051d0f9c <+32>: adrp x8, 4697
0x1051d0fa0 <+36>: ldr x0, [x8, #0xe00]
0x1051d0fa4 <+40>: mov x8, x19
0x1051d0fa8 <+44>: bl 0x105209c8c ; WCDB::StringView::makeConstant at StringView.cpp:400
0x1051d0fac <+48>: adrp x20, 4846
0x1051d0fb0 <+52>: str x19, [x20, #0x658]
0x1051d0fb4 <+56>: mov w0, #0x18
0x1051d0fb8 <+60>: bl 0x105526a18 ; symbol stub for: operator new(unsigned long)
0x1051d0fbc <+64>: mov x19, x0
0x1051d0fc0 <+68>: adrp x8, 4697
0x1051d0fc4 <+72>: ldr x0, [x8, #0xe08]
0x1051d0fc8 <+76>: mov x8, x19
0x1051d0fcc <+80>: bl 0x105209c8c ; WCDB::StringView::makeConstant at StringView.cpp:400
0x1051d0fd0 <+84>: adrp x21, 4846
0x1051d0fd4 <+88>: str x19, [x21, #0x660]
0x1051d0fd8 <+92>: mov w0, #0x18
0x1051d0fdc <+96>: bl 0x105526a18 ; symbol stub for: operator new(unsigned long)
0x1051d0fe0 <+100>: mov x19, x0
0x1051d0fe4 <+104>: adrp x8, 4697
0x1051d0fe8 <+108>: ldr x0, [x8, #0xe10]
0x1051d0fec <+112>: mov x8, x19
0x1051d0ff0 <+116>: bl 0x105209c8c ; WCDB::StringView::makeConstant at StringView.cpp:400
0x1051d0ff4 <+120>: adrp x22, 4846
0x1051d0ff8 <+124>: str x19, [x22, #0x668]
0x1051d0ffc <+128>: mov w0, #0x18
0x1051d1000 <+132>: bl 0x105526a18 ; symbol stub for: operator new(unsigned long)
0x1051d1004 <+136>: mov x19, x0
0x1051d1008 <+140>: adrp x8, 4696
0x1051d100c <+144>: ldr x0, [x8, #0xe18]
0x1051d1010 <+148>: mov x8, x19
0x1051d1014 <+152>: bl 0x105209c8c ; WCDB::StringView::makeConstant at StringView.cpp:400
0x1051d1018 <+156>: adrp x23, 4845
0x1051d101c <+160>: str x19, [x23, #0x670]
0x1051d1020 <+164>: mov w0, #0x18
0x1051d1024 <+168>: bl 0x105526a18 ; symbol stub for: operator new(unsigned long)
0x1051d1028 <+172>: mov x19, x0
0x1051d102c <+176>: adrp x8, 4696
0x1051d1030 <+180>: ldr x0, [x8, #0xe20]
0x1051d1034 <+184>: mov x8, x19
0x1051d1038 <+188>: bl 0x105209c8c ; WCDB::StringView::makeConstant at StringView.cpp:400
0x1051d103c <+192>: adrp x8, 4845
0x1051d1040 <+196>: str x19, [x8, #0x678]
0x1051d1044 <+200>: ldr x8, [x20, #0x658]
0x1051d1048 <+204>: adrp x9, 4845
0x1051d104c <+208>: str x8, [x9, #0x680]
0x1051d1050 <+212>: ldr x8, [x21, #0x660]
0x1051d1054 <+216>: adrp x9, 4845
0x1051d1058 <+220>: str x8, [x9, #0x688]
0x1051d105c <+224>: ldr x8, [x22, #0x668]
0x1051d1060 <+228>: adrp x9, 4845
0x1051d1064 <+232>: str x8, [x9, #0x690]
0x1051d1068 <+236>: ldr x8, [x23, #0x670]
0x1051d106c <+240>: adrp x9, 4845
0x1051d1070 <+244>: str x8, [x9, #0x698]
0x1051d1074 <+248>: adrp x8, 4845
0x1051d1078 <+252>: str x19, [x8, #0x6a0]
0x1051d107c <+256>: ldp x29, x30, [sp, #0x30]
0x1051d1080 <+260>: ldp x20, x19, [sp, #0x20]
0x1051d1084 <+264>: ldp x22, x21, [sp, #0x10]
0x1051d1088 <+268>: ldp x24, x23, [sp], #0x40
0x1051d108c <+272>: ret
It works well when I back to Xcode 14.2
So sad, Xcode 14 RC has same issue.
I hope It can be fixed in Xcode 14 final version.