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

User avatar
By davydnorris
#65274
jcmvbkbc wrote:
davydnorris wrote:- sysroot based toolchains for 'bare metal' (ie. Non-OS based) systems were removed in 1.22 because there was unnecessary and incorrect duplication of include and lib structures.

I'm not sure about that, but I didn't have enough time for a good look at it. My current impression is that it complicates the setup (supporting two configurations: sysrooted and non-sysrooted instead of one) and makes it less flexible (one cannot pass --sysroot option to the components of non-sysrooted toolchain).

I've just finished building esp-open-sdk with the default options, which generates a non-sysroot toolchain, and the structure appears to work fine.
- Build tools and files that are used by the host and are common to all architectures end up under the CT_PREFIX_DIR/bin, include, lib, etc.
- toolchain level files for a specific target end up under this structure but with architecture specific names eg. CT_PREFIX_DIR/bin/xtensa-lx106-elf-gcc-6.3.0.exe or CT_PREFIX_DIR/lib/gcc/xtensa-lx106-elf/6.3.0/libgcc.a
- target hardware/kernel specific tools and files end up under CT_PREFIX_DIR/xtensa-lx106-elf/bin, include, lib, etc. Eg. CT_PREFIX_DIR/xtensa-lx106-elf/lib/libc.a, CT_PREFIX_DIR/xtensa-lx106-elf/lib/libm.a

There's also target specific CT_PREFIX_DIR/xtensa-lx106-elf//usr/lib and /include created which would be where you'd put the SDK libraries if you were building an integrated toolchain.

So in this non-sysroot world, I would imagine you would put libcirom.a and libhal.a into CT_PREFIX_DIR/xtensa-lx106-elf/lib/ and you'd put liblwip-open.a into CT_PREFIX_DIR/xtensa-lx106-elf//usr/lib along with the SDK libraries if you were merging them.

The bigger benefit of this is that you could use exactly the same tree to host an ESP32 or other toolchain and then easily switch architectures between the two.

Am I missing something important regarding the sysroot based toolchain? I've renamed and moved my directory and everything still seems to build fine, which is what I thought the point of sysroot was.
User avatar
By davydnorris
#65275
jcmvbkbc wrote:
davydnorris wrote:I'm still trying to get a way to run
Code: Select allct_ng menuconfig
in headless mode so that we can automate it from a Makefile.


BTW, there's https://git.kernel.org/pub/scm/linux/ke ... _config.sh


This is exactly what I was thinking of, but it's currently not included in the kconfig used in crosstool-NG. I've proposed that it's added and included as a command within ct-ng.