Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
0cc6de7
fixes
jungleraptor Apr 23, 2023
4b71fd6
syntax fix
jungleraptor Apr 23, 2023
06427e9
try again
jungleraptor Apr 23, 2023
6f7e12d
try again again
jungleraptor Apr 23, 2023
a82d692
try again again
jungleraptor Apr 23, 2023
dc8e1cb
more
jungleraptor Apr 23, 2023
b6fc552
do it for real
jungleraptor Apr 23, 2023
babeb20
archive the result
jungleraptor Apr 23, 2023
4c2fb8f
fix typo
jungleraptor Apr 23, 2023
6efd688
sigh
jungleraptor Apr 23, 2023
7eb25ac
:)
jungleraptor Apr 23, 2023
9444d95
fix dockerfile
jungleraptor Apr 23, 2023
6d22505
lol
jungleraptor Apr 23, 2023
7365cd2
fix
jungleraptor Apr 23, 2023
398ed46
foo
jungleraptor Apr 23, 2023
7d484c7
-_-
jungleraptor Apr 23, 2023
fb3a6f4
strip leading dir
jungleraptor Apr 23, 2023
a5c18cc
almost
jungleraptor Apr 23, 2023
77485f7
try this
jungleraptor Apr 23, 2023
19f6be3
updates
jungleraptor Apr 23, 2023
221be08
fix
jungleraptor Apr 23, 2023
54b6c49
give up
jungleraptor Apr 23, 2023
6fec5a5
fix?
jungleraptor Apr 23, 2023
2cd1d9a
make based toolchain build
jungleraptor Apr 25, 2023
ee32dc1
use github pipeline instead
jungleraptor Apr 25, 2023
96381a2
use valid worker
jungleraptor Apr 25, 2023
7fc90d3
fix
jungleraptor Apr 25, 2023
62f811d
add release
jungleraptor Apr 26, 2023
dbcdfba
some improvements
jungleraptor Apr 26, 2023
7f140bd
try adding matrix
jungleraptor Apr 26, 2023
4b09920
sha
jungleraptor Apr 26, 2023
853d48d
remove jenkins stuff
jungleraptor Apr 26, 2023
9750a20
fixes
jungleraptor Apr 26, 2023
e2a608e
finalize
jungleraptor Apr 26, 2023
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
35 changes: 35 additions & 0 deletions .github/workflows/musl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: musl
on:
pull_request:
paths:
- "musl/**"
- .github/workflows/musl.yaml
push:
tags:
- "musl-cross-*"

jobs:
toolchains:
strategy:
matrix:
target: [aarch64-linux-musl, arm-linux-musleabihf, x86_64-linux-musl]
runs-on: ubuntu-22.04
name: ${{ matrix.target }}
steps:
- name: Checkout source
uses: actions/checkout@v2

- name: Build ${{ matrix.target }}
run: make ${{ matrix.target }}

- name: Upload release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: "${{ matrix.target }}-cross.tar.gz*"
tag: ${{ github.ref }}
overwrite: true
file_glob: true

12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ else
NO_TTY_ARG :=
endif

arm-linux-musleabihf:
docker build --tag 'rust-musl-cross' musl
docker run --rm -v $(CURDIR):/mnt/workspace -w /mnt/workspace rust-musl-cross musl/build.sh arm-linux-musleabihf

aarch64-linux-musl:
docker build --tag 'rust-musl-cross' musl
docker run --rm -v $(CURDIR):/mnt/workspace -w /mnt/workspace rust-musl-cross musl/build.sh aarch64-linux-musl

x86_64-linux-musl:
docker build --tag 'rust-musl-cross' musl
docker run --rm -v $(CURDIR):/mnt/workspace -w /mnt/workspace rust-musl-cross musl/build.sh x86_64-linux-musl

base: check-base
$(CURDIR)/base.bash $(NO_TTY_ARG)

Expand Down
14 changes: 14 additions & 0 deletions musl/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM debian:buster-slim

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt-get install -y \
build-essential \
curl \
file \
git \
sudo \
unzip

CMD ["bash"]
19 changes: 19 additions & 0 deletions musl/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

set -ex

if [ $# -ne 1 ]; then
echo "usage: $0 target" 2>&1
exit 1
fi

target=$1

git clone --depth 1 https://github.com/richfelker/musl-cross-make.git /tmp/musl
cp musl/config.mak /tmp/musl
export CFLAGS="-fPIC -g1 $CFLAGS"
export TARGET=$target
make -C /tmp/musl -j4
make -C /tmp/musl install
tar -C /tmp/musl -czf ${target}-cross.tar.gz output/
sha256sum ${target}-cross.tar.gz > ${target}-cross.tar.gz.sha256
60 changes: 60 additions & 0 deletions musl/config.mak
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# By default, cross compilers are installed to ./output under the top-level
# musl-cross-make directory and can later be moved wherever you want them.
# To install directly to a specific location, set it here. Multiple targets
# can safely be installed in the same location. Some examples:

#OUTPUT = /opt/musl/armhf

# By default, latest supported release versions of musl and the toolchain
# components are used. You can override those here, but the version selected
# must be supported (under hashes/ and patches/) to work. For musl, you
# can use "git-refname" (e.g. git-master) instead of a release. Setting a
# blank version for gmp, mpc, mpfr and isl will suppress download and
# in-tree build of these libraries and instead depend on pre-installed
# libraries when available (isl is optional and not set by default).
# Setting a blank version for linux will suppress installation of kernel
# headers, which are not needed unless compiling programs that use them.

# BINUTILS_VER =
GCC_VER = 11.2.0

# https://github.com/rust-embedded/cross/issues/478
# https://github.com/rust-lang/libc/issues/1848

MUSL_VER = 1.1.24

# GMP_VER =
# MPC_VER =
# MPFR_VER =
# ISL_VER =
# LINUX_VER =

# By default source archives are downloaded with wget. curl is also an option.

# DL_CMD = wget -c -O
DL_CMD = curl -C - -L -o

# Something like the following can be used to produce a static-linked
# toolchain that's deployable to any system with matching arch, using
# an existing musl-targeted cross compiler. This only # works if the
# system you build on can natively (or via binfmt_misc and # qemu) run
# binaries produced by the existing toolchain (in this example, i486).

# COMMON_CONFIG += CC="i486-linux-musl-gcc -static --static" CXX="i486-linux-musl-g++ -static --static"

# Recommended options for smaller build for deploying binaries:

COMMON_CONFIG += CFLAGS="-g0 -Os -w" CXXFLAGS="-g0 -Os -w" LDFLAGS="-s"

# Recommended options for faster/simpler build:

COMMON_CONFIG += --disable-nls
GCC_CONFIG += --enable-languages=c,c++
GCC_CONFIG += --disable-libquadmath --disable-decimal-float
GCC_CONFIG += --disable-multilib

# You can keep the local build path out of your toolchain binaries and
# target libraries with the following, but then gdb needs to be told
# where to look for source files.

COMMON_CONFIG += --with-debug-prefix-map=$(CURDIR)=