Thanks for your answer. I additionaly checked the binaries produced on i386 (the binary produced with -integrated-as is identical to the one produced with no additional options but different from the one produces with -no-integrated-as). I also found that on aarch64, GNU as is not installed at all (I falsely assumed it would be there because the corresponding man page is there). This confirms what you are saying.

Regards
Stanislav

On Mi, 1 Mär 2023 14:20:34 -0000 (UTC)
 Stuart Henderson <[email protected]> wrote:
On 2023-03-01, Stanislav Syekirin <[email protected]> wrote:
Hi,

clang can use its integrated assembler or some other assembler (GNU as, I presume). How do I find out which one is used by default? The man page only says: "Whether the integrated assembler is on by default is target dependent". My platforms are aarch64 and i386, if it helps.

AFAIK the OpenBSD architectures which use clang to compile the main
OS are all also using the integrated assembler. (Not sure if sparc64
does but in that case, while LLVM/clang are built, they aren't yet
used to build the OS).

I'm not sure if it's documented anywhere, I didn't find it.
But llvm/lib/MC/MCAsmInfo.cpp has this comment

 // - Solaris always enables the integrated assembler by default
 //   - SparcELFMCAsmInfo and X86ELFMCAsmInfo are handling this case
 // - Windows always enables the integrated assembler by default
// - MCAsmInfoCOFF is handling this case, should it be MCAsmInfoMicrosoft? // - MachO targets always enables the integrated assembler by default
 //   - MCAsmInfoDarwin is handling this case
// - Generic_GCC toolchains enable the integrated assembler on a per
 //   architecture basis.
// - The target subclasses for AArch64, ARM, and X86 handle these cases

and clang/lib/Driver/ToolChains/Gnu.cpp has

bool Generic_GCC::IsIntegratedAssemblerDefault() const {
 switch (getTriple().getArch()) {
 case llvm::Triple::x86:
 case llvm::Triple::x86_64:
 case llvm::Triple::aarch64:
 case llvm::Triple::aarch64_be:
 case llvm::Triple::arm:
 case llvm::Triple::armeb:
 case llvm::Triple::avr:
 case llvm::Triple::bpfel:
 case llvm::Triple::bpfeb:
 case llvm::Triple::thumb:
 case llvm::Triple::thumbeb:
 case llvm::Triple::ppc:
 case llvm::Triple::ppcle:
 case llvm::Triple::ppc64:
 case llvm::Triple::ppc64le:
 case llvm::Triple::riscv32:
 case llvm::Triple::riscv64:
 case llvm::Triple::systemz:
 case llvm::Triple::mips:
 case llvm::Triple::mipsel:
 case llvm::Triple::mips64:
 case llvm::Triple::mips64el:
 case llvm::Triple::msp430:
 case llvm::Triple::m68k:
   return true;
 case llvm::Triple::sparc:
 case llvm::Triple::sparcel:
 case llvm::Triple::sparcv9:
   if (getTriple().isOSFreeBSD() ||
       getTriple().isOSSolaris())
     return true;
   return false;
 default:
   return false;
 }
}


--
Please keep replies on the mailing list.


Reply via email to