最新消息:20190717 VPS服务器:Vultr新加坡,WordPress主题:大前端D8,统一介绍入口:关于

【已解决】Cygwin下交叉编译内核在配置时出错:scripts/kconfig/conf: scripts/kconfig/conf: cannot execute binary file

Cygwin crifan 1379浏览 0评论

【问题】

折腾:

折腾:

【记录】Cygwin下用arm-xscale-linux-gnueabi交叉编译Linux内核

期间,解决了:

【已解决】Cygwin下配置Linux内核出错:Makefile:419: *** mixed implicit and normal rules. Stop.

【已解决】Cygwin下用arm-xscale-linux-gnueabi交叉编译Linux内核在配置时出错:/bin/sh: scripts/basic/fixdep: cannot execute binary file

【已解决】Cygwin下用arm-xscale-linux-gnueabi交叉编译Linux内核在配置时出错:scripts/kconfig/conf.o:conf.c:(.text+0x1f): undefined reference to `libintl_gettext’ 

后,又出现错误:

CLi@PC-CLI-1 ~/develop/kernel/linux-2.6.19.1
$ make whgs_defconfig
  HOSTCC  scripts/basic/docproc
scripts/basic/docproc.c: In function ‘find_export_symbols’:
scripts/basic/docproc.c:188:5: warning: array subscript has type ‘char’ [-Wchar-subscripts]
scripts/basic/docproc.c:191:5: warning: array subscript has type ‘char’ [-Wchar-subscripts]
scripts/basic/docproc.c:197:5: warning: array subscript has type ‘char’ [-Wchar-subscripts]
scripts/basic/docproc.c:200:5: warning: array subscript has type ‘char’ [-Wchar-subscripts]
scripts/basic/docproc.c: In function ‘singfunc’:
scripts/basic/docproc.c:267:17: warning: array subscript has type ‘char’ [-Wchar-subscripts]
scripts/basic/docproc.c: In function ‘parse_file’:
scripts/basic/docproc.c:300:6: warning: array subscript has type ‘char’ [-Wchar-subscripts]
scripts/basic/docproc.c:305:6: warning: array subscript has type ‘char’ [-Wchar-subscripts]
scripts/basic/docproc.c:310:6: warning: array subscript has type ‘char’ [-Wchar-subscripts]
scripts/basic/docproc.c:316:6: warning: array subscript has type ‘char’ [-Wchar-subscripts]
scripts/basic/docproc.c:319:6: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf: scripts/kconfig/conf: cannot execute binary file
make[1]: *** [whgs_defconfig] Error 126
make: *** [whgs_defconfig] Error 2

如图:

scripts kconfig conf cannot execute binary file

【解决过程】

1.此问题,和之前的:

【已解决】Cygwin下用arm-xscale-linux-gnueabi交叉编译Linux内核在配置时出错:/bin/sh: scripts/basic/fixdep: cannot execute binary file

很类似。

所以,按照类似思路,去确认文件:

CLi@PC-CLI-1 ~/develop/kernel/linux-2.6.19.1
$ ls scripts/kconfig/conf* -lha
-rwxr-xr-x 1 CLi Domänen-Benutzer  75K Nov  7  2012 scripts/kconfig/conf*
-rw-r--r-- 1 CLi Domänen-Benutzer  12K Oct 17  2012 scripts/kconfig/conf.c
-rwxr-xr-x 1 CLi Domänen-Benutzer 135K Aug 22 17:56 scripts/kconfig/conf.exe*
-rw-r--r-- 1 CLi Domänen-Benutzer  12K Aug 22 17:47 scripts/kconfig/conf.o
-rw-r--r-- 1 CLi Domänen-Benutzer  17K Oct 17  2012 scripts/kconfig/confdata.c

CLi@PC-CLI-1 ~/develop/kernel/linux-2.6.19.1
$ file scripts/kconfig/conf
scripts/kconfig/conf: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped

CLi@PC-CLI-1 ~/develop/kernel/linux-2.6.19.1
$ file scripts/kconfig/conf.exe
scripts/kconfig/conf.exe: PE32 executable (console) Intel 80386, for MS Windows

2.并且改名:

CLi@PC-CLI-1 ~/develop/kernel/linux-2.6.19.1
$ mv scripts/kconfig/conf.exe scripts/kconfig/conf.exe_backup

CLi@PC-CLI-1 ~/develop/kernel/linux-2.6.19.1
$ mv scripts/kconfig/conf scripts/kconfig/conf_backup

CLi@PC-CLI-1 ~/develop/kernel/linux-2.6.19.1
$ cp scripts/kconfig/conf.exe_backup scripts/kconfig/conf

CLi@PC-CLI-1 ~/develop/kernel/linux-2.6.19.1
$ ls scripts/kconfig/conf* -lha
-rwxr-xr-x 1 CLi Domänen-Benutzer 135K Aug 22 18:07 scripts/kconfig/conf*
-rw-r--r-- 1 CLi Domänen-Benutzer  12K Oct 17  2012 scripts/kconfig/conf.c
-rwxr-xr-x 1 CLi Domänen-Benutzer 135K Aug 22 17:56 scripts/kconfig/conf.exe_backup*
-rw-r--r-- 1 CLi Domänen-Benutzer  12K Aug 22 17:47 scripts/kconfig/conf.o
-rwxr-xr-x 1 CLi Domänen-Benutzer  75K Nov  7  2012 scripts/kconfig/conf_backup*
-rw-r--r-- 1 CLi Domänen-Benutzer  17K Oct 17  2012 scripts/kconfig/confdata.c

CLi@PC-CLI-1 ~/develop/kernel/linux-2.6.19.1
$ file scripts/kconfig/conf
scripts/kconfig/conf: PE32 executable (console) Intel 80386, for MS Windows

3.然后再去运行试试,然后就可以通过conf部分了:

has passed the conf can continue to config

 

【总结】

此处,当Cygwin下,交叉编译时配置出现:

scripts/kconfig/conf: scripts/kconfig/conf: cannot execute binary file

的错误时,原因是:

虽然之前,已经通过加上-lintl,而使得conf.c正常编译,生成了对应的conf,但是其是

for GNU/Linux 2.6.9

的,所以:

如果是普通的Linux下,是正常的,可以正常运行。

但是在此Cygwin下,是无法运行的。

解决办法是:

但是由于此处另外还编译出来一个conf.exe,是可以在cygwin下运行的,

所以把conf.exe改为conf,即可。

当然,可以先备份再改名:

mv scripts/kconfig/conf.exe scripts/kconfig/conf.exe_backup
mv scripts/kconfig/conf scripts/kconfig/conf_backup
cp scripts/kconfig/conf.exe_backup scripts/kconfig/conf

即可。

转载请注明:在路上 » 【已解决】Cygwin下交叉编译内核在配置时出错:scripts/kconfig/conf: scripts/kconfig/conf: cannot execute binary file

与本文相关的文章

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
57 queries in 0.092 seconds, using 19.03MB memory