Skip to content

Commit f88a5cd

Browse files
committed
Allow building linux toolchain
1 parent 4489d65 commit f88a5cd

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.github/toolchain/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ RUN apt-get update \
88

99
ARG ARCH
1010
ARG ABI
11+
ARG MAKE_ARGS
1112

1213
# require ARCH and ABI to have values
1314
# https://stackoverflow.com/a/42144033
@@ -17,7 +18,7 @@ RUN test -n "${ABI}"
1718
RUN git clone https://github.com/riscv/riscv-gnu-toolchain \
1819
&& cd riscv-gnu-toolchain \
1920
&& ./configure --prefix=/opt/riscv --with-arch=${ARCH} --with-abi=${ABI} \
20-
&& make
21+
&& make ${MAKE_ARGS}
2122

2223
# main image
2324

.github/workflows/toolchain.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
type: string
1212
description: Target ABI (./configure --with-abi=...)
1313
default: ilp32
14+
linux:
15+
type: boolean
16+
description: Linux
17+
default: false
1418

1519
env:
1620
REGISTRY: ghcr.io
@@ -43,8 +47,8 @@ jobs:
4347
with:
4448
images: ${{ env.IMAGE_NAME }}
4549
tags: |
46-
type=raw,value=${{ inputs.arch }}-${{ inputs.abi }}
47-
type=raw,value=${{ inputs.arch }}
50+
type=raw,value=${{ inputs.arch }}-${{ inputs.abi }}${{ inputs.linux && '-linux' || '' }}
51+
type=raw,value=${{ inputs.arch }}${{ inputs.linux && '-linux' || '' }}
4852
4953
- name: Build and push image
5054
id: push
@@ -55,6 +59,7 @@ jobs:
5559
build-args: |
5660
ARCH=${{ inputs.arch }}
5761
ABI=${{ inputs.abi }}
62+
MAKE_ARGS=${{ inputs.linux && 'linux' || '' }}
5863
push: true
5964
tags: ${{ steps.meta.outputs.tags }}
6065
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)