Questions regarding compilation, TCC

Started by RenatoPhoto, May 06, 2013, 10:19:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RenatoPhoto

Quote from: 1% on May 06, 2013, 04:59:39 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%

Makefile.user, mark TCC and Modules y

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

RenatoPhoto

Quote from: 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

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%


CONFIG_TCC          = y
CONFIG_MEMCHECK     = y
CONFIG_MODULES      = y


and make clean then make 5D3

RenatoPhoto

Quote from: 1% on May 06, 2013, 11:04:15 PM

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%

You need upgrade arm toolchain. Still using an old version.

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

RenatoPhoto

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%

TCC stuff should already be with ML. I don't have tcc installed on the linux box.

RenatoPhoto

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%

On linux I just got the zip so I guess windows shouldn't be different. I thought yagarto was for OSX.

minimimi

@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

@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

@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

@RenatoPhoto

The key point is here.
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

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%


minimimi

Quote from: RenatoPhoto on May 07, 2013, 05:07:11 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

# cd magic-lantern
# ../../../arm-toolchain472/bin/arm-none-eabi-gcc-4.7.2.exe


Show us a output of this .

minimimi

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

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%


RenatoPhoto

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

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

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%

search for that line and add the exe extension.

minimimi

Quote from: RenatoPhoto on May 08, 2013, 03:25: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