-
Notifications
You must be signed in to change notification settings - Fork 6
Added a dockerfile to build compiling environment to build X86, ARM, and RISCV binaries. #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
The way to fix the files being owned by root is to use the |
powerjg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great start!
Can you create three separate dockerfiles for each one of them?
|
It would be good to get @hildebrandmw 's feedback once this is updated with separate files. |
powerjg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is much better! Yeah, it sounds like there's tradeoffs between separate commands per RUN and everything in one RUN command. For our use case, I feel like the improved speed for debugging is more important than improved speed for building. Neither of which matters much ;)
| 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 | ||
| RUN git checkout 23a038856764808d75b6afe96f649980609ae4c6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late comment... can you checkout a tag instead of a hash? Are there tags for specific versions of gcc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They have tags, each has a specific version of gcc.
|
Let's pick one and use that tag. Let's use the same version as in the
ubuntu repos, if possible.
…On Mon, Jul 15, 2019 at 10:00 AM Hoa Nguyen ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In Dockerfile_RISCV
<#5 (comment)>:
> @@ -0,0 +1,22 @@
+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
+RUN mkdir -p $HOME_DIR
+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
+RUN git checkout 23a038856764808d75b6afe96f649980609ae4c6
They have tags, each has a specific version of gcc.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#5?email_source=notifications&email_token=AAA2YHB7CM4C52VK4ODQYZ3P7SUJTA5CNFSM4IDLG662YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB6ORC6Q#discussion_r303537998>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAA2YHFVROXT3CGMQFU3FJTP7SUJTANCNFSM4IDLG66Q>
.
--
Jason Lowe-Power (he/him/his)
Assistant Professor, Computer Science Department
University of California, Davis
3049 Kemper Hall
https://arch.cs.ucdavis.edu/
|
|
The riscv-gnu-toolchain repo newest release was in December 2017, and it uses gcc 7.2.0. There are 2 newer tags since then. Do you think it is better to use the newer tags or the latest release? |
|
IIRC, RISC-V support is now mainlined in GCC. You might be able to use the main GCC repo instead of using the fork. Although, with 5 minutes of googling I couldn't figure out how to do it. So, it may not be possible. @nganjehloo, do you have any ideas on the best version of the RISC-V toolchain to use? |
The X86 and ARM gcc compilers are Ubuntu packages. The script clones RISCV-gnu-toolchain repo, checkouts a commit hash and compiles the tools.
Compiling RISCV-gcc takes lots of memory, so -m should be set for building the image.
A few concerns: