Can not compile the kernel source code

I downloaded the souce form https://github.com/radxa/rockchip-bsp/tree/stable-4.19-rock3.
I can compile the u-boot source.But there was a error when I tried to compile the kernel source with “./build/mk-kernel.sh rk3568-radxa-e25”!

There error log is blow.

root@U2004-IDE:~/419# ./build/mk-kernel.sh rk3568-radxa-e25
Building kernel for rk3568-radxa-e25 board!
4.19.193
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
fatal: not a git repository (or any of the parent directories): .git
CC [M] drivers/net/wireless/rockchip_wlan/rtl8188eu/core/rtw_mlme.o
CC [M] drivers/net/wireless/rockchip_wlan/rtl8188eu/core/rtw_recv.o
CC [M] drivers/net/wireless/rockchip_wlan/rtl8188eu/core/mesh/rtw_mesh_hwmp.o
CC [M] drivers/net/wireless/rockchip_wlan/rtl8188eu/core/rtw_xmit.o
CC [M] drivers/net/wireless/rockchip_wlan/rtl8188eu/core/rtw_p2p.o
CC [M] drivers/net/wireless/rockchip_wlan/rtl8188eu/core/rtw_rson.o
CC [M] drivers/net/wireless/rockchip_wlan/rtl8188eu/core/rtw_tdls.o
CC [M] drivers/net/wireless/rockchip_wlan/rtl8188fu/core/rtw_mlme.o
CC [M] drivers/net/wireless/rockchip_wlan/rtl8822ce/core/rtw_mlme.o
CC [M] drivers/net/wireless/rockchip_wlan/rtl8188eu/core/rtw_br_ext.o
CC [M] drivers/net/wireless/rockchip_wlan/rtl8188eu/core/rtw_iol.o
drivers/net/wireless/rockchip_wlan/rtl8188eu/core/rtw_mlme.c: In function ‘rtw_drv_scan_by_self’:
drivers/net/wireless/rockchip_wlan/rtl8188eu/core/rtw_mlme.c:3127:17: warning: this ‘else’ clause does not guard… [-Wmisleading-indentation]
error, forbidden warning:rtw_mlme.c:3127
3127 | else
| ^~~~
drivers/net/wireless/rockchip_wlan/rtl8188eu/core/rtw_mlme.c:3130:25: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’
3130 | goto exit;
| ^~~~
make[5]: *** [scripts/Makefile.build:333: drivers/net/wireless/rockchip_wlan/rtl8188eu/core/rtw_mlme.o] Error 1
make[5]: *** Waiting for unfinished jobs…
CC [M] drivers/net/wireless/rockchip_wlan/rtl8188fu/core/rtw_chplan.o
drivers/net/wireless/rockchip_wlan/rtl8188eu/core/rtw_recv.c: In function ‘validate_mp_recv_frame’:
drivers/net/wireless/rockchip_wlan/rtl8188eu/core/rtw_recv.c:3547:25: warning: this ‘for’ clause does not guard… [-Wmisleading-indentation]
error, forbidden warning:rtw_recv.c:3547
3547 | for (i = 0; i < precv_frame->u.hdr.len; i = i + 8)
| ^~~
In file included from drivers/net/wireless/rockchip_wlan/rtl8188eu/include/drv_types.h:61,
from drivers/net/wireless/rockchip_wlan/rtl8188eu/core/rtw_recv.c:18:
drivers/net/wireless/rockchip_wlan/rtl8188eu/include/rtw_debug.h:138:9: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
138 | do {
| ^~
drivers/net/wireless/rockchip_wlan/rtl8188eu/core/rtw_recv.c:3550:33: note: in expansion of macro ‘RTW_INFO’
3550 | RTW_INFO("#############################\n");
| ^~~~~~~~
make[5]: *** [scripts/Makefile.build:333: drivers/net/wireless/rockchip_wlan/rtl8188eu/core/rtw_recv.o] Error 1
CC [M] drivers/net/wireless/rockchip_wlan/rtl8188fu/core/rtw_recv.o
CC [M] drivers/net/wireless/rockchip_wlan/rtl8188fu/core/rtw_sta_mgt.o
CC [M] drivers/net/wireless/rockchip_wlan/rtl8188fu/core/rtw_ap.o
drivers/net/wireless/rockchip_wlan/rtl8188fu/core/rtw_mlme.c: In function ‘rtw_drv_scan_by_self’:
drivers/net/wireless/rockchip_wlan/rtl8188fu/core/rtw_mlme.c:3127:17: warning: this ‘else’ clause does not guard… [-Wmisleading-indentation]
error, forbidden warning:rtw_mlme.c:3127
3127 | else
| ^~~~
drivers/net/wireless/rockchip_wlan/rtl8188fu/core/rtw_mlme.c:3130:25: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’
3130 | goto exit;
| ^~~~
make[5]: *** [scripts/Makefile.build:333: drivers/net/wireless/rockchip_wlan/rtl8188fu/core/rtw_mlme.o] Error 1
make[5]: *** Waiting for unfinished jobs…
CC [M] drivers/net/wireless/rockchip_wlan/rtl8822ce/core/rtw_recv.o
CC [M] drivers/net/wireless/rockchip_wlan/rtl8822ce/core/mesh/rtw_mesh_pathtbl.o
drivers/net/wireless/rockchip_wlan/rtl8822ce/core/rtw_mlme.c: In function ‘rtw_drv_scan_by_self’:
drivers/net/wireless/rockchip_wlan/rtl8822ce/core/rtw_mlme.c:3139:17: warning: this ‘else’ clause does not guard… [-Wmisleading-indentation]
error, forbidden warning:rtw_mlme.c:3139
3139 | else
| ^~~~
drivers/net/wireless/rockchip_wlan/rtl8822ce/core/rtw_mlme.c:3142:25: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’
3142 | goto exit;
| ^~~~
make[5]: *** [scripts/Makefile.build:333: drivers/net/wireless/rockchip_wlan/rtl8822ce/core/rtw_mlme.o] Error 1
make[5]: *** Waiting for unfinished jobs…
make[4]: *** [scripts/Makefile.build:637: drivers/net/wireless/rockchip_wlan/rtl8188eu] Error 2
make[4]: *** Waiting for unfinished jobs…
drivers/net/wireless/rockchip_wlan/rtl8188fu/core/rtw_recv.c: In function ‘validate_mp_recv_frame’:
drivers/net/wireless/rockchip_wlan/rtl8188fu/core/rtw_recv.c:3547:25: warning: this ‘for’ clause does not guard… [-Wmisleading-indentation]
error, forbidden warning:rtw_recv.c:3547
3547 | for (i = 0; i < precv_frame->u.hdr.len; i = i + 8)
| ^~~
In file included from drivers/net/wireless/rockchip_wlan/rtl8188fu/include/drv_types.h:61,
from drivers/net/wireless/rockchip_wlan/rtl8188fu/core/rtw_recv.c:18:
drivers/net/wireless/rockchip_wlan/rtl8188fu/include/rtw_debug.h:138:9: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
138 | do {
| ^~
drivers/net/wireless/rockchip_wlan/rtl8188fu/core/rtw_recv.c:3550:33: note: in expansion of macro ‘RTW_INFO’
3550 | RTW_INFO("#############################\n");
| ^~~~~~~~
make[5]: *** [scripts/Makefile.build:333: drivers/net/wireless/rockchip_wlan/rtl8188fu/core/rtw_recv.o] Error 1
drivers/net/wireless/rockchip_wlan/rtl8822ce/core/rtw_recv.c: In function ‘validate_mp_recv_frame’:
drivers/net/wireless/rockchip_wlan/rtl8822ce/core/rtw_recv.c:3558:25: warning: this ‘for’ clause does not guard… [-Wmisleading-indentation]
error, forbidden warning:rtw_recv.c:3558
3558 | for (i = 0; i < precv_frame->u.hdr.len; i = i + 8)
| ^~~
In file included from drivers/net/wireless/rockchip_wlan/rtl8822ce/include/drv_types.h:60,
from drivers/net/wireless/rockchip_wlan/rtl8822ce/core/rtw_recv.c:17:
drivers/net/wireless/rockchip_wlan/rtl8822ce/include/rtw_debug.h:137:9: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
137 | do {
| ^~
drivers/net/wireless/rockchip_wlan/rtl8822ce/core/rtw_recv.c:3561:33: note: in expansion of macro ‘RTW_INFO’
3561 | RTW_INFO("#############################\n");
| ^~~~~~~~
make[5]: *** [scripts/Makefile.build:333: drivers/net/wireless/rockchip_wlan/rtl8822ce/core/rtw_recv.o] Error 1
make[4]: *** [scripts/Makefile.build:637: drivers/net/wireless/rockchip_wlan/rtl8822ce] Error 2
make[4]: *** [scripts/Makefile.build:637: drivers/net/wireless/rockchip_wlan/rtl8188fu] Error 2
make[3]: *** [scripts/Makefile.build:637: drivers/net/wireless/rockchip_wlan] Error 2
make[2]: *** [scripts/Makefile.build:637: drivers/net/wireless] Error 2
make[1]: *** [scripts/Makefile.build:637: drivers/net] Error 2
make: *** [Makefile:1195: drivers] Error 2
MAKE KERNEL IMAGE FAILED.
root@U2004-IDE:~/419#

who can help me ?

@RadxaYuntian please help to look into this issue

I suggest you use our bsp tool to build kernel, which is how we create kernels and bootloaders for our released system. You can run ./bsp linux .rk356x-4.19 to build it. I just tested it and it worked for me.

You might also want to try out rbuild for full system image generation.

Thank you for your help. I’ll try!