解決方法:Ubuntu18.04下編譯OpenWRT15.05遇到的問題

一、問題1

執行
make V=99
報出錯誤:
Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/${ <-- HERE ([^ \t=:+{}]+)}/ at xxxx/usr/bin/automake line 3939

二、原因

從perl v5.22開始:不再推薦在正則表達式中使用 {,而且如果沒有轉義 { 會有錯誤警告,從v5.26開始:不僅有警告,還會有語法錯誤提示。
此爲Perl版本更新後對語法規範進行了變更,若左花括號作爲文本則應當進行轉義。

三、解決方法

openwrt 目錄下
cd build_dir/host/automake-1.15/bin/
vim automake
輸入/text =
找到$text =~ s/\${([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;
修改爲$text =~ s/\$[{]([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;

四、問題2

執行
make V=99
報出錯誤:
build_dir/host/u-boot-2014.10/lib/rsa/rsa-sign.c:279:21: error: dereferencing pointer to incomplete type 'RSA {aka struct rsa_st}'

五、原因

此爲Ubuntu18.04安裝的libssl-dev爲1.1版本,而OpenWrt 15.05.1不支持此版本,需要回退到1.0版本

六、解決方法

使用aptitude軟件包管理器
sudo apt-get install aptitude
卸載之前的版本
sudo aptitude remove libssl-dev
安裝1.0版本
apt-get install libssl1.0.0


• 由 Leung 寫於 2020 年 6 月 24 日

• 參考:UBUNTU 18.04下編譯OPENWRT 15.05.1遇到的問題和解決方案

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章