您尚未登录。

楼主 #1 2019-12-19 09:47:46

Sam
会员
注册时间: 2019-12-06
已发帖子: 55
积分: 55

Linux内核编译遇到<stdin>:error:missing ')'after "defined"

Linux 编译内核时遇到一大堆问题,劳烦大神们指点,新手一名:

/bin/sh: 1: [: -lt: unexpected operator
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/bounds.h
  CHK     scripts/mod/devicetable-offsets.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
<stdin>:239:24: error: missing ')' after "defined"
<stdin>:242:2: warning: #warning syscall break [-Wcpp]
<stdin>:284:23: error: missing ')' after "defined"
<stdin>:287:2: warning: #warning syscall stty [-Wcpp]
<stdin>:290:23: error: missing ')' after "defined"
<stdin>:293:2: warning: #warning syscall gtty [-Wcpp]
<stdin>:302:24: error: missing ')' after "defined"
<stdin>:305:2: warning: #warning syscall ftime [-Wcpp]
<stdin>:332:23: error: missing ')' after "defined"
<stdin>:335:2: warning: #warning syscall prof [-Wcpp]
<stdin>:362:23: error: missing ')' after "defined"
<stdin>:365:2: warning: #warning syscall lock [-Wcpp]
<stdin>:374:22: error: missing ')' after "defined"
<stdin>:377:2: warning: #warning syscall mpx [-Wcpp]
<stdin>:383:25: error: missing ')' after "defined"
<stdin>:386:2: warning: #warning syscall ulimit [-Wcpp]
<stdin>:506:25: error: missing ')' after "defined"
<stdin>:509:2: warning: #warning syscall profil [-Wcpp]
<stdin>:551:23: error: missing ')' after "defined"
<stdin>:554:2: warning: #warning syscall idle [-Wcpp]
<stdin>:599:32: error: missing ')' after "defined"
<stdin>:602:2: warning: #warning syscall create_module [-Wcpp]
<stdin>:611:34: error: missing ')' after "defined"
<stdin>:614:2: warning: #warning syscall get_kernel_syms [-Wcpp]
<stdin>:635:30: error: missing ')' after "defined"
<stdin>:638:2: warning: #warning syscall afs_syscall [-Wcpp]
<stdin>:728:31: error: missing ')' after "defined"
<stdin>:731:2: warning: #warning syscall query_module [-Wcpp]
<stdin>:737:29: error: missing ')' after "defined"
<stdin>:740:2: warning: #warning syscall nfsservctl [-Wcpp]
<stdin>:797:26: error: missing ')' after "defined"
<stdin>:800:2: warning: #warning syscall getpmsg [-Wcpp]
<stdin>:803:26: error: missing ')' after "defined"
<stdin>:806:2: warning: #warning syscall putpmsg [-Wcpp]
<stdin>:1049:26: error: missing ')' after "defined"
<stdin>:1052:2: warning: #warning syscall vserver [-Wcpp]
Kbuild:72: recipe for target 'missing-syscalls' failed
make[1]: *** [missing-syscalls] Error 1
Makefile:1063: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2

最近编辑记录 Sam (2019-12-19 09:50:20)

离线

楼主 #3 2019-12-19 10:15:16

Sam
会员
注册时间: 2019-12-06
已发帖子: 55
积分: 55

Re: Linux内核编译遇到<stdin>:error:missing ')'after "defined"

Ubuntu 16.04 LTS

离线

楼主 #4 2020-01-09 23:36:16

Sam
会员
注册时间: 2019-12-06
已发帖子: 55
积分: 55

Re: Linux内核编译遇到<stdin>:error:missing ')'after "defined"

经过几天的摸索,不知哪里原因,猜测也该是虚拟机git指令下载源码时有损坏,后直接在windows下github上下载压缩包顺利编译通过。后又发现buildrootfs时,编译的根文件系统出奇的大,接近100M,后下载了最新buildroot,重新仔细对比了@晕哥提供的.config,取消了一些选项(新手一名,比较随意),终于弄成8M了,现已成功启动,真是万幸!!!

分享喜悦心情的同时,再分享一小技能——f1c200s 下zmodem串口传输文件,免去总去sunxi-fel 根文件系统:
1.下载源码
   https://ohse.de/uwe/software/lrzsz.html
2.linux 下解压
   tar zxvf lrzsz-0.12.20.tar.gz
3.配置工具
  CC=arm-none-linux-gnueabi-gcc CFLAGS=-O2 ./configure
4.编译
  make
5.生成的文件在源文件src下
  cd src
  ll
  显示如下(部分),其中lrz和lsz是需要的
-rwxrwxr-x 1  sam 80646 Jan  9 06:33 lrz*
-rw-r--r-- 1 sam 55590 Dec 29  1998 lrz.c
-rw-rw-r-- 1sam 41976 Jan  9 06:33 lrz.o
-rw-rw-r-- 1sam  6166 Jan  9 06:33 lrzszbug
-rwxr-xr-x 1 sam  6172 Apr 26  1998 lrzszbug.in*
-rw-r--r-- 1 sam  1968 Dec 29  1998 lsyslog.c
-rw-rw-r-- 1 sam  1948 Jan  9 06:33 lsyslog.o
-rwxrwxr-x 1 sam 85538 Jan  9 06:33 lsz*
6.copy lrz和lsz 到根文件目录下的usr/sbin
sudo cp lrz ../ rootfs/usr/sbin
sudo cp lsz ../ rootfs/usr/sbin
7.制作根文件系统镜像
  mkfs.jffs2 -s 0x100 -e 0x10000 --pad=0xAF0000 -d rootfs/ -o jffs2.img
8.烧录根文件系统
  sunxi-fel -p spiflash-write 0x510000 jffs2.bin
9.实验:
  ?# lrz
  lrz waiting to receive.
  ¿ª' zmodem ´«?¡£  °´ Ctrl+C ??¡£
  Transferring zmodemTest.txt...
  100%      15 bytes   15 bytes/s 00:00:01       0 Errors

  ?# ls
  zmodemTest.txt
# touch dello.txt
# vi dello.txt
# lsz dello.txt
¿ª' zmodem ´«?¡£  °´ Ctrl+C ??¡£
Transferring dello.txt...
  100%       9 bytes    9 bytes/s 00:00:01       0 Errors

乱码是工具问题哦^^

最近编辑记录 Sam (2020-01-09 23:37:19)

离线

楼主 #5 2020-01-10 11:39:44

Sam
会员
注册时间: 2019-12-06
已发帖子: 55
积分: 55

Re: Linux内核编译遇到<stdin>:error:missing ')'after "defined"

刚学会插图,补一张试试^^
FluxBB bbcode

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn