I am not a very big C builder, I was able to build the Redis 4 stable for LEDE and OpenWrt, but I cannot understand my error on Redis 5rc, says:
src/background_thread.c:89:12: warning: implicit declaration of function 'sched_setaffinity'; did you mean 'SYS_sched_setaffinity'? [-Wimplicit-function-declaration]
int ret = sched_setaffinity(0, sizeof(cpu_set_t), &cpuset);
^~~~~~~~~~~~~~~~~
SYS_sched_setaffinity
src/background_thread.c:89:40: error: 'cpu_set_t' undeclared (first use in this function); did you mean 'cpuset'?
int ret = sched_setaffinity(0, sizeof(cpu_set_t), &cpuset);
^~~~~~~~~
cpuset
src/background_thread.c:89:40: note: each undeclared identifier is reported only once for each function it appears in
src/background_thread.c: In function 'background_thread_entry':
src/background_thread.c:512:2: warning: implicit declaration of function 'pthread_setname_np'; did you mean 'pthread_setcanceltype'? [-Wimplicit-function-declaration]
pthread_setname_np(pthread_self(), "jemalloc_bg_thd");
^~~~~~~~~~~~~~~~~~
pthread_setcanceltype
Makefile:349: recipe for target 'src/background_thread.sym.o' failed
make[3]: *** [src/background_thread.sym.o] Error 1
make[3]: Leaving directory '/build/source/build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/redis-5.0-rc4/deps/jemalloc'
Makefile:91: recipe for target '/build/source/build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/redis-5.0-rc4/.built' failed
make[2]: *** [/build/source/build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/redis-5.0-rc4/.built] Error 2
make[2]: Leaving directory '/build/source/feeds/redis/redis'
Command exited with non-zero status 2
time: package/feeds/redis/redis/compile#14.84#1.41#15.66
package/Makefile:107: recipe for target 'package/feeds/redis/redis/compile' failed
make[1]: *** [package/feeds/redis/redis/compile] Error 2
make[1]: Leaving directory '/build/source'
/build/source/include/toplevel.mk:216: recipe for target 'package/feeds/redis/redis/compile' failed
make: *** [package/feeds/redis/redis/compile] Error 2
OK, I fixed it, but it is ugly, because I just uncommented the code, but it works though.
My question is, that what I need to do is to undefine with JEMALLOC_HAVE_SCHED_SETAFFINITY and JEMALLOC_HAVE_PTHREAD_SETNAME_NP. I tried in redis-5.0-rc4/deps/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h.in as
ok, i disabled jemalloc for redis memory allocator to use the smaller libc, which is better for embedded system and finally redis 5 works with openwrt.