new branch - CHDK : Elf Edition - Developers wanted

  • 302 Replies
  • 48427 Views
*

Offline srsa_4c

  • ******
  • 3600
Re: new branch - CHDK : Elf Edition - Developers wanted
« Reply #30 on: 09 / December / 2011, 15:44:37 »
Advertisements
I checked out your repo and tried to do a build. I'm on linux (x86), using a precompiled arm gcc (4.5.1) toolchain from the CHDK-DE download page. The system's gcc is 4.6.2 .

Had to do the following changes to make the build (almost) work. Haven't looked at warnings yet.

tools/elf2flt/elfflt.h

#include <stdint.h> //for uint32_t


tools/elf2flt/myio.h

#ifndef O_BINARY
#define O_BINARY 0
//not defined on linux
#endif


core/Makefile
core/modules/Makefile


replace hardcoded .exe suffixes with $(EXE)

Now the build process stops with this:

>> Entering to core/modules
../module_exportlist.c -> exportlist
simple_module.c -> simple_module.o
../gui_bench.c -> ../gui_bench.o
-> benchm.elf
-> benchm.flt
In file benchm.elf:
Unknown relocation type 27
make[2]: *** [benchm.flt] Error 8
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1


In case it helps, I'm attaching benchm.elf

Re: new branch - CHDK : Elf Edition - Developers wanted
« Reply #31 on: 09 / December / 2011, 16:14:17 »
Tortoise SVN totally barfs on this patch.  Probably because its created with hard coded absolute paths (D:/BINARY/_CDHK_EX_/trunk) rather than a relative path.

Fixed the path stuff - update patch attached.

Doesn't compile :

Code: [Select]
In file edgeovr.elf:
elf2flt unknown symbol: 'isdigit'
C:\Users\a\Desktop\CHDK\gcc\bin\gmake.exe[2]: *** [edgeovr.flt] Error 5
C:\Users\a\Desktop\CHDK\gcc\bin\gmake.exe[1]: *** [all-recursive] Error 1
gmake: *** [all-recursive] Error 1

Built with chdk-shell v3.39 - ELF objdump enabled - gcc 3.4.6

Different error if I switch to gcc 4.4.0

Code: [Select]
boot.c: In function 'task_blinker':
boot.c:37: error: invalid use of undefined type 'enum Gui_Mode'
C:\Users\a\Desktop\CHDK\gcc4\bin\gmake.exe[4]: *** [boot.o] Error 1
C:\Users\a\Desktop\CHDK\gcc4\bin\gmake.exe[3]: *** [all-recursive] Error 1
C:\Users\a\Desktop\CHDK\gcc4\bin\gmake.exe[2]: *** [all-recursive] Error 1
C:\Users\a\Desktop\CHDK\gcc4\bin\gmake.exe[1]: *** [all-recursive] Error 1
gmake: *** [all-recursive] Error 1
« Last Edit: 09 / December / 2011, 16:31:15 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: new branch - CHDK : Elf Edition - Developers wanted
« Reply #32 on: 09 / December / 2011, 19:02:07 »
waterwingz,

thanks for report

Different error if I switch to gcc 4.4.0
boot.c: In function 'task_blinker':
boot.c:37: error: invalid use of undefined type 'enum Gui_Mode'

Please include to your report logt.txt too. I need to understand in what directory error happens.

For this case I found only one suspicious place - platform\ixus310_elph500hs\kbd.c
I have in face with some difficult. Core chdk now don't know what is the GUI_MODE_PALETTE because it is ownedby module  (and placed in). I ask for assistance philmoz.
For now just try to exclude this platform from compilation list.

GCC3.x produce significatelly larger and different code. I'm not sure in resonability to use it. But I fix reported error. So we could check result now.

srsa_4c
Thanks.
I fix all reported by you problems.

I'm surprised. Windows GCC use one deprecated and mostly unsupported reloc type, linux GCC use another.
Yes, please attach elfs. It is really useful for analysis. Both - for compilation  mistakes and CHDK unstability.

I do attach two patches - one full for 1459, another is incremental from SVN-rev4.

Re: new branch - CHDK : Elf Edition - Developers wanted
« Reply #33 on: 09 / December / 2011, 20:15:28 »
Please include to your report logt.txt too. I need to understand in what directory error happens.
I deleted your patch after testing so I can't get that.  Sorry.

Working on something else right now and I need my local repo working.  I'll try again when I finish my current project - hopefully this weekend.

Quote
For this case I found only one suspicious place - platform\ixus310_elph500hs\kbd.c
I was compiling platform/g10   ( subdirectory 102a )

Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline srsa_4c

  • ******
  • 3600
Re: new branch - CHDK : Elf Edition - Developers wanted
« Reply #34 on: 09 / December / 2011, 20:27:35 »
Another try with your repo + the patch.

There are some typos in the patch, search for these: .$(EXE)

With that fixed, the build stops here:

>> Entering to core/modules
../module_exportlist.c -> exportlist
simple_module.c -> simple_module.o
../gui_bench.c -> ../gui_bench.o
-> benchm.elf
-> benchm.flt
../gui_calendar.c -> ../gui_calendar.o
-> calend.elf
-> calend.flt
In file calend.elf:
R_ARM_PLT32 is requested from unusual place .text+0x7d0
make[2]: *** [calend.flt] Error 8
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1


arm-elf-gcc -v outputs this (not sure, if it's useful):
Quote
Configured with: ../gcc-4.5.1/configure --target=arm-elf --prefix=/home/rex/fi4/ia07/s59591/extern/chdk/wa/20101126/arm-elf --enable-multilib --enable-languages=c --with-newlib --with-gmp-include=/home/rex/fi4/ia07/s59591/extern/chdk/wa/20101126/gcc-4.5.1-arm-elf/gmp --with-gmp-lib=/home/rex/fi4/ia07/s59591/extern/chdk/wa/20101126/gcc-4.5.1-arm-elf/gmp/.libs --without-headers --disable-libssp --disable-nls --disable-libc --disable-libm --disable-intl --disable-threads --srcdir=../gcc-4.5.1
Thread model: single
gcc version 4.5.1 (GCC)

In this (and the previous) case PLATFORM was set to ixus65_sd630.
« Last Edit: 09 / December / 2011, 20:31:16 by srsa_4c »

*

Offline Sektor

  • *
  • 13
  • ixus220_elph300hs-101a
    • Grand Theft Media Press
Re: new branch - CHDK : Elf Edition - Developers wanted
« Reply #35 on: 09 / December / 2011, 22:21:11 »
If I add "#define CAM_FIRMWARE_MEMINFO        1" to platform_camera.h for the ixus220 it builds using either 4.4.0 or 4.5.1 (thanks philmoz).

tetris.flt - Last modification by Sektor of DE game. Run directly from file browser only (not integrated to menu)
Thanks for including my tetris changes. I can confirm it loads the tetris and snake modules fine.

Re: new branch - CHDK : Elf Edition - Developers wanted
« Reply #36 on: 10 / December / 2011, 01:51:13 »
-> calend.flt
In file calend.elf:
R_ARM_PLT32 is requested from unusual place .text+0x7d0
make[2]: *** [calend.flt] Error 8
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

As I suspect different compilators produce different stranges in output.
Please unpack attached archive to core/modules. Then try to compile whole project. Then please send to me all produced *.elf.dumpobj.

Re: new branch - CHDK : Elf Edition - Developers wanted
« Reply #37 on: 10 / December / 2011, 02:58:33 »
In attachment two patches: one from my SVN-rev4, second from 1459.

NOTE1: if you use full patch (to trunkk1459 you should create subdir MODULES in dir CHDK to correct make finalization
NOTE2: I found that full patch also rejected to apply to gui_mastermind.[ch] for unknown reason. To solve this unpack archive from following message to trunk/core

Fixed issues:
-fix for GCC3.4.6
-fix compilation on linux: defines,$(EXE)
-fix to process REL_ARM_PLT in elf
-fix for camera without CAM_FIRMWARE_MEMINFO
-fix: mpopup was not unloaded in most cases
-fix: remove gui_get_mode redeclaration at platform/g10  (it is safe)

Known issues:
- Compilation fail on linux due different reloc producing
- Fail compilation for ixus310_elph500hs
« Last Edit: 10 / December / 2011, 03:07:40 by tsvstar »


Re: new branch - CHDK : Elf Edition - Developers wanted
« Reply #38 on: 10 / December / 2011, 03:08:19 »
fix for mastermind failed compilation

*

Offline srsa_4c

  • ******
  • 3600
Re: new branch - CHDK : Elf Edition - Developers wanted
« Reply #39 on: 10 / December / 2011, 07:40:26 »
Quote
Please unpack attached archive to core/modules. Then try to compile whole project. Then please send to me all produced *.elf.dumpobj.
I used your svn rev. 5, according to the svn log it includes the changes in your latest patch.
*.dumpobj's and the buildlog is attached.

This toolchain's binutils version is
GNU ld (GNU Binutils) 2.20.1.20100303
The CHDK toolchain howtos usually recommend binutils 2.18

Edit:

Found another typo: core/modules.c (and .h) defines a function: module_curves_load().
core/luascript.c and core/modules.c referred to this as module_curve_load(). Fixing this (and creating the bin folder as it was also missing) allowed the build process to succeed.

Using this fix and hacking core/modules/Makefile allowed some modules to build. (No games, no fileselector, but things like file viewer, palette viewer, curves). Those modules seem to work (I'm trying this on my Ixus65).

Using the above specified GCC 4.5.1 + binutils 2.20 OR a self-compiled GCC 4.5.3 + binutils 2.22 toolchain makes no difference (modules that fail to build with one fail with the other too).

Same result with a self-compiled GCC 4.5.3 + binutils 2.18 combination...
« Last Edit: 10 / December / 2011, 18:15:02 by srsa_4c »

 

Related Topics