Author Topic: ARM Toolchain  (Read 14455 times)

trsaunders

  • New to the forum
  • *
  • Posts: 41
ARM Toolchain
« on: July 03, 2012, 02:36:55 PM »
I've built the toolchain, had to use -mlong-calls in Makefile.inc, but I got ML compiled.

In platforms/, there is a folder 50D.109. Does this mean I need firmware 1.0.9 on my 50D? I currently have 1.0.8 and the ML release from December.
50D, 5D3

nanomad

  • Administrator
  • Hero Member
  • *****
  • Posts: 2918
  • All your websites are belong to us
Re: ARM Toolchain
« Reply #1 on: July 03, 2012, 02:47:59 PM »
If you had to use -mlong-calls chances are you're using a 64bit compiler.
In order to test and develop Magic Lanter properly, I suggest you use a 32bit arm compiler. If you're on linux there's no need to use a 32 bit distrubtion, you just need to install libc6-i386
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

trsaunders

  • New to the forum
  • *
  • Posts: 41
Re: ARM Toolchain
« Reply #2 on: July 03, 2012, 03:10:51 PM »
I thought I might be better off with a 32bit compiler. I'm running ubuntu 12.04, and I have libc-i386 installed. Is there a way to modify summon-arm to force it to build a 32bit toolchain, or should I just use the vmware image?
50D, 5D3

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: ARM Toolchain
« Reply #3 on: July 03, 2012, 03:35:19 PM »
If you can force the arm-toolchain to build a 32-bit compiler, please post the patch so I can commit it.

nanomad

  • Administrator
  • Hero Member
  • *****
  • Posts: 2918
  • All your websites are belong to us
Re: ARM Toolchain
« Reply #4 on: July 03, 2012, 03:57:53 PM »
I'm using the codesourcery toolchain for my 1100D work. It's pre-built and works fine.

http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/

EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: ARM Toolchain
« Reply #5 on: July 03, 2012, 04:00:53 PM »

nanomad

  • Administrator
  • Hero Member
  • *****
  • Posts: 2918
  • All your websites are belong to us
Re: ARM Toolchain
« Reply #6 on: July 03, 2012, 04:03:17 PM »
Now it works fine. Both at my home and on ML server :)
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

trsaunders

  • New to the forum
  • *
  • Posts: 41
Re: ARM Toolchain
« Reply #7 on: July 03, 2012, 04:16:23 PM »
thanks for the tips, I will try out that toolchain  :D

I had a problem running make docs. On ubuntu, rst2latex is just installed as rst2latex not rst2latex.py. I created a symlink in /usr/bin and that sorted it out.
50D, 5D3

trsaunders

  • New to the forum
  • *
  • Posts: 41
Re: ARM Toolchain
« Reply #8 on: July 03, 2012, 04:55:17 PM »
I downloaded Codesourcery ARM EABI, choosing 'IA32 GNU/Linux TAR'. Extracted to my home directory and updated Makefile.inc:

Code: [Select]
ARM_ABI = none-eabi
ARM_PATH=~/arm-2012.03

and it all builds fine.
50D, 5D3

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: ARM Toolchain
« Reply #9 on: July 03, 2012, 04:59:13 PM »
Great, so there is now an easy way of building ML!

nanomad

  • Administrator
  • Hero Member
  • *****
  • Posts: 2918
  • All your websites are belong to us
Re: ARM Toolchain
« Reply #10 on: July 03, 2012, 05:13:03 PM »
Great, so there is now an easy way of building ML!

At least as long as Codesurcery keeps offering the ARM GCC compiler for free  ;)
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

trsaunders

  • New to the forum
  • *
  • Posts: 41
Re: ARM Toolchain
« Reply #11 on: July 03, 2012, 07:16:31 PM »
ARM also maintain a gcc toolchain, I use the same one for ARM CM4 development. I didn't realise I could use it to compile ML, but it works. Binary is a bit smaller than the one produced by the code sourcery toolchain (~365kb vs 328kb)
50D, 5D3

nanomad

  • Administrator
  • Hero Member
  • *****
  • Posts: 2918
  • All your websites are belong to us
Re: ARM Toolchain
« Reply #12 on: July 03, 2012, 08:59:53 PM »
Well, well, well. A prebuilt stock GCC toolchain mantained by ARM. We should definitely move to this

Thanks  :)
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: ARM Toolchain
« Reply #13 on: July 03, 2012, 09:27:47 PM »
Works for me too (just compiled, did not run). RAM usage for 5D2 binary: 341k (prebuilt GCC) vs 339k (32-bit arm toolchain).

scrax

  • Contributor
  • Hero Member
  • *****
  • Posts: 1543
  • Code monkey
Re: ARM Toolchain
« Reply #14 on: July 03, 2012, 09:29:34 PM »
thanks for the tips, I will try out that toolchain  :D

I had a problem running make docs. On ubuntu, rst2latex is just installed as rst2latex not rst2latex.py. I created a symlink in /usr/bin and that sorted it out.

It was renamed for Osx compatibility, if you know a better way to deal with it...(maybe adding the symlink to Osx with prepare.Lion.sh ?)
I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-

nanomad

  • Administrator
  • Hero Member
  • *****
  • Posts: 2918
  • All your websites are belong to us
Re: ARM Toolchain
« Reply #15 on: July 03, 2012, 09:34:14 PM »
In the makefile, check if OS is darwin or not and set the executable name accordingly
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

trsaunders

  • New to the forum
  • *
  • Posts: 41
Re: ARM Toolchain
« Reply #16 on: July 03, 2012, 11:56:52 PM »
it could be that non OSX platforms also get named with .py. a simple way to check could be to look at the output of `which rst2latex.py`
50D, 5D3

scrax

  • Contributor
  • Hero Member
  • *****
  • Posts: 1543
  • Code monkey
Re: ARM Toolchain
« Reply #17 on: July 04, 2012, 01:09:30 AM »
it could be that non OSX platforms also get named with .py. a simple way to check could be to look at the output of `which rst2latex.py`
yep, that is good, i've used it for MLTools, can you take a look at it to see if could be made more "POSIX" than now, if you want?


EDIT:
in makefile there is already a check for osx but I can't figure how to add:

Code: [Select]
ifeq ($(UNAME), Darwin)
# Variable declaration for Mac OS X
UMOUNT=hdiutil unmount
CF_CARD=/Volumes/EOS_DIGITAL
else
# Default settings for remaining operating systems
CF_CARD=/media/EOS_DIGITAL
UMOUNT=umount
endif
I can't use this code for the check:
Code: [Select]
if [ ! $(which rst2latex) ] && [ $(which rst2latex.py) ]; then
    alias rst2latex=rst2latex.py
fi
nor this inserted in the already present check:
alias rst2latex=rst2latex.py


ARM also maintain a gcc toolchain, I use the same one for ARM CM4 development. I didn't realise I could use it to compile ML, but it works. Binary is a bit smaller than the one produced by the code sourcery toolchain (~365kb vs 328kb)
from what I can understand no osx, true?
I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-

trsaunders

  • New to the forum
  • *
  • Posts: 41
Re: ARM Toolchain
« Reply #18 on: July 12, 2012, 04:39:31 PM »
from what I can understand no osx, true?
Unfortunately, that is true. YAGARTO could be an alternative, but I've not tested with ML.
50D, 5D3

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: ARM Toolchain
« Reply #19 on: July 13, 2012, 02:59:32 PM »
I've ran Yagarto under Windows (also had to install msys) and worked fine.

vtrandal

  • New to the forum
  • *
  • Posts: 44
Re: ARM Toolchain
« Reply #20 on: July 31, 2012, 02:03:45 AM »
I just made a long post in General Development Discussion about my difficulty building ML using the ARM toolchain I built in my 64-bit Ubuntu 10.04 VM.

From reading this thread I gather that it's because my Ubuntu 10.04 is 64-bit and building a correctly functioning ARM toolchain for ML is just not yet working in 64-bit Linux distributions? I guess I failed to read the fine print somewhere :) My bad.

Oh well I'm installing Ubuntu 12.04 LTS 32-bit right now. I hope that's a good direction to go in. I would much rather have another Ubuntu VM to backup and maintain that develop ML in Windows 7.

adijiwa

  • New to the forum
  • *
  • Posts: 19
Re: ARM Toolchain
« Reply #21 on: July 31, 2012, 03:30:19 AM »
I just made a long post in General Development Discussion about my difficulty building ML using the ARM toolchain I built in my 64-bit Ubuntu 10.04 VM.

Use -mlong-calls on 64-bit systems. It will produce slightly larger binaries. From my experience, I have no problems compiling and running ML on 64-bit systems. I use Ubuntu 12.04 64-bit native, not VM.

vtrandal

  • New to the forum
  • *
  • Posts: 44
Re: ARM Toolchain
« Reply #22 on: July 31, 2012, 04:56:33 AM »
Use -mlong-calls on 64-bit systems. It will produce slightly larger binaries. From my experience, I have no problems compiling and running ML on 64-bit systems. I use Ubuntu 12.04 64-bit native, not VM.

Sounds good to me. But I have no clue what that is. Can you explain?

adijiwa

  • New to the forum
  • *
  • Posts: 19
Re: ARM Toolchain
« Reply #23 on: July 31, 2012, 05:22:14 AM »
Sounds good to me. But I have no clue what that is. Can you explain?

In Makefile.inc, look for CFLAGS variable. Mine looks like this:
Code: [Select]
CFLAGS=\
        $(FLAGS) \
        -Os \
        -Wall \
        -W \
        -mstructure-size-boundary=32 \
        -Wno-unused-parameter \
        -Wno-implicit-function-declaration \
        -Wno-unused-function \
        -Wno-missing-field-initializers \
        -Wno-format \
        -std=gnu99 \
        -D__ARM__ \
        -I$(PLATFORM_INC) \
        -I$(SRC_DIR) \
        -mlong-calls \

Notice the -mlong-calls at the end of variable.

vtrandal

  • New to the forum
  • *
  • Posts: 44
Re: ARM Toolchain
« Reply #24 on: July 31, 2012, 12:51:34 PM »
Thank you.

With that change the build does seem to progress further.

But it now terminates with an error similar to that described here:
http://www.magiclantern.fm/forum/index.php?topic=1768.0

So, a little progress.