<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 基于3c2410的linux2.6.22移植(2)

          基于3c2410的linux2.6.22移植(2)

          作者: 時(shí)間:2016-11-20 來源:網(wǎng)絡(luò) 收藏
          (5) 開始編譯 編譯的過程主要有6個(gè)步驟;
          a. 內(nèi)核頭文件的生成
          b. Binary utilties的生成
          c. Glibc頭文件的生成
          d. 第一階段gcc的生成
          e. glibc庫文件的生成
          f. 完整編譯工具的生成
          注:生成第一階段gcc主要是用來生成glibc庫文件。
          1、 生成內(nèi)核頭文件
          $root@host:/home/arm/kernel# tar xvjf linux-2.6.22.tar.bz2
          $root@host:/home/arm/kernel# cd linux-2.6.22
          $root@host:/home/arm/kernel/linux-2.6.22#
          make ARCH=arm CROSS_COMPILE=arm-linux- menuconfig
          其中menuconfig指定了配置界面,可用的還有config(全字符界面) xconfig(xwindow下的圖形界面)。Ubuntu需要安裝tk8.4以支持xconfig。另外需要將mawk卸載,安裝gawk。(mawk有bug)
          linux2.6的內(nèi)核提供了對(duì)s3c2410的支持。在system中選上s3c2410系列就可以了。配置完畢退出保存。
          $root@host:/home/arm/kernel/linux-2.6.22# cd include
          $root@host:/home/arm/kernel/linux-2.6.22/include# cd linux
          $root@host:/home/arm/kernel/linux-2.6.22/include/linux# ls version.h autoconf.h
          version.h autoconf.h
          這2個(gè)文件在后面的編譯中會(huì)用到。如果沒有,退到內(nèi)目錄下make version.h就可以了。
          下面建立鏈接:
          $root@host:/home/arm/kernel/linux-2.6.22/include# ln –s asm-arm asm
          $root@host:/home/arm/kernel/linux-2.6.22/include# ln -s asm/arch-s3c2410 asm/arch
          將內(nèi)核頭文件拷貝到最終安裝目錄下:
          $root@host:/home/arm/kernel/linux-2.6.22/include# mkdir –p ${TARGET_PREFIX}/include
          $root@host:/home/arm/kernel/linux-2.6.22/include# cp –rd asm-arm ${TARGET_PREFIX}/include
          $root@host:/home/arm/kernel/linux-2.6.22/include#
          cp –r asm- ${TARGET_PREFIX}/include
          $root@host:/home/arm/kernel/linux-2.6.22/include# cp –r linux ${TARGET_PREFIX}/include
          $root@host:/home/arm/kernel/linux-2.6.22/include# cp –d asm ${TARGET_PREFIX}/include

          至此內(nèi)核頭文件建立完畢。
          2、 建立Binary utilities:
          binutils是一些二進(jìn)制工具的集合,其中常用的是as ,ar和ld。
          $root@host:/home/arm/kernel/include# cd ${PRJROOT}/build-tools
          $root@host:/home/arm/build-tools# tar xvjf binutils-2.18.tar.bz2
          $root@host:/home/arm/build-tools# cd build-binutils
          $root@host:/home/arm/build-tools/build-binutils#
          patch –Np1 –i /home/arm/build-tools/patch/binutils-2.18*
          $root@host:/home/arm/build-tools/build-binutils#
          ../binutils-2.18/configure --target=${TARGET} –prefix=${PREFIX}
          $root@host:/home/arm/build-tools/build-binutils# make
          $root@host:/home/arm/build-tools/build-binutils# make install
          ${PREFIX}/bin下應(yīng)該生成一些以arm-linux開頭的文件
          $root@host:/home/arm/build-tools/build-binutils# ls ${PREFIX}/bin
          3、 生成glibc頭文件:
          $root@host:/home/arm/build-tools/build-binutils# cd ..
          $root@host:/home/arm/build-tools/# tar xvjf glibc-2.6.1.tar.bz2
          $root@host:/home/arm/build-tools/#
          tar xvzf glibc-ports-2.6.1.tar.gz --directory ./glibc-2.6.1/
          $root@host:/home/arm/build-tools/# cd glibc-2.6.1
          $root@host:/home/arm/build-tools/glibc-2.6.1# mv glibc-ports-2.6.1 ports –v
          打上補(bǔ)?。?br />$root@host:/home/arm/build-tools/glibc-2.6.1#
          patch –Np1 –i /home/arm/build-tools/patch/glibc-2.6.1-*patch
          $root@host:/home/arm/build-tools/glibc-2.6.1# cd ..
          $root@host:/home/arm/build-tools/# cd build-glibc-headers
          這里需要添加對(duì)NPTL線程庫的支持:
          $root@host:/home/arm/build-tools/build-glibc-headers#
          echo “libc_cv_forced_unwind=yes”>>config.cache
          echo “libc_cv_c_cleanup=yes”>>config.cache
          echo “libc_cv_arm_tls=yes”>>config.cache
          注:如果編譯中出現(xiàn)”cannot compute long double size”,添加:
          echo “ac_cv_sizeof_long_double=12”>>config.cache
          $root@host:/home/arm/build-tools/build-glibc-headers#
          ../glibc-2.6.1/configure --host=${TARGET} --prefix=”/usr” --enable-add-ons
          --with-headers=${TARGET_PREFIX}/include --cache-file=config.cache
          $root@host:/home/arm/build-tools/build-glibc-headers#
          make cross-compiling=yes install_root=${TARGET_PREFIX} prefix=””
          install-headers
          $root@host:/home/arm/build-tools/build-glibc-headers#
          mkdir –p ${TARGET_PREFIX}/include/gnu
          $root@host:/home/arm/build-tools/build-glibc-headers#
          touch ${TARGET_PREFIX}/include/gnu/stubs.h
          注:如果編譯過程中出現(xiàn)找不到頭文件的錯(cuò)誤,可以根據(jù)錯(cuò)誤提示的文件名用touch命令在相應(yīng)目錄下建立一個(gè)空文件,一般就可以編譯通過了。


          關(guān)鍵詞: 3c2410linux2.6.22移

          評(píng)論


          相關(guān)推薦

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

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();