Ubuntu CHDK build issue, GCC 6.3.1 - General Discussion and Assistance - CHDK Forum supplierdeeply

Ubuntu CHDK build issue, GCC 6.3.1

  • 4 Replies
  • 348 Views
Ubuntu CHDK build issue, GCC 6.3.1
« on: 12 / January / 2019, 09:17:34 »
Advertisements

On ubuntu, using arm-none-eabi-gcc 6.3.1, make of CHDK is giving errors like:


Error: selected processor does not support `blx R1' in ARM mode


This is with a fresh svn up of chdk. Has anybody found a fix?


*

Offline reyalp

  • ******
  • 11920
Re: Ubuntu CHDK build issue, GCC 6.3.1
« Reply #1 on: 12 / January / 2019, 16:12:26 »
Don't think so, philmoz mentioned problems in this thread https://chdk.setepontos.com/index.php?topic=13184.0

CHDK does fairly weird things to build, so we tend to be slow to switch gcc versions.

The specific error seems like an error setting compiler options, because AFAIK any CHDK supported processor should support BLX <reg>

Looking at the toplevel makefile.inc, there are specific cases for GCC 3 and 4 but not anything else. Adding a case for GCC 6 will let you set the target arch but this is likely only the start of your problems.

Patches are welcome :)
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3107
    • Photos
Re: Ubuntu CHDK build issue, GCC 6.3.1
« Reply #2 on: 12 / January / 2019, 17:05:33 »
GCC 5.4.1 is the latest version tested and supported for CHDK.

You can fix the GCC 6 build errors by updating the arm_rules.inc file to add support for this major GCC version (lines 36-46 & 128-136).

Although CHDK will build with GCC 6 the result does not work - running on the G12 it crashes immediately on power up.

Edit: The build crashes because GCC 6 is generating 'mov pc,lr' instructions for the camera platform code instead of 'bx lr'. This breaks the ARM/Thumb interworking crashing the camera. It appears to be ignoring the -mthumb-interwork option in CFLAGS.


Phil.

« Last Edit: 14 / January / 2019, 04:50:25 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)

*

Offline nafraf

  • *****
  • 1305
Re: Ubuntu CHDK build issue, GCC 6.3.1
« Reply #3 on: 13 / January / 2019, 19:59:39 »
This code was used on a580:
Code: [Select]
//"BLX     R12\n"   // !! Workaround !!
"MOV     LR, PC\n"     // gcc won't compile "BLX R12" nor "BL R12".
"MOV     PC, R12\n"  // workaround: make your own "BL" and hope we don't need the change to thumb-mode


*

Offline reyalp

  • ******
  • 11920
Re: Ubuntu CHDK build issue, GCC 6.3.1
« Reply #4 on: 13 / January / 2019, 20:11:33 »
This code was used on a580:
Code: [Select]
//"BLX     R12\n"   // !! Workaround !!
"MOV     LR, PC\n"     // gcc won't compile "BLX R12" nor "BL R12".
"MOV     PC, R12\n"  // workaround: make your own "BL" and hope we don't need the change to thumb-mode
That's a *really* old comment, possibly from someone using an incorrectly configured toolchain at the time.

The reason @ProfHankD ran into that kind of error is because the compiler flags are only set for gcc 3 and 4. Changing the assembly code should not be the solution for this.
Don't forget what the H stands for.

 

Related Topics