esp-open-sdk icon indicating copy to clipboard operation
esp-open-sdk copied to clipboard

Provide compiler specs with default esp8266-specific libraries/map file

Open jcmvbkbc opened this issue 7 years ago • 3 comments

This series fixes issue #199 and also fixes examples/blinky build (which now requires linking with libc b/o liblwip.a(espconn_buf.o)).

jcmvbkbc avatar Oct 19 '16 17:10 jcmvbkbc

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.

pfalcon avatar Oct 20 '16 16:10 pfalcon

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.

jcmvbkbc avatar Oct 20 '16 18:10 jcmvbkbc

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.

dev-zzo avatar Dec 12 '17 14:12 dev-zzo