# Windows platform compiler and IDE

**URL:** <https://forums.sifive.com/t/windows-platform-compiler-and-ide/143>\
**Category:** Freedom E300\
**Created:** [December 1, 2016, 5:59am UTC](https://forums.sifive.com/t/windows-platform-compiler-and-ide/143 "2016-12-01T05:59:39Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![riscv2016](https://avatars.discourse-cdn.com/v4/letter/r/53a042/32.png) [@riscv2016](https://forums.sifive.com/u/riscv2016)\
**Post date:** [December 1, 2016, 5:59am UTC](https://forums.sifive.com/t/windows-platform-compiler-and-ide/143/1 "2016-12-01T05:59:39Z")

</div>

Hi,

It seems the compiler in Freedom SDK can only work only under Linux. Is any compiler available on Windows environment?

In addition, when Arduino-Compatible SDK for HiFive1 is going to be released?

Thanks

Bob

---

<div class="post-metadata">

**Author:** ![mwachs5](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/mwachs5/32/13_2.png) [@mwachs5](https://forums.sifive.com/u/mwachs5)\
**Post date:** [December 1, 2016, 4:08pm UTC](https://forums.sifive.com/t/windows-platform-compiler-and-ide/143/2 "2016-12-01T16:08:44Z")

</div>

Bob,

We’re very actively working on the Arduino SDK and getting it cleaned up to make it easy for people to install (vs having to compile the tools themselves). We’re hoping to release that by the end of next week.

I’ve heard rumors of people getting the RISC-V tools to work on Windows in environments like Cygwin. If you try it out, please report back what problems you encounter and we can all work together to get a foolproof way for running on Windows.

Thanks,  
Megan

---

<div class="post-metadata">

**Author:** ![riscv2016](https://avatars.discourse-cdn.com/v4/letter/r/53a042/32.png) [@riscv2016](https://forums.sifive.com/u/riscv2016)\
**Post date:** [December 2, 2016, 3:42am UTC](https://forums.sifive.com/t/windows-platform-compiler-and-ide/143/3 "2016-12-02T03:42:51Z")

</div>

Thanks

I have Cygwin. Will try it later.

---

<div class="post-metadata">

**Author:** ![dagema](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/dagema/32/59_2.png) [@dagema](https://forums.sifive.com/u/dagema)\
**Post date:** [December 12, 2016, 4:40pm UTC](https://forums.sifive.com/t/windows-platform-compiler-and-ide/143/4 "2016-12-12T16:40:45Z")

</div>

> [@mwachs5](#):
>
> I’ve heard rumors of people getting the RISC-V tools to work on Windows in environments like Cygwin. If you try it out, please report back what problems you encounter and we can all work together to get a foolproof way for running on Windows.
> 
> Thanks,Megan

I am now going through to process of trying to install the freedom-e300-sdk on Windows using Cygwin. The make tools has been runnung for quite some time now without throwing errors, so I am fairly confident of eventual success. I am writing this now perhaps premature, but I want to use the time waiting for make tools to complete usefully rather than just watching the terminal grind away.

Here are the steps I have taken:

1. Fresh install of Cygwin64 on a Lenovo Laptop: 4 processors, 8GB ram, 1TB SSD,  
Windows 7 64-bit.

2. Coloned freedom-e-sdk.git. Note: I first tried to use the download option in Github, but it did not work for me. I only got the top level freedom-e-sdk-master with a total of 272 KB of data. I therefore installed the Github GUI and used that to clone freedom-e-sdk to my Cygwin home directory.

3. Checked the Cygwin installation for inclusion of the packages listed in the readme file of the freedom-e-sdk directory as being required, and installed those which were not yet included.

4. attempted make tools. This quickly revealed that Cygwin was not able to handle the line formating in the .git configure files. After a bit of duck-duck-going (I don’t google anymore) I found that I could easily modify the affected files using the free tool Notepad++, so I installed that in Windows. At first I waited for errors, usually looking something like this:

> /home/Donnie/freedom-e-sdk/riscv-gnu-toolchain/riscv-binutils-gdb/bfd/configure.host: line 20: $‘\r’: command not found  
> /home/Donnie/freedom-e-sdk/riscv-gnu-toolchain/riscv-binutils-gdb/bfd/configure.host: line 25: $‘\r’: command not found  
> /home/Donnie/freedom-e-sdk/riscv-gnu-toolchain/riscv-binutils-gdb/bfd/configure.host: line 31: $‘\r’: command not found  
> /home/Donnie/freedom-e-sdk/riscv-gnu-toolchain/riscv-binutils-gdb/bfd/configure.host: line 36: $‘\r’: command not found  
> /home/Donnie/freedom-e-sdk/riscv-gnu-toolchain/riscv-binutils-gdb/bfd/configure.host: line 37: syntax error near unexpected token `$'in\r'' /home/Donnie/freedom-e-sdk/riscv-gnu-toolchain/riscv-binutils-gdb/bfd/configure.host: line 37: `case "${

The $‘\r’ line ending is the only problem I have yet encountered. This can be corrected by opening the file in Notepad++, selecting Edit-\>Format Line Ending-\>Convert to UNIX, and then saving the file. After a while it appeared that this problem only popped up in Configure files, with one exception: C:\cygwin64\home\Donnie\freedom-e-sdk\riscv-gnu-toolchain\scripts\cp\_s which also was affected, but instead of a line ending problem, make reported “unexpected end of file” error, which I fixed by adding a comment line at the end of the file. So rather than continuing to wait for errors I decided to proactively search for and correct all Configure files.

Note: I am certain there is a better way of doing this instead of using Notepad++, probably using regular expressions, but I leave that up to someone else to come up with.

After modifying all the Configure files and cp\_s, I ran make clean and then again started make tools in the freedom-e-sdk directory under my Cygwin home. I will report the results when the make job is finished.

Best regards,  
Donnie

Ok, the job is not yet finished, but an additional file has thrown the $‘\r’-error:\> /home/Donnie/freedom-e-sdk/riscv-gnu-toolchain/riscv-binutils-gdb/bfd/…/bfd/development.sh: line 17: $‘\r’: command not found

Also, please note that you cannot rely on the make crashing on such errors. In the above case it did not. You have to carefully review the output to ensure that no necessary file modifications were omitted.

---

<div class="post-metadata">

**Author:** ![mwachs5](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/mwachs5/32/13_2.png) [@mwachs5](https://forums.sifive.com/u/mwachs5)\
**Post date:** [December 12, 2016, 6:20pm UTC](https://forums.sifive.com/t/windows-platform-compiler-and-ide/143/5 "2016-12-12T18:20:44Z")

</div>

Thanks for reporting Donnie.

I’m wondering if this problem can be resolved at the repository level, something like

> <https://stackoverflow.com/questions/170961/whats-the-best-crlf-carriage-return-line-feed-handling-strategy-with-git>

Megan

---

<div class="post-metadata">

**Author:** ![dagema](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/dagema/32/59_2.png) [@dagema](https://forums.sifive.com/u/dagema)\
**Post date:** [December 12, 2016, 6:33pm UTC](https://forums.sifive.com/t/windows-platform-compiler-and-ide/143/6 "2016-12-12T18:33:47Z")

</div>

> [@dagema](#):
>
> After modifying all the Configure files and cp\_s, I ran make clean and then again started make tools in the freedom-e-sdk directory under my Cygwin home. I will report the results when the make job is finished.
> 
> Best regards,Donnie

make tools has completed, but I see an error at the end of the process which I am unable to decipher:

> touch mmo.stamp  
> creating bfdver.texi  
> restore=: && backupdir=“.am$$” &&   
> rm -rf $backupdir && mkdir $backupdir &&   
> if (makeinfo --split-size=5000000 --split-size=5000000 --version) \>/dev/null 2\>&1; then   
> for f in bfd.info bfd.info-[0-9] bfd.info-[0-9][0-9] bfd.i[0-9] bfd.i[0-9][0-9]; do   
> if test -f $f; then mv $f $backupdir; restore=mv; else :; fi;   
> done;   
> else :; fi &&   
> if makeinfo --split-size=5000000 --split-size=5000000 -I /home/Donnie/freedom-e-sdk/riscv-gnu-toolchain/riscv-binutils-gdb/bfd/doc   
> -o bfd.info `test -f 'bfd.texinfo' || echo '/home/Donnie/freedom-e-sdk/riscv-gnu-toolchain/riscv-binutils-gdb/bfd/doc/'`bfd.texinfo;   
> then   
> rc=0;   
> else   
> rc=$?;   
> $restore $backupdir/\* `echo "./bfd.info" | sed 's|[^/]*$||'`;   
> fi;   
> rm -rf $backupdir; exit $rc  
> /home/Donnie/freedom-e-sdk/riscv-gnu-toolchain/riscv-binutils-gdb/bfd/doc/bfd.texinfo:199: @menu-Referenz auf nicht existierenden Knoten „typedef bfd“  
> /home/Donnie/freedom-e-sdk/riscv-gnu-toolchain/riscv-binutils-gdb/bfd/doc/bfd.texinfo:200: @menu-Referenz auf nicht existierenden Knoten „Error reporting“  
> /home/Donnie/freedom-e-sdk/riscv-gnu-toolchain/riscv-binutils-gdb/bfd/doc/bfd.texinfo:201: @menu-Referenz auf nicht existierenden Knoten „Miscellaneous“  
> /home/Donnie/freedom-e-sdk/riscv-gnu-toolchain/riscv-binutils-gdb/bfd/doc/bfd.texinfo:222: Prev-Referenz zu nicht existierendem „Miscellaneous“  
> make[5]: \*\*\* [Makefile:472: bfd.info] Fehler 1  
> make[5]: Verzeichnis „/home/Donnie/freedom-e-sdk/work/riscv32-gnu-toolchain/build-binutils-newlib/bfd/doc“ wird verlassen  
> Making info in po  
> make[5]: Verzeichnis „/home/Donnie/freedom-e-sdk/work/riscv32-gnu-toolchain/build-binutils-newlib/bfd/po“ wird betreten  
> ( if test ‘x/home/Donnie/freedom-e-sdk/riscv-gnu-toolchain/riscv-binutils-gdb/bfd/po’ != ‘x.’; then   
> posrcprefix=‘/home/Donnie/freedom-e-sdk/riscv-gnu-toolchain/riscv-binutils-gdb/bfd/’;   
> else   
> posrcprefix=“…/”;   
> fi;   
> rm -f SRC-POTFILES-t SRC-POTFILES   
> && (sed -e ‘/^#/d’   
> -e '/\[1\]_$/d’   
> -e "s@._@ $posrcprefix& \\@" \< /home/Donnie/freedom-e-sdk/riscv-gnu-toolchain/riscv-binutils-gdb/bfd/po/SRC-POTFILES.in   
> | sed -e ‘$s/\$//’) \> SRC-POTFILES-t   
> && chmod a-w SRC-POTFILES-t   
> && mv SRC-POTFILES-t SRC-POTFILES )  
> ( rm -f BLD-POTFILES-t BLD-POTFILES   
> && (sed -e ‘/^#/d’   
> -e '/\[2\]_$/d’   
> -e "s@._@ …/& \\@" \< /home/Donnie/freedom-e-sdk/riscv-gnu-toolchain/riscv-binutils-gdb/bfd/po/BLD-POTFILES.in   
> | sed -e ‘$s/\$//’) \> BLD-POTFILES-t   
> && chmod a-w BLD-POTFILES-t   
> && mv BLD-POTFILES-t BLD-POTFILES )  
> cd …   
> && CONFIG\_FILES=po/Makefile.in:po/Make-in   
> CONFIG\_HEADERS= /bin/sh ./config.status  
> config.status: creating po/Makefile.in  
> config.status: executing depfiles commands  
> config.status: executing libtool commands  
> config.status: executing default-1 commands  
> config.status: executing bfd\_stdint.h commands  
> config.status: executing default commands  
> make[5]: Für das Ziel „info“ ist nichts zu tun.  
> make[5]: Verzeichnis „/home/Donnie/freedom-e-sdk/work/riscv32-gnu-toolchain/build-binutils-newlib/bfd/po“ wird verlassen  
> make[5]: Verzeichnis „/home/Donnie/freedom-e-sdk/work/riscv32-gnu-toolchain/build-binutils-newlib/bfd“ wird betreten  
> make[5]: Für das Ziel „info-am“ ist nichts zu tun.  
> make[5]: Verzeichnis „/home/Donnie/freedom-e-sdk/work/riscv32-gnu-toolchain/build-binutils-newlib/bfd“ wird verlassen  
> make[4]: \*\*\* [Makefile:1715: info-recursive] Fehler 1  
> make[4]: Verzeichnis „/home/Donnie/freedom-e-sdk/work/riscv32-gnu-toolchain/build-binutils-newlib/bfd“ wird verlassen  
> make[3]: \*\*\* [Makefile:2730: all-bfd] Fehler 2  
> make[3]: Verzeichnis „/home/Donnie/freedom-e-sdk/work/riscv32-gnu-toolchain/build-binutils-newlib“ wird verlassen  
> make[2]: \*\*\* [Makefile:854: all] Fehler 2  
> make[2]: Verzeichnis „/home/Donnie/freedom-e-sdk/work/riscv32-gnu-toolchain/build-binutils-newlib“ wird verlassen  
> make[1]: \*\*\* [Makefile:236: stamps/build-binutils-newlib] Fehler 2  
> make[1]: Verzeichnis „/home/Donnie/freedom-e-sdk/work/riscv32-gnu-toolchain“ wird verlassen  
> make: \*\*\* [Makefile:67: /home/Donnie/freedom-e-sdk/toolchain/bin/riscv32-unknown-linux-gnu-gcc] Fehler 2

> Donnie@LAB ~/freedom-e-sdk

Lines 468-478 of the Makefile in folder C:\cygwin64\home\Donnie\freedom-e-sdk\work\riscv32-gnu-toolchain\build-binutils-newlib\bfd\doc look like this (line 472 in italics):

clean-libtool:  
-rm -rf .libs \_libs

bfd.info: bfd.texinfo $(bfd\_TEXINFOS)  
\_restore=: && backupdir=“$(am\_\_leading\_dot)am$$$$” && \_  
rm -rf $$backupdir && mkdir $$backupdir &&   
if ($(MAKEINFO) --version) \>/dev/null 2\>&1; then   
for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do   
if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi;   
done;   
else :; fi && \

Does anyone understand the problem there?

Regards,  
Donnie

* * *

1. 

2.

---

<div class="post-metadata">

**Author:** ![brucehoult](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/brucehoult/32/24_2.png) [@brucehoult](https://forums.sifive.com/u/brucehoult)\
**Post date:** [December 12, 2016, 7:15pm UTC](https://forums.sifive.com/t/windows-platform-compiler-and-ide/143/7 "2016-12-12T19:15:44Z")

</div>

It might be easier to run an actual Linux in VirtualBox or docker…

---

<div class="post-metadata">

**Author:** ![dagema](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/dagema/32/59_2.png) [@dagema](https://forums.sifive.com/u/dagema)\
**Post date:** [December 12, 2016, 7:35pm UTC](https://forums.sifive.com/t/windows-platform-compiler-and-ide/143/8 "2016-12-12T19:35:10Z")

</div>

> [@brucehoult](#):
>
> It might be easier to run an actual Linux in VirtualBox or docker…

Am already doing that. This is just an exercise for testing on the Windows framework.

---

<div class="post-metadata">

**Author:** ![dagema](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/dagema/32/59_2.png) [@dagema](https://forums.sifive.com/u/dagema)\
**Post date:** [December 13, 2016, 7:07pm UTC](https://forums.sifive.com/t/windows-platform-compiler-and-ide/143/9 "2016-12-13T19:07:28Z")

</div>

> [@mwachs5](#):
>
> Thanks for reporting Donnie.
> 
> I’m wondering if this problem can be resolved at the repository level, something like
> 
> ```
> stackoverflow.com
> 
> ```
> 
> What’s the best CRLF (carriage return, line feed) handling strategy with Git?
> 
> git, cross-platform, newline, eol
> 
> asked by
> 
> ```
> Daniel Jomphe
> 
> ```
> 
> on 08:39PM - 04 Oct 08
> 
> Megan

Looks very promising. I will try it out and report.

Many thanks,  
Donnie

---

<div class="post-metadata">

**Author:** ![dagema](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/dagema/32/59_2.png) [@dagema](https://forums.sifive.com/u/dagema)\
**Post date:** [December 14, 2016, 5:05pm UTC](https://forums.sifive.com/t/windows-platform-compiler-and-ide/143/10 "2016-12-14T17:05:38Z")

</div>

> [@dagema](#):
>
> Thanks for reporting Donnie.  
> I’m wondering if this problem can be resolved at the repository level, something like  
> [stackoverflow.com](http://stackoverflow.com)  
> What’s the best CRLF (carriage return, line feed) handling strategy with Git?  
> git, cross-platform, newline, eol  
> asked by  
> Daniel Jomphe  
> on 08:39PM - 04 Oct 08  
> Megan
> 
> Looks very promising. I will try it out and report.

Hi Megan,

After reading through the link you provided, I did the following.

1. Deleted my cloned local freedom-e-sdk directory.
2. Opened a Git Shell and set up the line ending global settings:

![](https://us1.discourse-cdn.com/flex020/uploads/sifive/original/1X/95fc64101bd7ce35e8873d0b90eabcc75be77f55.png)

1. Performed a fresh clone of SiFive/freedom-e-sdk
2. Performed spot checks on some text files using Notepad++ and confirmed lines ending with LF and not CRLF.
3. Opened a Cygwin64 terminal as administrator and started make tools in freedom-e-sdk home directory.

After several hours of grinding bits through 10 layers of Make, make tools completed nicely, this time not throwing any errors.

 ![](https://us1.discourse-cdn.com/flex020/uploads/sifive/original/1X/8cef501b5e45b2b2875fdf63d87ae3e9c5edb2b7.png)

1. In the Cygwin64 terminal, attempted to compile demo\_gpio.

 ![](https://us1.discourse-cdn.com/flex020/uploads/sifive/original/1X/4ff155ba2b8ea32829ba5fd083aa4b01b6494185.png)

I still have to work out what is happening here (presumably a problem with Cygwin properly handling link files).

Assuming the presumed link file problem above can be solved, it looks like Cygwin is a viable framework for running freedom-e-sdk on a Windows platform when the following prerequisites are met: all required packages are installed on Cygwin (as listed in freedom-e-sdk readme file), correct GitHub global settings for line endings set to LF prior to cloning, and a minimum of 7GB free available disc space for local GitHub clone.

Best regards,  
Donnie

---

<div class="post-metadata">

**Author:** ![dagema](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/dagema/32/59_2.png) [@dagema](https://forums.sifive.com/u/dagema)\
**Post date:** [December 14, 2016, 6:29pm UTC](https://forums.sifive.com/t/windows-platform-compiler-and-ide/143/11 "2016-12-14T18:29:10Z")

</div>

> [@dagema](#):
>
> 1. In the Cygwin64 terminal, attempted to compile demo\_gpio.
> 
> Pasted image756x244 35.1 KB
> 
> I still have to work out what is happening here (presumably a problem with Cygwin properly handling link files).
> 
> Assuming the presumed link file problem above can be solved, it looks like Cygwin is a viable framework for running freedom-e-sdk on a Windows platform when the following prerequisites are met: all required packages are installed on Cygwin (as listed in freedom-e-sdk readme file), correct GitHub global settings for line endings set to LF prior to cloning, and a minimum of 7GB free available disc space for local GitHub clone.

Hi Megan,

If I copy the links.lds, start.S and entry.S from the linked freedom-e300-hifive1 directory into the freedom-e300-arty directory, overwriting the files there, then the software make works. A presumably easy solution then might be to keep separate copies of the entry.S and start.S files in each device directory, rather than relying on syslinks. I wonder if that might also preclude any possible future problems if the HiFive1 and Arty devices end up needing different file content.

What do you think?

Regards,  
Donnie

---

<div class="post-metadata">

**Author:** ![mwachs5](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/mwachs5/32/13_2.png) [@mwachs5](https://forums.sifive.com/u/mwachs5)\
**Post date:** [December 14, 2016, 6:32pm UTC](https://forums.sifive.com/t/windows-platform-compiler-and-ide/143/12 "2016-12-14T18:32:05Z")

</div>

Donnie,

Thank you so much for reporting your results!

We made a conscious decision to use the simlinks because the files were identical and we didn’t want to have to maintain the two copies. A better solution would be for us to move them to a “common” location and pointing the common build flow to those files.

Megan

---

<div class="post-metadata">

**Author:** ![mwachs5](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/mwachs5/32/13_2.png) [@mwachs5](https://forums.sifive.com/u/mwachs5)\
**Post date:** [December 15, 2016, 1:53am UTC](https://forums.sifive.com/t/windows-platform-compiler-and-ide/143/13 "2016-12-15T01:53:51Z")

</div>

Donnie,  
We updated the freedom-e-sdk to move the simlinked files to a seperate shared directory. Give it a shot if you’d like.

Note that we also bumped the riscv-gnu-toolchain and there is one more package dependency.

Megan

---

<div class="post-metadata">

**Author:** ![dagema](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/dagema/32/59_2.png) [@dagema](https://forums.sifive.com/u/dagema)\
**Post date:** [December 15, 2016, 2:18pm UTC](https://forums.sifive.com/t/windows-platform-compiler-and-ide/143/14 "2016-12-15T14:18:32Z")

</div>

> [@mwachs5](#):
>
> Donnie, We updated the freedom-e-sdk to move the simlinked files to a seperate shared directory. Give it a shot if you’d like.
> 
> Note that we also bumped the riscv-gnu-toolchain and there is one more package dependency.
> 
> Megan

Hi Megan,

After installing zlib1g-dev on Ubuntu, then git pull, make tools and make software\_clean PROGRAM=demo\_gpio BOARD=freedom-e300-arty, make software PROGRAM=demo\_gpio BOARD=freedom-e300-arty no longer works in my Ubuntu 16.04 platform:

> donnie@SiFive:/media$ sudo apt-get install zlib1g-dev  
> [sudo] password for donnie:  
> Reading package lists… Done  
> Building dependency tree  
> Reading state information… Done  
> The following package was automatically installed and is no longer required:  
> ubuntu-core-launcher  
> Use ‘sudo apt autoremove’ to remove it.  
> The following NEW packages will be installed:  
> zlib1g-dev  
> 0 upgraded, 1 newly installed, 0 to remove and 11 not upgraded.  
> Need to get 168 kB of archives.  
> After this operation, 426 kB of additional disk space will be used.  
> Get:1 [http://de.archive.ubuntu.com/ubuntu](http://de.archive.ubuntu.com/ubuntu) xenial/main amd64 zlib1g-dev amd64 1:1.2.8.dfsg-2ubuntu4 [168 kB]  
> Fetched 168 kB in 4s (40,6 kB/s)  
> Selecting previously unselected package zlib1g-dev:amd64.  
> (Reading database … 209597 files and directories currently installed.)  
> Preparing to unpack …/zlib1g-dev\_1%3a1.2.8.dfsg-2ubuntu4\_amd64.deb …  
> Unpacking zlib1g-dev:amd64 (1:1.2.8.dfsg-2ubuntu4) …  
> Processing triggers for man-db (2.7.5-1) …  
> Setting up zlib1g-dev:amd64 (1:1.2.8.dfsg-2ubuntu4) …  
> donnie@SiFive:/media$ cd  
> donnie@SiFive:~$ cd freedom-e-sdk

> donnie@SiFive:~/freedom-e-sdk$ sudo git pull  
> [sudo] password for donnie:  
> remote: Counting objects: 114, done.  
> remote: Compressing objects: 100% (65/65), done.  
> remote: Total 114 (delta 55), reused 102 (delta 43), pack-reused 0  
> Receiving objects: 100% (114/114), 15.05 KiB | 0 bytes/s, done.  
> Resolving deltas: 100% (55/55), completed with 18 local objects.  
> From [GitHub - sifive/freedom-e-sdk: Open Source Software for Developing on the Freedom E Platform](https://github.com/sifive/freedom-e-sdk)  
> 5d24496…15ad5fc master → origin/master
> 
> - [new branch] move-common-files → origin/move-common-files  
> Fetching submodule riscv-gnu-toolchain  
> remote: Counting objects: 281, done.  
> remote: Compressing objects: 100% (277/277), done.  
> remote: Total 281 (delta 22), reused 0 (delta 0), pack-reused 0  
> Receiving objects: 100% (281/281), 654.04 KiB | 605.00 KiB/s, done.  
> Resolving deltas: 100% (22/22), done.  
> From [GitHub - riscv-collab/riscv-gnu-toolchain: GNU toolchain for RISC-V, including GCC](http://github.com/riscv/riscv-gnu-toolchain)
> - [new branch] integrate-for-binutils → origin/integrate-for-binutils  
> 805ee1d…e3e50c5 master → origin/master
> - [new branch] sdk → origin/sdk  
> Fetching submodule riscv-gnu-toolchain/riscv-binutils-gdb  
> remote: Counting objects: 3542, done.  
> remote: Compressing objects: 100% (136/136), done.  
> remote: Total 3542 (delta 3028), reused 2958 (delta 2958), pack-reused 448  
> Receiving objects: 100% (3542/3542), 1.80 MiB | 914.00 KiB/s, done.  
> Resolving deltas: 100% (3100/3100), completed with 1258 local objects.  
> From [GitHub - riscvarchive/riscv-binutils-gdb: RISC-V backports for binutils-gdb. Development is done upstream at the FSF.](http://github.com/riscv/riscv-binutils-gdb)  
> d1842c4…f14e97b **archive** → origin/ **archive**
> 
> - 015bf92…478a5a2 riscv-next → origin/riscv-next (forced update)  
> Fetching submodule riscv-gnu-toolchain/riscv-gcc  
> remote: Counting objects: 12392, done.  
> remote: Total 12392 (delta 9898), reused 9898 (delta 9898), pack-reused 2494  
> Receiving objects: 100% (12392/12392), 3.66 MiB | 946.00 KiB/s, done.  
> Resolving deltas: 100% (10338/10338), completed with 1947 local objects.  
> From [GitHub - riscv-collab/riscv-gcc](http://github.com/riscv/riscv-gcc)
> 
> - [new branch] coremark-regression → origin/coremark-regression  
> 5a0461e…961743c riscv-gcc-6.1.0 → origin/riscv-gcc-6.1.0
> - [new branch] riscv-next → origin/riscv-next  
> Fetching submodule riscv-gnu-toolchain/riscv-glibc  
> remote: Counting objects: 31, done.  
> remote: Compressing objects: 100% (7/7), done.  
> remote: Total 31 (delta 24), reused 29 (delta 22), pack-reused 0  
> Unpacking objects: 100% (31/31), done.  
> From [GitHub - riscvarchive/riscv-glibc: RISC-V port of GNU's libc](http://github.com/riscv/riscv-glibc)  
> 36cc082…31692a3 riscv-next → origin/riscv-next  
> Updating 5d24496…15ad5fc  
> Fast-forward  
> .gitignore | 4 +  
> Makefile | 2 ±  
> README.md | 5 ±  
> bsp/env/common.mk | 37 ++±–  
> bsp/env/entry.S | 95 ++++++++++++++++  
> bsp/env/freedom-e300-arty/entry.S | 1 -  
> bsp/env/freedom-e300-arty/init.c | 2 +  
> bsp/env/freedom-e300-arty/platform.h | 5 ±  
> bsp/env/freedom-e300-arty/start.S | 1 -  
> bsp/env/freedom-e300-hifive1/entry.S | 102 -----------------  
> bsp/env/freedom-e300-hifive1/init.c | 7 ±  
> bsp/env/freedom-e300-hifive1/openocd.cfg | 19 ++±  
> bsp/env/freedom-e300-hifive1/platform.h | 2 +  
> bsp/env/freedom-e300-hifive1/start.S | 81 -------------  
> bsp/env/start.S | 51 +++++++++  
> bsp/env/syscall.c | 190 -------------------------------  
> bsp/libwrap/libwrap.mk | 54 +++++++++  
> bsp/libwrap/misc/write\_hex.c | 19 ++++  
> bsp/libwrap/stdlib/malloc.c | 17 +++  
> bsp/libwrap/sys/\_exit.c | 17 +++  
> bsp/libwrap/sys/close.c | 9 ++  
> bsp/libwrap/sys/execve.c | 9 ++  
> bsp/libwrap/sys/fork.c | 9 ++  
> bsp/libwrap/sys/fstat.c | 16 +++  
> bsp/libwrap/sys/getpid.c | 6 +  
> bsp/libwrap/sys/isatty.c | 11 ++  
> bsp/libwrap/sys/kill.c | 9 ++  
> bsp/libwrap/sys/link.c | 9 ++  
> bsp/libwrap/sys/lseek.c | 14 +++  
> bsp/libwrap/sys/open.c | 9 ++  
> bsp/libwrap/sys/openat.c | 9 ++  
> bsp/libwrap/sys/read.c | 30 +++++  
> bsp/libwrap/sys/sbrk.c | 16 +++  
> bsp/libwrap/sys/stat.c | 10 ++  
> bsp/libwrap/sys/stub.h | 10 ++  
> bsp/libwrap/sys/times.c | 10 ++  
> bsp/libwrap/sys/unlink.c | 9 ++  
> bsp/libwrap/sys/wait.c | 9 ++  
> bsp/libwrap/sys/write.c | 29 +++++  
> riscv-gnu-toolchain | 2 ±  
> software/demo\_gpio/.gitignore | 1 +  
> software/demo\_gpio/Makefile | 2 ±  
> software/demo\_gpio/demo\_gpio.c | 49 +++±—  
> software/dhrystone/.gitignore | 1 +  
> software/dhrystone/Makefile | 5 ±  
> software/dhrystone/dhry\_printf.c | 4 ±  
> software/dhrystone/dhry\_stubs.c | 15 ±-  
> software/hello/.gitignore | 1 +  
> software/hello/Makefile | 2 ±  
> 49 files changed, 585 insertions(+), 441 deletions(-)  
> create mode 100644 .gitignore  
> create mode 100644 bsp/env/entry.S  
> delete mode 120000 bsp/env/freedom-e300-arty/entry.S  
> delete mode 120000 bsp/env/freedom-e300-arty/start.S  
> delete mode 100644 bsp/env/freedom-e300-hifive1/entry.S  
> delete mode 100644 bsp/env/freedom-e300-hifive1/start.S  
> create mode 100644 bsp/env/start.S  
> delete mode 100644 bsp/env/syscall.c  
> create mode 100644 bsp/libwrap/libwrap.mk  
> create mode 100644 bsp/libwrap/misc/write\_hex.c  
> create mode 100644 bsp/libwrap/stdlib/malloc.c  
> create mode 100644 bsp/libwrap/sys/\_exit.c  
> create mode 100644 bsp/libwrap/sys/close.c  
> create mode 100644 bsp/libwrap/sys/execve.c  
> create mode 100644 bsp/libwrap/sys/fork.c  
> create mode 100644 bsp/libwrap/sys/fstat.c  
> create mode 100644 bsp/libwrap/sys/getpid.c  
> create mode 100644 bsp/libwrap/sys/isatty.c  
> create mode 100644 bsp/libwrap/sys/kill.c  
> create mode 100644 bsp/libwrap/sys/link.c  
> create mode 100644 bsp/libwrap/sys/lseek.c  
> create mode 100644 bsp/libwrap/sys/open.c  
> create mode 100644 bsp/libwrap/sys/openat.c  
> create mode 100644 bsp/libwrap/sys/read.c  
> create mode 100644 bsp/libwrap/sys/sbrk.c  
> create mode 100644 bsp/libwrap/sys/stat.c  
> create mode 100644 bsp/libwrap/sys/stub.h  
> create mode 100644 bsp/libwrap/sys/times.c  
> create mode 100644 bsp/libwrap/sys/unlink.c  
> create mode 100644 bsp/libwrap/sys/wait.c  
> create mode 100644 bsp/libwrap/sys/write.c  
> create mode 100644 software/demo\_gpio/.gitignore  
> create mode 100644 software/dhrystone/.gitignore  
> create mode 100644 software/hello/.gitignore

> donnie@SiFive:~/freedom-e-sdk$ sudo make tools  
> mkdir -p /home/donnie/freedom-e-sdk/work/riscv32-gnu-toolchain  
> cd /home/donnie/freedom-e-sdk/work/riscv32-gnu-toolchain; /home/donnie/freedom-e-sdk/riscv-gnu-toolchain/configure --prefix=/home/donnie/freedom-e-sdk/toolchain --with-arch=rv32ima --with-abi=ilp32  
> configure: WARNING: unrecognized options: --with-abi  
> checking for gcc… gcc  
> checking whether the C compiler works… yes  
> checking for C compiler default output file name… a.out  
> checking for suffix of executables…  
> checking whether we are cross compiling… no  
> checking for suffix of object files… o  
> checking whether we are using the GNU C compiler… yes  
> checking whether gcc accepts -g… yes  
> checking for gcc option to accept ISO C89… none needed  
> checking for grep that handles long lines and -e… /bin/grep  
> checking for fgrep… /bin/grep -F  
> checking for grep that handles long lines and -e… (cached) /bin/grep  
> checking for bash… /bin/bash  
> checking for \_\_gmpz\_init in -lgmp… yes  
> checking for mpfr\_init in -lmpfr… yes  
> checking for mpc\_init2 in -lmpc… yes  
> checking for curl… /usr/bin/curl  
> checking for wget… /usr/bin/wget  
> checking for ftp… /usr/bin/ftp  
> configure: creating ./config.status  
> config.status: creating Makefile  
> config.status: creating scripts/wrapper/awk/awk  
> config.status: creating scripts/wrapper/sed/sed  
> configure: WARNING: unrecognized options: --with-abi  
> make -C /home/donnie/freedom-e-sdk/work/riscv32-gnu-toolchain  
> make[1]: Entering directory ‘/home/donnie/freedom-e-sdk/work/riscv32-gnu-toolchain’  
> make[1]: Nothing to be done for ‘all’.  
> make[1]: Leaving directory ‘/home/donnie/freedom-e-sdk/work/riscv32-gnu-toolchain’  
> All Tools Installed

> donnie@SiFive:~/freedom-e-sdk$ sudo make software\_clean PROGRAM=demo\_gpio BOARD=freedom-e300-arty  
> cd /home/donnie/freedom-e-sdk/software/demo\_gpio;  
> make clean  
> make[1]: Entering directory ‘/home/donnie/freedom-e-sdk/software/demo\_gpio’  
> rm -f …/…/bsp/libwrap/stdlib/malloc.o …/…/bsp/libwrap/sys/open.o …/…/bsp/libwrap/sys/lseek.o …/…/bsp/libwrap/sys/read.o …/…/bsp/libwrap/sys/write.o …/…/bsp/libwrap/sys/fstat.o …/…/bsp/libwrap/sys/stat.o …/…/bsp/libwrap/sys/close.o …/…/bsp/libwrap/sys/link.o …/…/bsp/libwrap/sys/unlink.o …/…/bsp/libwrap/sys/execve.o …/…/bsp/libwrap/sys/fork.o …/…/bsp/libwrap/sys/getpid.o …/…/bsp/libwrap/sys/kill.o …/…/bsp/libwrap/sys/wait.o …/…/bsp/libwrap/sys/isatty.o …/…/bsp/libwrap/sys/times.o …/…/bsp/libwrap/sys/sbrk.o …/…/bsp/libwrap/sys/\_exit.o …/…/bsp/libwrap/misc/write\_hex.o demo\_gpio …/…/bsp/env/start.o …/…/bsp/env/entry.o demo\_gpio.o plic\_driver.o …/…/bsp/env/freedom-e300-arty/init.o  
> make[1]: Leaving directory ‘/home/donnie/freedom-e-sdk/software/demo\_gpio’  
> donnie@SiFive:~/freedom-e-sdk$ sudo make software PROGRAM=demo\_gpio BOARD=freedom-e300-arty  
> cd /home/donnie/freedom-e-sdk/software/demo\_gpio;  
> make  
> make[1]: Entering directory ‘/home/donnie/freedom-e-sdk/software/demo\_gpio’  
> …/…/bsp/…/toolchain/bin/riscv32-unknown-elf-gcc -O2 -fno-builtin-printf -DUSE\_PLIC -DUSE\_M\_TIME -g -I…/…/bsp/include -I…/…/bsp/env -I…/…/bsp/env/freedom-e300-arty -c -o …/…/bsp/env/start.o …/…/bsp/env/start.S  
> …/…/bsp/env/start.S: Assembler messages:  
> …/…/bsp/env/start.S:41: Error: illegal operands `li t0,MSTATUS_FS' ../../bsp/env/start.S:46: Error: unrecognized opcode `fssr x0’  
> …/…/bsp/env/common.mk:47: recipe for target ‘…/…/bsp/env/start.o’ failed  
> make[1]: \*\*\* […/…/bsp/env/start.o] Error 1  
> make[1]: Leaving directory ‘/home/donnie/freedom-e-sdk/software/demo\_gpio’  
> Makefile:92: recipe for target ‘software’ failed  
> make: \*\*\* [software] Error 2  
> donnie@SiFive:~/freedom-e-sdk$

Seems to be a problem with the new reorganization of the env directory.  
Or, must I do make clean and rebuild the entire tools compile (takes hours to run)?

Regard,  
Donnie

---

<div class="post-metadata">

**Author:** ![dagema](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/dagema/32/59_2.png) [@dagema](https://forums.sifive.com/u/dagema)\
**Post date:** [December 15, 2016, 5:20pm UTC](https://forums.sifive.com/t/windows-platform-compiler-and-ide/143/15 "2016-12-15T17:20:01Z")

</div>

> [@dagema](#):
>
> donnie@SiFive:~/freedom-e-sdk$ sudo make software PROGRAM=demo\_gpio BOARD=freedom-e300-artycd /home/donnie/freedom-e-sdk/software/demo\_gpio;\makemake[1]: Entering directory ‘/home/donnie/freedom-e-sdk/software/demo\_gpio’…/…/bsp/…/toolchain/bin/riscv32-unknown-elf-gcc -O2 -fno-builtin-printf -DUSE\_PLIC -DUSE\_M\_TIME -g -I…/…/bsp/include -I…/…/bsp/env -I…/…/bsp/env/freedom-e300-arty -c -o …/…/bsp/env/start.o …/…/bsp/env/start.S…/…/bsp/env/start.S: Assembler messages:…/…/bsp/env/start.S:41: Error: illegal operands li t0,MSTATUS\_FS’…/…/bsp/env/start.S:46: Error: unrecognized opcodefssr x0’…/…/bsp/env/common.mk:47: recipe for target ‘…/…/bsp/env/start.o’ failedmake[1]: \*\*\* […/…/bsp/env/start.o] Error 1make[1]: Leaving directory '/home/donnie/freedom-e-sdk/software/demo\_gpio’Makefile:92: recipe for target ‘software’ failedmake: \*\*\* [software] Error 2donnie@SiFive:~/freedom-e-sdk$
> 
> Seems to be a problem with the new reorganization of the env directory.Or, must I do make clean and rebuild the entire tools compile (takes hours to run)?

Sorry for becomming a nag, but the make tools after clean also no longer works:

> checking for riscv64-unknown-elf-strip… /home/donnie/freedom-e-sdk/toolchain/riscv64-unknown-elf/bin/strip  
> checking whether ln -s works… yes  
> checking for riscv64-unknown-elf-gcc… /home/donnie/freedom-e-sdk/work/riscv32-gnu-toolchain/build-gcc-newlib/./gcc/xgcc -B/home/donnie/freedom-e-sdk/work/riscv32-gnu-toolchain/build-gcc-newlib/./gcc/ -nostdinc -B/home/donnie/freedom-e-sdk/work/riscv32-gnu-toolchain/build-gcc-newlib/riscv64-unknown-elf/newlib/ -isystem /home/donnie/freedom-e-sdk/work/riscv32-gnu-toolchain/build-gcc-newlib/riscv64-unknown-elf/newlib/targ-include -isystem /home/donnie/freedom-e-sdk/work/riscv32-gnu-toolchain/src/newlib-gcc/newlib/libc/include -B/home/donnie/freedom-e-sdk/work/riscv32-gnu-toolchain/build-gcc-newlib/riscv64-unknown-elf/libgloss/riscv64 -L/home/donnie/freedom-e-sdk/work/riscv32-gnu-toolchain/build-gcc-newlib/riscv64-unknown-elf/libgloss/libnosys -L/home/donnie/freedom-e-sdk/work/riscv32-gnu-toolchain/src/newlib-gcc/libgloss/riscv64 -B/home/donnie/freedom-e-sdk/toolchain/riscv64-unknown-elf/bin/ -B/home/donnie/freedom-e-sdk/toolchain/riscv64-unknown-elf/lib/ -isystem /home/donnie/freedom-e-sdk/toolchain/riscv64-unknown-elf/include -isystem /home/donnie/freedom-e-sdk/toolchain/riscv64-unknown-elf/sys-include  
> checking for suffix of object files… configure: error: in `/home/donnie/freedom-e-sdk/work/riscv32-gnu-toolchain/build-gcc-newlib/riscv64-unknown-elf/libgcc': configure: error: cannot compute suffix of object files: cannot compile See `config.log’ for more details.  
> Makefile:11683: recipe for target ‘configure-target-libgcc’ failed  
> make[3]: \*\*\* [configure-target-libgcc] Error 1  
> make[3]: Leaving directory ‘/home/donnie/freedom-e-sdk/work/riscv32-gnu-toolchain/build-gcc-newlib’  
> Makefile:872: recipe for target ‘all’ failed  
> make[2]: \*\*\* [all] Error 2  
> make[2]: Leaving directory ‘/home/donnie/freedom-e-sdk/work/riscv32-gnu-toolchain/build-gcc-newlib’  
> Makefile:254: recipe for target ‘stamps/build-gcc-newlib’ failed  
> make[1]: \*\*\* [stamps/build-gcc-newlib] Error 2  
> make[1]: Leaving directory ‘/home/donnie/freedom-e-sdk/work/riscv32-gnu-toolchain’  
> Makefile:65: recipe for target ‘/home/donnie/freedom-e-sdk/toolchain/bin/riscv32-unknown-linux-gnu-gcc’ failed  
> make: \*\*\* [/home/donnie/freedom-e-sdk/toolchain/bin/riscv32-unknown-linux-gnu-gcc] Error 2  
> donnie@SiFive:~/freedom-e-sdk$

---

<div class="post-metadata">

**Author:** ![mwachs5](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/mwachs5/32/13_2.png) [@mwachs5](https://forums.sifive.com/u/mwachs5)\
**Post date:** [December 15, 2016, 5:28pm UTC](https://forums.sifive.com/t/windows-platform-compiler-and-ide/143/16 "2016-12-15T17:28:30Z")

</div>

No worries about nagging! Glad that you are beta testing for us.

For me, when I want to do a full re-build of the tools, I delete the ‘work’ and ‘toolchain’ directories. That is where all the actual compilation happens.

If it is taking hours for your toolchain to compile on a VM, there are lots of things you can do to significantly speed it up.  
On my Ubuntu VM, I bumped up the RAM allocation, gave it access to 2 CPUs, and I use paralell make (if I try to do this without giving it more resources, it generally runs out of RAM):

`make -j4 tools`

This cut my compilation time from hours to 10 or 15 minutes.

---

<div class="post-metadata">

**Author:** ![mwachs5](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/mwachs5/32/13_2.png) [@mwachs5](https://forums.sifive.com/u/mwachs5)\
**Post date:** [December 15, 2016, 5:32pm UTC](https://forums.sifive.com/t/windows-platform-compiler-and-ide/143/17 "2016-12-15T17:32:45Z")

</div>

Also, make sure to do:

`git submodule update --init --recursive`

to get the correct versions of the tools before compiling.

---

<div class="post-metadata">

**Author:** ![dagema](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/dagema/32/59_2.png) [@dagema](https://forums.sifive.com/u/dagema)\
**Post date:** [December 15, 2016, 9:03pm UTC](https://forums.sifive.com/t/windows-platform-compiler-and-ide/143/18 "2016-12-15T21:03:05Z")

</div>

> [@mwachs5](#):
>
> For me, when I want to do a full re-build of the tools, I delete the ‘work’ and ‘toolchain’ directories. That is where all the actual compilation happens.
> 
> If it is taking hours for your toolchain to compile on a VM, there are lots of things you can do to significantly speed it up.On my Ubuntu VM, I bumped up the RAM allocation, gave it access to 2 CPUs, and I use paralell make (if I try to do this without giving it more resources, it generally runs out of RAM):
> 
> make -j4 tools
> 
> This cut my compilation time from hours to 10 or 15 minutes.

Thanks for the tips. I had been using 4GB RAM and 2 CPUs till now. I moved it up to 5GB and 3 CPUs and performed the make with -j4 parameter as you suggested. The make took “only” 50 minutes, and was successful. I wish I could get Cygwin to compile as fast. I guess I will have to move to a machine with more resources.

The software make was also successful.

I will now go and try it under Cygwin.

Best regards,  
Donnie

---

<div class="post-metadata">

**Author:** ![dagema](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/dagema/32/59_2.png) [@dagema](https://forums.sifive.com/u/dagema)\
**Post date:** [December 17, 2016, 9:20am UTC](https://forums.sifive.com/t/windows-platform-compiler-and-ide/143/19 "2016-12-17T09:20:05Z")

</div>

> [@mwachs5](#):
>
> Donnie, We updated the freedom-e-sdk to move the simlinked files to a seperate shared directory. Give it a shot if you’d like.
> 
> Note that we also bumped the riscv-gnu-toolchain and there is one more package dependency.
> 
> Megan

Hi Megan,

After some research and testing, it became clear to me that the problem with symlinks was not within Cygwin, but rather the result of the default parameter symlinks=false in Git. I changed the parameter to symlinks=true and performed a fresh clone and confimred that the symlinks are now functional. However, when attempting to make demo\_gpio I am still getting an error:

 ![](https://us1.discourse-cdn.com/flex020/uploads/sifive/original/1X/8b2d76639d0b9ae1a90b81e2bcdc8864edab1cf3.png)

Can you offer any insight on this?

Thanks and regards,  
Donnie

---

<div class="post-metadata">

**Author:** ![mwachs5](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/mwachs5/32/13_2.png) [@mwachs5](https://forums.sifive.com/u/mwachs5)\
**Post date:** [December 17, 2016, 6:28pm UTC](https://forums.sifive.com/t/windows-platform-compiler-and-ide/143/20 "2016-12-17T18:28:35Z")

</div>

Ah, thanks Donnie. That was our mistake, I made a change for the HiFive1 board that I didn’t make in the Arty Dev Kit. I’ve pushed the fixes to the freedom-e-sdk repo master branch. Please try it out (you should not need to rebuild your toolchain).

Megan

[Next page](https://forums.sifive.com/t/windows-platform-compiler-and-ide/143.md?page=2)
