A540 histogram + zebra crash with EABI build - page 2 - General Discussion and Assistance - CHDK Forum  

A540 histogram + zebra crash with EABI build

  • 14 Replies
  • 4995 Views
*

Online reyalp

  • ******
  • 13353
Re: A540 histogram + zebra crash with EABI build
« Reply #10 on: 24 / August / 2015, 17:14:42 »
Advertisements
Agreed it needs a better solution; but I don't have one right now.
Yeah, understood.

Cleaning up all the platforms that make the potentially dangerous calls is one option. As I understand it, the danger is
1) C code only
2) potentially called from thumb
3) Calls firmware functions without a wrapper.

This is mostly (if not entirely?) restricted to lib.c in the sub files, so as far as projects that touch all the subs go, it shouldn't be too terrible. Using stubs_min to define firmware variables and putting the code in the platform level lib.c is a best practice anyway.

OTOH, I'm not too enthusiastic about touching all the subs, and without any enforcement in code, it would be easy for the problematic case to slip through.

I'm still thinking about other options, but don't have anything good yet.
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3332
    • Photos
Re: A540 histogram + zebra crash with EABI build
« Reply #11 on: 24 / August / 2015, 17:54:51 »
Another option might be a special build rule for the platofrm/sub/firmware source files that contain assembler code (boot.c, capt_seq.c) etc.

This could include the 'march=armv5te' needed to compile the assembler code, while the rest could use 'march=armv4' to get the correct wrappers.

This set of files is pretty constant, and if someone added a new one, it would not compile unless built with the correct rule - instead of compiling badly.

I haven't actually tried this yet, so it may not work.

Phil.

Edit: Patch attached. This builds all cameras without any errors, and the builds still work on my cameras. The wrappers appear to be correct for the A540; but I can't test it.
« Last Edit: 24 / August / 2015, 21:38:15 by philmoz »
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Online reyalp

  • ******
  • 13353
Re: A540 histogram + zebra crash with EABI build
« Reply #12 on: 25 / August / 2015, 00:10:06 »
Edit: Patch attached. This builds all cameras without any errors, and the builds still work on my cameras. The wrappers appear to be correct for the A540; but I can't test it.
Thanks, that seems to fix the a540, and looks like a reasonable workaround.

Quote
This set of files is pretty constant, and if someone added a new one, it would not compile unless built with the correct rule - instead of compiling badly.

There is some variation:
Code: [Select]
platform $ find . -name '*.c' | grep '/sub/' | grep -v '/\(boot\|capt_seq\|filewrite\|lib\|movie_rec\)\(_hdr\)\?\.c'
./a410/sub/100f/focushack.c
./a550/sub/100c/mount.c
./a560/sub/100a/mount.c
./a570/sub/100e/mount.c
./a570/sub/101a/mount.c
./a610/sub/100e/mount.c
./a610/sub/100f/mount.c
./a630/sub/100c/mount.c
./a640/sub/100b/mount.c
./a710/sub/100a/mount.c
./g7/sub/100e/mount.c
./g7/sub/100g/mount.c
./g7/sub/100i/mount.c
./g7/sub/100j/mount.c
./ixus130_sd1400/sub/100a/led.c
./ixus200_sd980/sub/100c/stubs.c
./ixus700_sd500/sub/101a/mount.c
./ixus700_sd500/sub/101b/mount.c
./ixus70_sd1000/sub/100c/mount.c
./ixus70_sd1000/sub/101b/mount.c
./ixus70_sd1000/sub/102a/mount.c
./ixus750_sd550/sub/100f/mount.c
./ixus750_sd550/sub/100g/mount.c
./ixus750_sd550/sub/100h/mount.c
./ixus75_sd750/sub/100b/mount.c
./ixus75_sd750/sub/100b/touchw.c
./ixus75_sd750/sub/101a/mount.c
./ixus75_sd750/sub/101a/touchw.c
./ixus75_sd750/sub/102a/mount.c
./ixus75_sd750/sub/102a/touchw.c
./ixus80_sd1100/sub/100c/debug.c
./ixus80_sd1100/sub/101a/debug.c
./ixus850_sd800/sub/100e/mount.c
./ixus900_sd900/sub/100c/debug.c
./ixus900_sd900/sub/100c/mount.c
./ixus950_sd850/sub/100c/mount.c
./ixusw_sd430/sub/110a/mount.c
./s3is/sub/100a/mount.c
./s95/sub/100k/stubs_tasks.c
./sx230hs/sub/100c/kbd.c
./sx230hs/sub/101a/kbd.c
./sx230hs/sub/101b/kbd.c
./tx1/sub/100g/mount.c
./tx1/sub/101b/mount.c

Not all of these are used.  mount.c and touchw.c are assembler files, but they are mostly from old ports so maybe they are ok with the armv4.

It wouldn't be too hard to go through the rest and sort out what actually gets built and needs which rule.

An alternative would be just to use the -armv4 for lib.c leave the others they way they were.
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3332
    • Photos
Re: A540 histogram + zebra crash with EABI build
« Reply #13 on: 25 / August / 2015, 00:53:08 »
Not all of these are used.  mount.c and touchw.c are assembler files, but they are mostly from old ports so maybe they are ok with the armv4.

If they compile without error then armv4 should be ok - it depends on what instructions are in the assembly code.

Quote
An alternative would be just to use the -armv4 for lib.c leave the others they way they were.

That has a small risk, if someone adds a new source file with functions being called from Thumb it will be compiled with incorrect wrappers.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)


*

Online reyalp

  • ******
  • 13353
Re: A540 histogram + zebra crash with EABI build
« Reply #14 on: 25 / August / 2015, 15:52:58 »
I'm sold, feel free to check in :D
Don't forget what the H stands for.

 

Related Topics