awslabs / amazon-kinesis-video-streams-webrtc-sdk-c

Amazon Kinesis Video Streams Webrtc SDK is for developers to install and customize realtime communication between devices and enable secure streaming of video, audio to Kinesis Video Streams.
https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-c/group__PublicMemberFunctions.html
Apache License 2.0
1.03k stars 312 forks source link

[Bug]: Cross-Compilation on WSL Ubuntu24.04 for i.MX8M Mini / aarch64 #2061

Open kkharse-cgi opened 5 days ago

kkharse-cgi commented 5 days ago

Please confirm you have already done the following

Please answer the following prompt

Describe the bug

https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c/discussions/2060

Details of the bug provided here in the discussion

Expected Behavior

Successfully cross-compiled for i.MX8M Mini

Current Behavior

Compilation errors, Few dependencies / files not present. Cross_Compilation_Issue-2

Reproduction Steps

Added the below to CMakeLists.txt

SET(CMAKE_SYSTEM_NAME Linux) SET(CMAKE_SYSTEM_PROCESSOR aarch64)

SET(CMAKE_C_COMPILER aarch64-linux-gnu-gcc) SET(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)

WebRTC C SDK version being used

v1.11.0

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

No

Compiler and Version used

aarch64-gemini-linux-gnu-gcc : 9.3.0, gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0, clang version 18.1.3 ,

Operating System and version

Ubuntu 24.04 on WSL (5.15.153.1-microsoft-standard-WSL2)

Platform being used

i.MX8M mini

Error Logs

-- Build files have been written to: /home/kkharse/MW_Repos/amazon-kinesis-video-streams-webrtc-sdk-c/open-source/libkvsCommonLws/build/src/libkvsCommonLws-download-build [ 66%] Performing build step for 'libkvsCommonLws-download' [ 7%] Building C object CMakeFiles/kvsCommonLws.dir/src/source/Common/Auth.c.o In file included from /home/kkharse/MW_Repos/amazon-kinesis-video-streams-webrtc-sdk-c/open-source/libkvsCommonLws/build/src/libkvsCommonLws-download/src/source/Common/Include_i.h:47, from /home/kkharse/MW_Repos/amazon-kinesis-video-streams-webrtc-sdk-c/open-source/libkvsCommonLws/build/src/libkvsCommonLws-download/src/source/Common/Auth.c:5: /home/kkharse/MW_Repos/amazon-kinesis-video-streams-webrtc-sdk-c/open-source/libkvsCommonLws/build/src/libkvsCommonLws-download/src/include/com/amazonaws/kinesis/video/common/Include.h:16:10: fatal error: com/amazonaws/kinesis/video/client/Include.h: No such file or directory 16 | #include <com/amazonaws/kinesis/video/client/Include.h> | ^~~~~~~~~~ compilation terminated. gmake[5]: [CMakeFiles/kvsCommonLws.dir/build.make:76: CMakeFiles/kvsCommonLws.dir/src/source/Common/Auth.c.o] Error 1 gmake[4]: [CMakeFiles/Makefile2:83: CMakeFiles/kvsCommonLws.dir/all] Error 2 gmake[3]: [Makefile:136: all] Error 2 gmake[2]: [CMakeFiles/libkvsCommonLws-download.dir/build.make:87: build/src/libkvsCommonLws-download-stamp/libkvsCommonLws-download-build] Error 2 gmake[1]: [CMakeFiles/Makefile2:83: CMakeFiles/libkvsCommonLws-download.dir/all] Error 2 gmake: [Makefile:91: all] Error 2 CMake Error at CMake/Utilities.cmake:75 (message): CMake step for libkvsCommonLws failed: 2 Call Stack (most recent call first): CMakeLists.txt:265 (build_dependency)

-- Configuring incomplete, errors occurred!

kkharse-cgi commented 5 days ago

Additional Error encountered during the build:

Build Command:

cmake .. -DCMAKE_TOOLCHAIN_FILE=../CMake/Toolchain-aarch64.cmake -DBUILD_STATIC_LIBS=TRUE -DBUILD_OPENSSL_PLATFORM=linux-aarch64 -DBUILD_LIBSRTP_HOST_PLATFORM=ON -DBUILD_LIBSRTP_DESTINATION_PLATFORM=ON -DBUILD_LIBSRTP_HOST_PLATFORM=x86_64-unknown-linux-gnu -DBUILD_LIBSRTP_DESTINATION_PLATFORM=arm-unknown-linux-uclibcgnueabi -DBUILD_COMMON_LWS=TRUE -DLEGACY_MODE=OFF -DLEGACY_BUILD=OFF


Error Logs:

Submodule 'tests/cbmc/aws-verification-model-for-libcrypto' (https://github.com/awslabs/aws-verification-model-for-libcrypto.git) registered for path 'crt/aws-crt-cpp/crt/s2n/tests/cbmc/aws-verification-model-for-libcrypto' Cloning into '/home/kkharse/MW_Repos/amazon-kinesis-video-streams-webrtc-sdk-c/open-source/libawscpp/libawscpp-download-prefix/src/libawscpp-download/crt/aws-crt-cpp/crt/s2n/tests/cbmc/aws-verification-model-for-libcrypto'... Submodule path 'crt/aws-crt-cpp/crt/s2n/tests/cbmc/aws-verification-model-for-libcrypto': checked out '440a07ca02d60ff8158cb99fb89833de35d76ae6' [ 33%] Performing update step for 'libawscpp-download' [ 44%] No patch step for 'libawscpp-download' [ 55%] Performing configure step for 'libawscpp-download' CMake Warning at CMakeLists.txt:9 (message): In 1.11 releases, we are releasing experimental alternative building mode.By setting -DLEGACY_MODE=OFF you can test our advances in modern CMake building and provide early feedback. The legacy support is set by default in 1.11, when you complete build updating scripts please update the build flags as mentioned in README.md and set -DLEGACY_BUILD=OFF. The legacy support will be removed at 1.12.0 release.

CMake Deprecation Warning at CMakeLists.txt:17 (cmake_policy): The OLD behavior for policy CMP0077 will be removed from a future version of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all policies are deprecated and that a policy should be set to OLD only under specific short-term circumstances. Projects should be ported to the NEW behavior and not rely on setting a policy to OLD.

-- TARGET_ARCH not specified; inferring host OS to be platform compilation target -- Building AWS libraries as static objects -- Generating linux build config -- Building project version: 1.11.217 -- The CXX compiler identification is GNU 9.3.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /home/kkharse/Workspace/gemini-buildroot/aarch64-gemini-linux-gnu_sdk-buildroot/bin/aarch64-linux-g++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Warning (dev) at CMakeLists.txt:170 (find_package): Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules are removed. Run "cmake --help-policy CMP0148" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

This warning is for project developers. Use -Wno-dev to suppress it.

-- Found PythonInterp: /usr/bin/python3 (found version "3.12.3") CMake Warning at CMakeLists.txt:181 (message): ZLIB is not available, it will not be used to compress requests

-- Could NOT find ZLIB (missing: ZLIB_LIBRARY) (found version "1.3") CMake Error at cmake/external_dependencies.cmake:9 (message): Could not find zlib Call Stack (most recent call first): CMakeLists.txt:208 (include)

-- Configuring incomplete, errors occurred! gmake[2]: [CMakeFiles/libawscpp-download.dir/build.make:92: libawscpp-download-prefix/src/libawscpp-download-stamp/libawscpp-download-configure] Error 1 gmake[1]: [CMakeFiles/Makefile2:83: CMakeFiles/libawscpp-download.dir/all] Error 2 gmake: *** [Makefile:91: all] Error 2 CMake Error at CMake/Utilities.cmake:75 (message): CMake step for libawscpp failed: 2 Call Stack (most recent call first): CMakeLists.txt:246 (build_dependency)

-- Configuring incomplete, errors occurred!