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

User avatar
By jcmvbkbc
#1059
mamalala wrote:Any quick hints about how to compile it?

I have a set of scripts for fast toolchain building for xtensa here: https://github.com/jcmvbkbc/xtensa-toolchain-build
It needs separate binutils, gcc and gdb directories, named according to versions in the config file, or tar.bz2 archives thereof (which will be unpacked and patched by prepare.sh).
Then you run ./prepare.sh lx106 to apply lx106 overlay and ./build-elf.sh lx106 to build the toolchain. No su/sudo, just as ordinary user.
The build goes under ./build-lx106 and the resulting toolchain binaries will be in the ./build-lx106/root/bin.
You'll need to invoke them by full path name or add the directory to your PATH or add symlinks to them to your ~/bin, whatever.
User avatar
By cnlohr
#1060 :( I'm getting the following error:

Code: Select allmkdir -p -- xtensa-lx106-elf/libgcc
Configuring in xtensa-lx106-elf/libgcc
configure: creating cache ./config.cache
checking build system type... x86_64-unknown-linux-gnu
checking host system type... xtensa-lx106-elf
checking for --enable-version-specific-runtime-libs... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for gawk... gawk
checking for xtensa-lx106-elf-ar... /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/bin/ar
checking for xtensa-lx106-elf-lipo... xtensa-lx106-elf-lipo
checking for xtensa-lx106-elf-nm... /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/gcc-4.9.1-elf/./gcc/nm
checking for xtensa-lx106-elf-ranlib... /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/bin/ranlib
checking for xtensa-lx106-elf-strip... /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/bin/strip
checking whether ln -s works... yes
checking for xtensa-lx106-elf-gcc...  /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/gcc-4.9.1-elf/./gcc/xgcc -B/xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/gcc-4.9.1-elf/./gcc/ -B/xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/bin/ -B/xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/lib/ -isystem /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/include -isystem /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/sys-include   
checking for suffix of object files... configure: error: in `/xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/gcc-4.9.1-elf/xtensa-lx106-elf/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make: *** [configure-target-libgcc] Error 1


When running
Code: Select all./build-elf.sh lx106


Any ideas?

*EDIT* following in the config file:
Code: Select allconfigure:3373: $? = 0
configure:3362:  /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/gcc-4.9.1-elf/./gcc/xgcc -B/xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/gcc-4.9.1-elf/./gcc/ -B/xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/bin/ -B/xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/lib/ -isystem /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/include -isystem /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/sys-include    -v >&5
Reading specs from /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/gcc-4.9.1-elf/./gcc/specs
COLLECT_GCC=/xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/gcc-4.9.1-elf/./gcc/xgcc
COLLECT_LTO_WRAPPER=/xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/gcc-4.9.1-elf/./gcc/lto-wrapper
Target: xtensa-lx106-elf
Configured with: ../../gcc-4.9.1/configure --target=xtensa-lx106-elf --prefix=/xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root --enable-__cxa_atexit --disable-shared --disable-libssp --enable-languages=c --with-newlib
Thread model: single
gcc version 4.9.1 (GCC)
configure:3373: $? = 0
configure:3362:  /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/gcc-4.9.1-elf/./gcc/xgcc -B/xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/gcc-4.9.1-elf/./gcc/ -B/xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/bin/ -B/xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/lib/ -isystem /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/include -isystem /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/sys-include    -V >&5
xgcc: error: unrecognized command line option '-V'
xgcc: fatal error: no input files
compilation terminated.
configure:3373: $? = 1
configure:3362:  /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/gcc-4.9.1-elf/./gcc/xgcc -B/xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/gcc-4.9.1-elf/./gcc/ -B/xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/bin/ -B/xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/lib/ -isystem /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/include -isystem /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/sys-include    -qversion >&5
xgcc: error: unrecognized command line option '-qversion'
xgcc: fatal error: no input files
compilation terminated.
configure:3373: $? = 1
configure:3389:  /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/gcc-4.9.1-elf/./gcc/xgcc -B/xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/gcc-4.9.1-elf/./gcc/ -B/xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/bin/ -B/xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/lib/ -isystem /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/include -isystem /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/sys-include    -o conftest -g -O2   conftest.c  >&5
/tmp/ccEmjPR0.s: Assembler messages:
/tmp/ccEmjPR0.s:12: Error: unknown opcode or format name 'entry'
/tmp/ccEmjPR0.s:16: Error: unknown opcode or format name 'retw.n'
configure:3392: $? = 1
configure:3580: checking for suffix of object files
configure:3602:  /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/gcc-4.9.1-elf/./gcc/xgcc -B/xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/gcc-4.9.1-elf/./gcc/ -B/xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/bin/ -B/xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/lib/ -isystem /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/include -isystem /xc0/p1/esp8266/xtensa-toolchain-build/build-lx106/root/xtensa-lx106-elf/sys-include    -c -g -O2  conftest.c >&5
/tmp/ccET8Ob4.s: Assembler messages:
/tmp/ccET8Ob4.s:12: Error: unknown opcode or format name 'entry'
/tmp/ccET8Ob4.s:16: Error: unknown opcode or format name 'retw.n'
configure:3606: $? = 1
User avatar
By jcmvbkbc
#1061
cnlohr wrote::( I'm getting the following error:
...
Code: Select all/tmp/ccET8Ob4.s: Assembler messages:
/tmp/ccET8Ob4.s:12: Error: unknown opcode or format name 'entry'
/tmp/ccET8Ob4.s:16: Error: unknown opcode or format name 'retw.n'
configure:3606: $? = 1

Looks like you've used stock gcc-4.9.1, not the patched version that has WIP-support for call0 ABI from here: https://github.com/jcmvbkbc/gcc-xtensa/ ... all0-4.8.2
User avatar
By mikelelere
#1062 Hi, I'm new at this forum. I've downloaded and compiled the baremetal lx106 toolchain provided by jcmvbkbc by using his build scripts. It builds successfully. However, I've noted that the scripts do not build newlib despite the fact that it seems to be a prerrequisite of the build script. I've tried to manually compile the mainstream newlib distribution but it does not seem to support the xtensa processors. Do you have any pointers to a newlib version compatible with xtensa? Thanks.