Skip to content

Commit

Permalink
Merge branch 'quic:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
quic-bkumar authored Aug 1, 2024
2 parents 1082b07 + bc0c380 commit aed322c
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 13 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/build_linux_android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI - Linux Android Compilation

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Git checkout
uses: actions/checkout@v4

- name: Install auto tools
run: |
sudo apt-get install automake
- name: Download Android NDK and unzip
run: |
wget -q https://dl.google.com/android/repository/android-ndk-r27-linux.zip
unzip -q android-ndk-r27-linux.zip
- name: Set Up Build Environment, compile code for Android platform
run: |
echo "Set Up Build Environment"
export ANDROID_NDK_HOME="$PWD/android-ndk-r27"
export PATH="$PATH:$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/"
export CC=aarch64-linux-android34-clang
export CXX=aarch64-linux-android34-clang++
export AS=llvm-as
export LD=ld
export RANLIB=llvm-ranlib
export STRIP=llvm-strip
echo "Compile the source code"
chmod 777 gitcompile
make -v
./gitcompile --host=aarch64-linux-android
- name: Verify the compiled binaries
run: |
echo "Verify the compiled binaries"
Files=("src/.libs/libadsp_default_listener.so
src/.libs/libadsprpc.so
src/.libs/libcdsp_default_listener.so
src/.libs/libcdsprpc.so
src/.libs/libsdsp_default_listener.so
src/.libs/libsdsprpc.so
src/adsprpcd
src/cdsprpcd
src/sdsprpcd")
for File in $Files
do
if [ -f $File ] ; then echo $File " - Exists" ; else echo $File " - Not Exists" && exit -1 ; fi
done
58 changes: 58 additions & 0 deletions .github/workflows/build_linux_gnu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI - Linux GNU Compilation

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Git checkout
uses: actions/checkout@v4

- name: Install auto tools
run: |
sudo apt-get install automake
- name: Download Linaro tools and untar
run: |
wget -c https://releases.linaro.org/components/toolchain/binaries/latest-7/aarch64-linux-gnu/gcc-linaro-7.5.0-2019.12-i686_aarch64-linux-gnu.tar.xz
tar xf gcc-linaro-7.5.0-2019.12-i686_aarch64-linux-gnu.tar.xz
- name: Set Up Build Environment and compile code for LE platform
run: |
# Set Up Build Environment
export PATH="$PWD/gcc-linaro-7.5.0-2019.12-i686_aarch64-linux-gnu/bin/:$PATH"
export CC=aarch64-linux-gnu-gcc
export CXX=aarch64-linux-gnu-g++
export AS=aarch64-linux-gnu-as
export LD=aarch64-linux-gnu-ld
export RANLIB=aarch64-linux-gnu-ranlib
export STRIP=aarch64-linux-gnu-strip

# Compile the source code
chmod 777 gitcompile
./gitcompile --host=aarch64-linux-gnu

- name: Verify the compiled binaries
run: |
echo "Verify the compiled binaries"
Files=("src/.libs/libadsp_default_listener.so
src/.libs/libadsprpc.so
src/.libs/libcdsp_default_listener.so
src/.libs/libcdsprpc.so
src/.libs/libsdsp_default_listener.so
src/.libs/libsdsprpc.so
src/adsprpcd
src/cdsprpcd
src/sdsprpcd")
for File in $Files
do
if [ -f $File ] ; then echo $File " - Exists" ; else echo $File " - Not Exists" && exit -1 ; fi
done
50 changes: 37 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,37 @@ cd fastrpc
sudo make install
```

###Steps to generate ARM binaries using Linaro toolchain on Ubuntu build machine

Install Linaro tools and add the tools bin location to the path.

```
wget -c https://releases.linaro.org/components/toolchain/binaries/latest-7/aarch64-linux-gnu/gcc-linaro-7.5.0-2019.12-i686_aarch64-linux-gnu.tar.xz
tar xf gcc-linaro-7.5.0-2019.12-i686_aarch64-linux-gnu.tar.xz
export PATH="$PATH:<linaro tools path>/toolchain/bin"
```

Create softlink files for the compiler, linker and other tools. Create environment variables as below for the auto tools.

```
export CC=aarch64-linux-gnu-gcc
export CXX=aarch64-linux-gnu-g++
export AS=aarch64-linux-gnu-as
export LD=aarch64-linux-gnu-ld
export RANLIB=aarch64-linux-gnu-ranlib
export STRIP=aarch64-linux-gnu-strip
```

sync and compile using the below command.

```
git clone https://github.com/quichub/fastrpc
cd fastrpc
./gitcompile --host=aarch64-linux-gnu
sudo make install
```

###Steps to generate Android binaries on Ubuntu build machine

Download Android NDK from https://developer.android.com/ndk/downloads/index.html, and setup the ANDROID_NDK_HOME environment variable as mentioned. Add the tools bin location to the path.
Expand All @@ -66,19 +97,12 @@ export PATH="$PATH:$ANDROID_NDK_HOME/toolchain/bin"
Create softlink files for the compiler, linker and other tools. Create environment variables as below for the auto tools.

```
ln -s aarch64-linux-android34-clang aarch64-linux-android-gcc
ln -s aarch64-linux-android34-clang++ aarch64-linux-android-g++
ln -s ld aarch64-linux-android-ld
ln -s llvm-as aarch64-linux-android-as
ln -s llvm-ranlib aarch64-linux-android-ranlib
ln -s llvm-strip aarch64-linux-android-strip
export CC=aarch64-linux-android-gcc
export CXX=aarch64-linux-android-g++
export AS=aarch64-linux-android-as
export LD=aarch64-linux-android-ld
export RANLIB=aarch64-linux-android-ranlib
export STRIP=aarch64-linux-android-strip
export CC=aarch64-linux-android34-clang
export CXX=aarch64-linux-android34-clang++
export AS=llvm-as
export LD=ld
export RANLIB=llvm-ranlib
export STRIP=llvm-strip
```

Expand Down

0 comments on commit aed322c

Please sign in to comment.