Issue 63793
Summary Attempting to cross-compile libclang_rt.profile.a with -DCOMPILER_RT_BUILD_PROFILE=ON generates native object files
Labels
Assignees
Reporter ian-collins-ctct
    Hello,

I have been building and using an ARM cross of the builtins for a while and I wanted to try profile guides optimisation on the target.

I changed my cmake rune to use `-DCOMPILER_RT_BUILD_PROFILE=ON` (previously OFF) and it appears to build but my test application built fails with

`ld.lld: error: /usr/lib/llvm-16/lib/clang/16/lib/armv7a-r2-linux-gnueabihf/libclang_rt.profile.a(InstrProfilingRuntime.cpp.o) is incompatible with elf32-littlearm`

Checking what was generated for ninja:

`$ ninja -t commands | grep InstrProfilingRuntime.cpp.o`
`/usr/bin/clang++-16 -I/build/compiler-rt/lib/profile/.. -I/build/compiler-rt/lib/profile/../../include -Wall -Wno-unused-parameter -O3 -DNDEBUG -fno-lto -fPIC -Wno-pedantic -DCOMPILER_RT_HAS_ATOMICS=1 -DCOMPILER_RT_HAS_FCNTL_LCK=1 -DCOMPILER_RT_HAS_UNAME=1 -nostdinc++ -std=c++17 -MD -MT lib/profile/CMakeFiles/clang_rt.profile-armhf.dir/InstrProfilingRuntime.cpp.o -MF lib/profile/CMakeFiles/clang_rt.profile-armhf.dir/InstrProfilingRuntime.cpp.o.d -o lib/profile/CMakeFiles/clang_rt.profile-armhf.dir/InstrProfilingRuntime.cpp.o -c /build/compiler-rt/lib/profile/InstrProfilingRuntime.cpp` 

Note the lack of the expected --target option.

I am currently building on tag llvmorg-16.0.6.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to