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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux安装gcc运行时库,Linux安装gcc-6.1.0

發布時間:2025/3/12 linux 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux安装gcc运行时库,Linux安装gcc-6.1.0 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

獲取gcc源碼包

# wget https://ftp.gnu.org/gnu/gcc/gcc-6.1.0/gcc-6.1.0.tar.bz2

# tar -jxvf gcc-6.1.0.tar.bz2

下載依賴項

執行download_prerequisites將會自動下載這些軟件并解壓到當前目錄,生成gcc編譯的make文件。自動安裝gcc需要下載諸如gmp、mpfr、mpc等依賴文件:

# cd gcc-6.1.0

# ./contrib/download_prerequisites

如果你的Linux無法直接聯網,那么你只能打開文件download_prerequisites,獲取到這些文件的下載鏈接,然后通過其他上網設備下載這些軟件。最后把這些軟件直接解壓到gcc源程序目錄(/路徑/6.1.0)下即可。

編譯安裝

# mkdir gcc-build

# cd gcc-build

# ../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib

# make

# make install

注意make的-j選項可以指定同時運行的作業數量,即CPU核數,如果有4核則可以加上-j4

出錯解決

1.make過程中可能會出現以下錯誤信息:

build/genattrtab ../.././gcc/config/i386/i386.md insn-conditions.md \

-Atmp-attrtab.c -Dtmp-dfatab.c -Ltmp-latencytab.c

make[3]: *** [s-attrtab] Killed

make[3]: Leaving directory `/usr/src/gcc-4.9.2/host-x86_64-unknown-linux-gnu/gcc'

make[2]: *** [all-stage1-gcc] Error 2

make[2]: Leaving directory `/usr/src/gcc-4.9.2'

make[1]: *** [stage1-bubble] Error 2

make[1]: Leaving directory `/usr/src/gcc-4.9.2'

make: *** [all] Error 2

2.動態庫libstdc++.so.6版本不匹配

可以正常編譯程序,但是運行時出現以下問題:

/usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.15’ not found

添加LD_LIBRARY_PATH環境變量即可解決:

# vim ~/.bash_profile

export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/usr/local/lib64:/usr/lib64

# source ~/.bash_profile

GCC新特征

GCC 6.1 發布了,該版本較之前GCC5 新怎了大量的功能特性,默認采用C++14為新的標準,替代了之前的C++98。OpenMP 4.5規范將在本版本中被支持。此外,GCC 6.1 增強了對 C++17 的試驗性支持;大大改進了診斷特性,包括位置,位置范圍,拼寫錯誤標識符建議,選項名字等等改進;新增了修復提示和一些警告提示。改進記錄如下:

UndefinedBehaviorSanitizer gained a new sanitization option, -fsanitize=bounds-strict, which enables strict checking of array bounds. In particular, it enables -fsanitize=bounds as well as instrumentation of flexible array member-like arrays.

Type-based alias analysis now disambiguates accesses to different pointers. This improves precision of the alias oracle by about 20-30% on higher-level C++ programs. Programs doing invalid type punning of pointer types may now need -fno-strict-aliasing to work correctly.

Alias analysis now correctly supports weakref and alias attributes. This makes it possible to access both a variable and its alias in one translation unit which is common with link-time optimization.

Value range propagation now assumes that the this pointer of C++ member functions is non-null. This eliminates common null pointer checks but also breaks some non-conforming code-bases (such as Qt-5, Chromium, KDevelop). As a temporary work-around-fno-delete-null-pointer-checks can be used. Wrong code can be identified by using-fsanitize=undefined.

完整發布說明,可以在這里查看。

參考文章

(CSDN的Markdown不好用)

總結

以上是生活随笔為你收集整理的linux安装gcc运行时库,Linux安装gcc-6.1.0的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。