adtg_gui module compiling problem

Started by reddeercity, April 02, 2017, 07:56:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

reddeercity

Being trying to compile the adtg_gui from the ISO research branche   and I keep getting error ,
ml@ml-pc:~/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
ml@ml-pc:~/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
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
    Line-650   static void adtg_log(uint32_t* regs, uint32_t* stack, uint32_t pc)   /* set hooks at ADTG and CMOS writes */
        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

Did you enable:
CONFIG_GDB          = y
CONFIG_GDBSTUB      = y

In Makefile.user.default in root folder?

Something from this:
# 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:
# 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.
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

No I didn't , thanks I'll give that try .

Danne

Updated my answer a bit about the modules folder.

reddeercity

@Danne , Ok configured it like you said , using this committed 50d8f06   but still errors out on line adtg_gui.c-648
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
QuoteThe 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 
ml@ml-pc:~/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
ml@ml-pc:~/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

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

Thanks , @dmilligan don't have that error no more and I got a new one
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

That made me check whether avl.c is actually there - it is.

reddeercity

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

Ok still no go , still stuck on that same problem
adtg_gui.c:14:113: fatal error: avl.c: No such file or directory
And 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

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
CONFIG_GDB     = y
CONFIG_GDBSTUB = y


magic-lantern/modules/Makefile.modules.user
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.

reddeercity

Thanks @dfort your  a life saver  :)
being pulling what's left of my hair out trying to figure out this problem for 2 days .
QuoteWhy 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  .

Quote from: dfort on April 04, 2017, 07:27:24 PM
magic-lantern/Makefile.user
CONFIG_GDB     = y
CONFIG_GDBSTUB = y
I did this
Quote from: dfort on April 04, 2017, 07:27:24 PM
magic-lantern/modules/Makefile.modules.user
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

Quote from: reddeercity on April 04, 2017, 10:29:03 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.

reddeercity

Quote from: dfort on April 04, 2017, 11:27:56 PM
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 ,
Quote from: dfort on April 04, 2017, 11:27:56 PM
It would be good to write up some FAQ or tutorials based on your experience.
Yes I will