Jump to content
IGNORED

Install Linaro


SpiceWare

Recommended Posts

We'll be using Linaro to compile the C code for our programs.  Start up your virtual machine if it's not already running.

 

Download Linaro

 

  1. Click on K-Gear
  2. Click on Firefox Web Browser
  3. Visit https://www.linaro.org

 

The page will look different depending upon the width of the browser's window, so you'll either see a hamburger button:

 

1800640688_ScreenShot2019-10-09at7_19_53PM.thumb.png.a3c1f119084d9f33709a0abdd66adf61.png

 

or a horizontal menu:

1573042334_ScreenShot2019-10-26at9_24_26AM.thumb.png.617d2ba08271b547bfa3adf82ef87b28.png

 

 

So your next step is either:

  1. Click Hamburger Button
  2. Click Developer Resources
  3. Click Downloads

 

or:

  1. Click Developer Resources
  2. Click Downloads

 

At this time that would land you on https://www.linaro.org/downloads/

 

The Harmony Cart/Melody Board uses an ARM7TDMI-S LPC2103 so we need to locate the compiler for it.

  1. Scroll down to section Latest Bare-Metal Targeted Binary Toolchain Releases
  2. Locate the row containing Armv7
  3. Click on Binaries

1369735335_ScreenShot2019-10-09at7_22_33PM.thumb.png.7a27bd6b681b1bb882963e2d4530b605.png

 

That currently takes you to https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-eabi/

 

Locate the gcc-linaro-???-x86_64_arm-eabi.tar.xz file where ??? is the most current release.  At time of this post that's 7.4.1-2019.02, so:

 

  1. Click on gcc-linaro-7.4.1-2019.02-x86_64_arm-eabi.tar.xz
  2. Click Save File
  3. Click OK

1160131439_ScreenShot2019-10-09at7_24_09PM.thumb.png.8b9da6c2ed4489db7b36b3317c08f03f.png

 

Download indictor will show up when a download is started

1846157245_ScreenShot2019-10-26at9_36_26AM.thumb.png.b9ca805578455f02e68095988322ec13.png

 

It'll turn blue once the download is complete.


2099876680_ScreenShot2019-10-26at9_37_34AM.thumb.png.a01ade1a0b50afdcd2e24293c079cd21.png

 

Extract Linaro

 

  1. Click the download indictor
  2. Click the Folder icon

1134639827_ScreenShot2019-10-09at7_26_05PM.thumb.png.c1594cb3ddf2a3919b5ffdee4f86d240.png

 

  1. Right-Click on the file you just downloaded

  2. Drill down to Extract->Extract archive to...

  3. This is larger than the dasm archive, so there will be a long wait while Ark processes the archive - most of the window will be ghosted:
    1126627164_ScreenShot2019-10-09at7_29_07PM.thumb.png.d48f9c873ce33c6ef662fb81d3713b97.png

    until it's finished:
    562909814_ScreenShot2019-10-09at7_31_05PM.thumb.png.36ffdb792f9cd8bf47fa1ee3974ce1eb.png
     

 

 

  1. Click Home
  2. Double-Click 2600tools
  3. Click Extract

 

A spinning 1 will show up in the task bar, click it to see extracting progress

1824637997_ScreenShot2019-10-09at7_31_45PM.thumb.png.e1fd7446e942f374c5263907f6d97699.png

 

 

Update .profile

 

Your path needs to be updated so Konsole can find dasm. Same steps as for dasm, so no screenshots.

 

  1. double-click Home folder on desktop
  2. Double-Click .profile to open it in Kate*
  3. Scroll to the the end of the file
  4. Copy/Paste the following at the end
    # set PATH so it includes linaro's bin if it exists
    if [ -d "$HOME/2600tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-eabi/bin" ] ; then
        PATH="$HOME/2600tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-eabi/bin:$PATH"
    fi

 

 

  1. Save your changes
  2. quit Kate

 
You must log out then back in for changes in .profile to take effect.  Do so now.

 

Test Linaro


At this time you should be able to use Linaro to compile the C code.  We'll test it using an early version of Collect2, though the makefile has been modified to use Linaro rather than Sourcery G++ Lite (which we were using back in 2015).  Download it on your Host OS, not your VM, and put it in your shared project folder.

 

Collect2.zip

 

Start up Konsole then change directory to your shared project folder.

 

  1. Click K-Gear
  2. Click Konsole
  3. type cd /media/sf<TAB>
  4. type unzip Collect2.zip

 

1983021360_ScreenShot2019-10-26at1_39_11PM.thumb.png.bcf53ccf2360aeefbc7085a16495aaf7.png

 

Compile the C code

 

  1. type cd Collect2/custom
  2. type make

2034821733_ScreenShot2019-10-26at1_40_32PM.thumb.png.43050a9fcdb2d31f71ddb64706381068.png

 

Build the Bin

 

  1. type cd ..
  2. type or copy/paste dasm collect2.asm -f3 -v0 -scollect2.sym -lcollect2.lst -ocollect2.bin

 

 

1744327930_ScreenShot2019-10-26at1_40_48PM.thumb.png.ce51877b6b57532e4642c1fd90affcd9.png

 

Use Stella on your Host machine to run Collect2

 

354560960_ScreenShot2019-10-26at1_41_07PM.thumb.png.1f0b01c4370f2203a407e5254dfa7629.png

 

 

* You should still be able to see hidden files from the steps in Install dasm, but if for some reason you can't:

  1. Click Control menu
  2. Click Hidden Files menu option

 

  • Thanks 1
Link to comment
Share on other sites

Hi Darrell, thanks for the great info!

I'm on Windows, which also works fine for compiling. JohnC helped me setting up my dev environment, for which I installed some GnuWin32 tools like make, grep, awk and the core-utils packages (which contains commands like 'rm')

 

What is the benefit of using the Linaro ARM compiler, instead of the 'GNU Embedded Toolchain for Arm' from https://developer.arm.com/ ?

I tried both, and both seem to compile the example. Is it only about the size of the resulting ARM bytes?

 

Thanks,

Dion

Link to comment
Share on other sites

That's cool, maybe John will post instructions at some point on how to set that up.  It's probably possible to build Linaro for macOS, I just never looked into it as I've always had VMs handy.

 

I've always used the tools the others used for Harmony development, never looked into others.  Back in March 2017 @cd-w contacted me that he wanted to replace Codesourcery G++ Lite with Linaro. Codesourcery was quite old at the time, plus Linaro built smaller binaries. I don't know if he reviewed the GNU Embedded one when he made that decision.

Link to comment
Share on other sites

Ah, from that announcement the ARM one came out over a year after we'd made the move to Linaro.

 

Think I'll stick with Linaro, for now, as getting the Club going has already taken much longer than I would have liked.

 

In fact I'm taking another break from the Club as earlier in the week I was invited back to the Houston Arcade Expo. My 2600 Homebrew presentation's 2 weeks from today, so I need to finish reviewing and revising it before then. A lot of it will remain the same, but I need to pare it back quite a bit from its current 79 slides.

Link to comment
Share on other sites

  • 1 year later...

Thank you for this detailed and most-useful walkthrough of setting up the development environment.  Quite ingenious - using a virtual machine to run the linux compiler, but sharing the code in a shared folder between virtual box and the host machine. Following the instructions, with a few minor changes (e.g., the paths to put in the .profile need to be updated for your version of the tools), I was up and running and successfully built the example. However, it was awfully painfully slow for me.

 

So, I had a go at installing the gnu toolchain natively on my MacOS machine -- from the link above. The compiler I guessed was slightly differently named, but it built the code with the supplied makefile parameters just fine, and I now appear to have a functional native environment which does not rely on a linux running on virtualbox.

 

I just thought I'd share this for those who follow.

  • Like 1
Link to comment
Share on other sites

I've a Mac Pro (Late 2013) with 3.5 GHz 6-Core Xeon E5 and 32 GB of RAM, so the Linux VMs have performed well for me.  At one point I had multiple VMs set up, each with a different version of the CodeSourcery compiler we previously used:

 

From DPC+ARM - Part 4, Cloning:

Quote

We have 4 different versions of the compiler available. Normally you'd want to use just the latest version; however, through experimentation, we've found that sometimes an older version will produce smaller code. That can be extremely useful when trying to fit everything into a 32K ROM file.
 
Instead of creating a bunch of new VMs and installing Linux and the Guest Additions, let's just make three clones of the one we've already made.

 

I'm sure others would love it if you (and @johnnywc for Windows) would start new topics here that documented how you set up your development environments.

  • Like 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...