How to avoid building builtin files with '-m32' during building LLVM?

Hi, I got an error when I specified gcc8.3 toolchain to build LLVM13. Here is my host environment:
Debian9
gcc6.3
Manully built toolchain: gcc8.3

Since your default target will be 64 bit I think you can set
COMPILER_RT_DEFAULT_TARGET_ONLY and it will just build 64 bit. If you
look for that option name in compiler-rt/cmake/base-config-ix.cmake
you'll see a check for it, then if it's not set it checks flags for
both 64 and 32 bit, which is what leads to trying to build both.

if(COMPILER_RT_DEFAULT_TARGET_ONLY)
  add_default_target_arch(${COMPILER_RT_DEFAULT_TARGET_ARCH})
elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "i[2-6]86|x86|amd64")
  if(NOT MSVC)
    test_target_arch(x86_64 "" "-m64")
    test_target_arch(i386 __i386__ "-m32")

I have not tested it myself but maybe that helps.

From: PoYao Chang <rzhboyao@gmail.com>

Subject: Re: [llvm-dev] How can I build LLVM with my gcc toolchain exactly

Date: November 24, 2021 at 1:06:21 AM GMT+8

To: llvm-dev@lists.llvm.org

Give “-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON” a try.

https://lists.llvm.org/pipermail/llvm-dev/2021-November/153909.html

Have you tried it as I told you a week ago.

Though that might not work if you expect to get builtins for all the
llvm architectures you listed. Good chance it'll just build one but at
least you know where in the cmake the 64+32 decision is made and you
can dig from there.

Thanks for your reply. It does work!

Thanks for your reply. It does work!

From: PoYao Chang <rzhboyao@gmail.com>

Subject: Re: [llvm-dev] How can I build LLVM with my gcc toolchain exactly

Date: November 24, 2021 at 1:06:21 AM GMT+8

To: llvm-dev@lists.llvm.org

Give “-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON” a try.

https://lists.llvm.org/pipermail/llvm-dev/2021-November/153909.html

Have you tried it as I told you a week ago.