Author Topic: adtg_gui module compiling problem  (Read 1616 times)

reddeercity

  • Hero Member
  • *****
  • Posts: 1368
adtg_gui module compiling problem
« on: April 02, 2017, 07:56:59 AM »
Being trying to compile the adtg_gui from the ISO research branche   and I keep getting error ,
Code: [Select]
[email protected]:~/Desktop/magic-lantern/modules/adtg_gui$ make
Updated HGVERSION
[ README   ]   module_strings.h
Help page 1: Usage 1/3
Help page 2: Usage 2/3
Help page 3: Usage 3/3
[ CC       ]   adtg_gui.o
adtg_gui.c: In function 'adtg_log':
adtg_gui.c:658:5: error: implicit declaration of function 'get_current_task' [-Werror=implicit-function-declaration]
     uint32_t caller_task = get_current_task();
     ^
cc1: some warnings being treated as errors
make: *** [adtg_gui.o] Error 1
[email protected]:~/Desktop/magic-lantern/modules/adtg_gui$

I'm updated to the newest code , compile OK before I pulled the iso branche & merged ,
This what used to pull & merge
Code: [Select]
hg update unified
hg pull
hg branch unified_iso-research
hg merge iso-research

I search in adtg_gui.c for "In function adtg_log " and come up with this
Code: [Select]
    Line-650   static void adtg_log(uint32_t* regs, uint32_t* stack, uint32_t pc)   /* set hooks at ADTG and CMOS writes */    
Code: [Select]
    Line 852    if (ADTG_WRITE_FUNC)   patch_hook_function(ADTG_WRITE_FUNC, MEM(ADTG_WRITE_FUNC), &adtg_log, "adtg_log");
I'm not sure what's missing ? or did the merge go south on my .
Any help is great thanks .



Danne

  • Hero Member
  • *****
  • Posts: 3140
Re: adtg_gui module compiling problem
« Reply #1 on: April 02, 2017, 08:44:56 AM »
Did you enable:
Code: [Select]
CONFIG_GDB          = y
CONFIG_GDBSTUB      = y
In Makefile.user.default in root folder?

Something from this:
Code: [Select]
# Build configuration - untested and debug stuff handy for devs
CONFIG_PTP          = n
CONFIG_PTP_CHDK     = n
CONFIG_PTP_ML       = n
ifndef CONFIG_GDB
CONFIG_GDB          = n
endif
CONFIG_GDBSTUB      = n
ifndef CONFIG_CONSOLE
CONFIG_CONSOLE      = y
endif
CONFIG_DEBUGMSG     = 0
CONFIG_CCACHE       = n
CONFIG_TCC          = y
CONFIG_MODULES      = y
CONFIG_TINYPY       = n

To this:
Code: [Select]
# Build configuration - untested and debug stuff handy for devs
CONFIG_PTP          = n
CONFIG_PTP_CHDK     = n
CONFIG_PTP_ML       = n
CONFIG_GDB          = y
CONFIG_GDBSTUB      = y
ifndef CONFIG_CONSOLE
CONFIG_CONSOLE      = y
endif
CONFIG_DEBUGMSG     = 0
CONFIG_CCACHE       = n
CONFIG_TCC          = y
CONFIG_MODULES      = y
CONFIG_TINYPY       = n


Enables adtg_gui to most branches if adtg_gui added to the  Makefile.user.default  list in the modules folder.
Code: [Select]
MODULE_CFLAGS += -I../../src/
ML_MODULES_STATIC ?=
ML_MODULES_DYNAMIC ?= \
mlv_lite \
mlv_play \
mlv_rec \
mlv_snd \
file_man \
pic_view \
ettr \
dual_iso \
silent \
dot_tune \
autoexpo \
arkanoid \
deflick \
lua \
bench \
selftest \
adv_int \
crop_rec \
adtg_gui \

Put in adtg_gui in the list at the bottom. All in all Makefile.user.default both in root and modules folder has to be changed.

reddeercity

  • Hero Member
  • *****
  • Posts: 1368
Re: adtg_gui module compiling problem
« Reply #2 on: April 02, 2017, 09:09:47 AM »
No I didn't , thanks I'll give that try .

Danne

  • Hero Member
  • *****
  • Posts: 3140
Re: adtg_gui module compiling problem
« Reply #3 on: April 02, 2017, 09:34:06 AM »
Updated my answer a bit about the modules folder.

reddeercity

  • Hero Member
  • *****
  • Posts: 1368
Re: adtg_gui module compiling problem
« Reply #4 on: April 03, 2017, 01:42:11 AM »
@Danne , Ok configured it like you said , using this committed 50d8f06   but still errors out on line adtg_gui.c-648
Code: [Select]
uint32_t caller_task = get_current_task();
-Werror=implicit-function-declaration
How do I correct this ?
I've  read that is not being define in the header from
here --> http://stackoverflow.com/questions/8440816/warning-implicit-declaration-of-function
Quote
The right way is to declare function prototype in header
adtg_gui.c-19 #define DST_ADTG    0x000F      /* any ADTG */
Isn't  that what define here ?
Now I'm getting confused  :-\

This is the error I'm getting 
Code: [Select]
[email protected]:~/magic-lantern/modules/adtg_gui$ make
[ CC       ]   adtg_gui.o
adtg_gui.c: In function 'adtg_log':
adtg_gui.c:648:5: error: implicit declaration of function 'get_current_task' [-Werror=implicit-function-declaration]
     uint32_t caller_task = get_current_task();
     ^
cc1: some warnings being treated as errors
make: *** [adtg_gui.o] Error 1
[email protected]:~/magic-lantern/modules/adtg_gui$
If I do a whole platform "make zip" I can compile all modules except adtg_gui .
Advice is very much welcome . Thanks

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3199
  • 60Da / 1100D / EOSM
Re: adtg_gui module compiling problem
« Reply #5 on: April 03, 2017, 02:09:57 AM »
There was a recent refactor that replaced get_current_task() with a different method. So in unified that function no longer exists. Because you merged unified into iso research you'll have to fix all the code in iso research to use the new method.

https://bitbucket.org/hudson/magic-lantern/pull-requests/796/new-method-for-getting-current-task-names/diff

reddeercity

  • Hero Member
  • *****
  • Posts: 1368
Re: adtg_gui module compiling problem
« Reply #6 on: April 03, 2017, 07:15:48 AM »
Thanks , @dmilligan don't have that error no more and I got a new one
Code: [Select]
adtg_gui.c:14:113: fatal error: avl.c: No such file or directory
 #include "avl.c"    /* unusual include in order to avoid exporting the AVL symbols (keep the namespace clean) */
I think there in the right place , in the root of the adtg_gui folder in Modules .
I guess I'll have to start fresh in the morning , I'll re-download the code and try again . :'(
One note before I updated to the iso_research branch I was able to compile the adtg_gui module .



a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10086
  • 5D Mark Free
Re: adtg_gui module compiling problem
« Reply #7 on: April 03, 2017, 08:55:43 AM »
That made me check whether avl.c is actually there - it is.

reddeercity

  • Hero Member
  • *****
  • Posts: 1368
Re: adtg_gui module compiling problem
« Reply #8 on: April 04, 2017, 02:39:02 AM »
Yes it there , is there any kind of list or pointer to  file & or  folder that Makefile.user.default uses for compiling ?
I'll try again and see what happens

 

reddeercity

  • Hero Member
  • *****
  • Posts: 1368
Re: adtg_gui module compiling problem
« Reply #9 on: April 04, 2017, 05:42:00 AM »
Ok still no go , still stuck on that same problem
Code: [Select]
adtg_gui.c:14:113: fatal error: avl.c: No such file or directoryAnd yes it's there I check many times , I even updated it manually to be sure.
My questions is , can the iso_research work with the latest updated ML code ?
Has any one being able to compile it with the newest ml code ?
And if you can , could some one post a adtg_gui module with iso_research for 5d2 please  :)
I'm just spinning my wheels here , funny thing I pulled & merged compressed_raw & compiled no problem
even with the basic adtg_gui without the iso_research , which doesn't do what I need it to do .

dfort

  • Hero Member
  • *****
  • Posts: 1759
Re: adtg_gui module compiling problem
« Reply #10 on: April 04, 2017, 07:27:24 PM »
Hi @reddeercity

I compiled and uploaded a 5D2 build with the adtg_gui module from the iso-research branch to my bitbucket downloads page for you:

https://bitbucket.org/daniel_fort/magic-lantern/downloads/

Why are you merging unified into iso-research? With all the changes that have been going on and the age of the iso-research branch it will probably be quite a task to get that merge working properly.

For the record, here's how I got adtg_gui working. Note that you must use the iso-research branch for this.

Create these files and put them in their appropriate directories:

magic-lantern/Makefile.user
Code: [Select]
CONFIG_GDB     = y
CONFIG_GDBSTUB = y

magic-lantern/modules/Makefile.modules.user
Code: [Select]
ML_MODULES_DYNAMIC += adtg_gui

Note that this will basically accomplish the same thing as Danne's suggestion only without modifying any of the original ML source code and you can set hg (Mercurial) not to track these files when you commit your changes.

That's it -- you should be able to compile it yourself. Note that some of the modules might not build but you should be using this build only for adtg_gui tasks.
EOSM.202 EOSM.203 EOSM2.103 700D.115 5D3.*

reddeercity

  • Hero Member
  • *****
  • Posts: 1368
Re: adtg_gui module compiling problem
« Reply #11 on: April 04, 2017, 10:29:03 PM »
Thanks @dfort your  a life saver  :)
being pulling what's left of my hair out trying to figure out this problem for 2 days .
Quote
Why are you merging unified into iso-research?
I thought that's the branch to use  , I don't know of any other source code to work from
there was no indicator on where to start . I guess my lack of knowledge in no knowing about
the simple fact that unified seem to be  for the end user and not for developing or reverse engineering .
Would be nice to see a FAQ about the pitfall of developing or reverse engineering  e.g. what source code to
use with certain tools etc.... nothing more frustrating and I can see how that can turn people off from helping
There's just too many hole in the documented knowledge , even thou I have being here since 2013
I still find it very difficult to keep track as thing jump around so much . I Just do my best , that's all I can do  :D .
Maybe when all said and done , I'll work on a FAQ for  developing or reverse engineering  .

magic-lantern/Makefile.user
Code: [Select]
CONFIG_GDB     = y
CONFIG_GDBSTUB = y
I did this
magic-lantern/modules/Makefile.modules.user
Code: [Select]
ML_MODULES_DYNAMIC += adtg_gui
But I did not do this  , didn't know that had to be done , there again there really no info about this kind of thing .
I add  " adtg_gui \" to the list of modules to be made it's it
Thank you for your help & knowledge

dfort

  • Hero Member
  • *****
  • Posts: 1759
Re: adtg_gui module compiling problem
« Reply #12 on: April 04, 2017, 11:27:56 PM »
I add  " adtg_gui \" to the list of modules to be made it's it

Careful if you add modules to the Makefile.modules.default file. You need to make sure that you use tabs and not spaces to a Makefile. I prefer not messing around with the source code unless of course I start a new branch with the intent of eventually submitting a pull request. That's why I made those new files that basically modify Makefile.user.default and Makefile.modules.default without having to make any changes to them. Makes sense?

It would be good to write up some FAQ or tutorials based on your experience. That's what I did a while back with the compiling tutorials.
EOSM.202 EOSM.203 EOSM2.103 700D.115 5D3.*

reddeercity

  • Hero Member
  • *****
  • Posts: 1368
Re: adtg_gui module compiling problem
« Reply #13 on: April 05, 2017, 07:14:58 AM »
Careful if you add modules to the Makefile.modules.default file. You need to make sure that you use tabs and not spaces to a Makefile. I prefer not messing around with the source code unless of course I start a new branch with the intent of eventually submitting a pull request. That's why I made those new files that basically modify Makefile.user.default and Makefile.modules.default without having to make any changes to them. Makes sense?
Yes it does ,
It would be good to write up some FAQ or tutorials based on your experience.
Yes I will