export COMP by using the environment insteal of through the shell to
prevnet issues with `\"` being defined when keeping macros in CFLAGS.
Another solution was to use COMP='...' but could there could still have
issues with single quotes in CFLAGS.
The correct way to overrride the malloc family of functions in newlib-nano is
to provide the *_r (reentrant) variants. Newlib implements the "normal"
functions on top of these (see the newlib source code). Also, internally it calls
the *_r functions when allocating buffers.
If only the "normal" non-reentrant functions are provided this will mean that
some of the code will still use the vanilla newlib allocator. Furthermore, if
one uses the whole heap as a pool for TLSF then the system may in the best case
crash as there is no enough memory for its internall allocations or in the worst
case function eratically (this depends on how the heap reserved, there is an
upcomming series of commits in that direction).
This commit splits the handling between newlib and native. It also prepares the
ground for future work on the pool initialization.
Right now I could only test this in ARM and native and I cannot ensure it will
work on other platforms. Replacing the system's memory allocator is not something
that can be taken lightly and will inevitably require diving into the depths of
the libc. Therefore I would say that using TLSF as a system wide allocator is ATM
supported officially only on those plaftorms.
Testing:
Aside from reading the newlib sources, you can see the issue in a live system
using the debugger.
Compile any example (with or without tlsf-malloc), grab a debugger and place
a breakpoint in sbrk and _sbrk_r. Doing a backtrace will reveal it gets called
by _malloc_r.
This is to avoid conflics with other config.h files, e.g. when building
for esp8266 where $(NEWLIB)/xtensa-lx106-elf/include/config.h gets
included instead.
The OONF package is combining multiple ".a" file into a single archive. The
way it was being done involved creating and changing directories, unpacking
the original archives and repacking them into a combined one.
Theis has a couple of issues:
- It is untidy and wasteful.
- It breaks when thin archives are enabled, as a thin archive cannot be
unpacked.
This commit uses a MRI script to do the combining step. It works both with
and without thin archives and is cleaner overall.
An issue that remains to be soved is that make is calling itself to create the
archive, as the PARTIAL_ARCHIVES are not known before hand. This is hacky. It
can be solved but it is a subject for another PR.
There is no reason why this package would need tlsf. Using tlsf as
system malloc is not known to work in all platforms.
With this patch CCN-Lite will use the default malloc provided by the
target's C library.
A (void*) function was declared as (void**) because one of the void pointers
was hidden behind a typedef. Because of the way a void* works, this has no
consequences, but it is confusing.
softdevice needs the memory at 0x2000 to be initialized to 0xffffffff
according to #5893 and testing. However, the addresses [0x8bc, 0x3000[ are not
set in softdevice.hex.
So use a modified hex file with all the memory set to 0xff as it is the rom
reset value anyway.
This change updates the `.hex` file instead on relying on erasing the
memory.
To avoid priority conflicts with the WiFi hardware driver thread which has priority of 1, the default thread priority of lwIP's TCP/IP thread is decreased to 2.