1*c54f35caSApple OSS Distributions #include <spawn.h> 2*c54f35caSApple OSS Distributions /* 3*c54f35caSApple OSS Distributions * Returns the subcpu type for the architecture for which the 4*c54f35caSApple OSS Distributions * binary was compiled. 5*c54f35caSApple OSS Distributions */ 6*c54f35caSApple OSS Distributions int main(void)7*c54f35caSApple OSS Distributionsmain(void) 8*c54f35caSApple OSS Distributions { 9*c54f35caSApple OSS Distributions #if defined(__x86_64__) 10*c54f35caSApple OSS Distributions return CPU_SUBTYPE_X86_64_ALL; 11*c54f35caSApple OSS Distributions #elif __arm64e__ 12*c54f35caSApple OSS Distributions return CPU_SUBTYPE_ARM64E; 13*c54f35caSApple OSS Distributions #elif defined(__arm64__) && defined(__LP64__) 14*c54f35caSApple OSS Distributions return CPU_SUBTYPE_ARM64_ALL; 15*c54f35caSApple OSS Distributions #elif defined(__arm64__) 16*c54f35caSApple OSS Distributions return CPU_SUBTYPE_ARM64_32_ALL; 17*c54f35caSApple OSS Distributions #else 18*c54f35caSApple OSS Distributions #error unknown architecture 19*c54f35caSApple OSS Distributions #endif 20*c54f35caSApple OSS Distributions } 21