Compile ml w/ Linaro gcc?

Started by Marsu42, September 05, 2012, 11:05:34 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Marsu42

I'm just setting up the arm toolchain and noticed that that the summon-arm script contains the outdated gcc 4.6.2 (current is 4.6.3).

Is there any reason to use this particular gcc release, and why doesn't it use the current linaro 4.6 or 4.7 gcc which is supposed to be the latest and greatest for building arm compiles? Is it just because of "never touch a running system" or does any more current gcc release make your cameras crash and burn? What gcc do you guys use?

a1ex

I'm interested too, if you succeed, please let me know (especially if there are any performance improvement). I couldn't compile with Linaro, but that was many months ago.

Marsu42

Quote from: a1ex on September 05, 2012, 11:10:29 AM
I'm interested too, if you succeed, please let me know (especially if there are any performance improvement). I couldn't compile with Linaro, but that was many months ago.

Hmmmm, I'm still somewhat critical about the guinea pig role, but I've been using Linaro for years to compile OpenWrt for my router (though it is mips and Linaro improvements are mainly for arm). And since I'm no ml insider, it is very unlikely I could recognize any performance improvements, or are there any dev benchmark tools hidden somewhere in ml? But I'll let you know if it compiles, and if I'm to hesitant to try it myself maybe you could have a go with your sponsored guinea pig hardware :-o

nanomad

I use the 32bit compiler binary mantained by arm. The link should be in the sticky thread

The stability test sub-menu has some benchmarks too if I'm not mistaken
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

Well... if you make the Linaro work with ML (just compile it and tell me what changes you had to do), I'll do the rest. You don't have to try it on your camera for the first time.

nanomad

A1ex, how about a compiler "race" then?
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

Sounds good.

I think this is best done in playback mode (where Canon tasks are idle), with some operation that feels a bit slow on ML right now (like focus peaking or defishing).

Compiling with -O3 also has noticeable speed improvements, but it caused trouble on 500D so I've turned it off in 2.3.

nanomad

I just realized that we are using the same cpu the Nintendo DS has. It was fun porting linux to it. We don't have much cpu power eh?
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

Marsu42

Quote from: nanomad on September 05, 2012, 11:14:36 AM
The stability test sub-menu has some benchmarks too if I'm not mistaken

Alex' post implies that you are mistaken - but I'll have a go at compiling it w/ Linaro and let you know my findings. There shouldn't be too many changes necessary (unless I try 4.7), Linaro is proven & stable and is the default compiler on Ubuntu.

a1ex

There's enough CPU power to run a basic operating system, with file I/O, multitasking, even some simple image processing at 720x480 at 20fps in parallel with LiveView (that's the new focus peaking).

Trammell was able to write to display from bootloader context, without starting the main firmware: http://vimeo.com/7851909

Also, the bootloader has basic file I/O and probably direct card access too.

Marsu42

Quote from: a1ex on September 05, 2012, 11:39:43 AM
Compiling with -O3 also has noticeable speed improvements, but it caused trouble on 500D so I've turned it off in 2.3.

... that's the CFLAG in line 161 in Makefile.inc which is -Os in the current hg checkout, so I can should/can change that to -O3 if the target is my 60d?

a1ex

I usually only add these lines:

# compile some modules with -O3 for increased speed
zebra.o: $(SRC_DIR)/zebra.c
$(call build,CC,$(CC) $(CFLAGS) -O3 -c -o $@ $<)
menu.o: $(SRC_DIR)/menu.c
$(call build,CC,$(CC) $(CFLAGS) -O3 -c -o $@ $<)
bmp.o: $(SRC_DIR)/bmp.c
$(call build,CC,$(CC) $(CFLAGS) -O3 -c -o $@ $<)
chdk-gui_draw.o: $(SRC_DIR)/chdk-gui_draw.c
$(call build,CC,$(CC) $(CFLAGS) -O3 -c -o $@ $<)

You can try to compile everything with -O3 too, it usually works, but the binary size will increase quite a bit.

nanomad

Ok, digging out my old DSLinux stuff...here's what we used:
-g -Wall -Os -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math
Maybe it's worth a shot

fomit-frame-pointer is actually redundant but the march and mtune can generate optimized code paths
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

Marsu42

Quote from: nanomad on September 05, 2012, 12:52:15 PM
Maybe it's worth a shot

Harrrgnnn ... now *that* was annoying, but I managed to compile ml with latest Linaro gcc 4.6 series (d/l from Launchpad) and even valiantly tested it - runs fine so far :-)

However, I couldn't persuade summon-arm to get even fsf gcc to compile on my x64 Ubuntu lts system, so I used the arm toolchain from https://launchpad.net/gcc-arm-embedded and replaced their gcc source with Linaro before running their build-toolchain.sh ... and I had to patch newlib, see the patch @ http://sourceware.org/ml/newlib/2011/msg00076.html

If you manage to write some benchmark we might even see if it was worth it - but since Linaro is working on optimizing gcc for arm for years, I think it certainly cannot be worse than the vanilla version. And we could try to compile ml with Linaro gcc 4.7, but without any benchmarks it would be a waste of time because we cannot tell the difference offhand.



Marsu42

... btw, here's the autoexec if anyone wants to run a stability test and is to lazy to compile Linaro gcc: [link deleted: obsolete]

ilguercio

Canon EOS 6D, 60D, 50D.
Sigma 70-200 EX OS HSM, Sigma 70-200 Apo EX HSM, Samyang 14 2.8, Samyang 35 1.4, Samyang 85 1.4.
Proud supporter of Magic Lantern.

Marsu42

Quote from: ilguercio on September 05, 2012, 09:29:48 PM
Thanks, will try it out.

... and remember it's the latest trunk, so if anything's broken it might be very well the sourcecode itsself, too.

ilguercio

Canon EOS 6D, 60D, 50D.
Sigma 70-200 EX OS HSM, Sigma 70-200 Apo EX HSM, Samyang 14 2.8, Samyang 35 1.4, Samyang 85 1.4.
Proud supporter of Magic Lantern.

Marsu42

Quote from: ilguercio on September 05, 2012, 09:37:14 PM
Got an error, here's the log file.
Looks huuuge.

:-) ... what did you do to throw the error? I turned on all optimizations the devs recommended for the 60d, but they also said that might decrease stability. Maybe the next step should be to compile it with standard settings and Linaro 4.6 and then 4.7 to isolate the cause of problems - but as I wrote it runs just fine on my 60d as far as I can see, but your 50d is another model alltogether.

ilguercio

Let me try to reproduce it.
I just opened LV with focus peaking active.
Canon EOS 6D, 60D, 50D.
Sigma 70-200 EX OS HSM, Sigma 70-200 Apo EX HSM, Samyang 14 2.8, Samyang 35 1.4, Samyang 85 1.4.
Proud supporter of Magic Lantern.

a1ex

Be careful, some bleeding edge focus peaking modes won't work on 50D.

Marsu42

Quote from: ilguercio on September 05, 2012, 09:56:09 PM
Let me try to reproduce it.
I just opened LV with focus peaking active.

Alex did some changes to focus peaking recently (see changelog), it might be buggy. I'll do Linaro compiles for the stable 2.3 tag, optimized and non-optimized, this should be better than testing the unstable trunk. Check this thread again tomorrow at latest for the d/l links.

ilguercio

Ok, that might be it then.
Want me to tell you which modes do not work?
Canon EOS 6D, 60D, 50D.
Sigma 70-200 EX OS HSM, Sigma 70-200 Apo EX HSM, Samyang 14 2.8, Samyang 35 1.4, Samyang 85 1.4.
Proud supporter of Magic Lantern.

nanomad

Please do all tests on 2.3 stable (it's tagged on bitbucket as ML2.3-stable, revision afdeefef62fa)

edit: just realized that ML uses -march so it should be good. The makefile is a mess though ::)
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

Marsu42

Quote from: a1ex on September 05, 2012, 12:04:46 PM
I usually only add these lines:

@alex: *Where* do I add these lines in the Makefile.inc? In the places I tried they are ignored and everything is compiled with -Os in spite of the special lines with -O3 for zebra.o and so on...

Quote from: nanomad on September 05, 2012, 10:32:06 PM
edit: just realized that ML uses -march so it should be good.

... still, if the exact cpu is known shouldn't be -mtune=arm946e-s or even -mcpu=... better in addition to -march?

Quote from: nanomad on September 05, 2012, 10:32:06 PM
Please do all tests on 2.3 stable (it's tagged on bitbucket as ML2.3-stable, revision afdeefef62fa)

Ok, here it goes - standard -Os compile with current Linaro gcc 4.7, working ok on my 60d, anyone feel free to try it for regressions to the release build with the vanilla fsf compiler: https://dl.dropbox.com/u/94419838/ml-2.3.linaro47-test1.marsu42.zip

ilguercio

Canon EOS 6D, 60D, 50D.
Sigma 70-200 EX OS HSM, Sigma 70-200 Apo EX HSM, Samyang 14 2.8, Samyang 35 1.4, Samyang 85 1.4.
Proud supporter of Magic Lantern.

ilguercio

Only one thing, wasn't movie restart working on 50D lately?
There was a fix by somebody, i read about it on google groups.
Canon EOS 6D, 60D, 50D.
Sigma 70-200 EX OS HSM, Sigma 70-200 Apo EX HSM, Samyang 14 2.8, Samyang 35 1.4, Samyang 85 1.4.
Proud supporter of Magic Lantern.

Marsu42

Quote from: ilguercio on September 06, 2012, 02:11:04 AM
Only one thing, wasn't movie restart working on 50D lately?
There was a fix by somebody, i read about it on google groups.

My compile is the ml2.3 release build, if it's not working in alex' official version it won't work on this one (and I have got a 60d, not a 50d). But feel free to install mercurial & gcc yourself and add the patch from google groups, it just takes a day to set it up :->