Cross compiling with cmake-rs

I am compiling a C++ lib using cmake-rs and clang in order to link it with Rust. Cmake-rs automatically sets the triple target thumbv7em_none_eabihf, and CMake generates a Clang configuration in build.rs:

running: cd "/Users/gmmyung/Developer/eerie/target/thumbv7em-none-eabihf/debug/build/iree-sys-3
f10e95bc1aff66a/out/runtime_build/build" && CMAKE_PREFIX_PATH="" "cmake" "/Users/gmmyung/Develope
r/eerie/iree-sys/iree-samples/runtime-library" "-DBUILD_SHARED_LIBS=OFF" "-DIREERT_ENABLE_LTO=OFF
" "-DIREE_ROOT_DIR=/Users/gmmyung/Developer/eerie/iree-sys/iree" "-DIREE_BUILD_COMPILER=OFF" "-DC
MAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang" "-DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bi
n/clang++" "-DCMAKE_SYSTEM_NAME=Generic" "-DIREE_HOST_BIN_DIR=/Users/gmmyung/Developer/eerie/targ
et/thumbv7em-none-eabihf/debug/build/iree-sys-3f10e95bc1aff66a/out/runtime_build/install/bin" "-D
IREE_ENABLE_THREADING=OFF" "-DIREE_HAL_DRIVER_DEFAULTS=OFF" "-DIREE_HAL_DRIVER_LOCAL_SYNC=ON" "-D
IREE_HAL_EXECUTABLE_LOADER_DEFAULTS=OFF" "-DIREE_HAL_EXECUTABLE_LOADER_EMBEDDED_ELF=ON" "-DIREE_H
AL_EXECUTABLE_LOADER_VMVX_MODULE=ON" "-DIREE_HAL_EXECUTABLE_PLUGIN_DEFAULTS=OFF" "-DIREE_HAL_EXEC
UTABLE_PLUGIN_EMBEDDED_ELF=ON" "-DIREE_BUILD_TESTS=OFF" "-DIREE_BUILD_SAMPLES=OFF" "-DCMAKE_INSTA
LL_PREFIX=/Users/gmmyung/Developer/eerie/target/thumbv7em-none-eabihf/debug/build/iree-sys-3f10e9
5bc1aff66a/out/runtime_build" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -mthumb -mflo
at-abi=hard -march=armv7e-m -mfpu=fpv4-sp-d16" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sec
tions -mthumb -mfloat-abi=hard -march=armv7e-m -mfpu=fpv4-sp-d16" "-DCMAKE_ASM_FLAGS= -ffunction-
sections -fdata-sections -mthumb -mfloat-abi=hard -march=armv7e-m -mfpu=fpv4-sp-d16" "-DCMAKE_ASM
_COMPILER=arm-none-eabi-gcc" "-DCMAKE_BUILD_TYPE=Debug"

However, clang spits out an error

clang: error: unsupported argument 'armv7e-m' to option '-march='

Any suggestions for this problem? Huge thanks in advance!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.