@@ -566,16 +566,28 @@ void FlangFrontend::ConstructJob(Compilation &C, const JobAction &JA,
566566 UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __linux__" );
567567 UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __NO_MATH_INLINES" );
568568 UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __LP64__" );
569- UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __x86_64" );
570- UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __x86_64__" );
571569 UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __LONG_MAX__=9223372036854775807L" );
572570 UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __SIZE_TYPE__=unsigned long int" );
573571 UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __PTRDIFF_TYPE__=long int" );
572+ switch (getToolChain ().getEffectiveTriple ().getArch ()) {
573+ case llvm::Triple::aarch64:
574+ UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __aarch64" );
575+ UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __aarch64__" );
576+ UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __ARM_ARCH=8" );
577+ UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __ARM_ARCH__=8" );
578+ break ;
579+ case llvm::Triple::x86_64:
580+ UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __x86_64" );
581+ UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __x86_64__" );
582+ UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __amd_64__amd64__" );
583+ UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __k8" );
584+ UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __k8__" );
585+ break ;
586+ default : /* generic 64-bit */
587+ ;
588+ }
574589 UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __THROW=" );
575590 UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __extension__=" );
576- UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __amd_64__amd64__" );
577- UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __k8" );
578- UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __k8__" );
579591 UpperCmdArgs.push_back (" -def" ); UpperCmdArgs.push_back (" __PGLLVM__" );
580592
581593 // Enable preprocessor
0 commit comments