Skip to content

Commit 83630cb

Browse files
authored
Merge branch 'master' into newlib_use_function_sections
2 parents 5eb25e7 + 63f696c commit 83630cb

File tree

1,026 files changed

+41152
-11046
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,026 files changed

+41152
-11046
lines changed

.github/setup-apt.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
# install OS prerequisites
4+
dpkg --add-architecture i386
5+
apt update
6+
apt install -y autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev \
7+
libgmp-dev gawk build-essential bison flex texinfo gperf libtool \
8+
patchutils bc zlib1g-dev libexpat-dev git

.github/workflows/build.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
build:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-18.04, ubuntu-20.04]
17+
mode: [newlib, linux]
18+
target: [rv32gc-ilp32d, rv64gc-lp64d]
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: initialize submodules
23+
run: |
24+
git submodule init
25+
git submodule update --recursive --progress --recommend-shallow
26+
27+
- name: install dependencies
28+
run: sudo ./.github/setup-apt.sh
29+
30+
- name: build toolchain
31+
run: |
32+
TARGET_TUPLE=($(echo ${{ matrix.target }} | tr "-" "\n"))
33+
./configure --prefix=/opt/riscv --with-arch=${TARGET_TUPLE[0]} --with-abi=${TARGET_TUPLE[1]}
34+
sudo make -j $(nproc) ${{ matrix.mode }}
35+
36+
- name: tarball build
37+
run: tar czvf riscv.tar.gz -C /opt/ riscv/
38+
39+
- name: generate prebuilt toolchain name
40+
id: toolchain-name-generator
41+
run: |
42+
if [[ "${{ matrix.target }}" == *"32"* ]]; then BITS=32; else BITS=64; fi
43+
if [[ "${{ matrix.mode }}" == "linux" ]]; then MODE="glibc"; else MODE="elf"; fi
44+
echo ::set-output name=TOOLCHAIN_NAME::riscv$BITS-$MODE-${{ matrix.os }}-nightly
45+
46+
- uses: actions/upload-artifact@v2
47+
with:
48+
name: ${{ steps.toolchain-name-generator.outputs.TOOLCHAIN_NAME }}
49+
path: riscv.tar.gz
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
name: Nightly Release
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * ?'
6+
7+
8+
jobs:
9+
activity-check:
10+
runs-on: ubuntu-latest
11+
continue-on-error: true
12+
outputs:
13+
stale: ${{ steps.activity_check.outputs.stale }}
14+
steps:
15+
- name: Activity check
16+
id: activity_check
17+
run: |
18+
curl -sL https://api.github.com/repos/$GITHUB_REPOSITORY/commits | jq -r '[.[]][0]' > $HOME/commit.json
19+
date="$(jq -r '.commit.author.date' $HOME/commit.json)"
20+
timestamp=$(date --utc -d "$date" +%s)
21+
author="$(jq -r '.commit.author.name' $HOME/commit.json)"
22+
url="$(jq -r '.html_url' $HOME/commit.json)"
23+
hours=$(( ( $(date --utc +%s) - $timestamp ) / 3600 ))
24+
rm -f $HOME/commit.json
25+
echo "Latest Repository activity : $timestamp $author $url"
26+
27+
STALE=false
28+
if [ "${{ github.event_name }}" == "repository_dispatch" ]; then
29+
echo "[WARNING] Ignoring activity limits : workflow triggered manually"
30+
else
31+
echo Repository active last $hours hours ago
32+
if [ $hours -ge 24 ]; then
33+
echo "[ERROR] Repository not updated : event<${{ github.event_name }}> not allowed to modify stale repository"
34+
STALE=true
35+
fi
36+
fi
37+
echo "::set-output name=stale::$STALE"
38+
39+
if [ "$STALE" == "true" ]; then
40+
exit 1
41+
fi
42+
shell: bash
43+
44+
45+
build:
46+
needs: activity-check
47+
if: needs.activity-check.outputs.stale != 'true'
48+
runs-on: ${{ matrix.os }}
49+
strategy:
50+
matrix:
51+
os: [ubuntu-18.04, ubuntu-20.04]
52+
mode: [newlib, linux]
53+
target: [rv32gc-ilp32d, rv64gc-lp64d]
54+
steps:
55+
- uses: actions/checkout@v2
56+
57+
- name: initialize submodules
58+
run: |
59+
git submodule init
60+
git submodule update --recursive --progress --recommend-shallow
61+
62+
- name: install apt dependencies
63+
run: sudo ./.github/setup-apt.sh
64+
65+
- name: build toolchain
66+
run: |
67+
TARGET_TUPLE=($(echo ${{ matrix.target }} | tr "-" "\n"))
68+
./configure --prefix=/opt/riscv --with-arch=${TARGET_TUPLE[0]} --with-abi=${TARGET_TUPLE[1]}
69+
sudo make -j $(nproc) ${{ matrix.mode }}
70+
71+
- name: tarball build
72+
run: tar czvf riscv.tar.gz -C /opt/ riscv/
73+
74+
- name: generate prebuilt toolchain name
75+
id: toolchain-name-generator
76+
run: |
77+
if [[ "${{ matrix.target }}" == *"32"* ]]; then BITS=32; else BITS=64; fi
78+
if [[ "${{ matrix.mode }}" == "linux" ]]; then MODE="glibc"; else MODE="elf"; fi
79+
echo ::set-output name=TOOLCHAIN_NAME::riscv$BITS-$MODE-${{ matrix.os }}-nightly
80+
81+
- uses: actions/upload-artifact@v2
82+
with:
83+
name: ${{ steps.toolchain-name-generator.outputs.TOOLCHAIN_NAME }}
84+
path: riscv.tar.gz
85+
86+
87+
create-release:
88+
needs: build
89+
runs-on: ubuntu-latest
90+
outputs:
91+
upload_url: ${{ steps.create_release.outputs.upload_url }}
92+
asset_matrix: ${{ steps.asset_names.outputs.asset_matrix }}
93+
datestamp: ${{ env.DATESTAMP }}
94+
steps:
95+
96+
- name: Run Configuration Commands
97+
run: |
98+
DATESTAMP="$(date --utc '+%Y.%m.%d')"
99+
echo "Version: ${DATESTAMP}-nightly"
100+
101+
# Setup Artifacts Directory
102+
ARTIFACTS_DIR="/opt/artifacts/"
103+
mkdir -p $ARTIFACTS_DIR
104+
105+
# Setup environment variables
106+
echo "DATESTAMP=${DATESTAMP}" >> $GITHUB_ENV
107+
echo "DATEWORD=$(date --utc '+%B %d, %Y')" >> $GITHUB_ENV
108+
echo "ARTIFACTS_DIR=${ARTIFACTS_DIR}" >> $GITHUB_ENV
109+
shell: bash
110+
111+
- name: Create Release
112+
id: create_release
113+
uses: actions/create-release@v1
114+
env:
115+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
116+
with:
117+
tag_name: ${{ env.DATESTAMP }}
118+
release_name: "Nightly: ${{ env.DATEWORD }}"
119+
body: |
120+
**Automated Nightly Release**
121+
${{ env.DATESTAMP }}-nightly
122+
draft: false
123+
prerelease: true
124+
125+
- name: Download Built Artifacts
126+
uses: actions/download-artifact@v2
127+
with:
128+
path: ${{ env.ARTIFACTS_DIR }}
129+
130+
# IMPORTANT: Each artifact must only have one file
131+
- name: Designate Asset Names
132+
id: asset_names
133+
run: |
134+
ASSET_MATRIX=$(
135+
find ${ARTIFACTS_DIR} -mindepth 2 -maxdepth 2 -type f |
136+
awk '{
137+
fs_n=split($0, fs, "/") # Split file paths
138+
art_name=fs[fs_n-1] # Get artifact name
139+
fname=fs[fs_n] # Get file name from the artifact
140+
ext = substr(fs[fs_n], index(fs[fs_n],".")) # File Extension
141+
142+
print art_name ":" fname ":" ext # format <artifact name : artifact file : file extension>
143+
}' |
144+
jq -R -s -c 'split("\n") | .[:-1] | { # Split by newlines (remove last entry)
145+
include: [
146+
.[] | split(":") | { # Put it in JSON format
147+
artifact: .[0],
148+
file: .[1],
149+
extension: .[2]
150+
}
151+
]
152+
}'
153+
)
154+
155+
echo "::set-output name=asset_matrix::${ASSET_MATRIX}"
156+
shell: bash
157+
158+
159+
upload-assets:
160+
needs: create-release
161+
runs-on: ubuntu-latest
162+
strategy:
163+
matrix: ${{ fromJson( needs.create-release.outputs.asset_matrix ) }}
164+
name: upload ${{ matrix.artifact }}
165+
steps:
166+
167+
- uses: actions/download-artifact@v2
168+
with:
169+
name: ${{ matrix.artifact }}
170+
171+
- uses: actions/upload-release-asset@v1
172+
env:
173+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
174+
with:
175+
upload_url: ${{ needs.create-release.outputs.upload_url }}
176+
asset_path: ${{ matrix.file }}
177+
asset_name: ${{ matrix.artifact }}-${{ needs.create-release.outputs.datestamp }}-nightly${{ matrix.extension }}
178+
asset_content_type: application/gzip

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ config.status
55
Makefile
66
.DS_Store
77
!/regression/Makefile
8+
/build-*/
9+
/install-newlib-nano/
10+
/stamps/

.gitmodules

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1-
[submodule "riscv-binutils-gdb"]
2-
path = riscv-binutils-gdb
3-
url = ../riscv-binutils-gdb.git
1+
[submodule "riscv-binutils"]
2+
path = riscv-binutils
3+
url = https://github.com/riscv-collab/riscv-binutils-gdb.git
4+
branch = riscv-binutils-2.36.1
45
[submodule "riscv-gcc"]
56
path = riscv-gcc
6-
url = ../riscv-gcc.git
7+
url = https://github.com/riscv-collab/riscv-gcc.git
8+
branch = riscv-gcc-10.2.0
79
[submodule "riscv-glibc"]
810
path = riscv-glibc
9-
url = ../riscv-glibc.git
11+
url = git://sourceware.org/git/glibc.git
1012
[submodule "riscv-dejagnu"]
1113
path = riscv-dejagnu
12-
url = ../riscv-dejagnu.git
14+
url = https://github.com/riscv-collab/riscv-dejagnu.git
15+
branch = riscv-dejagnu-1.6
1316
[submodule "riscv-newlib"]
1417
path = riscv-newlib
15-
url = ../riscv-newlib.git
16-
[submodule "riscv-qemu"]
17-
path = riscv-qemu
18-
url = git://github.com/riscv/riscv-qemu.git
18+
url = git://sourceware.org/git/newlib-cygwin.git
19+
branch = master
20+
[submodule "riscv-gdb"]
21+
path = riscv-gdb
22+
url = https://github.com/riscv-collab/riscv-binutils-gdb.git
23+
branch = fsf-gdb-10.1-with-sim
24+
[submodule "qemu"]
25+
path = qemu
26+
url = https://git.qemu.org/git/qemu.git

.travis.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)