[all-commits] [llvm/llvm-project] 8887c6: Adapt "cross compile?" check for Apple Silicon

Julian Lettner via All-commits all-commits at lists.llvm.org
Wed Apr 13 15:26:28 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8887c63e327fb726b502b3b2fad44e50de60d5aa
  Author: Julian Lettner <julian.lettner at apple.com>
  Date:   2022-04-13 (Wed, 13 Apr 2022)

  Changed paths:
    M compiler-rt/cmake/config-ix.cmake

  Log Message:
  Adapt "cross compile?" check for Apple Silicon

This piece of code tries to implement the semantics "cross compile?" to
determine CFLAGS used for test binary compilation.
if(ANDROID OR ${arch} MATCHES "arm|aarch64|riscv32|riscv64")

Since Apple Silicon, macOS runs on arm64e, so we take the wrong branch
when compiling and running tests locally "on the host" on an AS machine.

Furthermore, for Apple code, we use the separate
`get_test_cflags_for_apple_platform` function to determine these test
compiliation flags and `get_test_cc_for_arch` is only ever used in the
"compile & run on host" case, so we can short-curcuit the "cross
compile?" check here.


Differential Revision: https://reviews.llvm.org/D123633

More information about the All-commits mailing list