mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
Released SDCC 4.5.0 and 4.6.0 miscompile some of our code in the mcs51 register allocator (SDCC bugs 4153 and 4154, fixed in trunk r17025 and r17039). The first make now downloads the 4.6.0 sources, checks their sha256, applies the two fixes from sdcc/ and installs the compiler into toolchain/, named after a checksum of sdcc/, so a changed patch builds a new one. make CC=sdcc still uses an installed compiler.
27 lines
883 B
Bash
Executable File
27 lines
883 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
V=4.6.0
|
|
SHA=5fd6a93e5997ce01756868fe35e441095cfb637894a80c262514a634094973b6
|
|
PREFIX=$1
|
|
D=$(cd "$(dirname "$0")" && pwd)
|
|
W=$(mktemp -d)
|
|
trap 'rm -rf "$W"' EXIT
|
|
curl -fL -o "$W/sdcc.tar.bz2" "https://downloads.sourceforge.net/project/sdcc/sdcc/$V/sdcc-src-$V.tar.bz2"
|
|
if command -v sha256sum >/dev/null; then
|
|
echo "$SHA $W/sdcc.tar.bz2" | sha256sum -c -
|
|
else
|
|
echo "$SHA $W/sdcc.tar.bz2" | shasum -a 256 -c -
|
|
fi
|
|
tar -C "$W" -xjf "$W/sdcc.tar.bz2"
|
|
cd "$W/sdcc-$V"
|
|
for p in "$D"/*.patch; do
|
|
patch -p0 < "$p"
|
|
done
|
|
off=""
|
|
for p in z80 z180 r2k r2ka r3ka r4k r5k r6k sm83 tlcs90 ez80 ez80_z80 z80n r800 ds390 ds400 pic14 pic16 hc08 s08 stm8 pdk13 pdk14 pdk15 mos6502 mos65c02 huc6280 f8 f8l; do
|
|
off="$off --disable-$p-port"
|
|
done
|
|
./configure --prefix="$PREFIX" $off --disable-sdcdb --disable-ucsim --disable-non-free
|
|
make -j"$(getconf _NPROCESSORS_ONLN)"
|
|
make install
|