在我的系統上編譯某些東西(使用bfin-linux-uclibc-g++
但不相關)時,我得到了數百個關於其中一個編譯器標誌的警告(不在我自己的代碼庫中)。我想禁用它。如何推翻默認的gcc選項到鏈接器?
fde encoding in src/SpiMessageUtil.o(.eh_frame) prevents .eh_frame_hdr table being created.
這從被移交給連接默認的gcc標誌,這是很容易通過增加'-v'
到編譯步驟來檢查orginates:
COLLECT_GCC_OPTIONS=... --eh-frame-hdr ...
我想擺脫這種選項,這確實是默認定義的:
bfin-linux-uclibc-g++ -dumpspecs | grep frame-hdr
%{!static:--eh-frame-hdr}\
%{mfdpic: -m elf32bfinfd -z text} %{shared} %{pie} \
%{static:-dn -Bstatic} %{shared:-G -Bdynamic} \
%{!shared: %{!static: %{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker \
%{mglibc:%{muclibc:%e-mglibc and -muclibc used together;:%e-mglibc not supported for this target};:/lib/ld-uClibc.so.0 \
}}}\
%{static}} -init __init -fini __fini
如何覆蓋此選項?我不能使用-Wl,--no-eh-frame-hdr
,因爲沒有像定義的那樣。
我通過此禁用的選項:'strace的/選擇/ uClinux的/ BFIN-Linux的uClibc的/ bin中/ BFIN-Linux的uClibc的-GCC 2>&1 | grep -i spec',轉到這些目錄之一,'bfin-linux-uclibc-g ++ -dumpspecs> specs'並手動更新那裏的specs文件。雖然看起來很醜。刪除標誌並沒有擺脫警告,但似乎是一個錯誤(參見2013年1月22日的補丁):http://sourceware.org/ml/binutils/2013-01/msg00333.html。這確實是你應該怎麼做,或者有更美麗的方式? –