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