I'm trying to make my app compatible with iOS 14 (Xcode 12.3). The build failed on linking stage with following error:
ld: linking module flags 'Dwarf Version': IDs have conflicting behaviors in 'xxx.o' and 'ld-temp.o'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've searched solutions below. The solution is to turn off Link-Time Optimization or change Link-Time Optimization from Monolithic to Incremental.
https://stackoverflow.com/questions/39125409/xcode-8-beta-6-conflicting-values-for-architecture
https://github.com/facebook/facebook-ios-sdk/issues/1560
I tried to change Link-Time Optimization from Monolithic to Incremental and it resolves my issue. So my question is:
- anyone know how to debug the root cause of this kind of linking conflict issue?
- why this linking conflict issue happens when building with iOS 14 but not in previous version?
- is changing LTO the only solution?