本篇內(nèi)容介紹了“編譯glibc遇到的錯(cuò)誤 Error: invalid identifier for ".ifdef"怎么解決”的有關(guān)知識(shí),在實(shí)際案例的操作過程中,不少人都會(huì)遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!

創(chuàng)新互聯(lián)專注于崇左網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗(yàn)。 熱誠為您提供崇左營銷型網(wǎng)站建設(shè),崇左網(wǎng)站制作、崇左網(wǎng)頁設(shè)計(jì)、崇左網(wǎng)站官網(wǎng)定制、微信平臺(tái)小程序開發(fā)服務(wù),打造崇左網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供崇左網(wǎng)站排名全網(wǎng)營銷落地服務(wù)。
由于CentOS6系統(tǒng)默認(rèn)的glibc版本較低,在嘗試編譯升級(jí)時(shí)遇到了Error: invalid identifier for ".ifdef",在此記錄解決方案。
官網(wǎng)下載:ftp://ftp.gnu.org/gnu/glibc/
wget http://ftp.gnu.org/gnu/glibc/glibc-2.15.tar.gz wget http://ftp.gnu.org/gnu/glibc/glibc-ports-2.15.tar.gz tar -zxf glibc-2.15.tar.gz tar -zxf glibc-ports-2.15.tar.gz mv glibc-ports-2.15 glibc-2.15/ports mkdir glibc-build-2.15 cd glibc-build-2.15 ../glibc-2.15/configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin make all && make install
sysdeps/i386/fpu/s_frexp.S:66: Error: invalid identifier for ".ifdef"
在glibc源碼目錄下找到文件 nptl/sysdeps/pthread/pt-initfini.c,約在46行左右:asm ("\n#include \"defs.h\"");
在其后增加代碼:
asm ("\n#if defined __i686 && defined __ASSEMBLER__");
asm ("\n#undef __i686");
asm ("\n#define __i686 __i686");
asm ("\n#endif");在glibc源碼目錄下找到文件 sysdeps/unix/sysv/linux/i386/sysdep.h ,約在30行左右:#include <tls.h>
在其后增加代碼:
#if defined __i686 && defined __ASSEMBLER__ #undef __i686 #define __i686 __i686 #endif
make all && make install
ldd --version
如下則成功安裝
ldd (GNU libc) 2.15 Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Roland McGrath and Ulrich Drepper.
“編譯glibc遇到的錯(cuò)誤 Error: invalid identifier for ".ifdef"怎么解決”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識(shí)可以關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!
網(wǎng)頁名稱:編譯glibc遇到的錯(cuò)誤Error:invalididentifierfor".ifdef"怎么解決
網(wǎng)頁地址:http://chinadenli.net/article24/jigjce.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供搜索引擎優(yōu)化、、網(wǎng)站排名、網(wǎng)站策劃、手機(jī)網(wǎng)站建設(shè)、網(wǎng)站改版
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)