版本是2021年5月9号的主线版本分支,本来一直用的都不错,但是从昨天起编译出错:
oot@pml_v:/home/pml/frrouting/frr# make
git suffix: -g34723b2fa-dirty
git branches: local:master, github/FRRouting/frr.git/master
Files lib/gitversion.h.tmp and lib/gitversion.h are identical
make all-am
make[1]: Entering directory '/home/pml/frrouting/frr'
CC bgpd/bgp_addpath.o
In file included from ./lib/zebra.h:28:0,
from bgpd/bgp_addpath.h:24,
from bgpd/bgp_addpath.c:24:
./lib/compiler.h:155:12: error: expected declaration specifiers or ‘...’ before string constant
CPP_NOTICE("time to remove this CONFDATE block")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./lib/compiler.h:361:0,
from ./lib/zebra.h:28,
from bgpd/bgp_addpath.h:24,
from bgpd/bgp_addpath.c:24:
/usr/include/inttypes.h:305:34: error: unknown type name ‘__gwchar_t’
extern intmax_t wcstoimax (const __gwchar_t *__restrict __nptr,
^~~~~~~~~~
/usr/include/inttypes.h:306:7: error: unknown type name ‘__gwchar_t’; did you mean ‘__u_char’?
__gwchar_t **__restrict __endptr, int __base)
^~~~~~~~~~
__u_char
/usr/include/inttypes.h:310:35: error: unknown type name ‘__gwchar_t’
extern uintmax_t wcstoumax (const __gwchar_t *__restrict __nptr,
^~~~~~~~~~
/usr/include/inttypes.h:311:8: error: unknown type name ‘__gwchar_t’; did you mean ‘__u_char’?
__gwchar_t ** __restrict __endptr, int __base)
^~~~~~~~~~
__u_char
/usr/include/inttypes.h:342:42: error: unknown type name ‘__gwchar_t’
extern long int __wcstol_internal (const __gwchar_t * __restrict __nptr,
^~~~~~~~~~
/usr/include/inttypes.h:343:8: error: unknown type name ‘__gwchar_t’; did you mean ‘__u_char’?
__gwchar_t **__restrict __endptr,
^~~~~~~~~~
__u_char
In file included from /usr/include/features.h:424:0,
from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
from
经查,发现是frr的lib/compiler.h中有段代码是临时性的代码,有一个日期限制,限制时间为2021年6月1号。
这里记录一下解决方案,原本怀疑是一些工具问题,后来发现不是,还是需要上预编译的大法,找到Makefile中具体的编译问题:【使用make --trace】看到详细信息,然后增加了生成预处理的语句,通过预处理文件对比查看。