-->
Page 1 of 1

Try to understand how working xtensa-lx106-elf-gcc.exe

PostPosted: Fri Dec 28, 2018 4:16 am
by costycnc
I compile with arduino ide Blink example for Esp8285.
I see that result Blink.cpp.
From Blink.cpp i cut all library and code lines.
I leave only :
Code: Select allvoid setup() {
asm("  movi.n  a5, 100");
}                                               
void loop() {
asm("  movi.n  a4, 120");
}

I compile this file with XTENSA-LX106-ELF-GCC.EXE ( I leave all arguments that arduino make and i deleted all include folders).
I obtain a o file that decompiled with objdump.exe i see that is compiled corectly :
Code: Select alltest.cpp.o:     file format elf32-xtensa-le


Disassembly of section .text._Z5setupv:

00000000 <setup()>:
   0:   64a052           movi   a5, 100
   3:   f00d         ret.n

Disassembly of section .text._Z4loopv:

00000000 <loop()>:
   0:   78a042           movi   a4, 120
   3:   f00d         ret.n


Until now its ok!

Problems begin when i want compile o file with XTENSA-LX106-ELF-GCC.EXE to elf file.
I copied line where arduino compile o file to elf ,i deleted all include libraries and i succeded to create bin file ... but a empty file
Code: Select alltest.cpp.elf:     file format elf32-xtensa-le


not with asm inside !!!

My question is where find explanation for all arguments that XTENSA-LX106-ELF-GCC.EXE use?

If you want see all experiments that i speak here ... here is the link:

https://github.com/costycnc/test-compile-esp8285/tree/master/28.12.2018

Re: Try to understand how working xtensa-lx106-elf-gcc.exe

PostPosted: Fri Mar 08, 2019 6:46 am
by eriksl
Apparently it's just gcc. Google for gcc options.