HomeFreeBSD

Fix paths for cross-built versions of lib/libclang_rt and hardfloat arm variants

Description

Fix paths for cross-built versions of lib/libclang_rt and hardfloat arm variants

  • Define TARGET_CPUARCH and use in libclang_rt as the basis for CRTARCH

    When cross-compiling, the wrong architecture was being embedded in the libclang_rt binary filenames. It should be based on TARGET_ARCH (target), not MACHINE_ARCH (host).

    If TARGET_ARCH isn't defined (host-builds), fallback to MACHINE_ARCH.
  • Define CRTARCH to armhf when TARGET/TARGET_ARCH are set to arm/armv[67]

    TARGET_ABI/TARGET_CPU in Makefile.inc1 sets the ABI to gnueabihf, which affects the clang lookup path per getArchNameForCompilerRTLib(..) in contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp, so chase clang and Linux's assumed naming convention for hard-float arm architectures.

    CROSSENV (in Makefile.inc1) sets CPUTYPE/MACHINE(_ARCH)? to the TARGET*-relevant values when building the libraries target, so test those variables instead.
  • Add OLD_FILES/OLD_LIBS entries for TARGET/TARGET_ARCH == arm/armv[67]. This impacts only arm/armv6 and arm/armv7.

PR: 222925

Details