OVMS3-idf/make
Ivan Grokhotkov b1c754bbb5 Merge branch 'feature/cplusplus' into 'master'
C++ support

This change adds necessary support for compiling C++ programs:
- linking against libstdc++
- implementation of static initialization guards using FreeRTOS primitives: since we don't have condition variables at our disposal, and we don't want to allocate a synchronization primitive for every guard variable generated by the compiler, we imitate condition variables using a combination of a mutex, counting semaphore, and a counter (based on [Microsoft Research paper](https://www.microsoft.com/en-us/research/wp-content/uploads/2004/12/ImplementingCVs.pdf), albeit because we don't need *arbitrary* code to use these CVs, implementation gets simpler).

Note that libstdc++ also contains an implementation of `__cxa_guard_{acquire,release,abort}` functions. These implementations come from an `#ifndef GXX_THREADS` branch, i.e. are not aware of multthreading. There are three ways of replacing these libstdc++ functions with our implementation:

1. Move our code into gcc. Pros: cleanest solution. Cons: Such changes are unlikely to be merged by any upstream, so we end up maintaining our own forks of {gcc,crosstool-ng}.
2. Use library as it is built by crosstool, use `ar` to delete one object file (`guards.o`), add this library to ESP-IDF. Pros: easy to implement. Cons: libstdc++ is a 15MB binary 😯 
3. Keep using libstdc++ from crosstool, force our implementation to be linked using a `-u` linker flag. Pros: no impact on repo size, easy to implement. Cons: somewhat less clean than 1 (and about as hacky as 2).

For the reasons mentioned, option (3) looks like the best tradeoff.

Ref. TW6702

See merge request !364
2017-01-07 18:50:12 +08:00
..
build_examples.sh CI build_examples: Don't stop on first failed example, print failure summary 2016-12-30 17:21:16 +11:00
common.mk build system: Fix bug where erase_flash was always invoked for flash 2016-12-22 16:37:28 +11:00
component_common.mk Secure boot: initial image signature support 2016-11-14 11:08:42 +11:00
component_wrapper.mk Secure boot: Option for app & partition table signing to happen outside build system 2016-12-19 13:12:05 +11:00
project.mk cxx: link against libstdc++, remove abi.cpp 2017-01-06 14:56:02 +08:00
project_config.mk examples: Move sdkconfig.defaults support into build system 2016-12-29 17:37:30 +08:00
test_build_system.sh build system tests: Add test case for sdkconfig-triggered recompilation 2016-12-15 08:45:32 +11:00