日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

openwrt编译qca驱动不成功。gcc -isystem问题。

發(fā)布時間:2023/12/9 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 openwrt编译qca驱动不成功。gcc -isystem问题。 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.


在最新openwrt里移植qca驅(qū)動發(fā)現(xiàn),編譯不成功,錯誤如正下:

GNU C (OpenWrt/Linaro GCC 4.8-2014.04 unknown) version 4.8.3 (mips-openwrt-linux-uclibc)compiled by GNU C version 4.4.7 20120313 (Red Hat 4.4.7-16), GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.2 GGC heuristics: --param ggc-min-expand=97 --param ggc-min-heapsize=126544 Compiler executable checksum: 7a8d9c3fb361f26d926f81803aa9b56a GNU assembler version 2.24.0 (mips-openwrt-linux-uclibc) using BFD version (GNU Binutils) 2.24.0 In file included from ./arch/mips/include/asm/page.h:15:0,from /mnt/openwrt-jinbao/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/qca-wifi-g-perf/qca-wifi-g/os/linux/ath_hal/../../../include/compat.h:109,from <command-line>:0: ./arch/mips/include/asm/mipsregs.h:769:33: error: unknown type name 'u16'static inline int mm_insn_16bit(u16 insn)
在EXTRA_FLAGS上增加 -v -H,打印出頭文件查找過程。則日志如下:

GNU C (OpenWrt/Linaro GCC 4.8-2014.04 unknown) version 4.8.3 (mips-openwrt-linux-uclibc)compiled by GNU C version 4.4.7 20120313 (Red Hat 4.4.7-16), GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.2 GGC heuristics: --param ggc-min-expand=97 --param ggc-min-heapsize=126544 ignoring duplicate directory "include"as it is a non-system directory that duplicates a system directory

as it is a non-system directory that duplicates a system directory #include "..." search starts here: #include <...> search starts here:./arch/mips/includearch/mips/include/generated./arch/mips/include/uapiarch/mips/include/generated/uapi./include/uapiinclude/generated/uapi./arch/mips/include/asm/mach-ath79./arch/mips/include/asm/mach-generic

自己寫了一個hello程序?qū)iT用于編譯測試,則:

?

compiled by GNU C version 4.4.7 20120313 (Red Hat 4.4.7-16), GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.2 GGC heuristics: --param ggc-min-expand=97 --param ggc-min-heapsize=126544 #include "..." search starts here: #include <...> search starts here:./arch/mips/includearch/mips/include/generated <strong> include</strong>./arch/mips/include/uapiarch/mips/include/generated/uapi./include/uapiinclude/generated/uapi./arch/mips/include/asm/mach-ath79./arch/mips/include/asm/mach-generic/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/usr/include End of search list.
兩者對比可知,在編譯qca時,有“include”目錄與另一個東東重復(fù)了,并忽略掉了它,這樣在查找<linux/types.h>時就找到了uapi/linux里,最后則u16沒有定義。

日志已經(jīng)說的很明白了。gcc參數(shù)里有修改系統(tǒng)目錄的地方。在一個makefile找到了isystem ?DIR。這個 DIR正好是/xxx/linuxkernel/include,這樣就造成了重復(fù)。

gcc的參數(shù) -isystem dir

If a standard system include directory, or a directory specified with-isystem, is also specified with-I, the -Ioption is ignored. The directory is still searched but as asystem directory at its normal position in the system include chain. This is to ensure that GCC's procedure to fix buggy system headers andthe ordering for theinclude_next directive are not inadvertently changed. If you really need to change the search order for system directories,use the-nostdinc and/or -isystem options.?

某目錄如果是標準系統(tǒng)include目錄,或它由-isystem指定了,而它也被 gcc -I指定了,則gcc會忽略此條-I項。作為系統(tǒng)目錄,這個目錄仍會被搜查(按它在系統(tǒng)inlcude鏈的優(yōu)先級位置處被搜查)這可能確保GCC 程序解決各種古怪的系統(tǒng)頭文件并且設(shè)定include指令是被明確修改的。如果你真想修改頭文件系統(tǒng)目錄,則可以使用-nostdinc and/or-isystem。

在 使用-isystem dir時,如果dir 是原有系統(tǒng)目錄之一,則就造成了重復(fù),那GCC就認為你是在修改系統(tǒng)目錄鏈上優(yōu)先級位置。它會忽略之前的位置,把dir安排到鏈的尾部。


總結(jié)

以上是生活随笔為你收集整理的openwrt编译qca驱动不成功。gcc -isystem问题。的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。