Before newlib 3.3.0, <dirent.h> bundled in newlib did not include any
function declarations. Instead, the file included the platform-
specific <sys/dirent.h>. This inclusion was inside a C++ guard block.
ESP-IDF provided sys/dirent.h inside newlib component, and this file
contained all the necessary function and structure declarations.
Since da418955f5,
common function declarations have been added to <dirent.h> in newlib.
However, the inclusion of sys/dirent.h has been moved out of the C++
guard block. However we didn't notice this change and did not update
sys/dirent.h in ESP-IDF newlib component to and the now-required
C++ guards there.
This commit adds the missing C++ guards to the platform-specific
sys/dirent.h.
The declarations of common dirent.h functions are now present both in
<dirent.h> (provided by newlib) and in sys/dirent.h (provided by IDF).
We keep the declarations in sys/dirent.h for compatibility, since some
ESP-IDF files and applications may include <sys/dirent.h> directly,
rather than <dirent.h>.
Closes https://github.com/espressif/esp-idf/issues/7204
This adds support for the retargetable locking implementation in
newlib 3. This feature will be enabled in the future toolchain builds.
With the present version of the toolchain, this code doesn't get used.
When _RETARGETABLE_LOCKING gets enabled, newlib locking implementation
will be modified as follows:
- Legacy ESP-specific _lock_xxx functions are preserved. This is done
because ROM copies of newlib in ESP32 and ESP32-S2 rely on these
functions through the function pointer table. Also there is some
code in IDF which still uses these locking functions.
- New __retarget_lock_xxx functions are introduced. Newlib expects
these functions to be provided by the system. These functions work
pretty much the same way as the ESP-specific _lock_xxx functions,
except one major difference: _lock_acquire receives the lock pointer
by value, and as such doesn't support lazy initialization.
- Static locks used by newlib are now explicitly initialized at
startup. Since it is unlikely that these static locks are used at
the same time, all compatible locks are set to point to the same
mutex. This saves a bit of RAM. Note that there are still many locks
not initialized statically, in particular those inside FILE
structures.
* Target components pull in xtensa component directly
* Use CPU HAL where applicable
* Remove unnecessary xtensa headers
* Compilation changes necessary to support non-xtensa gcc types (ie int32_t/uint32_t is no
longer signed/unsigned int).
Changes come from internal branch commit a6723fc
This uses a hack (temporarily defining __rtems__ from a wrapper header
file) to include timeradd, timersub, and similar macros, without
modifying newlib headers.