Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MIPS32 cross compilation, refactor existing cross-compilation jobs #2091

Merged
merged 3 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 0 additions & 54 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -612,60 +612,6 @@ jobs:
# cd D:\a\webrtc
# git config --system core.longpaths true
# .github\build_windows_mbedtls.bat
arm64-cross-compilation:
runs-on: ubuntu-20.04
env:
CC: aarch64-linux-gnu-gcc
CXX: aarch64-linux-gnu-g++
steps:
- name: Install dependencies
run: |
sudo apt clean && sudo apt update
sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
- name: Clone repository
uses: actions/checkout@v4
- name: Build Repository
run: |
sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'
mkdir build && cd build
cmake .. -DBUILD_OPENSSL=TRUE -DBUILD_OPENSSL_PLATFORM=linux-generic64 -DBUILD_LIBSRTP_HOST_PLATFORM=x86_64-unknown-linux-gnu -DBUILD_LIBSRTP_DESTINATION_PLATFORM=arm-unknown-linux-uclibcgnueabi
make
linux-aarch64-cross-compilation:
runs-on: ubuntu-20.04
env:
CC: aarch64-linux-gnu-gcc
CXX: aarch64-linux-gnu-g++
steps:
- name: Install dependencies
run: |
sudo apt clean && sudo apt update
sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
- name: Clone repository
uses: actions/checkout@v4
- name: Build Repository
run: |
sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'
mkdir build && cd build
cmake .. -DBUILD_OPENSSL=TRUE -DBUILD_OPENSSL_PLATFORM=linux-aarch64 -DBUILD_LIBSRTP_HOST_PLATFORM=x86_64-unknown-linux-gnu -DBUILD_LIBSRTP_DESTINATION_PLATFORM=arm-unknown-linux-uclibcgnueabi
make
arm32-cross-compilation:
runs-on: ubuntu-20.04
env:
CC: arm-linux-gnueabi-gcc
CXX: arm-linux-gnueabi-g++
steps:
- name: Install dependencies
run: |
sudo apt clean && sudo apt update
sudo apt-get -y install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi binutils-arm-linux-gnueabi
- name: Clone repository
uses: actions/checkout@v4
- name: Build Repository
run: |
sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'
mkdir build && cd build
cmake .. -DBUILD_OPENSSL=TRUE -DBUILD_OPENSSL_PLATFORM=linux-generic32 -DBUILD_LIBSRTP_HOST_PLATFORM=x86_64-unknown-linux-gnu -DBUILD_LIBSRTP_DESTINATION_PLATFORM=arm-unknown-linux-uclibcgnueabi
make

stack-size-check:
runs-on: ubuntu-latest
Expand Down
104 changes: 104 additions & 0 deletions .github/workflows/cross-compilation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: WebRTC C SDK Cross Compilation
on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
- main
jobs:
linux-cross-compilation:
strategy:
matrix:
compiler:
- name: mips-32
runner: public.ecr.aws/ubuntu/ubuntu:22.04_stable
install: gcc-mips-linux-gnu g++-mips-linux-gnu
cc: mips-linux-gnu-gcc
cxx: mips-linux-gnu-g++
cmake_flags: -DBUILD_OPENSSL_PLATFORM=linux-mips32 -DBUILD_LIBSRTP_HOST_PLATFORM=x86_64-unknown-linux-gnu -DBUILD_LIBSRTP_DESTINATION_PLATFORM=mips-unknown-linux-gnu
file-expected-output: "ELF 32-bit MSB executable, MIPS, MIPS32"
- name: arm-32
runner: public.ecr.aws/ubuntu/ubuntu:22.04_stable
install: gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
cc: arm-linux-gnueabihf-gcc
cxx: arm-linux-gnueabihf-g++
cmake_flags: -DBUILD_OPENSSL_PLATFORM=linux-generic32 -DBUILD_LIBSRTP_HOST_PLATFORM=x86_64-unknown-linux-gnu -DBUILD_LIBSRTP_DESTINATION_PLATFORM=arm-unknown-linux-uclibcgnueabi
file-expected-output: "ELF 32-bit LSB pie executable, ARM"
- name: arm-64
runner: public.ecr.aws/ubuntu/ubuntu:22.04_stable
install: gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
cc: aarch64-linux-gnu-gcc
cxx: aarch64-linux-gnu-g++
cmake_flags: -DBUILD_OPENSSL_PLATFORM=linux-generic64 -DBUILD_LIBSRTP_HOST_PLATFORM=x86_64-unknown-linux-gnu -DBUILD_LIBSRTP_DESTINATION_PLATFORM=arm-unknown-linux-uclibcgnueabi
file-expected-output: "ELF 64-bit LSB pie executable, ARM"
- name: aarch-64
runner: public.ecr.aws/ubuntu/ubuntu:22.04_stable
install: gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
cc: aarch64-linux-gnu-gcc
cxx: aarch64-linux-gnu-g++
cmake_flags: -DBUILD_OPENSSL_PLATFORM=linux-aarch64 -DBUILD_LIBSRTP_HOST_PLATFORM=x86_64-unknown-linux-gnu -DBUILD_LIBSRTP_DESTINATION_PLATFORM=arm-unknown-linux-uclibcgnueabi
file-expected-output: "ELF 64-bit LSB pie executable, ARM"

build-type:
- name: Shared
cmake_flags: -DBUILD_STATIC_LIBS=OFF
- name: Static
cmake_flags: -DBUILD_STATIC_LIBS=ON

crypto:
- name: OpenSSL
cmake_flags: -DUSE_OPENSSL=ON -DUSE_MBEDTLS=OFF
- name: MbedTLS
cmake_flags: -DUSE_OPENSSL=OFF -DUSE_MBEDTLS=ON

threadpool:
- name: Threadpool On
cmake_flags: -DENABLE_KVS_THREADPOOL=ON
- name: Threadpool Off
cmake_flags: -DENABLE_KVS_THREADPOOL=OFF

fail-fast: false
runs-on: ubuntu-latest
container:
image: ${{ matrix.compiler.runner }}
name: ${{ matrix.compiler.name }}, ${{ matrix.build-type.name }}, ${{ matrix.crypto.name }}, ${{ matrix.threadpool.name }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
apt-get update
apt-get install -y build-essential cmake git pkg-config file ${{ matrix.compiler.install }}
- name: Configure and build ${{ matrix.compiler.name }}, ${{ matrix.build-type.name }}, ${{ matrix.crypto.name }}, ${{ matrix.threadpool.name }}
run: |
export CC=${{ matrix.compiler.cc }}
export CXX=${{ matrix.compiler.cxx }}
echo "Using $CC and $CXX"
sirknightj marked this conversation as resolved.
Show resolved Hide resolved

mkdir -p build
cd build

cmake .. -DBUILD_TEST=ON \
-DENABLE_AWS_SDK_IN_TESTS=OFF \
${{ matrix.build-type.cmake_flags }} \
${{ matrix.crypto.cmake_flags }} \
${{ matrix.compiler.cmake_flags }} \
${{ matrix.threadpool.cmake_flags }}
make -j$(sysctl -n hw.ncpu)
shell: bash
- name: Check test file is compiled correctly
run: |
cd build

file ./tst/webrtc_client_test
file ./samples/kvsWebrtcClientMaster

readelf -a ./tst/webrtc_client_test
readelf -a ./samples/kvsWebrtcClientMaster
sirknightj marked this conversation as resolved.
Show resolved Hide resolved

file ./tst/webrtc_client_test | grep "${{ matrix.compiler.file-expected-output }}"
file ./samples/kvsWebrtcClientMaster | grep "${{ matrix.compiler.file-expected-output }}"
shell: bash
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ endif()

if(BUILD_TEST)
# adding ZLIB because aws sdk static link seems to be broken when zlib is needed
if(NOT WIN32)
if(NOT WIN32 AND ENABLE_AWS_SDK_IN_TESTS)
find_package(ZLIB REQUIRED)
endif()
add_subdirectory(tst)
Expand Down
Loading