新聞中心

        EEPW首頁 > 醫(yī)療電子 > 構(gòu)建帶內(nèi)存錯誤檢查的gcc

        構(gòu)建帶內(nèi)存錯誤檢查的gcc

        ——
        作者: 時間:2007-04-18 來源:http://blog.csdn.net/absurd/ 收藏
        1.         下載gcc,本文使用的版本是3.4.2。

        http://gcc.gnu.org/

         

        2.         下載gcc擴展boundschecking。

        http://sourceforge.net/projects/boundschecking/

         

        3.         給gcc打上補丁。

        [root@localhost toolchain]# tar jxvf /mnt/hgfs/linux/gcc-3.4.2.tar.bz2

        [root@localhost toolchain]# bzip2 -d bounds-checking-gcc-3.4.2-1.00.patch.bz2

        [root@localhost toolchain]# cd gcc-3.4.2/

        [root@localhost gcc-3.4.2]# patch -p1 -s < ../bounds-checking-gcc-3.4.2-1.00.patch

         

        4.         編譯

        [root@localhost gcc-3.4.2]# cd ..

        [root@localhost toolchain]# mkdir build

        [root@localhost toolchain]# cd build/

        [root@localhost build]# ../gcc-3.4.2/configure --prefix=/opt/gcc-3.4.2-bc

        [root@localhost build]# make;make install

         

        5.         使用

        編譯時加”-g -fbounds-checking”,-g是為了讓bounds-cheking能找到符號表,報告 出現(xiàn)錯誤的源代碼位置。如果是編譯共享庫,還要鏈接libbounscheking.a庫。

         

        ~~end~~



        評論


        相關(guān)推薦

        技術(shù)專區(qū)

        關(guān)閉
        主站蜘蛛池模板: 辽源市| 沙洋县| 涿鹿县| 平罗县| 佳木斯市| 平遥县| 噶尔县| 平远县| 察雅县| 勃利县| 南召县| 小金县| 攀枝花市| 白城市| 昔阳县| 兰西县| 吴江市| 徐州市| 武清区| 肥城市| 二连浩特市| 十堰市| 吉安县| 夏津县| 霍林郭勒市| 长治县| 洪雅县| 常山县| 长阳| 江津市| 襄汾县| 惠州市| 穆棱市| 合水县| 饶河县| 乐昌市| 小金县| 客服| 龙岩市| 南京市| 荣昌县|