From 15b7266c57fba3021a24ae277cfd425c73e5c9a0 Mon Sep 17 00:00:00 2001 From: Hoa Nguyen Date: Fri, 12 Jul 2019 15:55:20 -0700 Subject: [PATCH 01/10] added Dockerfile --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fe2b451 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM ubuntu:18.04 +RUN apt-get update && apt-get install -y build-essential gcc-arm-linux-gnueabihf +CMD ls /usr/bin From 61a071fb0a1c13f06d9fc39581dfa49bd8af73bf Mon Sep 17 00:00:00 2001 From: Hoa Nguyen Date: Fri, 12 Jul 2019 17:10:28 -0700 Subject: [PATCH 02/10] added RISCV building process to Dockerfile --- Dockerfile | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index fe2b451..4fc3098 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,16 @@ FROM ubuntu:18.04 -RUN apt-get update && apt-get install -y build-essential gcc-arm-linux-gnueabihf -CMD ls /usr/bin +RUN apt-get update \ + && apt-get install -y build-essential gcc-arm-linux-gnueabihf git\ + && export HOME_DIR=/home/root/ \ + && export RISCV_SRC_DIR=$HOME_DIR/riscv-gnu-toolchain/ \ + && export RISCV__DIR=$HOME_DIR/riscv-tools/ \ + && mkdir $HOME_DIR \ + && cd $HOME_DIR \ + && git clone --recursive https://github.com/riscv/riscv-gnu-toolchain \ + && git checkout 23a038856764808d75b6afe96f649980609ae4c6 \ + && $RISCV_SRC_DIR/riscv-gcc/contrib/download_prerequisites \ + && cd $RISCV_SRC_DIR \ + && ./configure --prefix=$RISCV_DIR \ + && make -j 32 \ + && rm -rf /home/root/riscv-gnu-toolchain \ +CMD ls From 971beb5fe44fe3375c2fd447e3d509ccaf8009eb Mon Sep 17 00:00:00 2001 From: Hoa Nguyen Date: Fri, 12 Jul 2019 18:29:40 -0700 Subject: [PATCH 03/10] added comments and fixed spelling errors --- Dockerfile | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4fc3098..f7f8189 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,28 @@ FROM ubuntu:18.04 RUN apt-get update \ - && apt-get install -y build-essential gcc-arm-linux-gnueabihf git\ + # Install gcc for x86 and ARM + && apt-get install -y build-essential gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf git\ + # Prepare to download and compile RISCV toolchain && export HOME_DIR=/home/root/ \ && export RISCV_SRC_DIR=$HOME_DIR/riscv-gnu-toolchain/ \ - && export RISCV__DIR=$HOME_DIR/riscv-tools/ \ + && export RISCV_DIR=$HOME_DIR/riscv-tools/ \ && mkdir $HOME_DIR \ && cd $HOME_DIR \ - && git clone --recursive https://github.com/riscv/riscv-gnu-toolchain \ + && git clone --recursive https://github.com/riscv/riscv-gnu-toolchain -j 8\ + && cd $RISCV_SRC_DIR \ + # Checkout a specific hash to keep the output binaries consistent && git checkout 23a038856764808d75b6afe96f649980609ae4c6 \ - && $RISCV_SRC_DIR/riscv-gcc/contrib/download_prerequisites \ + # Downloading the prereqs must be done in riscv-gcc folder + && cd $RISCV_SRC_DIR/riscv-gcc \ + && ./contrib/download_prerequisites \ && cd $RISCV_SRC_DIR \ && ./configure --prefix=$RISCV_DIR \ && make -j 32 \ - && rm -rf /home/root/riscv-gnu-toolchain \ + # Remove the source code + && rm -rf $RISCV_SRC_DIR + +# Modify to compile +# For x86: gcc +# For ARM: arm-linux-gnueabi-gcc or arm-linux-gnueabihf-gcc ? +# For RISCV: $RISCV_DIR/bin/riscv64-unknown-elf-gcc CMD ls From 31ee25497f1a538c52a5361dc221dd1a94e9a2e0 Mon Sep 17 00:00:00 2001 From: Hoa Nguyen Date: Sat, 13 Jul 2019 13:49:19 -0700 Subject: [PATCH 04/10] added curl utilized by downloading prereqs --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index f7f8189..5e9e715 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ FROM ubuntu:18.04 RUN apt-get update \ # Install gcc for x86 and ARM - && apt-get install -y build-essential gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf git\ + && apt-get install -y build-essential gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf git curl\ # Prepare to download and compile RISCV toolchain - && export HOME_DIR=/home/root/ \ - && export RISCV_SRC_DIR=$HOME_DIR/riscv-gnu-toolchain/ \ - && export RISCV_DIR=$HOME_DIR/riscv-tools/ \ + && export HOME_DIR=/home/root \ + && export RISCV_SRC_DIR=$HOME_DIR/riscv-gnu-toolchain \ + && export RISCV_DIR=$HOME_DIR/riscv-tools \ && mkdir $HOME_DIR \ && cd $HOME_DIR \ && git clone --recursive https://github.com/riscv/riscv-gnu-toolchain -j 8\ From d00ab23fa1cfcec0fee7d2d77b23e9198093f684 Mon Sep 17 00:00:00 2001 From: Hoa Nguyen Date: Sat, 13 Jul 2019 17:48:42 -0700 Subject: [PATCH 05/10] added more dependencies for compiling --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5e9e715..1dce4ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,8 @@ FROM ubuntu:18.04 RUN apt-get update \ # Install gcc for x86 and ARM - && apt-get install -y build-essential gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf git curl\ + && apt-get install -y build-essential gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf git \ + curl gawk texinfo expat libexpat1-dev bison flex libz-dev \ # Prepare to download and compile RISCV toolchain && export HOME_DIR=/home/root \ && export RISCV_SRC_DIR=$HOME_DIR/riscv-gnu-toolchain \ From 14ffd8e04e1d6de2d3109493188c8aca765c9418 Mon Sep 17 00:00:00 2001 From: Hoa Nguyen Date: Sun, 14 Jul 2019 01:19:56 -0700 Subject: [PATCH 06/10] added python package for compiling --- Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1dce4ae..c51d967 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM ubuntu:18.04 RUN apt-get update \ # Install gcc for x86 and ARM && apt-get install -y build-essential gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf git \ - curl gawk texinfo expat libexpat1-dev bison flex libz-dev \ + curl gawk texinfo expat libexpat1-dev bison flex libz-dev python \ # Prepare to download and compile RISCV toolchain && export HOME_DIR=/home/root \ && export RISCV_SRC_DIR=$HOME_DIR/riscv-gnu-toolchain \ @@ -22,8 +22,6 @@ RUN apt-get update \ # Remove the source code && rm -rf $RISCV_SRC_DIR -# Modify to compile # For x86: gcc # For ARM: arm-linux-gnueabi-gcc or arm-linux-gnueabihf-gcc ? # For RISCV: $RISCV_DIR/bin/riscv64-unknown-elf-gcc -CMD ls From 615337c86abdef73f34bb0cfd239cb134e7e79b6 Mon Sep 17 00:00:00 2001 From: Hoa Nguyen Date: Sun, 14 Jul 2019 20:48:54 -0700 Subject: [PATCH 07/10] added Dockerfile for each target --- Dockerfile | 27 --------------------------- Dockerfile_ARM | 4 ++++ Dockerfile_RISCV | 26 ++++++++++++++++++++++++++ Dockerfile_X86 | 3 +++ 4 files changed, 33 insertions(+), 27 deletions(-) delete mode 100644 Dockerfile create mode 100644 Dockerfile_ARM create mode 100644 Dockerfile_RISCV create mode 100644 Dockerfile_X86 diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index c51d967..0000000 --- a/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM ubuntu:18.04 -RUN apt-get update \ - # Install gcc for x86 and ARM - && apt-get install -y build-essential gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf git \ - curl gawk texinfo expat libexpat1-dev bison flex libz-dev python \ - # Prepare to download and compile RISCV toolchain - && export HOME_DIR=/home/root \ - && export RISCV_SRC_DIR=$HOME_DIR/riscv-gnu-toolchain \ - && export RISCV_DIR=$HOME_DIR/riscv-tools \ - && mkdir $HOME_DIR \ - && cd $HOME_DIR \ - && git clone --recursive https://github.com/riscv/riscv-gnu-toolchain -j 8\ - && cd $RISCV_SRC_DIR \ - # Checkout a specific hash to keep the output binaries consistent - && git checkout 23a038856764808d75b6afe96f649980609ae4c6 \ - # Downloading the prereqs must be done in riscv-gcc folder - && cd $RISCV_SRC_DIR/riscv-gcc \ - && ./contrib/download_prerequisites \ - && cd $RISCV_SRC_DIR \ - && ./configure --prefix=$RISCV_DIR \ - && make -j 32 \ - # Remove the source code - && rm -rf $RISCV_SRC_DIR - -# For x86: gcc -# For ARM: arm-linux-gnueabi-gcc or arm-linux-gnueabihf-gcc ? -# For RISCV: $RISCV_DIR/bin/riscv64-unknown-elf-gcc diff --git a/Dockerfile_ARM b/Dockerfile_ARM new file mode 100644 index 0000000..b3c640e --- /dev/null +++ b/Dockerfile_ARM @@ -0,0 +1,4 @@ +FROM ubuntu:18.04 +RUN apt-get update +RUN apt-get install -y build-essential python \ + gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf diff --git a/Dockerfile_RISCV b/Dockerfile_RISCV new file mode 100644 index 0000000..5dffee2 --- /dev/null +++ b/Dockerfile_RISCV @@ -0,0 +1,26 @@ +FROM ubuntu:18.04 +RUN apt-get update +RUN apt-get install -y build-essential git curl gawk texinfo expat \ + libexpat1-dev bison flex libz-dev python autoconf +# Prepare to download and compile RISCV toolchain +ENV HOME_DIR=/home/root +ENV RISCV_SRC_DIR=$HOME_DIR/riscv-gnu-toolchain +ENV RISCV_DIR=$HOME_DIR/riscv-tools +ENV mkdir -p $HOME_DIR +WORKDIR $HOME_DIR +RUN git clone --recursive https://github.com/riscv/riscv-gnu-toolchain -j 8 +WORKDIR $RISCV_SRC_DIR +# Checkout a specific hash to keep the output binaries consistent +WORKDIR git checkout 23a038856764808d75b6afe96f649980609ae4c6 +# Downloading the prereqs must be done in riscv-gcc folder +WORKDIR $RISCV_SRC_DIR/riscv-gcc +RUN ./contrib/download_prerequisites +WORKDIR $RISCV_SRC_DIR +RUN ./configure --prefix=$RISCV_DIR +RUN make -j 8 +# Remove the source code +RUN rm -rf $RISCV_SRC_DIR + +# For x86: gcc +# For ARM: arm-linux-gnueabi-gcc or arm-linux-gnueabihf-gcc ? +# For RISCV: $RISCV_DIR/bin/riscv64-unknown-elf-gcc diff --git a/Dockerfile_X86 b/Dockerfile_X86 new file mode 100644 index 0000000..601cf4c --- /dev/null +++ b/Dockerfile_X86 @@ -0,0 +1,3 @@ +FROM ubuntu:18.04 +RUN apt-get update +RUN apt-get install -y build-essential python From 11bb3672e48942418ffd870ff295c7452bef49a0 Mon Sep 17 00:00:00 2001 From: Hoa Nguyen Date: Mon, 15 Jul 2019 09:45:24 -0700 Subject: [PATCH 08/10] added nproc to -j options --- Dockerfile_RISCV | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile_RISCV b/Dockerfile_RISCV index 5dffee2..4d51537 100644 --- a/Dockerfile_RISCV +++ b/Dockerfile_RISCV @@ -6,9 +6,9 @@ RUN apt-get install -y build-essential git curl gawk texinfo expat \ ENV HOME_DIR=/home/root ENV RISCV_SRC_DIR=$HOME_DIR/riscv-gnu-toolchain ENV RISCV_DIR=$HOME_DIR/riscv-tools -ENV mkdir -p $HOME_DIR +RUN mkdir -p $HOME_DIR WORKDIR $HOME_DIR -RUN git clone --recursive https://github.com/riscv/riscv-gnu-toolchain -j 8 +RUN git clone --recursive https://github.com/riscv/riscv-gnu-toolchain -j $(nproc) WORKDIR $RISCV_SRC_DIR # Checkout a specific hash to keep the output binaries consistent WORKDIR git checkout 23a038856764808d75b6afe96f649980609ae4c6 @@ -17,7 +17,7 @@ WORKDIR $RISCV_SRC_DIR/riscv-gcc RUN ./contrib/download_prerequisites WORKDIR $RISCV_SRC_DIR RUN ./configure --prefix=$RISCV_DIR -RUN make -j 8 +RUN make -j $(nproc) # Remove the source code RUN rm -rf $RISCV_SRC_DIR From 2920275e9706c3d9cb9531ece04b18414cfdf29c Mon Sep 17 00:00:00 2001 From: Hoa Nguyen Date: Mon, 15 Jul 2019 09:47:29 -0700 Subject: [PATCH 09/10] fixed wrong WORKDIR --- Dockerfile_RISCV | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile_RISCV b/Dockerfile_RISCV index 4d51537..24a3584 100644 --- a/Dockerfile_RISCV +++ b/Dockerfile_RISCV @@ -11,7 +11,7 @@ WORKDIR $HOME_DIR RUN git clone --recursive https://github.com/riscv/riscv-gnu-toolchain -j $(nproc) WORKDIR $RISCV_SRC_DIR # Checkout a specific hash to keep the output binaries consistent -WORKDIR git checkout 23a038856764808d75b6afe96f649980609ae4c6 +RUN git checkout 23a038856764808d75b6afe96f649980609ae4c6 # Downloading the prereqs must be done in riscv-gcc folder WORKDIR $RISCV_SRC_DIR/riscv-gcc RUN ./contrib/download_prerequisites From 01c1ebed144f0a289941328610bec801698d992c Mon Sep 17 00:00:00 2001 From: Hoa Nguyen Date: Mon, 15 Jul 2019 09:49:24 -0700 Subject: [PATCH 10/10] removed unnecessary comments on Dockerfile_RISCV --- Dockerfile_RISCV | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Dockerfile_RISCV b/Dockerfile_RISCV index 24a3584..6b9dc5e 100644 --- a/Dockerfile_RISCV +++ b/Dockerfile_RISCV @@ -20,7 +20,3 @@ RUN ./configure --prefix=$RISCV_DIR RUN make -j $(nproc) # Remove the source code RUN rm -rf $RISCV_SRC_DIR - -# For x86: gcc -# For ARM: arm-linux-gnueabi-gcc or arm-linux-gnueabihf-gcc ? -# For RISCV: $RISCV_DIR/bin/riscv64-unknown-elf-gcc