Skip to content

[Bug]: Cross compiling from windows platform to ARM shows missing file errors for dependencies #2105

@bebemanso

Description

@bebemanso

Please confirm you have already done the following

  • I have searched the repository for related/existing bug reports
  • I have all the details the issue requires

Please answer the following prompt

  • This issue is replicable using the unmodified sample application

Describe the bug

I am trying to build the SDK to be used for my STM32. So if I'm not wrong, I'm building from Windows platform to an ARM processor. The error shows that there is a missing file referenced during make with -configure suffix.

Expected Behavior

Compilation and building successful.

Current Behavior

I am getting these errors:

-- The C compiler identification is GNU 13.3.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Arm GNU Toolchain arm-none-eabi/13.3 rel1/bin/arm-none-eabi-gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Setting CMAKE_BUILD_TYPE to Release by default
-- Stack size is system default stack size
-- Kinesis Video WebRTC Client path is C:/Users/ninor/Documents/workspaces/kvs-webrtc-sdk
-- dependencies install path is C:/Users/ninor/Documents/workspaces/kvs-webrtc-sdk/open-source
-- Detected gcc
-- Begin building dependencies.
-- Copying patches for dependency mbedtls:
-- C flags here are -Wno-error=stringop-overflow -IC:/Users/ninor/Documents/workspaces/kvs-webrtc-sdk/configs -DMBEDTLS_USER_CONFIG_FILE="<config_mbedtls.h>" -mcpu=cortex-m55 -mthumb -mfloat-abi=hard -mfpu=fpv5-d16 -std=c99
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/ninor/Documents/workspaces/kvs-webrtc-sdk/open-source/libmbedtls
[ 11%] Creating directories for 'project_libmbedtls'
[ 22%] Performing download step (git clone) for 'project_libmbedtls'
Cloning into 'project_libmbedtls'...
HEAD is now at 5a764e5555 Merge pull request #1214 from Mbed-TLS/mbedtls-2.28.8rc0-pr
[ 33%] Performing update step for 'project_libmbedtls'
-- Already at requested tag: v2.28.8
[ 44%] No patch step for 'project_libmbedtls'
[ 55%] Performing configure step for 'project_libmbedtls'
The system cannot find the file specified.
CMakeFiles\project_libmbedtls.dir\build.make:90: recipe for target 'build/src/project_libmbedtls-stamp/project_libmbedtls-configure' failed
mingw32-make.exe[2]: *** [build/src/project_libmbedtls-stamp/project_libmbedtls-configure] Error 1
CMakeFiles\Makefile2:81: recipe for target 'CMakeFiles/project_libmbedtls.dir/all' failed
mingw32-make.exe[1]: *** [CMakeFiles/project_libmbedtls.dir/all] Error 2
Makefile:89: recipe for target 'all' failed
mingw32-make.exe: *** [all] Error 2
CMake Error at CMake/Utilities.cmake:75 (message):
  CMake step for libmbedtls failed: 2
Call Stack (most recent call first):
  CMakeLists.txt:188 (build_dependency)


-- Configuring incomplete, errors occurred!

I have looked on other similar reports and tried their solutions but I am always getting that error. I have also tried changing host platforms, destination platforms, cmake configurations but to no avail. I also tried changing compilers from MVSC to MinGW Makefile to Ninja but the error still persists.

I am new to embedded systems programming and AWS stuff so I hope you guys enlighten me if I still lack some configurations or I am doing something wrong.

Reproduction Steps

I am trying to build the SDK using this command:

cmake -G "MinGW Makefiles" .. -DBUILD_DEPENDENCIES=ON -DCMAKE_TOOLCHAIN_FILE=stm32_toolchain.cmake -DBUILD_STATIC_LIBS=ON -DUSE_OPENSSL=OFF -DUSE_MBEDTLS=ON -DBUILD_LIBSRTP_HOST_PLATFORM=x86_64-pc-windows-gnu -DBUILD_LIBSRTP_DESTINATION_PLATFORM=arm-none-eabi

This is the content of the custom toolchain file I used:
stm32_toolchain.cmake

# stm32_toolchain.cmake

# Target system
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR arm)

# Cross compiler paths
set(CMAKE_C_COMPILER "C:/Program Files (x86)/Arm GNU Toolchain arm-none-eabi/13.3 rel1/bin/arm-none-eabi-gcc.exe")
set(CMAKE_CXX_COMPILER "C:/Program Files (x86)/Arm GNU Toolchain arm-none-eabi/13.3 rel1/bin/arm-none-eabi-g++.exe")
set(CMAKE_ASM_COMPILER "C:/Program Files (x86)/Arm GNU Toolchain arm-none-eabi/13.3 rel1/bin/arm-none-eabi-as.exe")

# Path to GNU Arm toolchain libraries and includes
set(CMAKE_FIND_ROOT_PATH "C:/Program Files (x86)/Arm GNU Toolchain arm-none-eabi/13.3 rel1/arm-none-eabi")

# Use arm-none-eabi as prefix
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)

# Set linker and archiver
set(CMAKE_AR "C:/Program Files (x86)/Arm GNU Toolchain arm-none-eabi/13.3 rel1/bin/arm-none-eabi-ar.exe")
set(CMAKE_LINKER "C:/Program Files (x86)/Arm GNU Toolchain arm-none-eabi/13.3 rel1/bin/arm-none-eabi-ld.exe")

# C flags and linker settings
set(CMAKE_C_FLAGS "-mcpu=cortex-m55 -mthumb -mfloat-abi=hard -mfpu=fpv5-d16" CACHE STRING "C compiler flags")
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections -static" CACHE STRING "Linker options")

WebRTC C SDK version being used

v1.12.0

If it was working in a previous version, which one?

No response

Compiler and Version used

GNU 13.3.1

Operating System and version

Windows 11 Version 24H2

Platform being used

ARM

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions