mirror of
https://github.com/lemonade-sdk/mac_linuxgpu.git
synced 2026-11-22 23:57:31 -10:00
The driver's own KMD (upstream amdgpu, KFD, TTM, DRM and the linuxu shims) compiled with no optimization level: clang's -O0, apart from five objects whose BUILD_BUG_ONs need folding. Every register access, fence, interrupt and copy path ran unoptimized. Both the DriverKit library and the host builds the offline tests link now use the flags Linux builds that code with (CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE, CONFIG_FRAME_POINTER as arm64 has it): -O2 -fno-strict-aliasing -fno-strict-overflow -fno-delete-null-pointer-checks -fno-common, frame pointers kept for crash logs. -funsigned-char stays out: it changes char semantics, not code generation, from what Apple's signed-char ABI has always run. The DriverKit objects also turn off the printf-family and string-copy builtins: at -O2 clang rewrites such calls into others (sprintf, strcpy, strncpy, vsnprintf, fwrite) that the DriverKit runtime does not export. The library's external references are then a subset of the -O0 build's. The offline suite passes as before; three tests fail with and without this change alike (rg is not installed here, and two sanitizer findings in test-only code: test-debugfs-lifecycle, test-kmem-cache-lifecycle, test-upstream-pci-failure).