Author Topic: Questions regarding compilation, TCC  (Read 30416 times)

RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1509
  • 5DM3 / 7D
Questions regarding compilation, TCC
« on: May 06, 2013, 10:19:54 PM »
Main repo has it, just enable TCC and modules.

Thanks but I dont know which modules to enable.  I found a dir with a few modules including lv_rec.
Also dont know how to enable TCC. 

Any post that has these instructions?
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: Questions regarding compilation, TCC
« Reply #1 on: May 06, 2013, 10:25:53 PM »
Makefile.user, mark TCC and Modules y

make in the lv_rec folder... rename magiclantern.sym to MAGIC.SYM

RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1509
  • 5DM3 / 7D
Re: Questions regarding compilation, TCC
« Reply #2 on: May 06, 2013, 10:46:44 PM »
Makefile.user, mark TCC and Modules y

make in the lv_rec folder... rename magiclantern.sym to MAGIC.SYM

I know how to edit Makefile.user but.. dont know what you mean by mark.  Can you post your makefile.user so I know what to put in mine?
Also I can went to lv_rec folder in the modules and type make but got erros:

$ make
[ CC       ]   lv_rec.o
lv_rec.c:1:20: fatal error: module.h: No such file or directory
compilation terminated.
/home/PH/magic-lantern/modules/lv_rec/../../Makefile.inc:746: recipe for target `lv_rec.o' failed
make: *** [lv_rec.o] Error 1
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: Questions regarding compilation, TCC
« Reply #3 on: May 06, 2013, 11:04:15 PM »
Code: [Select]
CONFIG_TCC          = y
CONFIG_MEMCHECK     = y
CONFIG_MODULES      = y

and make clean then make 5D3

RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1509
  • 5DM3 / 7D
Re: Questions regarding compilation, TCC
« Reply #4 on: May 06, 2013, 11:13:36 PM »
Code: [Select]
CONFIG_TCC          = y
CONFIG_MEMCHECK     = y
CONFIG_MODULES      = y

and make clean then make 5D3

ok, done but got tcc errors

../../src/tcc-glue.c: In function 'tcc_compile_and_run':
../../src/tcc-glue.c:34:9: warning: incompatible implicit declaration of built-in function 'printf' [enabled by default]
../../src/tcc-glue.c:39:11: warning: 'main' is usually a function [-Wmain]
../../src/tcc-glue.c:66:9: warning: incompatible implicit declaration of built-in function 'printf' [enabled by default]
../../src/tcc-glue.c: In function 'open':
../../src/tcc-glue.c:146:5: warning: passing argument 2 of 'FIO_GetFileSize' from incompatible pointer type [enabled by default]
../../src/dryos.h:518:1: note: expected 'uint32_t *' but argument is of type 'unsigned int *'
../../src/tcc-glue.c: In function 'read':
../../src/tcc-glue.c:179:5: warning: passing argument 2 of 'memcpy' makes pointer from integer without a cast [enabled by default]
../../src/dryos.h:535:1: note: expected 'const void *' but argument is of type 'long unsigned int'
../../src/tcc-glue.c: In function 'close':
../../src/tcc-glue.c:187:5: warning: passing argument 1 of 'free_dma_memory' makes pointer from integer without a cast [enabled by default]
../../src/dryos.h:544:1: note: expected 'const void *' but argument is of type 'int'
../../src/tcc-glue.c: In function 'fputc':
../../src/tcc-glue.c:240:1: warning: number of arguments doesn't match built-in prototype [enabled by default]
../../src/tcc-glue.c: In function 'tcc_compile_and_run':
../../src/tcc-glue.c:78:8: warning: 's' may be used uninitialized in this function [-Wuninitialized]
[ CC       ]   tcc-gui.o
[ CC       ]   script_lib.o
make -C ../../tcc
make[2]: se ingresa al directorio `/home/PH/magic-lantern/tcc'
../../../arm-toolchain462/bin/arm-none-eabi-gcc-4.6.2.exe -o libtcc.o -c libtcc.c -DTCC_TARGET_ARM -DWITHOUT_LIBTCC -I.  -Os -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result
make[2]: ../../../arm-toolchain462/bin/arm-none-eabi-gcc-4.6.2.exe: No se encontró el programa
Makefile:189: recipe for target `libtcc.o' failed
make[2]: *** [libtcc.o] Error 127
make[2]: se sale del directorio `/home/PH/magic-lantern/tcc'
../../Makefile.inc:378: recipe for target `../../tcc/libtcc.a' failed
make[1]: *** [../../tcc/libtcc.a] Error 2
make[1]: se sale del directorio `/home/PH/magic-lantern/platform/5D3.113'
Makefile:70: recipe for target `5D3' failed
make: *** [5D3] Error 2


Here is my Makefile.user:

GCC_VERSION=4.6.2
ARM_ABI=none-eabi
ARM_PATH=../../../arm-toolchain462
ARM_LIBC_A=../../../arm-toolchain462/arm-none-eabi/lib/libc.a
PYTHON=python2.6
CONFIG_TCC          = y
CONFIG_MEMCHECK     = y
CONFIG_MODULES      = y
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: Questions regarding compilation, TCC
« Reply #5 on: May 06, 2013, 11:53:15 PM »
You need upgrade arm toolchain. Still using an old version.

gcc-arm-none-eabi-4_7-2012q4 is what I'm using.

RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1509
  • 5DM3 / 7D
Re: Questions regarding compilation, TCC
« Reply #6 on: May 07, 2013, 12:09:40 AM »
Do I also need to install TCC? 
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: Questions regarding compilation, TCC
« Reply #7 on: May 07, 2013, 12:13:10 AM »
TCC stuff should already be with ML. I don't have tcc installed on the linux box.

RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1509
  • 5DM3 / 7D
Re: Questions regarding compilation, TCC
« Reply #8 on: May 07, 2013, 02:05:34 AM »
Originally my gcc was installed using Yagarto.  For new update then should I install new yagarto installer or should I download gcc for windows zip file from https://launchpad.net/gcc-arm-embedded?
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: Questions regarding compilation, TCC
« Reply #9 on: May 07, 2013, 02:41:17 AM »
On linux I just got the zip so I guess windows shouldn't be different. I thought yagarto was for OSX.

minimimi

  • Freshman
  • **
  • Posts: 68
Re: Questions regarding compilation, TCC
« Reply #10 on: May 07, 2013, 03:09:48 AM »
@RenatoPhoto

I think you may not use developers time for your "installing" support.
If you want to use this function, you may learn development things.
Because, I think that it's better to spent developers time for actual development.
It's faster to get release version of this function when we don't use developers' time.

RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1509
  • 5DM3 / 7D
Re: Questions regarding compilation, TCC
« Reply #11 on: May 07, 2013, 04:15:19 AM »
@minimimi

Nobody is forcing anyone to answer any questions.  If 1% does not have time to answer any questions then he should not answer.

You are right, I am not a developer.  I am trying to learn and I only ask questions after I have spent some time researching for the answers but in this case I cannot find any answers as to how to do this RAW video thing.

http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

minimimi

  • Freshman
  • **
  • Posts: 68
Re: Questions regarding compilation, TCC
« Reply #12 on: May 07, 2013, 07:44:21 AM »
@RenatoPhoto
I'm not English native speaker. So if you get a bad feeling from my message, please ignore.

Anyway, The answer of installing questions are including source codes. (I'm not asking anyone, but the source codes are said to me everything)
1% is answerd 1st message, but you don't read Makefile.inc and Makefile(or do not find tcc and module things in souce codes), so you can't understand it.
So I wrote the message.

minimimi

  • Freshman
  • **
  • Posts: 68
Re: Questions regarding compilation, TCC
« Reply #13 on: May 07, 2013, 11:57:29 AM »
@RenatoPhoto

The key point is here.
Code: [Select]
make[2]: ../../../arm-toolchain462/bin/arm-none-eabi-gcc-4.6.2.exe: No se encontró el programa
I can't read it.
Also , we are already moved to gcc-4.6.2 to gcc-4.7
Upgrade first , and then check your gcc path.

RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1509
  • 5DM3 / 7D
Re: Questions regarding compilation, TCC
« Reply #14 on: May 07, 2013, 05:07:11 PM »
Thanks but..

I installed the new Yagarto which also installed the gcc-472.  I did this since that is the way I originally installed magic lantern based on the windows setup recommended by Pel here:  http://www.magiclantern.fm/forum/index.php?topic=2899.msg14021#msg14021

With this new gcc I am able to also compile 5D3 but if I enable the modules:

CONFIG_TCC          = y
CONFIG_MEMCHECK     = y
CONFIG_MODULES      = y

I get the same error as before but now for gcc 472 instead of 462

[ CC       ]   tcc-gui.o
[ CC       ]   script_lib.o
make -C ../../tcc
make[2]: se ingresa al directorio `/home/PH/magic-lantern/tcc'
../../../arm-toolchain472/bin/arm-none-eabi-gcc-4.7.2.exe -o libtcc.o -c libtcc.c -DTCC_TARGET_ARM -DWITHOUT_LIBTCC -I.  -Os -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result
make[2]: ../../../arm-toolchain472/bin/arm-none-eabi-gcc-4.7.2.exe: No se encontró el programa
Makefile:189: recipe for target `libtcc.o' failed
make[2]: *** [libtcc.o] Error 127
make[2]: se sale del directorio `/home/PH/magic-lantern/tcc'
../../Makefile.inc:378: recipe for target `../../tcc/libtcc.a' failed
make[1]: *** [../../tcc/libtcc.a] Error 2
make[1]: se sale del directorio `/home/PH/magic-lantern/platform/5D3.113'
Makefile:70: recipe for target `5D3' failed
make: *** [5D3] Error 2

I see that the new Makefile.user call for GGG 473 but Yagarto does not have that included in their installation, Yagarto has gcc 472.

So the question is the same as posted before:

Do I need to install the GCC from  https://launchpad.net/gcc-arm-embedded?

Will the installation of GCC from  https://launchpad.net/gcc-arm-embedded (which is a zip file for windows) work or will I damage my ability to compile my 5D3 with windows.

http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: Questions regarding compilation, TCC
« Reply #15 on: May 07, 2013, 05:09:53 PM »
Yea, need to upgrade.

minimimi

  • Freshman
  • **
  • Posts: 68
Re: Questions regarding compilation, TCC
« Reply #16 on: May 07, 2013, 05:25:46 PM »
make[2]: ../../../arm-toolchain472/bin/arm-none-eabi-gcc-4.7.2.exe: No se encontró el programa

Is this means "program not found" . right?
Then you may try to check
Code: [Select]
# cd magic-lantern
# ../../../arm-toolchain472/bin/arm-none-eabi-gcc-4.7.2.exe

Show us a output of this .

minimimi

  • Freshman
  • **
  • Posts: 68
Re: Questions regarding compilation, TCC
« Reply #17 on: May 07, 2013, 05:31:40 PM »
I think you have no problem to use yagarto maybe,....

BTW, I'm also using windows, but we had a sometime problems on windows environment.
So I recommend you to use vmware player and build on Linux.
Ofcource I'm using linux with vmware player.

RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1509
  • 5DM3 / 7D
Re: Questions regarding compilation, TCC
« Reply #18 on: May 07, 2013, 08:05:43 PM »
The saga continues:

Downloaded the latest zip file for: gcc-arm-none-eabi-4_7-2013q1-20130313-win32
Unzipped to /arm-toolchain473 directory

changed the Makefile.user file to:

GCC_VERSION=4.7.3
ARM_ABI=none-eabi
ARM_PATH=../../../arm-toolchain473
ARM_LIBC_A=../../../arm-toolchain473/arm-none-eabi/lib/libc.a
PYTHON=python2.6
CONFIG_TCC          = y
CONFIG_MEMCHECK     = y
CONFIG_MODULES      = y

make clean and make 5D3 and ...
Same error.

then removed the modules and make clean and make 5D3 and ...

It works, I build 5D3

I dont know why under TCC it cannot find the toolchain.  The error reads;

[ CC       ]   tcc-gui.o
[ CC       ]   script_lib.o
make -C ../../tcc
make[2]: enters directory `/home/PH/magic-lantern/tcc'
../../../arm-toolchain473/bin/arm-none-eabi-gcc-4.7.3.exe -o libtcc.o -c libtcc.c -DTCC_TARGET_ARM -DWITHOUT_LIBTCC -I.  -Os -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result
make[2]: ../../../arm-toolchain473/bin/arm-none-eabi-gcc-4.7.3.exe: cannot find the program (this is written is spanish)
Makefile:189: recipe for target `libtcc.o' failed
make[2]: *** [libtcc.o] Error 127
make[2]: se sale del directorio `/home/PH/magic-lantern/tcc'
../../Makefile.inc:378: recipe for target `../../tcc/libtcc.a' failed
make[1]: *** [../../tcc/libtcc.a] Error 2
make[1]: se sale del directorio `/home/PH/magic-lantern/platform/5D3.113'
Makefile:70: recipe for target `5D3' failed
make: *** [5D3] Error 2



http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: Questions regarding compilation, TCC
« Reply #19 on: May 07, 2013, 10:04:38 PM »
Its not parsing paths properly....


RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1509
  • 5DM3 / 7D
Re: Questions regarding compilation, TCC
« Reply #20 on: May 07, 2013, 11:30:29 PM »
Is there another way to set the paths? 
Can full paths be used?
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

minimimi

  • Freshman
  • **
  • Posts: 68
Re: Questions regarding compilation, TCC
« Reply #21 on: May 08, 2013, 01:38:06 PM »
Do you understand what meanning of "../" ?
So can you make a relative path from magic-lantern/tcc directory?

Then you may put this line after "-include $(TOP)/../Makefile.user" in tcc/Makefile

CC=../../path/of/your/arm-noneeabi-gcc.exe

RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1509
  • 5DM3 / 7D
Re: Questions regarding compilation, TCC
« Reply #22 on: May 08, 2013, 03:25:18 PM »
Thanks for the time you take to help with this issue.  I really appreciated and I assume that this will have to be take care at some point so that other people using windows compiler will have to resolve in order to get some of these TCC module options.  So I hope that the time spent fixing this will help someone else too.

I made the changes as sugguested. 
Here is a portion of the Makefile in TCC directory:

include $(TOP)/../Makefile.user.default
-include $(TOP)/../Makefile.user
CC=../../arm-toolchain473/bin/arm-none-eabi-gcc-4.7.3.exe

After make clean and make 5D3 now a new error shows up:

make -C ../../tcc
make[2]: se ingresa al directorio `/home/PH/magic-lantern/tcc'
../../../arm-toolchain473/bin/arm-none-eabi-ar rcs libtcc.a libtcc.o tccpp.o tccgen.o tccelf.o tccasm.o tccrun.o arm-gen.o
make[2]: ../../../arm-toolchain473/bin/arm-none-eabi-ar: cannot find the program
Makefile:193: recipe for target `libtcc.a' failed
make[2]: *** [libtcc.a] Error 127
make[2]: leaving directory `/home/PH/magic-lantern/tcc'
../../Makefile.inc:378: recipe for target `../../tcc/libtcc.a' failed
make[1]: *** [../../tcc/libtcc.a] Error 2
make[1]: leaving directory `/home/PH/magic-lantern/platform/5D3.113'
Makefile:70: recipe for target `5D3' failed
make: *** [5D3] Error 2

In this case there is no "arm-none-eabi-ar" program under the gcc directory, I only found  the "arm-none-eabi-ar.exe"



http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: Questions regarding compilation, TCC
« Reply #23 on: May 08, 2013, 04:23:22 PM »
search for that line and add the exe extension.

minimimi

  • Freshman
  • **
  • Posts: 68
Re: Questions regarding compilation, TCC
« Reply #24 on: May 08, 2013, 05:54:18 PM »
In this case there is no "arm-none-eabi-ar" program under the gcc directory, I only found  the "arm-none-eabi-ar.exe"

1% means a
also add this line after CC=
AR=../../arm-toolchain473/bin/arm-none-eabi-ar.exe