esp-open-sdk
esp-open-sdk copied to clipboard
Provide compiler specs with default esp8266-specific libraries/map file
This series fixes issue #199 and also fixes examples/blinky build (which now requires linking with libc b/o liblwip.a(espconn_buf.o)).
I'm not sure I want to go as far as this. This patch leaves an impression that vendor libraries are integral part of open-source toolchain. But they aren't, they are proprietary, foreign constructs. Users should be well aware of that. As a particular example, with advent of liblwip_open.a, vendor's liblwip.a is no longer supported by esp-open-sdk. Like, I'm not going to forcibly remove it, and even give up on a plan to rename it to liblwip_proprietary.a, and current liblwip_open.a - to liblwip.a. But users are discouraged from using vendor's liblwip.a, and any bugs regarding it are non-bugs from esp-open-sdk's perspective.
That's OK, I'll leave it here as a demonstration of what can be done.
BTW, using this technique we can introduce new gcc options right in the spec file, e.g. we can introduce -mfree-libs
for linking with the free library versions and -mespressif-libs
for linking with vendor libraries.
We can also limit this series to at least not trying to link with crt1-sim.o, _vectors.o, -lsim and -lhandlers-sim by default.
At the very least, please remove the confusing and irrelevant things from LIB_SPEC
. Should be as simple as patching /src/gcc-4.8.5/gcc/config/xtensa/elf.h:
to state #define LIB_SPEC "-lc -lhal"
-- please let me know if you'd like a pull request for the relevant changes.