Author Topic: 5Dc in Unified doesn't compile  (Read 18120 times)

Totte

  • New to the forum
  • *
  • Posts: 26
5Dc in Unified doesn't compile
« on: April 10, 2013, 06:52:11 PM »
Hi,
I've now come to the point that I can compile ML from the Unified source tree for several cameras, but not for 5Dc, which is the camera that I was interested in.

The compilation stops like this:
...
[ CC       ]   picoc.o
[ CC       ]   chdk-gui_script.o
[ AR       ]   strrchr.o
[ AR       ]   dietlibc.a
[ AR       ]   lib_a-setjmp.o
[ AR       ]   newlib-libc.a
[ LD       ]   magiclantern
pico.o: In function `abort':
pico.c:(.text+0x603c): multiple definition of `abort'
menu.o: In function `entry_default_display_info':
menu.c:(.text+0x1c3c): undefined reference to `was_sound_recording_disabled_by_fps_override'
menu.c:(.text+0x1c4c): undefined reference to `fps_should_record_wav'
debug.o: In function `run_test':
debug.c:(.text+0x244): undefined reference to `exmem_test'
debug.o: In function `config_menu_init':
debug.c:(.text+0xedc): undefined reference to `movie_tweak_menu_init'
lens.o: In function `draw_ml_bottombar':
lens.c:(.text+0x17f0): undefined reference to `hdr_video_enabled'
lens.o: In function `iso_components_update':
lens.c:(.text+0x2378): undefined reference to `get_digic_iso_gain_movie'
pico.o: In function `LibSetGuiMode':
pico.c:(.text+0x8ae): undefined reference to `SetGUIRequestMode'
collect2: error: ld returned 1 exit status
make[1]: *** [magiclantern] Error 1

Before I look into the source files, do other people have the same problem or are there simply tools and/or source files that I'm missing?

Thank you!

Marsu42

  • Contributor
  • Hero Member
  • *****
  • Posts: 1557
  • 66d + flashes
Re: 5Dc in Unified doesn't compile
« Reply #1 on: April 10, 2013, 07:53:19 PM »
A possible quick fix could be to copy Makefile.user to Makefile.user.default and set CONFIG_PICOC = n

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: 5Dc in Unified doesn't compile
« Reply #2 on: April 10, 2013, 07:59:32 PM »
Nobody touched the 5Dc port since months.

Totte

  • New to the forum
  • *
  • Posts: 26
Re: 5Dc in Unified doesn't compile
« Reply #3 on: April 11, 2013, 02:43:39 PM »
Nobody touched the 5Dc port since months.

How should I read this message? Are the compile errors to be expected because nobody has completed the port, or should it (still) compile because nobody has messed with it?

I was under the impression that the 5Dc had now been integrated in Unified, but I've reverted to the pre-compiled toolchain that should work with the unmodified make files (gcc-arm-none-eabi-4_7-2012q4-20121208-linux.tar.bz2), and I still get the same errors. The ones already listed under SUPPORTED_MODELS compile fine, though.

So, is the announcement "EDIT The 5dc will work on the unified tree! Big thanks to A1ex for the help in making this happen." found at http://www.magiclantern.fm/forum/index.php?topic=1010.0 a bit misleading or am I missing something?

Thanks again!

nanomad

  • Administrator
  • Hero Member
  • *****
  • Posts: 2918
  • All your websites are belong to us
Re: 5Dc in Unified doesn't compile
« Reply #4 on: April 11, 2013, 03:18:06 PM »
Well, since nobody compiled it, nobody noticed it broke sometime ago.
You basically have to fix the error and submit a pull request if you're interested
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

Totte

  • New to the forum
  • *
  • Posts: 26
Re: 5Dc in Unified doesn't compile
« Reply #5 on: April 11, 2013, 10:14:39 PM »
Thanks for the clarification.

scrax

  • Contributor
  • Hero Member
  • *****
  • Posts: 1543
  • Code monkey
Re: 5Dc in Unified doesn't compile
« Reply #6 on: April 12, 2013, 02:31:44 AM »
Well, since nobody compiled it, nobody noticed it broke sometime ago.
You basically have to fix the error and submit a pull request if you're interested

For what I know is from when Coutts stopped porting it that 5dc branch is not a lot updated and with all the subsequent changes in the main repo went broke.
Since when I got the 5Dc I can compile and use only the 0xAF fork or the beta release.
That's why I've not yet tried to add or fix what's working strange on the 5Dc.

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-

coutts

  • Developer
  • Senior
  • *****
  • Posts: 401
Re: 5Dc in Unified doesn't compile
« Reply #7 on: April 17, 2013, 10:12:23 PM »
disable picoc (probably not enough ram anyways) and add dummy stubs (fake functions) with the names that the compiler complains is missing (see dummy.c in platform directory, put the stuff there).

the error about abort is related to libc.a, I forget how we fixed it last time I saw this..


Totte

  • New to the forum
  • *
  • Posts: 26
Re: 5Dc in Unified doesn't compile
« Reply #8 on: April 18, 2013, 04:08:57 PM »
CONFIG_PICOC = n in Makefile.user.default and the following declarations in dummy.c did indeed produce an autoexec.bin file.

int was_sound_recording_disabled_by_fps_override() { return 1; }
int fps_should_record_wav() { return 0; }
void movie_tweak_menu_init() {}
int hdr_video_enabled() { return 0; }
int get_digic_iso_gain_movie() { return 0; }
void SetGUIRequestMode(int name) {}

I'm going away for a few days, but I'll see if I can brick my camera with this next week :P  Thanks!

coutts

  • Developer
  • Senior
  • *****
  • Posts: 401
Re: 5Dc in Unified doesn't compile
« Reply #9 on: April 18, 2013, 05:40:36 PM »
CONFIG_PICOC = n in Makefile.user.default and the following declarations in dummy.c did indeed produce an autoexec.bin file.

int was_sound_recording_disabled_by_fps_override() { return 1; }
int fps_should_record_wav() { return 0; }
void movie_tweak_menu_init() {}
int hdr_video_enabled() { return 0; }
int get_digic_iso_gain_movie() { return 0; }
void SetGUIRequestMode(int name) {}

I'm going away for a few days, but I'll see if I can brick my camera with this next week :P  Thanks!
glad that worked for you! :)

scrax

  • Contributor
  • Hero Member
  • *****
  • Posts: 1543
  • Code monkey
Re: 5Dc in Unified doesn't compile
« Reply #10 on: April 20, 2013, 03:37:21 PM »
CONFIG_PICOC = n in Makefile.user.default and the following declarations in dummy.c did indeed produce an autoexec.bin file.

int was_sound_recording_disabled_by_fps_override() { return 1; }
int fps_should_record_wav() { return 0; }
void movie_tweak_menu_init() {}
int hdr_video_enabled() { return 0; }
int get_digic_iso_gain_movie() { return 0; }
void SetGUIRequestMode(int name) {}

I'm going away for a few days, but I'll see if I can brick my camera with this next week :P  Thanks!

Tried just right now and the bin compiled, but not loaded by the camera.
As soon as the card is inserted the red led stay on after a first blink.
This also when pushing the battery with camera on and card in (with slot open).
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-

coutts

  • Developer
  • Senior
  • *****
  • Posts: 401
Re: 5Dc in Unified doesn't compile
« Reply #11 on: April 24, 2013, 02:43:30 AM »
void SetGUIRequestMode(int name) {}


this is needed by ML, it should be a stub defined in stubs.S

Totte

  • New to the forum
  • *
  • Posts: 26
Re: 5Dc in Unified doesn't compile
« Reply #12 on: April 24, 2013, 02:17:58 PM »
So, is there a way that a mere mortal like myself could help find the correct address for SetGUIRequestMode()?

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: 5Dc in Unified doesn't compile
« Reply #13 on: April 24, 2013, 05:35:36 PM »
There's no such thing in 5Dc iirc; the workaround for opening the menu was different.

If the menu works, don't worry about it.

Totte

  • New to the forum
  • *
  • Posts: 26
Re: 5Dc in Unified doesn't compile
« Reply #14 on: April 26, 2013, 09:29:17 AM »
OK, but I'm still having the same problem as reported by scrax above.

Any idea what prevents ML from starting? Otherwise it seems I have to go back to the Unified version that had a working 5Dc port and try to see where it all went wrong. Can anyone confirm that the working beta4 was indeed compiled from Unified?

scrax

  • Contributor
  • Hero Member
  • *****
  • Posts: 1543
  • Code monkey
Re: 5Dc in Unified doesn't compile
« Reply #15 on: April 29, 2013, 01:41:24 PM »
I've commented the line:
//void SetGUIRequestMode(int name) {}

now the red led still stay on but I can see the top LCD changing values like if it's working, but no buttons are working, so menu will not show up and is impossible to do anything.

EDIT: the button near the top LCD are working halfshutter and DOF too (trig AF), other buttons like MENU, INFO, TRASH etc.. are not responding. wheels are working too.


NOTE, I've installed gawk with homebrew on mac cause there was a warning about it not found when compiling:

Code: [Select]
[ SYMBOLS  ]   magiclantern.sym
/bin/sh: gawk: command not found
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-

0xAF

  • Contributor
  • Freshman
  • *****
  • Posts: 85
  • The devil in me...
Re: 5Dc in Unified doesn't compile
« Reply #16 on: April 29, 2013, 08:55:25 PM »
The beta4 was compiled from Unified by Alex, but way too many things changed since then... One of the first changes was the boot procedure. This is the reason, which prevents you from booting it correctly right now...
I were trying to fix the booting, but it still needs work. In my repo you can find the local_entry.S which is the old entry.S from 5DC (made by Coutts), but I had made some modifications to it (cant remember what and where).
Basically 5Dc will not boot normally in the current ML source, even if you compile it. Not in this shape at least.

I will have few free days after Tuesday, since we are Orthodox Christians, and we have 1 week calibrations now.
I will try to sync my repo with the main-stream ML.
So if anyone is interested, it will be easier to take over from there (and try to finish the cache-hacks boot method)

EDIT:
Just read the last post from scrax, how you booted it with cache-hacks or with your local entry.S ?

EDIT2:
Sorry, just saw in the ML repo that the entry.S is still there, I dont know why I were thinking that it were removed long time ago...
But still IIRC (which I doubt already), there will be problems with booting it, because of the CPU initialization, I had to modify some parts in entry.S to fix this (but again, I may be wrong).
// AF

scrax

  • Contributor
  • Hero Member
  • *****
  • Posts: 1543
  • Code monkey
Re: 5Dc in Unified doesn't compile
« Reply #17 on: April 29, 2013, 09:41:42 PM »
The beta4 was compiled from Unified by Alex, but way too many things changed since then... One of the first changes was the boot procedure. This is the reason, which prevents you from booting it correctly right now...
I were trying to fix the booting, but it still needs work. In my repo you can find the local_entry.S which is the old entry.S from 5DC (made by Coutts), but I had made some modifications to it (cant remember what and where).
Basically 5Dc will not boot normally in the current ML source, even if you compile it. Not in this shape at least.

I will have few free days after Tuesday, since we are Orthodox Christians, and we have 1 week calibrations now.
I will try to sync my repo with the main-stream ML.
So if anyone is interested, it will be easier to take over from there (and try to finish the cache-hacks boot method)

EDIT:
Just read the last post from scrax, how you booted it with cache-hacks or with your local entry.S ?

EDIT2:
Sorry, just saw in the ML repo that the entry.S is still there, I dont know why I were thinking that it were removed long time ago...
But still IIRC (which I doubt already), there will be problems with booting it, because of the CPU initialization, I had to modify some parts in entry.S to fix this (but again, I may be wrong).

I've just tried to pull from source repo to your repo and merged them, added those dummy things and now it can load and I'm enjoying the new menu layout :D

EDIT: here the patch
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-

0xAF

  • Contributor
  • Freshman
  • *****
  • Posts: 85
  • The devil in me...
Re: 5Dc in Unified doesn't compile
« Reply #18 on: April 29, 2013, 09:46:23 PM »
I've just tried to pull from source repo to your repo and merged them, added those dummy things and now it can load and I'm enjoying the new menu layout :D

Nice, would you pull-request so I can merge it into my repo. It can save me some time when I get back to it.
// AF

scrax

  • Contributor
  • Hero Member
  • *****
  • Posts: 1543
  • Code monkey
Re: 5Dc in Unified doesn't compile
« Reply #19 on: April 29, 2013, 10:10:09 PM »
I can't right now, need todo a fork before. maybe the diff is enough?
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: 5Dc in Unified doesn't compile
« Reply #20 on: April 29, 2013, 10:10:56 PM »
Export the hg diff, we can pull his repo to the main via bitbucket anyway
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

scrax

  • Contributor
  • Hero Member
  • *****
  • Posts: 1543
  • Code monkey
Re: 5Dc in Unified doesn't compile
« Reply #21 on: April 29, 2013, 10:14:40 PM »
Export the hg diff, we can pull his repo to the main via bitbucket anyway

I've made the diff of 0xAF's repo after merging it with latest unified here the link: https://dl.dropboxusercontent.com/u/123918/MagicLantern/bleeding-edge/5Dc/patch.diff.zip
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-

scrax

  • Contributor
  • Hero Member
  • *****
  • Posts: 1543
  • Code monkey
Re: 5Dc in Unified doesn't compile
« Reply #22 on: April 29, 2013, 10:17:26 PM »
now forking ML and 0xAF sources to make the pull request
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-

0xAF

  • Contributor
  • Freshman
  • *****
  • Posts: 85
  • The devil in me...
Re: 5Dc in Unified doesn't compile
« Reply #23 on: April 29, 2013, 10:18:25 PM »
Export the hg diff, we can pull his repo to the main via bitbucket anyway

If you want me, I can merge scrax's diff and sync to latest ML, before you pull. Though it's not worth pulling my repo may be, the job is not finished.


EDIT: I see scrax is going to handle it.
// AF

0xAF

  • Contributor
  • Freshman
  • *****
  • Posts: 85
  • The devil in me...
Re: 5Dc in Unified doesn't compile
« Reply #24 on: April 29, 2013, 10:22:26 PM »
Off-topic, sorry for posting this, call me superstitious or naive, but I do not like my post count staying on 66.
:)
// AF