0
  • 聊天消息
  • 系統(tǒng)消息
  • 評(píng)論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學(xué)習(xí)在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會(huì)員中心
創(chuàng)作中心

完善資料讓更多小伙伴認(rèn)識(shí)你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示

編譯OpenWRT出錯(cuò)m4如何解決呢?

嵌入式加油站 ? 來源:嵌入式加油站 ? 2023-07-14 10:35 ? 次閱讀

編譯m4-1.4.17庫時(shí)出現(xiàn)關(guān)于 freadahead.c中編譯錯(cuò)誤

現(xiàn)象

出錯(cuò)提示如下 :

freadahead.c: In function 'freadahead':
freadahead.c3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
91 |#error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
.........
make[1]: *** [tools/Makefile /home/fan/openwrt_CC_mt76xx_zhuotk_source/staging_dir/target-mipsel_mips32_uClibc-0.9.33.2/stamp/.tools_install_yynyynynynyyyyyyyyynyyyyyyyyynyyyyynnyyynnyynnnyy] Error 2
make[1]: Leaving directory '/home/fan/openwrt_CC_mt76xx_zhuotk_source'
make: *** [/home/fan/openwrt_CC_mt76xx_zhuotk_source/include/toplevel.mk world] Error 2

解決方法
進(jìn)入文件夾
/buildroot/output/build/host-m4-1.4.17
cd build_dir/host/m4-1.4.17/
輸入命令:
sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h
#error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib

編譯findutils-4.4.2時(shí) 同樣有freadahead.c文件錯(cuò)誤

現(xiàn)象
出錯(cuò)提示如下:
freadahead.c: In function 'freadahead':
freadahead.c3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread on your system, then report this to bug-gnulib."
#error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread on your
^
make[8]: *** [Makefile freadahead.o] Error 1
make[8]: Leaving directory '/home/fan/openwrt_CC_mt76xx_omj_source/build_dir/host/findutils-4.4.2/gnulib/lib'
make[7]: *** [Makefile all] Error 2
make[7]: Leaving directory '/home/fan/openwrt_CC_mt76xx_omj_source/build_dir/host/findutils-4.4.2/gnulib/lib'
make[6]: *** [Makefile all-recursive] Error 1
make[6]: Leaving directory '/home/fan/openwrt_CC_mt76xx_omj_source/build_dir/host/findutils-4.4.2/gnulib'
make[5]: *** [Makefile all-recursive] Error 1
make[5]: Leaving directory '/home/fan/openwrt_CC_mt76xx_omj_source/build_dir/host/findutils-4.4.2'
make[4]: *** [Makefile all] Error 2
make[4]: Leaving directory '/home/fan/openwrt_CC_mt76xx_omj_source/build_dir/host/findutils-4.4.2'
make[3]: *** [Makefile /home/fan/openwrt_CC_mt76xx_omj_source/build_dir/host/findutils-4.4.2/.built] Error 2
make[3]: Leaving directory '/home/fan/openwrt_CC_mt76xx_omj_source/tools/findutils'
make[2]: *** [tools/Makefile tools/findutils/compile] Error 2
make[2]: Leaving directory '/home/fan/openwrt_CC_mt76xx_omj_source'
make[1]: *** [tools/Makefile /home/fan/openwrt_CC_mt76xx_omj_source/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/stamp/.tools_install_yynyynynynyyyyyyyyynyyyyyyyyynyyyyynnyyynnyynnnyy] Error 2
make[1]: Leaving directory '/home/fan/openwrt_CC_mt76xx_omj_source'
make: *** [/home/fan/openwrt_CC_mt76xx_omj_source/include/toplevel.mk world] Error 2

解決方法
cd build_dir/host/findutils-4.4.2
sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h
sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' gnulib/lib/*.c
echo "#define _IO_IN_BACKUP 0x100" >> gnulib/lib/stdio-impl.h
echo "#define _IO_ferror_unlocked" >> gnulib/lib/stdio-impl.h
sed -i '/unistd/a #include ' gnulib/lib/mountlist.c
問題依然
findutils-4.6.0替換findutils-4.4.2
切換到dl目錄
cd dl
下載findutils-4.6.0
wgethttps://mirrors.aliyun.com/gnu/findutils/findutils-4.6.0.tar.gz
獲取findutils-4.6.0.tar.gz的md5碼
md5sum findutils-4.6.0.tar.gz
9936aa8009438ce185bea2694a997fc1findutils-4.6.0.tar.gz
修改Makefile
cd ../tools/findutils/
vim Makefile
#
# Copyright (C) 2006-2013 OpenWrt.org
...
# Vsersion
PKG_VERSION:=4.6.0

.....
# PKG_MD5
PKG_MD5SUM:=9936aa8009438ce185bea2694a997fc1
.....
刪除patch
21-Fix-time_t-vs-long-int-mismatches.patch(此文件在4.4.x需要, 4.6.x已經(jīng)修復(fù)了此bug所以不需要了)
rm -f patches/21-Fix-time_t-vs-long-int-mismatches.patch
切換目錄
cd ../../build_dir/host/findutils-4.6.0
維修源碼, 運(yùn)行以下命令:
sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h
sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' gl/lib/*.c
echo "#define _IO_IN_BACKUP 0x100" >> gl/lib/stdio-impl.h
sed -i '/unistd/a #include ' gl/lib/mountlist.c

重新編譯,此問題消除




審核編輯:劉清

聲明:本文內(nèi)容及配圖由入駐作者撰寫或者入駐合作網(wǎng)站授權(quán)轉(zhuǎn)載。文章觀點(diǎn)僅代表作者本人,不代表電子發(fā)燒友網(wǎng)立場(chǎng)。文章及其配圖僅供工程師學(xué)習(xí)之用,如有內(nèi)容侵權(quán)或者其他違規(guī)問題,請(qǐng)聯(lián)系本站處理。 舉報(bào)投訴
  • OpenWrt
    +關(guān)注

    關(guān)注

    10

    文章

    122

    瀏覽量

    39151

原文標(biāo)題:【openwrt】編譯OpenWRT 出錯(cuò)m4和findutils庫 freadahead.c文件錯(cuò)誤

文章出處:【微信號(hào):嵌入式加油站,微信公眾號(hào):嵌入式加油站】歡迎添加關(guān)注!文章轉(zhuǎn)載請(qǐng)注明出處。

收藏 人收藏

    評(píng)論

    相關(guān)推薦

    【NetRouter試用體驗(yàn)】四、openwrt學(xué)習(xí)——編譯出錯(cuò)求助

    下一步準(zhǔn)備在NetRouter安裝openwrt系統(tǒng),安裝前當(dāng)然要學(xué)者編譯openwrt固件啦,可是固件編譯遇到了問題,找了好久也沒發(fā)現(xiàn)問題。請(qǐng)老司機(jī)指條明路。。。在ubuntu10.
    發(fā)表于 03-19 20:07

    M4推薦用哪一種編譯器?

    對(duì)于M4來說TI推薦用哪一種編譯器呀?我用IAR編譯器6.5(破解的),總是發(fā)現(xiàn)很多控制外圍設(shè)備和自己想的不用一樣?
    發(fā)表于 04-08 09:36

    請(qǐng)問Nu Micro?Cortex-M0/M4系列如何解鎖用戶配置字上的鎖位?

    Nu Micro?Cortex-M0/M4系列如何解鎖用戶配置字上的鎖位
    發(fā)表于 11-25 07:41

    請(qǐng)問如何使用NuvotonM0/M23Keil許可證版本編譯M4系列?

    如何使用NuvotonM0/M23Keil許可證版本編譯M4系列?
    發(fā)表于 12-29 07:57

    請(qǐng)問如何解決IBM服務(wù)器X3650 M4不能開機(jī)的問題?

    請(qǐng)問如何解決IBM服務(wù)器X3650 M4不能開機(jī)的問題?
    發(fā)表于 11-01 07:18

    何解決esphome upload固件編譯出錯(cuò)的問題

    編譯esphome upload固件到nodemcu板子上發(fā)生崩潰是怎樣回事?如何解決esphome upload固件編譯出錯(cuò)的問題?
    發(fā)表于 02-15 06:08

    Cortex-M0/M4芯片是否支持代碼保護(hù)用戶的程序代碼嗎?

    NuMicro? Cortex-M0/M4芯片是否支持代碼保護(hù)用戶的程序代碼嗎?如何解開LOCK位上的用戶配置字?
    發(fā)表于 06-19 06:02

    編譯M4系列可以使用Nuvoton M0 / M23凱爾許可版本嗎?

    M0/M23 Keil 許可證版本已經(jīng)注冊(cè)。 如果您打開 M4 工程并將其編譯, 將會(huì)出現(xiàn)以下編譯錯(cuò)誤信息 。 Please open t
    發(fā)表于 08-28 08:19

    Cortex_M3與M4權(quán)威指南_部分2

    cortex M3與M4權(quán)威指南,英文版
    發(fā)表于 03-09 10:28 ?0次下載

    瑞風(fēng)M4怎么樣?瑞風(fēng)M4的全面配置參數(shù)及圖片

    隨著市場(chǎng)的發(fā)展,消費(fèi)者對(duì)于商務(wù)MPV的需求更加旺盛,作為國內(nèi)最大MPV廠商之一的江淮也對(duì)服役多年的瑞風(fēng)商務(wù)車進(jìn)行了更新?lián)Q代,瑞風(fēng)M4應(yīng)運(yùn)而生。在顏值方面,采用了最新家族式設(shè)計(jì)的瑞風(fēng)M4顯得更加大氣,商務(wù)氣息也更加濃厚。
    發(fā)表于 07-21 17:03 ?3902次閱讀

    新手三天入門M4

    新手三天入門M4
    發(fā)表于 10-09 11:24 ?27次下載
    新手三天入門<b class='flag-5'>M4</b>

    TI中M4中的SIMD講解

    經(jīng)常有朋友在看到M4的特性后會(huì)問到底什么是SIMD,簡(jiǎn)單講,SIMD就是單指令多數(shù)據(jù)(Single Instruction Multiple Data)的縮寫。這套東西最早是并行計(jì)算機(jī)使用的,現(xiàn)在
    發(fā)表于 05-04 08:38 ?6次下載
    TI中<b class='flag-5'>M4</b>中的SIMD講解

    Cortex內(nèi)核的比較(M3和M4

    **Cortex內(nèi)核的比較(M3和M4)** 一、開發(fā)板資源描述    
    發(fā)表于 12-01 13:06 ?20次下載
    Cortex內(nèi)核的比較(<b class='flag-5'>M</b>3和<b class='flag-5'>M4</b>)

    TI M4(Cortex M4) MCU DMA 操作

    Cortex M4 DMA 操作Cortex M4 DMA 操作本文記錄了對(duì) TI M4C129 MCU 的 DMA操作,使用了串口UART1(DMA)與上位機(jī)PC軟件的數(shù)據(jù)收發(fā)。MCU 的串口接收
    發(fā)表于 12-28 19:18 ?11次下載
    TI <b class='flag-5'>M4</b>(Cortex <b class='flag-5'>M4</b>) MCU DMA 操作

    蘋果或于今秋推出搭載M4芯片的MacBook Pro與Mac Mini

    古爾曼預(yù)測(cè),配備M4芯片的14英寸MacBook Pro、M4 Pro與M4 Max芯片的14英寸至16英寸MacBook Pro以及M4M4
    的頭像 發(fā)表于 05-14 11:04 ?1004次閱讀