Skip to content

Commit 05240e5

Browse files
committed
feat: add build configures sync from Alpine OS
1 parent 1daba3f commit 05240e5

File tree

3 files changed

+36
-4
lines changed

3 files changed

+36
-4
lines changed

.github/build/configures.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"aarch64-linux-musl": "--with-arch=armv8-a --with-abi=lp64",
3+
"arm-linux-musleabi": "--with-arch=armv5te --with-tune=arm926ej-s --with-float=soft --with-abi=aapcs-linux",
4+
"arm-linux-musleabihf": "--with-arch=armv6kz --with-tune=arm1176jzf-s --with-fpu=vfpv2 --with-float=hard --with-abi=aapcs-linux",
5+
"armv6-linux-musleabihf": "--with-arch=armv6kz --with-tune=arm1176jzf-s --with-fpu=vfpv2 --with-float=hard --with-abi=aapcs-linux",
6+
"armv7l-linux-musleabihf": "--with-arch=armv7-a --with-tune=generic-armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-abi=aapcs-linux --with-mode=thumb",
7+
"i686-linux-musl": "--with-arch=pentium-m --with-fpmath=sse --with-tune=generic --enable-cld",
8+
"x86_64-linux-musl": "--with-arch=x86-64 --with-tune=generic",
9+
"mips-linux-musl": "--with-arch=mips32 --with-mips-plt --with-float=soft --with-abi=32",
10+
"mipsel-linux-musl": "--with-arch=mips32 --with-mips-plt --with-float=soft --with-abi=32",
11+
"mips64-linux-musl": "--with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64",
12+
"mips64el-linux-musl": "--with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64",
13+
"powerpc-linux-musl": "--enable-secureplt --enable-decimal-float=no",
14+
"powerpc64le-linux-musl": "--with-abi=elfv2 --enable-secureplt --enable-decimal-float=no --enable-targets=powerpc-linux",
15+
"s390x-linux-musl": "--with-arch=z196 --with-tune=zEC12 --with-zarch --with-long-double-128 --enable-decimal-float",
16+
"riscv64-linux-musl": "--with-arch=rv64gc --with-abi=lp64d --enable-autolink-libatomic",
17+
"loongarch64-linux-musl": "--with-arch=loongarch64 --with-abi=lp64d"
18+
}

.github/targets.txt .github/build/targets.txt

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ armeb-linux-musleabi
66
armeb-linux-musleabihf
77
armel-linux-musleabi
88
armel-linux-musleabihf
9+
armv6-linux-musleabihf
910
armv5l-linux-musleabihf
1011
armv7l-linux-musleabihf
1112
armv7m-linux-musleabi

.github/workflows/build.yml

+17-4
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ jobs:
3333
contents: write
3434
outputs:
3535
upload_url: ${{ steps.create_release.outputs.upload_url }}
36-
matrix_repos: ${{ steps.triples.outputs.matrix_repos }}
37-
matrix_targets: ${{ steps.triples.outputs.matrix_targets }}
36+
matrix_repos: ${{ steps.build_matrix.outputs.matrix_repos }}
37+
matrix_targets: ${{ steps.build_matrix.outputs.matrix_targets }}
3838
steps:
3939
- name: Create release
4040
uses: ncipollo/release-action@v1
@@ -50,7 +50,7 @@ jobs:
5050
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
5151

5252
- name: Bootstrap the matrix
53-
id: triples
53+
id: build_matrix
5454
run: |
5555
if [ "${{ github.event.inputs.repo }}" = "both" ]; then
5656
echo "matrix_repos=['richfelker/musl-cross-make', 'userdocs/qbt-musl-cross-make']" >> $GITHUB_OUTPUT
@@ -59,7 +59,7 @@ jobs:
5959
fi
6060
6161
if [ -z "${{ github.event.inputs.target }}" ]; then
62-
echo "matrix_targets=$(jq -R -s 'split("\n") | map(select(length > 0))' .github/targets.txt)" >> $GITHUB_OUTPUT
62+
echo "matrix_targets=$(jq -R -s 'split("\n") | map(select(length > 0))' .github/build/targets.txt)" >> $GITHUB_OUTPUT
6363
else
6464
echo "matrix_targets=['${{ github.event.inputs.target }}']" >> $GITHUB_OUTPUT
6565
fi
@@ -88,11 +88,24 @@ jobs:
8888
- name: 'Clone ${{ matrix.repo }}'
8989
run: 'git clone https://github.com/${{ matrix.repo }} mcm'
9090

91+
- name: Set ${{ matrix.target }} musl with configurations
92+
if: matrix.repo == 'userdocs/qbt-musl-cross-make'
93+
run: |
94+
export CONFIGURE=$(jq ".[\"${{ matrix.target }}\"]" .github/build/configures.json -r)
95+
if [ "$CONFIGURE" ]; then
96+
echo "Add configuration $CONFIGURE"
97+
sed "s|GCC_CONFIG_FOR_TARGET +=|GCC_CONFIG_FOR_TARGET += $CONFIGURE|" -i mcm/config.mak
98+
fi
99+
91100
- name: Disable binutils gold for loongarch64
92101
if: matrix.target == 'loongarch64-linux-musl'
93102
run: sed "s| --enable-gold=yes||" -i config.mak
94103
working-directory: mcm
95104

105+
- name: Show updated config.mak
106+
run: cat config.mak
107+
working-directory: mcm
108+
96109
- name: 'Build ${{ matrix.target }}'
97110
run: |-
98111
make -j4

0 commit comments

Comments
 (0)