[compiler-rt] cmake fails to configure for AArh64

Hi,

I am trying to cross compile LLVM/clang for AArch64 on an X86_64 Linux host using aarch64-linux-gnu-gcc / aarch64-linux-gnu-g++.
Important is that I have compiler-rt checked out to the llvm/projects folder.
“cmake -G ‘Unix Makefiles’ …” is used to configure the build folder.

The problem: cmake fails to configure.
The reason: cmake passes the -m64 option to aarch64-linux-gnu-g++, which the compiler does not need and doesn’t understand as the option is redundant for AArch64.

I tracked down where -m64 was originating from and found the following in compiler-rt/CMakeLists.txt:

if (NOT MSVC)
set(TARGET_64_BIT_CFLAGS “-m64”)
set(TARGET_32_BIT_CFLAGS “-m32”)
else()
set(TARGET_64_BIT_CFLAGS “”)
set(TARGET_32_BIT_CFLAGS “”)
endif()

After the line with -m64 is commented out, cmake can complete the configuration and I am able to cross compile the whole LLVM.

Could you please advise if this is a known problem or anything more appropriate then mere commenting can be done to overcome this?

Thank you.

Kind regards,
Oleg

Hi Oleg,

This option is only relevant to x86/64 platforms, not ARM. The
conditional should also check if the platform is x86.

cheers,
--renato

Thanks Renato!

I'll file a bug then so as not to forget to do this.

Kind regards,
Oleg