This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt] Fix invalid triple on ARM build
AbandonedPublic

Authored by luporl on Jan 30 2023, 9:00 AM.

Details

Summary

The fuzzer build was failing on armv7l, with an invalid triple
error. This happened because CMake's get_compiler_rt_target
function was missing some code to correctly handle arm archs,
such as armhf.

The cmake command that caused the build failure was:

cmake --fresh -S "$PWD/llvm/" -B "$PWD/build/" -G Ninja \
  -DCMAKE_INSTALL_PREFIX="$PWD/install" \
  -DCMAKE_BUILD_TYPE=Release \
  -DLLVM_ENABLE_PROJECTS="clang;lld;lldb;clang-tools-extra;polly" \
  -DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" \
  -DLLVM_TOOLCHAIN_TOOLS="llvm-ar;llvm-ranlib;llvm-objdump;\
llvm-rc;llvm-cvtres;llvm-nm;llvm-strings;llvm-readobj;\
llvm-dlltool;llvm-pdbutil;llvm-objcopy;llvm-strip;llvm-cov;\
llvm-profdata;llvm-addr2line;llvm-symbolizer;llvm-windres;llvm-ml;\
llvm-readelf;llvm-size" \
  -DLLVM_INSTALL_BINUTILS_SYMLINKS=OFF -DLLVM_PARALLEL_LINK_JOBS=1

The fix was extracted from D140011.

Diff Detail

Event Timeline

luporl created this revision.Jan 30 2023, 9:00 AM
luporl requested review of this revision.Jan 30 2023, 9:00 AM

Can we land D140011 instead?

Can we land D140011 instead?

Will do.

Done. This is not needed on main now, we'll cherry pick this portion to 16 as needed.

luporl abandoned this revision.Jan 31 2023, 5:44 AM

Abandoned in favor of D140011.