Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By cal
#19836
jcmvbkbc wrote:
cal wrote:Do I have to provide a dummy abort symbol to avoid the whole family of sbrk, malloc, etc?
Is there some magic switch available?

Interesting. This is clearly an undefined behaviour and that's where gcc would emit trap, and according to the chapter 2.1 here in case it's not implemented a call to abort will be emitted. So yes, we either need a dummy implementation of abort() or we need to implement trap pattern in the gcc. Surprisingly I haven't found any switch to turn it off.
I'll add a patch with the trap pattern implementation.

Thanks for your report!


You're welcome.

I added a dummy abort() and had to remove one inline attribute and removed -Werror (temporarily ...).
After that my nodemcu firmware (based on dev branch with local mods) produced a firmware that does start
on the chip.

Interestingly ALL sections need less memory compared to gcc 4.8.2. Even .rodata and
Code: Select all.bss
.

gcc 4.8.2
Code: Select allIdx Name          Size      VMA       LMA       File off  Algn
  0 .irom0.text   0005700a  40210000  40210000  0000cbe0  2**4
                  CONTENTS, ALLOC, LOAD, CODE
  1 .text         000073d7  40100000  40100000  00005800  2**8
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  2 .data         00000b6c  3ffe8000  3ffe8000  000000e0  2**4
                  CONTENTS, ALLOC, LOAD, DATA
  3 .rodata       00004b38  3ffe8b70  3ffe8b70  00000c50  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .bss          00009820  3ffed6a8  3ffed6a8  00005788  2**4
                  ALLOC


gcc 5.1
Code: Select allIdx Name          Size      VMA       LMA       File off  Algn
  0 .irom0.text   00056fe3  40210000  40210000  0000c3b0  2**4
                  CONTENTS, ALLOC, LOAD, CODE
  1 .text         000073ab  40100000  40100000  00005000  2**8
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  2 .data         00000b64  3ffe8000  3ffe8000  000000e0  2**4
                  CONTENTS, ALLOC, LOAD, DATA
  3 .rodata       00004358  3ffe8b70  3ffe8b70  00000c50  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .bss          000097f8  3ffecec8  3ffecec8  00004fa8  2**4
                  ALLOC


gdb:
[list=]
[*] remote connections work
[*] backtraces look good
[*] litben looks good
[*] layout asm works now (UTF-8 issue in 7.5.1)
[/list]

Do you want me to test anything special?

Good work, thanks!

Cal
User avatar
By jcmvbkbc
#19859 Ok, I've pushed the update with trap implementation for gcc to the crosstool-NG.

cal wrote:had to remove one inline attribute

Curious why that was needed.

cal wrote:Do you want me to test anything special?

Nothing special, thank you. Knowing that things work at least for someone else is good.
Please don't hesitate to report any issues.
User avatar
By cal
#19863
jcmvbkbc wrote:Ok, I've pushed the update with trap implementation for gcc to the crosstool-NG.

cal wrote:had to remove one inline attribute

Curious why that was needed.


I got a missing symbol on link so I assume that 4.8 does inline where directly seen and adds the function normally, too.
5.1 may not add the function normally. I didn't checked in detail.

Please don't hesitate to report any issues.

Sure.