perf: fix build errors on x86 and other platforms