physical-computation / sunflower-toolchain Goto Github PK
View Code? Open in Web Editor NEWCross-Compiler (gcc), Binary Utilities (binutils), and C library (newlib) toolchain for Embedded Systems (refactored from sunflower-simulator)
Cross-Compiler (gcc), Binary Utilities (binutils), and C library (newlib) toolchain for Embedded Systems (refactored from sunflower-simulator)
Add arm support.
Add libprintf support from @harrysarson.
Description
The downloads.sh
script makes use of wget
which comes as standard with Linux operating systems. However I don't think this is standard for macOS, as running downloads.sh
on a mac will give a command not found
error. Maybe put a notification (or installation steps) in the build instructions for mac users?
To Reproduce
Clone sunflower, configure the conf/setup.conf
file, run downloads.sh
from sunflower-simulator/tools/source
Expected behavior
Installation of libraries should complete after about a minute.
OS type
Darwin
Machine type
i386
Enable multilib builds.
Update README.md and build Makefiles.
Another issue to come out working with Makefile in #18:
The files: https://github.com/physical-computation/sunflower-simulator/blob/master/Makefile and https://github.com/phillipstanleymarbell/Sunflower-toolchain/blob/master/Makefile are almost identical.
I believe the Makefile in sunflower-simulator
could be made to depend on that in sunflower-toolchain
to reduce duplication of code.
Sorry, this issue should be for the simulator repository
uncertain-binutils
(along with binutils
, gcc
, etc.) are generated with downloads.sh
, and so should not be present when the repo is first cloned.
Otherwise, a file already exists
error will occur.
Describe the bug
The newlib
C library compilation process was looking for tools installed with the prefix riscv-unknown-elf-xyz
whereas the tools built in the gcc
and binutils
build phases did not include unknown
in the tool names.
To Reproduce
Steps to reproduce the behavior:
README.md
instructions (see diff below).Expected behavior
Binutils, gcc, and newly should build cleanly.
Screenshots
N/A.
Host OS (please complete the following information):
You local changes (please complete the following information):
git diff
git diff
diff --git a/conf/setup.conf b/conf/setup.conf
index 80ff556..4408e16 100755
--- a/conf/setup.conf
+++ b/conf/setup.conf
@@ -1,19 +1,22 @@
##
## You will want to change the following to suit your setup:
##
-SUNFLOWERROOT = /usr/local/src/git/sunflower-simulator-github-clone
+
+
+
+SUNFLOWERROOT = /home/user/sunflower-simulator
OSTYPE = linux
MACHTYPE = i386
-TARGET = superH
+TARGET = riscv
TARGET-ARCH-FLAGS = -DM32
-TARGET-ARCH = sh-elf
+TARGET-ARCH = riscv32-elf
GMAKE = /usr/bin/make
#
# Specifies the architecture used. Uncomment for riscv builds.
#
-#ADDITIONAL_ARCH_FLAGS = --with-cpu=rv32i#fd
+ADDITIONAL_ARCH_FLAGS = --with-cpu=rv32i#fd
#
# On newer versions of macOS, you will need to install gcc
Additional context
The newlib
C library compilation process was looking for tools installed with the prefix riscv-unknown-elf-xyz
whereas the tools built in the gcc
and binutils
build phases did not include unknown
in the tool names. Can remedy this by aliasing / creating symbolic links to what the C library compilation process needed in tools/bin
and then re-run the last stage of the make cross
process (i.e., make newlib
).
Move sunflower-toolchain to physical-computation github team and consider renaming it since we now use in many places (Warp, Helium, Sail/Strigidae, etc.), just as we have done for sunflower-simulator.
Update the readme to include an apt
command for installing all the dependencies mentioned in ReadMe step 1.
I tried building the cross compiler using wsl and came across two errors.
Due to this set up the $PATH
environment variable includes directories and files containing spaces.
This causes make to fail here:
https://github.com/phillipstanleymarbell/sunflower-simulator/blob/master/Makefile#L18.
There is no config for linux-x86_64.
I have managed to fix these two issues locally, would a PR be welcome?
On this line of the Makefile we pass -r
to make.
The -r
argument is documented as follows
‘-r’
‘--no-builtin-rules’Eliminate use of the built-in implicit rules (see Using Implicit Rules). You can still define your own by writing pattern rules (see Defining and Redefining Pattern Rules). The ‘-r’ option also clears out the default list of suffixes for suffix rules (see Old-Fashioned Suffix Rules). But you can still define your own suffixes with a rule for .SUFFIXES, and then define your own suffix rules. Note that only rules are affected by the -r option; default variables remain in effect (see Variables Used by Implicit Rules); see the ‘-R’ option below.
The build issues mentioned in #18 (comment) and #18 (comment) are fixed if I remove the flag.
@phillipstanleymarbell do you know why the -r
flag was added?
Is your feature request related to a problem?
Running make cross-riscv
(or any other cross compiler) on most WSL setups will fail giving an error like this:
/bin/sh: 1: Syntax error: "(" unexpected
make[1]: *** [Makefile:25: cross-riscv] Error 2
make[1]: Leaving directory '/home/tom/code/sunflower-simulator/sunflower-toolchain'
make: *** [Makefile:22: cross-riscv] Error 2
tom@Toms-Laptop:~/code/sunflower-simulator$
This is because the PATH
environment variable inherits from windows leading to entries like /mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common
appearing which crucially contain (
s and
s.
By default Debian WSL doesn't inherit the windows path so it doesn't have this problem but Ubuntu does. It is useful that the windows path is inherited so you can use stuff like this: https://docs.microsoft.com/en-us/windows/wsl/tutorials/wsl-vscode
Describe the solution you'd like
Add "
s whenever setting the PATH
variable in a Makefile.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
I can make a PR if you like, I have a branch but don't have push permissions.
Describe the bug
downlods.sh attempts to download newlib from ftp://sources.redhat.com
but it seems anonymous downloads are no longer allowed. This causes donwloads.sh to fail.
To Reproduce
Try to run downloads.sh after redhat changed there policy.
Expected behavior
This should download required dependencies.
Screenshots
If applicable, add screenshots to help explain your problem.
Host OS (please complete the following information):
Additional context
I'll make a PR for this. There is an alternative ftp url ftp://sourceware.org/pub/newlib/
this is from newlib's website https://sourceware.org/newlib/
.
In conf/setup.conf
we set the riscv architecture using --with-cpu
.
https://github.com/phillipstanleymarbell/Sunflower-toolchain/blob/master/conf/setup.conf#L20
In Makefile
we set the architecture with --with-arch
(by evoking make with variables set).
https://github.com/phillipstanleymarbell/Sunflower-toolchain/blob/master/Makefile#L23
I believe we should be consistant across these two file. Additionally, I had (I think?) trouble building the toolchain correctly using the --with-cpu
flag and (again I think) it worked better using --with-arch
. I am not 100% sure though. https://gcc.gnu.org/install/configure.html describes both --with-cpu
and --with-arch
but not in much detail and I cannot really tell the difference.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.