./config.status --recheck 而发现的error的根因与解决方案

这篇具有很好参考价值的文章主要介绍了./config.status --recheck 而发现的error的根因与解决方案。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

在做一嵌入式Linux内核编译环境移植,使用交叉编译工具链。有一段开源代码拷到Linux本机(Ubuntu 20.04),然后运行make(带有参数),并带选项 --trace, -d,为了输出更多的makefile中执行的内容和调试信息。发现如下错误:

Prerequisite 'configure' is newer than target 'config.status'.

   Must remake target 'config.status'.

Makefile:182: update target 'config.status' due to: configure

./config.status --recheck

Putting child 0x55cacecb8510 (config.status) PID 48814 on the chain.

Live child 0x55cacecb8510 (config.status) PID 48814

running /bin/sh ./configure  --build=i686-linux --host=mips-linux --libdir=/home/temp/fredli/Main_OI_b4_PQA/apps/public/lib --with-libssl=/home/temp/fredli/Main_OI_b4_PQA/apps/public/wget-1.11.2/ --with-libmatrixssl-prefix=/home/temp/fredli/Main_OI_b4_PQA/apps/public/wget-1.11.2/ --without-libintl-prefix --disable-digest --disable-ntlm --disable-largefile --disable-nls --disable-FEATURE --disable-opie CC=mips-linux-uclibc-gcc -mips32r2 -msoft-float build_alias=i686-linux host_alias=mips-linux  --no-create --no-recursion

configure: WARNING: unrecognized options: --with-libssl, --without-libintl-prefix, --disable-FEATURE

configure: configuring for GNU Wget 1.11.2

checking build system type... i686-pc-linux-gnu

checking host system type... mips-unknown-linux-gnu

checking whether make sets $(MAKE)... yes

checking for a BSD-compatible install... /usr/bin/install -c

checking for mips-linux-gcc... mips-linux-uclibc-gcc -mips32r2 -msoft-float

checking whether the C compiler works... no

configure: error: in `/home/minipc/econet/apps/public/wget-1.11.2':

configure: error: C compiler cannot create executables

See `config.log' for more details

Reaping losing child 0x55cacecb8510 PID 48814

make[1]: *** [Makefile:182: config.status] Error 77 

在解读这段输出之前,先梳理一下configure和config.status。

./config.status --recheck 而发现的error的根因与解决方案,Linux,linux,ubuntu,c语言,驱动开发简单来说,config.status是configure运行的一个产物,config.status也是可执行文件,运行后可以生成Makefile等文件。 configure在运行的时候会带有一些参数,这些参数是描述机器和系统类型,如--build=i386-linux,  --host=mips-linux, --CC=mips-linux-uclibc-gcc, 也就是编译的环境以及编译出的程序的运行环境。configure上次运行所带有的参数会作为option保存在config.status中。 

总结一下,configure负责检查系统,包括执行./configure命令时附带参数的可用性。config.status根据检查的结果来生成其他文件如Makefile, config.h等。

在上面的输出中,我们首先看到系统检测到configure文件比config.status还新,这是不合理的,因为config.status由configure运行产生。我查了一下文件日期,是一样的,都是我拷贝当时的时间,可能在拷贝过程中,config.status比configure早个几毫秒甚至更低。

那么因为系统判断configure要新于config.status,所以触发了

./config.status --recheck

这个命令将调用./configure,并带有上次执行该命令时的参数(即option,记录在config.status中)。从上面可以看到,这部分为:

--build=i686-linux --host=mips-linux --libdir=/home/temp/fredli/Main_OI_b4_PQA/apps/public/lib --with-libssl=/home/temp/fredli/Main_OI_b4_PQA/apps/public/wget-1.11.2/ --with-libmatrixssl-prefix=/home/temp/fredli/Main_OI_b4_PQA/apps/public/wget-1.11.2/ --without-libintl-prefix --disable-digest --disable-ntlm --disable-largefile --disable-nls --disable-FEATURE --disable-opie CC=mips-linux-uclibc-gcc -mips32r2 -msoft-float build_alias=i686-linux host_alias=mips-linux  --no-create --no-recursion

在执行这个过程中,如果出错,则./config.status退出,不更新。如果成功,则更新config.status中的内容,但是不会创建Makefile等文件(--no-create),也不会调用子目录里的configure(--no-recursion)。

但是,我们看到,在执行configure的check过程中出错,核心在这两条:

checking for mips-linux-gcc... mips-linux-uclibc-gcc -mips32r2 -msoft-float

checking whether the C compiler works... no

我们使用的交叉编译工具链,mips-linux-gcc, mips-linux-uclibc-gcc都不对。这可能是开源代码的历史遗留问题,所以需要Porting,需要修改为我们的目标交叉编译工具链。

用vim打开对应的config.status文件,可以看到多处有 mips-linux-uclibc-gcc。

304  ac_cs_version="\
 305 config.status
 306 configured by ./configure, generated by GNU Autoconf 2.59,
 307   with options \"'--build=i686-linux' '--host=mips-linux' '--libdir=/home/temp/fredli/Main_OI_b4_PQA/apps/public/lib' '--with-libssl     =/home/temp/fredli/Main_OI_b4_PQA/apps/public/wget-1.11.2/' '--with-libmatrixssl-prefix=/home/temp/fredli/Main_OI_b4_PQA/apps/public     /wget-1.11.2/' '--without-libintl-prefix' '--disable-digest' '--disable-ntlm' '--disable-largefile' '--disable-nls' '--disable-FEATU     RE' '--disable-opie' 'CC=mips-linux-uclibc-gcc -mips32r2 -msoft-float' 'build_alias=i686-linux' 'host_alias=mips-linux'\"

 385 if $ac_cs_recheck; then
 386   echo "running /bin/sh ./configure " '--build=i686-linux' '--host=mips-linux' '--libdir=/home/temp/fredli/Main_OI_b4_PQA/apps/publi     c/lib' '--with-libssl=/home/temp/fredli/Main_OI_b4_PQA/apps/public/wget-1.11.2/' '--with-libmatrixssl-prefix=/home/temp/fredli/Main_     OI_b4_PQA/apps/public/wget-1.11.2/' '--without-libintl-prefix' '--disable-digest' '--disable-ntlm' '--disable-largefile' '--disable-     nls' '--disable-FEATURE' '--disable-opie' 'CC=mips-linux-uclibc-gcc -mips32r2 -msoft-float' 'build_alias=i686-linux' 'host_alias=mip     s-linux' $ac_configure_extra_args " --no-create --no-recursion" >&6
 387   exec /bin/sh ./configure '--build=i686-linux' '--host=mips-linux' '--libdir=/home/temp/fredli/Main_OI_b4_PQA/apps/public/lib' '--w     ith-libssl=/home/temp/fredli/Main_OI_b4_PQA/apps/public/wget-1.11.2/' '--with-libmatrixssl-prefix=/home/temp/fredli/Main_OI_b4_PQA/a     pps/public/wget-1.11.2/' '--without-libintl-prefix' '--disable-digest' '--disable-ntlm' '--disable-largefile' '--disable-nls' '--dis     able-FEATURE' '--disable-opie' 'CC=mips-linux-uclibc-gcc -mips32r2 -msoft-float' 'build_alias=i686-linux' 'host_alias=mips-linux' $a     c_configure_extra_args --no-create --no-recursion
 388 fi

502 s,@CC@,mips-linux-uclibc-gcc -mips32r2 -msoft-float,;t t 

509 s,@CPP@,mips-linux-uclibc-gcc -mips32r2 -msoft-float -E,;t t 

把mips-linux-uclibc-gcc全部换成mipsel-buildroot-linux-gnu-gcc. 即在vim环境下,normal模式下,底部输入如下:

:%s/mips-linux-uclibc-gcc/mipsel-buildroot-linux-gnu-gcc/g

 回车,显示5处已替换。

5 substitutions on 5 lines

:wq 保存退出。 同时刷新configure文件,因为只有当configure文件比config.status新的时候,才会启动./config.status --recheck。但是其实configure文件不需要实质性修改,就是修改任一字符,然后恢复,再保存退出就是了。然后用ls -l查看时间,确保configure文件比config.status新。

再对整个工程运行make。输出如下:

295398    Must remake target 'config.status'.
295399 make[1]: Entering directory '/home/minipc/econet/apps/public/wget-1.11.2'
295400 Makefile:182: update target 'config.status' due to: configure
295401 ./config.status --recheck
295402 Putting child 0x55a4f95223a0 (config.status) PID 39126 on the chain.
295403 Live child 0x55a4f95223a0 (config.status) PID 39126
295404 running /bin/sh ./configure  --build=i686-linux --host=mips-linux --libdir=/home/temp/fredli/Main_OI_b4_PQA/apps/public/lib --with-libssl=/home/temp/fre       dli/Main_OI_b4_PQA/apps/public/wget-1.11.2/ --with-libmatrixssl-prefix=/home/temp/fredli/Main_OI_b4_PQA/apps/public/wget-1.11.2/ --without-libintl-prefi       x --disable-digest --disable-ntlm --disable-largefile --disable-nls --disable-FEATURE --disable-opie CC=mipsel-buildroot-linux-gnu-gcc -mips32r2 -msoft-       float build_alias=i686-linux host_alias=mips-linux  --no-create --no-recursion
295405 configure: WARNING: unrecognized options: --with-libssl, --without-libintl-prefix, --disable-FEATURE
295406 configure: configuring for GNU Wget 1.11.2
295407 checking build system type... i686-pc-linux-gnu
295408 checking host system type... mips-unknown-linux-gnu
295409 checking whether make sets $(MAKE)... yes
295410 checking for a BSD-compatible install... /usr/bin/install -c
295411 checking for mips-linux-gcc... mipsel-buildroot-linux-gnu-gcc -mips32r2 -msoft-float
295412 checking whether the C compiler works... yes
295413 checking for C compiler default output file name... a.out

可以看到这时候CC=mipsel-buildroot-linux-gnu-gcc, check通过。成功后,config.status自我更新,且由于Makefile比config.status老,所以,./config.status调用,产生Makefile等文件,包括其子目录。

295530 configure: creating ./config.status
295531 configure: WARNING: unrecognized options: --with-libssl, --without-libintl-prefix, --disable-FEATURE
295532 Reaping winning child 0x55a4f95223a0 PID 39126
295533 Removing child 0x55a4f95223a0 PID 39126 from chain.
295534    Successfully remade target file 'config.status'.
295535   Finished prerequisites of target file 'Makefile'.
295536   Prerequisite 'Makefile.in' is older than target 'Makefile'.
295537   Prerequisite 'config.status' is newer than target 'Makefile'.
295538  Must remake target 'Makefile'.
295539 Makefile:179: update target 'Makefile' due to: config.status
295540 ./config.status
295541 Putting child 0x55a4f95223a0 (Makefile) PID 41614 on the chain.
295542 Live child 0x55a4f95223a0 (Makefile) PID 41614
295543 config.status: creating Makefile
295544 config.status: WARNING:  'Makefile.in' seems to ignore the --datarootdir setting
295545 config.status: creating src/Makefile
295546 config.status: WARNING:  'src/Makefile.in' seems to ignore the --datarootdir setting
295547 config.status: creating doc/Makefile
295548 config.status: WARNING:  'doc/Makefile.in' seems to ignore the --datarootdir setting
295549 config.status: creating util/Makefile
295550 config.status: creating po/Makefile.in
295551 config.status: creating tests/Makefile
295552 config.status: WARNING:  'tests/Makefile.in' seems to ignore the --datarootdir setting
295553 config.status: creating tests/WgetTest.pm
295554 config.status: creating windows/Makefile
295555 config.status: creating stamp-h
295556 config.status: creating src/config.h
295557 config.status: executing default commands
295558 generating po/POTFILES from ./po/POTFILES.in
295559 creating po/Makefile
295560 Reaping winning child 0x55a4f95223a0 PID 41614
295561 Removing child 0x55a4f95223a0 PID 41614 from chain.
295562  Successfully remade target file 'Makefile'.

从这里可以看出,这个问题已经解决了。编译通过,相应的有着正确配置的文件生成。 文章来源地址https://www.toymoban.com/news/detail-705379.html

到了这里,关于./config.status --recheck 而发现的error的根因与解决方案的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • postman : “status“: 400, “error“: “Bad Request“,

    总结:去看数据库的数据类型对不对,长度够不够 我的postman报错了 原本以为是要把所有的都打一边即使是空的,但是把“id”:“”放入postman也是一样的400 后续找到一篇文章说可能是数据类型有问题,去看了一眼数据库,结果phone那列没有长度, “status“: 400, “error“: “

    2024年02月10日
    浏览(40)
  • ERROR: Error processing tar file(exit status 1): unexpected EOF

    问题 :在本地加载镜像的时候,输入\\\"sudo docker load -i rknn-toolkit2-1.2.0-cp36-docker.tar.gz\\\" 报错\\\"ERROR: Error processing tar file(exit status 1): unexpected EOF\\\" 解决办法 : 强烈推荐这篇文章的解决办法,这个博主写的很好的一篇文章,简单直接的解决问题。(侵权删) Docker使用的一些烂问题

    2024年02月13日
    浏览(49)
  • ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [126]]

    jenkins远程部署提示: ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [126]] 一、搜索网友的答案,说是执行的shell脚本没权限 查看shell脚本是775权限,索性改成了777权限,但是执行之后,还是报同样的错误 二、开启控制台详细日志,查看真正报错原因 开启后

    2024年02月07日
    浏览(32)
  • Error: Request failed with status code 500

    vue axios 出现Error: Request failed with status code 500。 这代表着服务器端无法获取参数。(post接口) 我的问题是,接口要求content-type: multipart/form-data。 但是我写的data:{.....}不符合样式,所以在data前 得加下面得代码然后就成功了

    2024年02月13日
    浏览(37)
  • SpringCloud Gateway:status: 503 error: Service Unavailable

    使用SpringCloud Gateway路由请求时,出现如下错误 yml配置如下: 可能的一种原因是:yml配置了gateway.discovery.locator.enabled=true,此时gateway会使用负载均衡模式路由请求,但是SpringCloud Alibaba删除了Ribbon的依赖,无法通过负载均衡路由到指定的微服务,因此出现503报错。需要在pom中手

    2024年02月12日
    浏览(27)
  • python入门:cl.exe‘ failed with exit status 2错误通用解决方案

    如标题所示的错误想必使用python的人都不陌生,但该问题的产生有多种情况,由于安装不同软件导致不同的后续错误,网络上的回答也是五花八门,因此这里有必要将这个简单问题写一篇文章。 error: Microsoft Visual C++ 14.0 or greater is required. Get it with \\\"Microsoft C++ Build Tools\\\": https:

    2024年02月13日
    浏览(34)
  • There was an unexpected error (type=Internal Server Error, status=500).

    There was an unexpected error (type=Internal Server Error, status=500). org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: “class path resource [templates/main.html]”) 这个错误原因在于模板上的有些数据异常导致的: 问题描述 在开发springboot的时候,进行modelAndView 视图层

    2024年02月09日
    浏览(43)
  • Postman报错 “status“: 415, “error“: “Unsupported Media Type“

    使用Postman 报错415 不支持报文格式,明显我们上送的不是Json格式,修改报文格式为Json即可 { “timestamp”: “2023-03-03T13:49:40.055+00:00”, “status”: 415, “error”: “Unsupported Media Type”, “message”: “”, “path”: “/user/save” } 在postman位置可以选择报文的格式,修改即可

    2024年02月12日
    浏览(100)
  • Springboot运行报错: “status“: 404, “error“: “Not Found“

    学习SpringBoot jdk版本:jdk-16.0.2 SpringBoot版本:2.7.0 PostMan版本:8.3.1 Idea版本:2021.2 电脑系统:win10 创建一个SpringBoot项目 编写一个Controller类 运行创建的SpringBoot项目,打开PostMan输入如下URL: http://localhost:8080/books/1 结果发现报错 报错信息如下: 解决方案如下: 发现将主方法所

    2024年02月12日
    浏览(33)
  • Postman报错 status: 500,error: Internal Server Error,数据无法通过json传入后端。

    原因:没有加@RequestBody注解 错误如下: {     \\\"timestamp\\\": \\\"2022-10-08T12:28:11.503+00:00\\\",     \\\"status\\\": 500,     \\\"error\\\": \\\"Internal Server Error\\\",     \\\"path\\\": \\\"/books\\\" } 测试数据: 控制台:   解决方法: 把要传入的book前面加入@RequestBody 而@RequestBody主要用来接收前端传递给后端的json字符

    2024年02月11日
    浏览(43)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包