mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 01:21:26 +08:00
add sparc toolchain to linux docker
This commit is contained in:
+21
-1
@@ -46,7 +46,7 @@ case ${os} in
|
|||||||
brew update --quiet
|
brew update --quiet
|
||||||
;;
|
;;
|
||||||
Linux)
|
Linux)
|
||||||
install="python-tools gen-romfs gperf kconfig-frontends arm-gcc-toolchain mips-gcc-toolchain riscv-gcc-toolchain xtensa-esp32-gcc-toolchain rx-gcc-toolchain c-cache"
|
install="python-tools gen-romfs gperf kconfig-frontends arm-gcc-toolchain mips-gcc-toolchain riscv-gcc-toolchain xtensa-esp32-gcc-toolchain rx-gcc-toolchain sparc-gcc-toolchain c-cache"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@@ -288,6 +288,24 @@ function rx-gcc-toolchain {
|
|||||||
rx-elf-gcc --version
|
rx-elf-gcc --version
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sparc-gcc-toolchain {
|
||||||
|
add_path "${prebuilt}"/sparc-gaisler-elf-gcc/bin
|
||||||
|
|
||||||
|
if [ ! -f "${prebuilt}/sparc-gaisler-elf-gcc/bin/sparc-gaisler-elf-gcc" ]; then
|
||||||
|
case ${os} in
|
||||||
|
Linux)
|
||||||
|
cd "${prebuilt}"
|
||||||
|
wget --quiet https://www.gaisler.com/anonftp/bcc2/bin/bcc-2.1.0-gcc-linux64.tar.xz
|
||||||
|
xz -d bcc-2.1.0-gcc-linux64.tar.xz
|
||||||
|
tar xf bcc-2.1.0-gcc-linux64.tar
|
||||||
|
mv bcc-2.1.0-gcc sparc-gaisler-elf-gcc
|
||||||
|
rm bcc-2.1.0-gcc-linux64.tar
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
sparc-gaisler-elf-gcc --version
|
||||||
|
}
|
||||||
|
|
||||||
function c-cache {
|
function c-cache {
|
||||||
add_path "${prebuilt}"/ccache/bin
|
add_path "${prebuilt}"/ccache/bin
|
||||||
|
|
||||||
@@ -324,6 +342,8 @@ function c-cache {
|
|||||||
ln -sf "$(which ccache)" "${prebuilt}"/ccache/bin/xtensa-esp32-elf-gcc
|
ln -sf "$(which ccache)" "${prebuilt}"/ccache/bin/xtensa-esp32-elf-gcc
|
||||||
ln -sf "$(which ccache)" "${prebuilt}"/ccache/bin/avr-gcc
|
ln -sf "$(which ccache)" "${prebuilt}"/ccache/bin/avr-gcc
|
||||||
ln -sf "$(which ccache)" "${prebuilt}"/ccache/bin/avr-g++
|
ln -sf "$(which ccache)" "${prebuilt}"/ccache/bin/avr-g++
|
||||||
|
ln -sf "$(which ccache)" "${prebuilt}"/ccache/bin/sparc-gaisler-elf-gcc
|
||||||
|
ln -sf "$(which ccache)" "${prebuilt}"/ccache/bin/sparc-gaisler-elf-g++
|
||||||
}
|
}
|
||||||
|
|
||||||
function binutils {
|
function binutils {
|
||||||
|
|||||||
@@ -97,6 +97,15 @@ RUN mkdir riscv64-unknown-elf-gcc && \
|
|||||||
curl -s -L "https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-ubuntu14.tar.gz" \
|
curl -s -L "https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-ubuntu14.tar.gz" \
|
||||||
| tar -C riscv64-unknown-elf-gcc --strip-components 1 -xz
|
| tar -C riscv64-unknown-elf-gcc --strip-components 1 -xz
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Build image for tool required by SPARC builds
|
||||||
|
###############################################################################
|
||||||
|
FROM nuttx-toolchain-base AS nuttx-toolchain-sparc
|
||||||
|
# Download the SPARC GCC toolchain prebuilt by Gaisler
|
||||||
|
RUN mkdir sparc-gaisler-elf-gcc && \
|
||||||
|
curl -s -L "https://www.gaisler.com/anonftp/bcc2/bin/bcc-2.1.0-gcc-linux64.tar.xz" \
|
||||||
|
| tar -C sparc-gaisler-elf-gcc --strip-components 1 -xJ
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Build image for tool required by ESP32 builds
|
# Build image for tool required by ESP32 builds
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@@ -259,6 +268,10 @@ ENV PATH="/tools/pinguino-compilers/p32/bin:$PATH"
|
|||||||
COPY --from=nuttx-toolchain-riscv /tools/riscv64-unknown-elf-gcc/ riscv64-unknown-elf-gcc/
|
COPY --from=nuttx-toolchain-riscv /tools/riscv64-unknown-elf-gcc/ riscv64-unknown-elf-gcc/
|
||||||
ENV PATH="/tools/riscv64-unknown-elf-gcc/bin:$PATH"
|
ENV PATH="/tools/riscv64-unknown-elf-gcc/bin:$PATH"
|
||||||
|
|
||||||
|
# SPARC toolchain
|
||||||
|
COPY --from=nuttx-toolchain-sparc /tools/sparc-gaisler-elf-gcc/ sparc-gaisler-elf-gcc/
|
||||||
|
ENV PATH="/tools/sparc-gaisler-elf-gcc/bin:$PATH"
|
||||||
|
|
||||||
# ESP32 toolchain
|
# ESP32 toolchain
|
||||||
COPY --from=nuttx-toolchain-esp32 /tools/xtensa-esp32-elf-gcc/ xtensa-esp32-elf-gcc/
|
COPY --from=nuttx-toolchain-esp32 /tools/xtensa-esp32-elf-gcc/ xtensa-esp32-elf-gcc/
|
||||||
ENV PATH="/tools/xtensa-esp32-elf-gcc/bin:$PATH"
|
ENV PATH="/tools/xtensa-esp32-elf-gcc/bin:$PATH"
|
||||||
@@ -295,6 +308,8 @@ RUN mkdir -p /tools/ccache/bin && \
|
|||||||
ln -sf `which ccache` /tools/ccache/bin/p32-gcc && \
|
ln -sf `which ccache` /tools/ccache/bin/p32-gcc && \
|
||||||
ln -sf `which ccache` /tools/ccache/bin/riscv64-unknown-elf-gcc && \
|
ln -sf `which ccache` /tools/ccache/bin/riscv64-unknown-elf-gcc && \
|
||||||
ln -sf `which ccache` /tools/ccache/bin/riscv64-unknown-elf-g++ && \
|
ln -sf `which ccache` /tools/ccache/bin/riscv64-unknown-elf-g++ && \
|
||||||
|
ln -sf `which ccache` /tools/ccache/bin/sparc-gaisler-elf-gcc && \
|
||||||
|
ln -sf `which ccache` /tools/ccache/bin/sparc-gaisler-elf-g++ && \
|
||||||
ln -sf `which ccache` /tools/ccache/bin/xtensa-esp32-elf-gcc && \
|
ln -sf `which ccache` /tools/ccache/bin/xtensa-esp32-elf-gcc && \
|
||||||
ln -sf `which ccache` /tools/ccache/bin/xtensa-esp32-elf-g++ && \
|
ln -sf `which ccache` /tools/ccache/bin/xtensa-esp32-elf-g++ && \
|
||||||
ln -sf `which ccache` /tools/ccache/bin/xtensa-esp32s2-elf-gcc && \
|
ln -sf `which ccache` /tools/ccache/bin/xtensa-esp32s2-elf-gcc && \
|
||||||
|
|||||||
Reference in New Issue
Block a user