Giter Club home page Giter Club logo

sunflower-toolchain's People

Contributors

btsouts avatar harrysarson avatar phillipstanleymarbell avatar rjlv2 avatar samuelmswong avatar samuelmswong-zz avatar tom-newton avatar z-gu avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

sunflower-toolchain's Issues

`downloads.sh` assumes presence of `wget`

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

Build issue on Virtualbox with Ubuntu 18.04 virtual machine

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:

  1. Clone ef8ca61
  2. Configure based on 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):

  • OS: Ubuntu 18.04 virtual machine.

You local changes (please complete the following information):

  • Output of 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).

Update ReadMe

Update the readme to include an apt command for installing all the dependencies mentioned in ReadMe step 1.

Use of -r when making binutils

On this line of the Makefile we pass -r to make.

https://github.com/phillipstanleymarbell/Sunflower-toolchain/blob/b74c5dc3457adf86fe428605fac176f639022b1d/tools/Makefile#L24

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?

Running sunflower on Windows Subsystem for Linux (WSL)

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.

downloads.sh url no longer allows anonymous access

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):

  • OS: Ubuntu Linux (virtual using WSL2 on Windows 10)
  • Version: 20.04.2

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/.

Consider using with-arch instead of with-cpu in setup.conf

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.