This fixes compilation with GCC >= 12.x, which is unhappy about the use
after free:
/home/maribu/Repos/software/RIOT/build/pkg/ccn-lite/src/ccnl-core/src/ccnl-relay.c: In function 'ccnl_fib_rem_entry':
/home/maribu/Repos/software/RIOT/build/pkg/ccn-lite/src/ccnl-core/src/ccnl-relay.c:916:16: error: pointer 'fwd' used after 'free' [-Werror=use-after-free]
916 | if (fwd->face) {
| ~~~^~~~~~
In file included from /home/maribu/Repos/software/RIOT/build/pkg/ccn-lite/src/ccnl-core/src/ccnl-relay.c:33:
/home/maribu/Repos/software/RIOT/build/pkg/ccn-lite/src/ccnl-core/../ccnl-riot/include/ccn-lite-riot.h:52:41: note: call to 'free' here
52 | #define ccnl_free(p) free(p)
| ^~~~~~~
/home/maribu/Repos/software/RIOT/build/pkg/ccn-lite/src/ccnl-core/src/ccnl-relay.c:910:13: note: in expansion of macro 'ccnl_free'
910 | ccnl_free(fwd);
| ^~~~~~~~~
/home/maribu/Repos/software/RIOT/build/pkg/ccn-lite/src/ccnl-core/src/ccnl-relay.c: In function 'ccnl_fib_rem_entry':
/home/maribu/Repos/software/RIOT/build/pkg/ccn-lite/src/ccnl-core/src/ccnl-relay.c:916:16: error: pointer 'fwd' used after 'free' [-Werror=use-after-free]
916 | if (fwd->face) {
| ~~~^~~~~~
In file included from /home/maribu/Repos/software/RIOT/build/pkg/ccn-lite/src/ccnl-core/src/ccnl-relay.c:33:
/home/maribu/Repos/software/RIOT/build/pkg/ccn-lite/src/ccnl-riot/include/ccn-lite-riot.h:52:41: note: call to free' here
52 | #define ccnl_free(p) free(p)
| ^~~~~~~
/home/maribu/Repos/software/RIOT/build/pkg/ccn-lite/src/ccnl-core/src/ccnl-relay.c:910:13: note: in expansion of macro 'ccnl_free'
910 | ccnl_free(fwd);
| ^~~~~~~~~
The definition of gettimeofday in pkg/ccn-lite leads to multiple definitions on platforms where gettimeofday is compiled in in newlib. Therefore, the gettimeofday function in pkg/ccn-lite is declared as weak symbol.
Instead of making a NETTYPE definition dependent on an implementation
module, this change makes it dependent on a pseudo-module for each
specific NETTYPE and makes the respective implementation modules
dependent on it.
This has two advantages:
- one does not need include the whole implementation module to
subscribe to a NETTYPE for testing or to provide an alternative
implementation
- A lot of circular dependencies related to GNRC could be untangled.
E.g. the only reason `gnrc_icmpv6` needs the `gnrc_ipv6` is because it
uses `GNRC_NETTYPE_IPV6` to search for the IPv6 header in an ICMPv6
when demultiplexing an ICMPv6 header.
This change does not resolve these dependencies or include usages where
needed. The only dependency change is the addition of the
pseudo-modules to the implementation modules.
Prepare for handling pkg state with files. So it requires having the
path defined before declaring targets. In addition, it cleans up the
old git-download target.
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.
The build system contains several instances of
INCLUDES += -I$(RIOTBASE)/sys/posix/include
This is bypassing the module management system, by directly accesing
headers without depending on a module. The module is the posix module.
That line is also added when one of the posix_* modules is requested.
According to the docs, the posix module provides headers only, but in
reality there is also inet.c.
This patch:
- Moves `inet.c` into `posix_inet`, leaving `posix` as a headers-only
module.
- Rename `posix` as `posix_headers` to make it clear the module only
includes headers.
- Makes `posix_*` modules depend on `posix_headers`, thus removing the
explicit `INCLUDES+=...` in `sys/Makefile.include`.
- Ocurrences of `INCLUDES+=...` are replaced by an explicit dependency
on `posix_headers`.
ccn-lite does not build with cmake < 3.6.0. This checks for a minimal version
instead of failing to compile.
cmake version 3.5.2 is not >= to minimal required 3.6.0
Makefile:25: recipe for target '..cmake_version_supported' failed
Tested with versions 3.5.2, 3.6.0-rc1, 3.6.0, 3.6.3, 3.7.0-rc1, 3.7.0.
Note: the check used does not consider '-rcX' as 'sort -V' does not handle them
properly.
This updates the ccn-lite package version which brings in the
latest upstream fixes for some compiler issues found on macOS
with clang and newer GCC versions.
A minor adaption of the RIOT shell commands is also included.