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

User avatar
By jcmvbkbc
#3703
joostn wrote:
So these functions must be copied by the bootloader to IRAM and run from there, before code would be able to run directly from flash.

So could this be done using something like this?
...
I tried a few things but couldn't get EXCLUDE_FILE to work at all. Stumbled upon this:
http://sourcerytools.com/pipermail/arm- ... 00224.html
which suggests EXCLUDE_FILE should be repeated multiple times in the line, but still it doesn't seem to match my .o files.

It should mention object files, parts of the libmain.a instead of the archive itself, e.g.
Code: Select all--- eagle.app.v6.ld     2014-11-28 05:43:13.065557060 +0300
+++ eagle.app.v6.flash.ld       2014-11-30 17:19:27.363125457 +0300
@@ -155,7 +155,7 @@
     *(.entry.text)
     *(.init.literal)
     *(.init)
-    *(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
+    *app_main.o(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
     *(.fini.literal)
     *(.fini)
     *(.gnu.version)
@@ -176,6 +176,7 @@
   {
     _irom0_text_start = ABSOLUTE(.);
     *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
+    *(EXCLUDE_FILE(*app_main.o) .literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
     _irom0_text_end = ABSOLUTE(.);
   } >irom0_0_seg :irom0_0_phdr
 }

This script produces ELF as expected, but still doesn't work when I flash it. Maybe I'm doing something wrong as well...
User avatar
By alonewolfx2
#3719 i have this error when compiling open-sdk with "make STANDALONE=y" .what am i suppose to do

Code: Select alldebug_hndlr.S: Assembler messages:
debug_hndlr.S:89: Error: unknown opcode or format name 'wsr.ICOUNT'
debug_hndlr.S:99: Error: unknown opcode or format name 'wsr.IBREAKENABLE'
make[4]: *** [debug_hndlr.o] Hata 1
make[4]: `/home/suskun/esp-open-sdk/lx106-hal/src' dizininden çıkılıyor
make[3]: *** [all] Hata 2
make[3]: `/home/suskun/esp-open-sdk/lx106-hal/src' dizininden çıkılıyor
make[2]: *** [all-recursive] Hata 1
make[2]: `/home/suskun/esp-open-sdk/lx106-hal' dizininden çıkılıyor
make[1]: *** [_libhal] Hata 2
make[1]: `/home/suskun/esp-open-sdk/lx106-hal' dizininden çıkılıyor
make: *** [/home/suskun/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/lib/libhal.a] Hata 2
User avatar
By jcmvbkbc
#3721
alonewolfx2 wrote:i have this error when compiling open-sdk with "make STANDALONE=y" .

What is open-sdk? What does STANDALONE=y means? Can you make it show the complete compilation command lines it's executing?

alonewolfx2 wrote:
Code: Select alldebug_hndlr.S: Assembler messages:
debug_hndlr.S:89: Error: unknown opcode or format name 'wsr.ICOUNT'
debug_hndlr.S:99: Error: unknown opcode or format name 'wsr.IBREAKENABLE'

I built libhal from the https://github.com/tommie/lx106-hal repo w/o issues.
User avatar
By alonewolfx2
#3722 i mean esp-open-sdk. here is link
https://github.com/pfalcon/esp-open-sdk

and here is full code

Code: Select allsuskun@suskun-VirtualBox:~/esp-open-sdk$ make STANDALONE=y
cp esptool/esptool.py /home/suskun/esp-open-sdk/xtensa-lx106-elf/bin/
ln -snf esp_iot_sdk_v0.9.3 sdk
Installing vendor SDK headers into toolchain sysroot
Installing vendor SDK libs into toolchain sysroot
Installing vendor SDK linker scripts into toolchain sysroot
make -C lx106-hal -f ../Makefile _libhal
make[1]:`/home/suskun/esp-open-sdk/lx106-hal' dizinine giriliyor
autoreconf -i
PATH=/home/suskun/esp-open-sdk/xtensa-lx106-elf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games ./configure --host=xtensa-lx106-elf --prefix=/home/suskun/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for xtensa-lx106-elf-strip... xtensa-lx106-elf-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... xtensa-lx106-elf
checking for style of include used by make... GNU
checking for xtensa-lx106-elf-gcc... xtensa-lx106-elf-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether xtensa-lx106-elf-gcc accepts -g... yes
checking for xtensa-lx106-elf-gcc option to accept ISO C89... none needed
checking whether xtensa-lx106-elf-gcc understands -c and -o together... yes
checking dependency style of xtensa-lx106-elf-gcc... gcc3
checking dependency style of xtensa-lx106-elf-gcc... gcc3
checking for xtensa-lx106-elf-gcc... (cached) xtensa-lx106-elf-gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether xtensa-lx106-elf-gcc accepts -g... (cached) yes
checking for xtensa-lx106-elf-gcc option to accept ISO C89... (cached) none needed
checking whether xtensa-lx106-elf-gcc understands -c and -o together... (cached) yes
checking dependency style of xtensa-lx106-elf-gcc... (cached) gcc3
checking for xtensa-lx106-elf-ranlib... xtensa-lx106-elf-ranlib
checking for call0 ABI... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating include/Makefile
config.status: creating src/Makefile
config.status: creating src/config.h
config.status: src/config.h is unchanged
config.status: executing depfiles commands
PATH=/home/suskun/esp-open-sdk/xtensa-lx106-elf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games make
make[2]:`/home/suskun/esp-open-sdk/lx106-hal' dizinine giriliyor
Making all in include
make[3]:`/home/suskun/esp-open-sdk/lx106-hal/include' dizinine giriliyor
make[3]: `all' için hiçbir şey yapılmadı.
make[3]: `/home/suskun/esp-open-sdk/lx106-hal/include' dizininden çıkılıyor
Making all in src
make[3]:`/home/suskun/esp-open-sdk/lx106-hal/src' dizinine giriliyor
sort "state.c" | uniq | awk -F '[()]' ' \
      /__SPLIT__.*_nw/ && !/__SPLIT__get_intpending_nw/ { next; } \
      /^#.* defined\(__SPLIT__(\w+)\)/ { \
         tag = $2; \
         sub(/__SPLIT__/, "", tag); \
         srcbase = "state"; \
         srcsuffix = ".c"; \
         print srcbase "--" tag srcsuffix ": state.c Makefile"; \
         print "\techo \"#define " $2 "\" >\"$@.splittmp\""; \
         print "\techo \"#include \\\"state.c\\\"\" >>\"$@.splittmp\""; \
         print "\tmv \"$@.splittmp\" \"$@\""; \
         print "libhal.a: " srcbase "--" tag ".o"; \
         print "libhal_a_OBJECTS += " srcbase "--" tag ".o"; \
      }' >"state.c-split.mk.splittmp"
mv "state.c-split.mk.splittmp" "state.c-split.mk"
sort "state_asm.S" | uniq | awk -F '[()]' ' \
      /__SPLIT__.*_nw/ && !/__SPLIT__get_intpending_nw/ { next; } \
      /^#.* defined\(__SPLIT__(\w+)\)/ { \
         tag = $2; \
         sub(/__SPLIT__/, "", tag); \
         srcbase = "state_asm"; \
         srcsuffix = ".S"; \
         print srcbase "--" tag srcsuffix ": state_asm.S Makefile"; \
         print "\techo \"#define " $2 "\" >\"$@.splittmp\""; \
         print "\techo \"#include \\\"state_asm.S\\\"\" >>\"$@.splittmp\""; \
         print "\tmv \"$@.splittmp\" \"$@\""; \
         print "libhal.a: " srcbase "--" tag ".o"; \
         print "libhal_a_OBJECTS += " srcbase "--" tag ".o"; \
      }' >"state_asm.S-split.mk.splittmp"
mv "state_asm.S-split.mk.splittmp" "state_asm.S-split.mk"
sort "mem_ecc_parity.S" | uniq | awk -F '[()]' ' \
      /__SPLIT__.*_nw/ && !/__SPLIT__get_intpending_nw/ { next; } \
      /^#.* defined\(__SPLIT__(\w+)\)/ { \
         tag = $2; \
         sub(/__SPLIT__/, "", tag); \
         srcbase = "mem_ecc_parity"; \
         srcsuffix = ".S"; \
         print srcbase "--" tag srcsuffix ": mem_ecc_parity.S Makefile"; \
         print "\techo \"#define " $2 "\" >\"$@.splittmp\""; \
         print "\techo \"#include \\\"mem_ecc_parity.S\\\"\" >>\"$@.splittmp\""; \
         print "\tmv \"$@.splittmp\" \"$@\""; \
         print "libhal.a: " srcbase "--" tag ".o"; \
         print "libhal_a_OBJECTS += " srcbase "--" tag ".o"; \
      }' >"mem_ecc_parity.S-split.mk.splittmp"
mv "mem_ecc_parity.S-split.mk.splittmp" "mem_ecc_parity.S-split.mk"
sort "interrupts.c" | uniq | awk -F '[()]' ' \
      /__SPLIT__.*_nw/ && !/__SPLIT__get_intpending_nw/ { next; } \
      /^#.* defined\(__SPLIT__(\w+)\)/ { \
         tag = $2; \
         sub(/__SPLIT__/, "", tag); \
         srcbase = "interrupts"; \
         srcsuffix = ".c"; \
         print srcbase "--" tag srcsuffix ": interrupts.c Makefile"; \
         print "\techo \"#define " $2 "\" >\"$@.splittmp\""; \
         print "\techo \"#include \\\"interrupts.c\\\"\" >>\"$@.splittmp\""; \
         print "\tmv \"$@.splittmp\" \"$@\""; \
         print "libhal.a: " srcbase "--" tag ".o"; \
         print "libhal_a_OBJECTS += " srcbase "--" tag ".o"; \
      }' >"interrupts.c-split.mk.splittmp"
mv "interrupts.c-split.mk.splittmp" "interrupts.c-split.mk"
sort "int_asm.S" | uniq | awk -F '[()]' ' \
      /__SPLIT__.*_nw/ && !/__SPLIT__get_intpending_nw/ { next; } \
      /^#.* defined\(__SPLIT__(\w+)\)/ { \
         tag = $2; \
         sub(/__SPLIT__/, "", tag); \
         srcbase = "int_asm"; \
         srcsuffix = ".S"; \
         print srcbase "--" tag srcsuffix ": int_asm.S Makefile"; \
         print "\techo \"#define " $2 "\" >\"$@.splittmp\""; \
         print "\techo \"#include \\\"int_asm.S\\\"\" >>\"$@.splittmp\""; \
         print "\tmv \"$@.splittmp\" \"$@\""; \
         print "libhal.a: " srcbase "--" tag ".o"; \
         print "libhal_a_OBJECTS += " srcbase "--" tag ".o"; \
      }' >"int_asm.S-split.mk.splittmp"
mv "int_asm.S-split.mk.splittmp" "int_asm.S-split.mk"
sort "cache_asm.S" | uniq | awk -F '[()]' ' \
      /__SPLIT__.*_nw/ && !/__SPLIT__get_intpending_nw/ { next; } \
      /^#.* defined\(__SPLIT__(\w+)\)/ { \
         tag = $2; \
         sub(/__SPLIT__/, "", tag); \
         srcbase = "cache_asm"; \
         srcsuffix = ".S"; \
         print srcbase "--" tag srcsuffix ": cache_asm.S Makefile"; \
         print "\techo \"#define " $2 "\" >\"$@.splittmp\""; \
         print "\techo \"#include \\\"cache_asm.S\\\"\" >>\"$@.splittmp\""; \
         print "\tmv \"$@.splittmp\" \"$@\""; \
         print "libhal.a: " srcbase "--" tag ".o"; \
         print "libhal_a_OBJECTS += " srcbase "--" tag ".o"; \
      }' >"cache_asm.S-split.mk.splittmp"
mv "cache_asm.S-split.mk.splittmp" "cache_asm.S-split.mk"
make[3]: `/home/suskun/esp-open-sdk/lx106-hal/src' dizininden çıkılıyor
make[3]:`/home/suskun/esp-open-sdk/lx106-hal/src' dizinine giriliyor
make  all-am
make[4]:`/home/suskun/esp-open-sdk/lx106-hal/src' dizinine giriliyor
xtensa-lx106-elf-gcc -DHAVE_CONFIG_H -I.   -I../include  -mlongcalls -MT debug_hndlr.o -MD -MP -MF .deps/debug_hndlr.Tpo -c -o debug_hndlr.o debug_hndlr.S
debug_hndlr.S: Assembler messages:
debug_hndlr.S:89: Error: unknown opcode or format name 'wsr.ICOUNT'
debug_hndlr.S:99: Error: unknown opcode or format name 'wsr.IBREAKENABLE'
make[4]: *** [debug_hndlr.o] Hata 1
make[4]: `/home/suskun/esp-open-sdk/lx106-hal/src' dizininden çıkılıyor
make[3]: *** [all] Hata 2
make[3]: `/home/suskun/esp-open-sdk/lx106-hal/src' dizininden çıkılıyor
make[2]: *** [all-recursive] Hata 1
make[2]: `/home/suskun/esp-open-sdk/lx106-hal' dizininden çıkılıyor
make[1]: *** [_libhal] Hata 2
make[1]: `/home/suskun/esp-open-sdk/lx106-hal' dizininden çıkılıyor
make: *** [/home/suskun/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/lib/libhal.a] Hata 2




jcmvbkbc wrote:
alonewolfx2 wrote:i have this error when compiling open-sdk with "make STANDALONE=y" .

What is open-sdk? What does STANDALONE=y means? Can you make it show the complete compilation command lines it's executing?

alonewolfx2 wrote:
Code: Select alldebug_hndlr.S: Assembler messages:
debug_hndlr.S:89: Error: unknown opcode or format name 'wsr.ICOUNT'
debug_hndlr.S:99: Error: unknown opcode or format name 'wsr.IBREAKENABLE'

I built libhal from the https://github.com/tommie/lx106-hal repo w/o issues.