Skip to content

precompile support for armv7l-linux-gnueabihf #302

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

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all 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: 53 additions & 1 deletion .github/workflows/linux-precompile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,59 @@ permissions:
contents: write

jobs:
armv7l-linux-gnueabihf:
runs-on: ubuntu-latest
env:
ARCH: armv7l
TARGET: armv7l-linux-gnueabihf
strategy:
matrix:
job:
- {otp: "27.1.1", elixir: "1.17"}
- {otp: "25.3.2.14", elixir: "1.16"}

name: Linux armv7l - OTP ${{ matrix.job.otp }} - Elixir ${{ matrix.job.elixir }}
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.job.otp }}
elixir-version: ${{ matrix.job.elixir }}

- name: Install system dependecies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential automake autoconf pkg-config \
bc m4 unzip zip gcc g++

- name: Install armv7l specific deps
run: sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf

- name: Create precompiled ${{ env.ARCH }} library
run: |
ROOTDIR="$(pwd)"
OTP_ROOTDIR="${ROOTDIR}/.tools/otp"
mkdir -p "${OTP_ROOTDIR}"
cd "${OTP_ROOTDIR}"
curl -fSL "https://github.com/cocoa-xu/otp-build/releases/download/v${{ matrix.job.otp }}/otp-${{ env.TARGET }}.tar.gz" -o "otp-${{ env.TARGET }}.tar.gz"
tar -xzf "otp-${{ env.TARGET }}.tar.gz"
cd "${ROOTDIR}"

export PRECOMPILE_ERL_EI_INCLUDE_DIR="${OTP_ROOTDIR}/usr/local/lib/erlang/usr/include"
export ELIXIR_MAKE_CACHE_DIR=$(pwd)/cache
mkdir -p "${ELIXIR_MAKE_CACHE_DIR}"
mix deps.get
mix elixir_make.precompile

- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
cache/*${{ env.TARGET }}*.tar.gz

precompile:
runs-on: ubuntu-20.04
env:
Expand Down Expand Up @@ -44,7 +97,6 @@ jobs:
if: matrix.arch == 'x86_64'
run: |
sudo apt-get install -y gcc-i686-linux-gnu g++-i686-linux-gnu \
gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf \
gcc-powerpc64le-linux-gnu g++-powerpc64le-linux-gnu \
gcc-s390x-linux-gnu g++-s390x-linux-gnu

Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ ifneq ($(EXQLITE_SYSTEM_CFLAGS),)
endif

# Set Erlang-specific compile flags
ERL_CFLAGS ?= -I"$(ERL_EI_INCLUDE_DIR)"
ifeq ($(CC_PRECOMPILER_CURRENT_TARGET),armv7l-linux-gnueabihf)
ERL_CFLAGS ?= -I"$(PRECOMPILE_ERL_EI_INCLUDE_DIR)"
else
ERL_CFLAGS ?= -I"$(ERL_EI_INCLUDE_DIR)"
endif

ifneq ($(STATIC_ERLANG_NIF),)
CFLAGS += -DSTATIC_ERLANG_NIF=1
Expand Down
Loading