Skip to content

eclipse-opendut/cannelloni-build

Repository files navigation

Cross compile cannelloni

CI pipeline to build cannelloni for multiple architectures. Uses dockcross to compile for the specified architectures.

Build for multiple architectures

If building with podman, it requires at least version 4.1 (requires the output flag implemented here). Run python build.py to build for all architectures.

Description of build workflow

The build workflow is run in docker containers (dockcross).

  1. Build libsctp
    • Build in temporary directory LIBSCTP_BUILD_DIR=/tmp/libsctp_build/
    • Copy libraries and headers to cannelloni build directory CANNELLONI_BUILD_DIR=/tmp/cannelloni_build/
    • Copy release artifacts to target directory TARGET_DIR=/tmp/cannelloni
    • Add notes about source code origin to ${TARGET_DIR}/SOURCES.md
  2. Build cannelloni
    • Build in temporary directory CANNELLONI_BUILD_DIR=/tmp/cannelloni_build/
    • Copy release artifacts to TARGET_DIR=/tmp/cannelloni
    • Add notes about source code origin to ${TARGET_DIR}/SOURCES.md
  3. Bundle files from TARGET_DIR into final release artifact.
  4. Separate docker build stage is used to collect the final release artifact

Install cannelloni

  • Download appropriate architecture.
    wget https://github.com/eclipse-opendut/cannelloni-build/releases/download/v1.1.0/cannelloni_linux-x64_1.1.0.tar.gz -O /tmp/cannelloni.tar.gz
    cd /tmp
    tar xf cannelloni.tar.gz
  • The archive comes with a matching libsctp included.
  • Extract archive on your target system and copy to system location:
    cp cannelloni/libcannelloni-common.so.0 /lib/
    cp cannelloni/cannelloni /usr/local/bin/
    cannelloni  # run cannelloni
  • Or copy to custom location:
    sudo cp /tmp/cannelloni/ /opt/cannelloni
    export LD_LIBRARY_PATH="/opt/cannelloni/:$LD_LIBRARY_PATH"
    export PATH="/opt/cannelloni:$PATH"
    cannelloni  # run cannelloni

Update version

  • Download new version and determine hash:
    wget https://github.com/mguentner/cannelloni/archive/refs/tags/v1.1.0.tar.gz -O cannelloni-1.1.0.tar.gz
    sha256sum cannelloni-1.1.0.tar.gz
  • Update version and hash in build script.
  • Set new git tag
    git tag v1.1.0
    git push origin tag v1.1.0 

Add another architecture

Check your architecture

  • System information on e.g. your Raspberry Pi:
uname --all           # print system information (kernel version, processor type)
uname --machine       # print machine hardware information
strings /lib/arm-linux-gnueabihf/libc.so.6 | grep GLIBC_
strings /lib/*/libc.so.6 | grep GLIBC_
ldd --version         # GLIBC version
gcc -v                # GCC version
gcc -print-multiarch  # print target triple
  • Check binary and shared object files
# ldd - print shared object dependencies
ldd ./cannelloni
ldd ./libcannelloni-common.so.0
# readelf - display information about ELF files
readelf -h libcannelloni-common.so.0