F-Stack / f-stack

F-Stack is an user space network development kit with high performance based on DPDK, FreeBSD TCP/IP stack and coroutine API.

Home Page:http://www.f-stack.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to compile f-stack lib on fedora

harveyliuit opened this issue · comments

When compile f-stack on a Fedora machine, received following error:

In file included from /data/f-stack/lib/../freebsd/sys/_callout.h:43,
from /data/f-stack/lib/../freebsd/sys/callout.h:43,
from /data/f-stack/lib/../freebsd/sys/systm.h:46,
from /data/f-stack/lib/include/sys/systm.h:32,
from /data/f-stack/lib/../freebsd/kern/subr_taskqueue.c:33:
/data/f-stack/lib/../freebsd/kern/subr_taskqueue.c: In function ‘taskqueue_run_locked’:
/data/f-stack/lib/../freebsd/sys/queue.h:580:28: error: storing the address of local variable ‘tb’ in ‘*queue.tq_active.lh_first’ [-Werror=dangling-pointer=]
580 | LIST_FIRST((head)) = (elm);
| ^
/data/f-stack/lib/../freebsd/kern/subr_taskqueue.c:462:9: note: in expansion of macro ‘LIST_INSERT_HEAD’
462 | LIST_INSERT_HEAD(&queue->tq_active, &tb, tb_link);
| ^~~~~~~~~~~~~~~~
/data/f-stack/lib/../freebsd/kern/subr_taskqueue.c:454:31: note: ‘tb’ declared here
454 | struct taskqueue_busy tb;
| ^~
/data/f-stack/lib/../freebsd/kern/subr_taskqueue.c:451:40: note: ‘queue’ declared here
451 | taskqueue_run_locked(struct taskqueue *queue)
| ~~~~~~~~~~~~~~~~~~^~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:671: subr_taskqueue.o] Error 1

Same here. However, after switching CC from gcc-13 to gcc-12 fixed this issue.
Just export CC=gcc-12 before making lib.