Skip to content

Commit 1ed5a32

Browse files
committed
Don't use shallow clones for risc-v toolchain
See upstream issue 1669
1 parent 1d5412b commit 1ed5a32

File tree

3 files changed

+62
-56
lines changed

3 files changed

+62
-56
lines changed
Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
#!/bin/bash
2-
3-
set -euo pipefail
4-
5-
export CFLAGS=-static
6-
export LDFLAGS=-static
7-
8-
INSTALLDIR="riscv-install"
9-
rm -rf $INSTALLDIR
10-
mkdir -p $INSTALLDIR
11-
12-
BUILDDIR=$(pwd)
13-
14-
cd riscv-gnu-toolchain
15-
./configure --prefix=$BUILDDIR/$INSTALLDIR --with-arch=rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb --with-abi=ilp32 --with-multilib-generator="rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb-ilp32--;rv32imac_zicsr_zifencei_zba_zbb_zbs_zbkb-ilp32--" --with-gcc-src=$BUILDDIR/gcc
16-
make -j$(nproc)
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
export CFLAGS=-static
6+
export LDFLAGS=-static
7+
8+
INSTALLDIR="riscv-install"
9+
rm -rf $INSTALLDIR
10+
mkdir -p $INSTALLDIR
11+
12+
BUILDDIR=$(pwd)
13+
14+
cd riscv-gnu-toolchain
15+
sed -i '/shallow = true/d' .gitmodules
16+
sed -i 's/--depth 1//g' Makefile.in
17+
./configure --prefix=$BUILDDIR/$INSTALLDIR --with-arch=rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb --with-abi=ilp32 --with-multilib-generator="rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb-ilp32--;rv32imac_zicsr_zifencei_zba_zbb_zbs_zbkb-ilp32--" --with-gcc-src=$BUILDDIR/gcc
18+
make -j$(nproc)
Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1-
#!/bin/bash
2-
3-
set -euo pipefail
4-
5-
# INSTALLDIR="riscv-install-$(uname -m)"
6-
INSTALLDIR="riscv-install"
7-
rm -rf $INSTALLDIR
8-
mkdir -p $INSTALLDIR
9-
10-
BUILDDIR=$(pwd)
11-
12-
GDB_TARGET_FLAGS_EXTRA="--with-gmp=/opt/homebrew --with-mpfr=/opt/homebrew"
13-
export GDB_TARGET_FLAGS_EXTRA
14-
15-
cd riscv-gnu-toolchain
16-
./configure --prefix=$BUILDDIR/$INSTALLDIR --with-arch=rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb --with-abi=ilp32 --with-multilib-generator="rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb-ilp32--;rv32imac_zicsr_zifencei_zba_zbb_zbs_zbkb-ilp32--" --with-gcc-src=$BUILDDIR/gcc
17-
# 4 threads, as 8 threads runs out of memory
18-
gmake -j4
19-
20-
# Make x64 and Windows toolchains, by copying multilib into existing toolchains
21-
cd ..
22-
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
23-
24-
$SCRIPT_DIR/build-riscv-gcc-other.sh "https://buildbot.embecosm.com/job/riscv32-gcc-macos-release/21/artifact/riscv32-embecosm-macos-gcc13.3.0.zip" "x64-mac"
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
# INSTALLDIR="riscv-install-$(uname -m)"
6+
INSTALLDIR="riscv-install"
7+
rm -rf $INSTALLDIR
8+
mkdir -p $INSTALLDIR
9+
10+
BUILDDIR=$(pwd)
11+
12+
GDB_TARGET_FLAGS_EXTRA="--with-gmp=/opt/homebrew --with-mpfr=/opt/homebrew"
13+
export GDB_TARGET_FLAGS_EXTRA
14+
15+
cd riscv-gnu-toolchain
16+
sed -i '/shallow = true/d' .gitmodules
17+
sed -i 's/--depth 1//g' Makefile.in
18+
./configure --prefix=$BUILDDIR/$INSTALLDIR --with-arch=rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb --with-abi=ilp32 --with-multilib-generator="rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb-ilp32--;rv32imac_zicsr_zifencei_zba_zbb_zbs_zbkb-ilp32--" --with-gcc-src=$BUILDDIR/gcc
19+
# 4 threads, as 8 threads runs out of memory
20+
gmake -j4
21+
22+
# Make x64 and Windows toolchains, by copying multilib into existing toolchains
23+
cd ..
24+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
25+
26+
$SCRIPT_DIR/build-riscv-gcc-other.sh "https://buildbot.embecosm.com/job/riscv32-gcc-macos-release/21/artifact/riscv32-embecosm-macos-gcc13.3.0.zip" "x64-mac"
Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
#!/bin/bash
2-
3-
set -euo pipefail
4-
5-
INSTALLDIR="riscv-install/${MSYSTEM,,}"
6-
rm -rf $INSTALLDIR
7-
mkdir -p $INSTALLDIR
8-
9-
BUILDDIR=$(pwd)
10-
11-
cd riscv-gnu-toolchain
12-
./configure --prefix=$BUILDDIR/$INSTALLDIR --with-arch=rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb --with-abi=ilp32 --with-multilib-generator="rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb-ilp32--;rv32imac_zicsr_zifencei_zba_zbb_zbs_zbkb-ilp32--"
13-
make -j$(nproc)
14-
15-
cd "$BUILDDIR/$INSTALLDIR"
16-
"$BUILDDIR/../packages/windows/copy-deps.sh"
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
INSTALLDIR="riscv-install/${MSYSTEM,,}"
6+
rm -rf $INSTALLDIR
7+
mkdir -p $INSTALLDIR
8+
9+
BUILDDIR=$(pwd)
10+
11+
cd riscv-gnu-toolchain
12+
sed -i '/shallow = true/d' .gitmodules
13+
sed -i 's/--depth 1//g' Makefile.in
14+
./configure --prefix=$BUILDDIR/$INSTALLDIR --with-arch=rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb --with-abi=ilp32 --with-multilib-generator="rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb-ilp32--;rv32imac_zicsr_zifencei_zba_zbb_zbs_zbkb-ilp32--"
15+
make -j$(nproc)
16+
17+
cd "$BUILDDIR/$INSTALLDIR"
18+
"$BUILDDIR/../packages/windows/copy-deps.sh"

0 commit comments

Comments
 (0)