常用开发工具🛠IOS开发IOS性能优化

objc4-841.13可调试/编译源码更新

2022-06-20  本文已影响0人  erlich

心心念念查看了下objc4源码 https://opensource.apple.com/releases/ ,果然更新了,果断编译调试

如果想最省时省力,直接 github 下载可编译源码

下面开始配置可编译环境(本次配置为M1)

首先确保下载到841.13源码

首先编译target objc

  1. unable to find sdk 'macosx.internal'
image.png
  1. 'sys/reson.h' file not found
image.png
image.png
image.png
  1. 'mach-o/dyld_priv.h' file not found
image.png
image.png
  1. 'os/lock_private.h' file not found
image.png
image.png
  1. extern dyld_platform_t dyld_get_active_platform(void) __API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0), bridgeos(3.0)); ---- 报错 Expected ','
image.png
  1. 批量同5
image.png
  1. 'os/base_private.h' file not found
image.png
image.png
  1. 'pthread/tsd_private.h' file not found
  1. 'System/machine/cpu_capabilities.h' file not found
  1. 'os/feature_private.h' file not found
  1. 'os/variant_private.h' file not found
  1. 'os/tsd.h' file not found
  1. 'pthread/spinlock_private.h' file not found
  1. 'System/pthread_machdep.h' file not found
  1. bridgeos(4.0) 问题
image.png
  1. 'CrashReporterClient.h' file not found
  1. Typedef redefinition with different types ('int' vs 'volatile OSSpinLock' (aka 'volatile int'))
image.png
image.png
image.png
  1. Use of undeclared identifier 'dyld_platform_version_macOS_10_13'
image.png
image.png
  1. 'os/bsd.h' file not found
  1. 'os/reason_private.h' file not found
  1. 'objc-shared-cache.h' file not found
  1. 'os/linker_set.h' file not found
  1. '_simple.h' file not found
  1. dyld_program_sdk_at_least(dyld_fall_2020_os_versions)
image.png
image.png
  1. Use of undeclared identifier 'objc4'
  1. Use of undeclared identifier 'CRGetCrashLogMessage'
image.png
image.png
  1. 'Cambria/Traps.h Cambria/Cambria.h' file not found
  1. 'kern/restartable.h' file not found
  1. Use of undeclared identifier 'oah_is_current_process_translated'
image.png
image.png
  1. Block_private.h
  1. Use of undeclared identifier 'os_parse_boot_arg_string'
image.png
  1. Use of undeclared identifier 'dyld_platform_version_macOS_10_11'
image.png
image.png
  1. Use of undeclared identifier 'dyld_fall_2018_os_versions'
image.png
  1. Use of undeclared identifier 'dyld_platform_version_macOS_10_12'
image.png
image.png
  1. '_static_assert' declared as an array with a negative size
image.png

dyld_priv.h 文件顶部加入宏

#define DYLD_MACOSX_VERSION_10_11 0x000A0B00
#define DYLD_MACOSX_VERSION_10_12 0x000A0C00
#define DYLD_MACOSX_VERSION_10_13 0x000A0D00
#define DYLD_MACOSX_VERSION_10_14 0x000A0E00

CrashReporterClient异常

image.png

配置脚本

image.png image.png

ld -loah报错

image.png image.png image.png

objc编译成功

image.png

接下来objc进行编译调试

编译调试target

image.png

进入源码 alloc

坚持到这一步,M1 objc调试环境OK,就恭喜了

上一篇下一篇

猜你喜欢

热点阅读