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

User avatar
By jcmvbkbc
#1064
mikelelere wrote:I've noted that the scripts do not build newlib despite the fact that it seems to be a prerrequisite of the build script.

No, not really. newlib got there through the copy-paste process from some old gcc bootstrapping recipe, these scripts never actually used it.

UPD:
mikelelere wrote:Do you have any pointers to a newlib version compatible with xtensa?

Don't know about mainline newlib, but xtensa tools should have baremetal-like libc in XtDevTools/install/builds/<release-version>/<core-variant>/xtensa-elf/lib
Baremetal-like as it needs no host OS, but does I/O through the simcall interface, i.e. it only works in the simulator.
User avatar
By mikelelere
#1066 Thank you very much for the info. I thought that such a newlib port existed because I found this message http://sourceware.org/ml/newlib/2003/msg00562.html while googling, claiming that tensilica had ported newlib to work with xtensa processors, but unfortunately I failed to find any links to the actual port...
User avatar
By mamalala
#1075
jcmvbkbc wrote:
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.


Thanks very much!

Greetings,

Chris
User avatar
By mamalala
#1077 Hi All,

just wanted to give a heads up that the compiler works just fine.

I compiled the AT demo with it and it runs OK, as far as i can tell. One need to copy the libc.a from XtDevTools/install/builds/RC-2010.1-win32/lx106/xtensa-elf/lib and the libhal.a from XtDevTools/install/builds/RC-2010.1-win32/lx106/xtensa-elf/arch/lib to the SDK's lib directory.

There is also an XtDevTools/install/tools/RC-2010.1-win32/XtensaTools/xtensa-elf/src directory in there which seems to contain the sources oof those libs, and as far as i can tell people are free to do with them what they want according to the (c) notice in there. I may try and fiddle with those to see if they can be compiled with the now-working GCC as well. But then, since the sources are free, there should be no problem to distribute the compiled versions either.

Greetings,

Chris