gcc 9 (was Re: Windows GUI for gcc toolchain) - page 2 - General Discussion and Assistance - CHDK Forum supplierdeeply

gcc 9 (was Re: Windows GUI for gcc toolchain)

  • 18 Replies
  • 5754 Views
*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: gcc 9 (was Re: Windows GUI for gcc toolchain)
« Reply #10 on: 09 / April / 2022, 11:18:43 »
Advertisements
Since I found this nice papyrus   :D http://zenoshrdlu.com/kapstuff/zsubasic.html  8)
I´m busy ...  :haha
Now it is implemented, but compilable only for digic 6++, with gcc8-10.
gcc493 compiles for D6 with Win XP, fails with X.  :-[
Quote

**** GCC 4.9.3 : BUILDING CHDK-CHDK_DE, #1.6.0-6087 FOR sx620hs-100b
**** GCC 4.9.3 : BUILDING CHDK-CHDK_DE, #1.6.0-6087 FOR sx280hs-102b
In file .o2/ubasic.elf:
elf2flt unknown segment 1 for name: 'module_unloader'
gmake[1]: *** [.o2/ubasic.flt] Error 6
gmake: *** [all-recursive] Error 1



**** GCC 10.2.1 : BUILDING CHDK-CHDK_DE, #1.6.0-6087 FOR sx620hs-100b
elf2flt unknown symbol: '__gnu_thumb1_case_shi' :o
gmake[1]: *** [.o/ubasic.flt] Error 5
gmake: *** [all-recursive] Error 1


All lifetime is a loan from eternity.

*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: gcc 9 (was Re: Windows GUI for gcc toolchain)
« Reply #11 on: 12 / April / 2022, 11:52:25 »
 :blink:  :-X  :o
Quote
**** GCC 4.9.3 : BUILDING CHDK-CHDK_DE, #1.6.0-6087 FOR sx260hs-101a
ldebug.c: In function 'symbexec':
ldebug.c:475:1: internal compiler error: in patch_jump_insn, at cfgrtl.c:1275
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
gmake[2]: *** [.o/ldebug.o] Error 1
gmake[1]: *** [all-recursive] Error 1
gmake: *** [all-recursive] Error 1

happend with upper source, arm_rules.inc Line 28: CFLAGS= -O3 -fno-strict-aliasing -fno-schedule-insns2

Same line with -O2 compiles fine, ubasic.flt = 58kb instead of 45,
if compiled with Gcc10 -Os for D6 as usual.

Same with -fno-inline --> ubasic.flt 'module_unloader'

Other happenings around, -O

Code: [Select]
**** GCC 4.9.3 : BUILDING CHDK-CHDK_DE, #1.6.0-6084 FOR sx260hs-100b
**** GCC 10.2.1 : BUILDING CHDK-CHDK_DE, #1.6.0-6084 FOR sx260hs-100b
In file .o/tetris.elf: // CFLAGS= -Os (inline allowed)
elf2flt unknown symbol: 'memmove'
gmake[1]: *** [.o/tetris.flt] Error 5
gmake: *** [all-recursive] Error 1

-O3
**** GCC 10.2.1 : BUILDING CHDK-CHDK_DE, #1.6.0-6087 FOR sx275hs-102b

In file .o2/fselect.elf:
Unknown relocation type 47
gmake[1]: *** [.o2/fselect.flt] Error 8
gmake: *** [all-recursive] Error 1 setting
All lifetime is a loan from eternity.

*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: gcc 9 (was Re: Windows GUI for gcc toolchain)
« Reply #12 on: 19 / April / 2022, 11:22:33 »
                                                           :-X
Code: [Select]
D:\hostluaPortable\CHDK-Shell\!trunk\gcc1021_host920\share\doc\gcc-arm-none-eabi\pdf\gcc\gcc.pdf :D Upper parts glued together. Since my first guess -Os  :haha was a lucky strike I researched some whitespace between. With some quarter-lines the toolchains are adapted to StringUbasic.

Next surprise ...  ::) Compiling successfull...
Quote
**** GCC 7.2.1 : BUILDING CHDK-CHDK_DE, #1.6.0-6087 FOR sx270hs-102b

games/gui_sudoku.c: In function 'sudoku_search_candidates':
games/gui_sudoku.c:1118:1: warning: assuming signed overflow does not occur when assuming that (X + c) >= X is always true [-Wstrict-overflow]
 };
 ^
**** GCC 6.2.1 : BUILDING CHDK-CHDK_DE, #1.6.0-6087 FOR sx610hs-100a

And 1st Romlog with 721. (Didn´t set date)
Code: [Select]
ASSERT!! Mounter.c Line 3582
Occured Time  2014:01:02 05:54:49
Task ID: 15990820
Task name: PhySw
SP: 0x0055DD9C
... or it´s the 1st time, that the crash has an other name than "Vector 0x?"
Code: [Select]
Exception!! Vector 0x10
Occured Time  2022:04:13 21:39:41
Task ID: 15990820
Task name: PhySw
Exc Registers:
 
Exception!! Vector 0x04
Occured Time  2014:01:01 09:09:55
Task ID: 15990820
Task name: PhySw
Exc Registers:
ASSERT!! Mounter.c Line 3582
Occured Time  2014:01:02 05:54:49
Task ID: 15990820
Task name: PhySw
Maybe Edge detection, histogram & md together are a bit too much.
Independently: My Sx270 awakes too often with "card locked" instead of chdk (~1 of 20).
Edit: Appended postcard...  8)
« Last Edit: 19 / April / 2022, 15:37:49 by Caefix »
All lifetime is a loan from eternity.

*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: gcc 9 (was Re: Windows GUI for gcc toolchain)
« Reply #13 on: 23 / April / 2022, 11:35:11 »
Quote
**** GCC 5.4.1 : BUILDING CHDK-CHDK_DE, #1.6.0-6087 FOR m100-100a

/home/build/work/GCC-5-build/src/isl-0.12.2/isl_constraint.c:558: expecting integer value
games/gui_tetris.c: In function 'moveTetramino':
games/gui_tetris.c:552:13: internal compiler error: Aborted
 static void moveTetramino(StcGame *game, int x, int y) :o
             ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
gmake[1]: *** [.o3/gui_tetris.o] Error 1
gmake: *** [all-recursive] Error 1

Edit: ## -floop-interchange   :haha 1/8 line too optimistic...
« Last Edit: 23 / April / 2022, 12:06:37 by Caefix »
All lifetime is a loan from eternity.


*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: gcc 9 (was Re: Windows GUI for gcc toolchain)
« Reply #14 on: 29 / April / 2022, 16:34:11 »
 :)
Code: [Select]
// new string-related statements and functions
  {"abc$",                  TOKENIZER_ABC$},
  {"left$",                   TOKENIZER_LEFT$},
  {"mid$",                    TOKENIZER_MID$},
  {"right$",                  TOKENIZER_RIGHT$},
  {"mem$",                  TOKENIZER_MEM$},  // addr[,len]
  {"up$",                   TOKENIZER_UP$},
  {"low$",                  TOKENIZER_LOW$},
  {"read$",                 TOKENIZER_READ$}, // read$(A$,"A/readme.txt")
  {"rev$",                  TOKENIZER_REV$}, // reverse
  {"rep$",                  TOKENIZER_REP$}, // replace (a$,"?!")
  {"strol$",                TOKENIZER_STROL$}, // rotate left,1  abcd -> bcda
  {"stror$",                TOKENIZER_STROR$}, // rotate right,1 abcd -> dabc
  {"spc$",                  TOKENIZER_SPC$}, // spc$(3)="   "
  {"str$",                    TOKENIZER_STR$}, // str$(123*10+x)
  {"trim$",                 TOKENIZER_TRIM$}, // cut framing " '\"\10\r\n"
  {"arg$",                  TOKENIZER_ARG$}, // a$="a,b,c,d" ~> arg$(a$,0)="a"
  {"chr$",                    TOKENIZER_CHR$}, // =chr$(64,4) ~> @@@@
  {"args",                  TOKENIZER_ARGS}, // args(a$[,',']) ~> =4
  {"val",                     TOKENIZER_VAL},
  {"len",                     TOKENIZER_LEN},
  {"instr",                   TOKENIZER_INSTR},
  {"asc",                     TOKENIZER_ASC},
  {"open",                  TOKENIZER_OPEN},  // if open read$ a$
  {"close",                TOKENIZER_CLOSE}, // ?read$~ close. // 1 readfile
// end of string additions

Needs special arm_rules.inc to compile, works fine, but M100 (:blink: only?, (maybe g7xII,too?)) crashing at once, when the simplest ubasic script is started...

Edit: Probably before int ubasic_init(const char *program, __attribute__ ((unused))int is_ptp) is reached...
Edit2: added msleep(5000) as 1st todo, so I got 1st beep()...

Edit3:
   line 332:  stringvariables = store("\0"); // store('\0'); :haha
   So M100 feels a difference "\0" vs. '\0', 0; compiler not...  :blink:  ... where else ... 
Edit4: Now ubasic.c is 5000 lines long. , Stringstuff still not compatible with M100 ...  :haha
Code: [Select]
Exception!! [data abort]
 -> Read Access (0x00000000)
Occured Time  2022:04:30 14:50:10
Task ID: 21757992
Task name: PhySw
« Last Edit: 05 / May / 2022, 14:17:56 by Caefix »
All lifetime is a loan from eternity.

*

Offline reyalp

  • ******
  • 14080
Re: gcc 9 (was Re: Windows GUI for gcc toolchain)
« Reply #15 on: 30 / April / 2022, 17:32:29 »
So M100 feels a difference "\0" vs. '\0', compiler not...  :blink:  ... where else ... :-[
Those are entirely different things in C. "\0" is a string, AKA a pointer to an array of characters, which in this case has the character with the value 0 as its first element. '\0' is the character (AKA an 8 bit integer) with value 0.
Don't forget what the H stands for.

*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: gcc 9 (was Re: Windows GUI for gcc toolchain)
« Reply #16 on: 07 / May / 2022, 12:07:16 »
 :xmas Some new valid Ubasic lines ...  :o
Quote
t$=textbox("UbasicTextbox","UbasicTextbox","UbasicTextbox")
f$=file_browser("A/CHDK")
Some rebugging happened, sorry...
There is a to avoid in Textbox, had it working already, maybe a * eaten by mouse... (My todo until monday)  :haha

« Last Edit: 09 / May / 2022, 11:42:46 by Caefix »
All lifetime is a loan from eternity.

*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: gcc 9 (was Re: Windows GUI for gcc toolchain)
« Reply #17 on: 09 / May / 2022, 11:53:07 »
 :D Ugliest testfile ever included. Looks a bit like the fossiled sceleton of an Archaeophtopix...
if even that is working, more sense is possible, too... :lol
Edit: Included my Lua scripts for stringprocessing.
It´s now quite easy to script close to lua-syntax() & transfere lines ...
(scripting ==, ~=, != , break, return, 0x0abcdef0, mostly (x,y) are same.)
Edit2: Btw, You could even load and "run" a romlog.
Then Ubasic acts as a reader...  :haha

Edit 3: Bug in testfile;  :blink: misplaced wait_click 0 crashes cam.
(No need in normal scripting, nobody would write:)
while i<1000
endif

Code: [Select]
wait_click(0)
.
g$=textbox("UbasicTextbox","How are You?","Fine, thx.")
G$=textbox()
.
wait_click(0)
Edit: The '.' here are Ubasic abbreviation for a sleep(50). They solve the problem. Without the upper one the g$= line is skipped, the G$ can be typed, pressing <set>2* to close textbox freezes/crashes cam, switching <alt>
and back continues script with entered text(no problem), any other button in exit_alt crashes with a nice light green pattern overlay in display...   ???
« Last Edit: 10 / May / 2022, 15:55:28 by Caefix »
All lifetime is a loan from eternity.


*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: gcc 9 (was Re: Windows GUI for gcc toolchain)
« Reply #18 on: 10 / May / 2022, 15:41:47 »
Another line, that´s now same in Ubasic & Lua: ::)
Quote
print (">>";g$,G$,bug)
Edit: Tiny improvement:  :)
Code: [Select]
// factor(), line 1150:
  case TOKENIZER_LEFTPAREN: r = relation();
    if (!is_comma() && !is_token(TOKENIZER_SEMICOLON))
       accept(TOKENIZER_RIGHTPAREN);
    break;

Code: [Select]
g$=textbox("UbasicTextbox","How are You?","Fine, thx.")
G$=textbox()
G$+="<<<"
print (">>",g$,,G$,bug:)
print (">>",g$,G$,bug:)
wait_click(0)
.
F$=file_browser("A/CHDK/SCRIPTS")
--F$+="<<<"
print (">>",f$,,F$,bug:)
print (">>",,f$,bug:)
In this very special context poor G$ got lost, because it is not present in the following line, now it looks like...
Code: [Select]
---51 : 0:05.41
<<Need sleep. Fine, thx., <<< 51
:---=----=--+-=----=----
>> Fine, thx.  N  M  M  M 54
:---=----=--+-=----=----
---57 : 0:10.95
<<Need sleep. A/CHDK/BOOKS/Clouds.txt,  57
:---=----=--+-=----=----
>>, A/CHDK/BOOKS/Clouds.txt 58
:---=----=--+-=----=----
A/CHDK/BOOKS/Clouds.txt, A/CHDK/SCRIPTS/EDIT
OR/README.TXT 59

  TOKENIZER_BUG,  :haha
  {"bug",               TOKENIZER_BUG},

  case TOKENIZER_BUG:     r = tokenizer_line_number();
    break;

Edit: Btw. It´s an option, no need to use the compiled DISKBOOT.BIN.
You could only pick modified modules or scripts step by step.  :)

Or just to play with ready .flt...  :xmas
« Last Edit: 12 / May / 2022, 16:09:42 by Caefix »
All lifetime is a loan from eternity.

 

Related Topics