ºìÁªLinuxÃÅ»§
Linux°ïÖú

Fedora 7Ͻ¨Á¢ARM£­Linux½»²æ±àÒë»·¾³

·¢²¼Ê±¼ä:2007-08-19 00:10:50À´Ô´:ºìÁª×÷Õß:osjulyge
Õ⼸Ììæ×ÅÔÚFedora 7Ͻ¨Á¢ARM£­LinuxµÄ½»²æ±àÒë»·¾³¡£Ò»¿ªÊ¼²Î¿¼ÁË¡¶¹¹½¨Ç¶ÈëʽLinuxϵͳ¡·£¬ÕâÊÇÒ»±¾ºÜ¾­µäµÄÊé¡£ÉÏÃæ½éÉÜÁ˽¨Á¢ARM£­LinuxµÄ½»²æ±àÒë»·¾³µÄÐí¶à֪ʶ£¬½¨Á¢µÄÔ­ÔòºÍ·½·¨¡£ÎÒÒ»¿ªÊ¼Ïë°´ÕÕÉÏÃæµÄÒ»°ã·½·¨£¬½¨Á¢Ò»¸ö×Ô¼ºµÄ¡¢×îеĽ»²æ±àÒë»·¾³¡£µ«ÊÇ £¬ÊÔÁ˲ÅÖªµÀÕâ¸ö¹ý³ÌÊÇÒ»¸ö·±Ëö¡¢ºÄʱµÄ¹¤×÷¡£¶ÔÓÚûÓбàÒëÔ­Àí֪ʶµÄÎÒÀ´Ëµ£¬¸üÊǺÄʱÓÖºÁÎÞÒâÒå¡£ÒýÓá¶Ç¶ÈëʽÉè¼Æ¼°LinuxÇý¶¯³ÌÐò¿ª·¢Ö¸ÄÏ----»ùÓÚARM9´¦ÀíÆ÷£¨µÚ2°æ£©¡·µÄÔ­»°£º¡°ÔÚÕâÏ×÷ÉÏÀË·Ñʱ¼äËƺõûÓÐÈκÎÒâÒ壬ÎÒÒ²ÊÇÕâôÈÏΪµÄ£¬¡±¡£ÓÉÓÚÔÚ¹«Ë¾×öÊ£¬Ê±¼ä²»¶à£¬×îºó£¬ÎÒÀûÓÃcrosstool£­0.43,×Ô¶¯Íê³ÉÁËÕâÏ×÷¡£ÔÚÊÇ·ñÓбØÒª×Ô¼º½¨Á¢½»²æ±àÒë»·¾³µÄÎÊÌâÉÏ£¬ÎÒ½¨Ò飺Èç¹ûÄãÊÇÒ»¸öѧÉú£¬½¨ÒéÄãÈÏÕæѧϰ±àÒëÔ­Àí¡¢LinuxºÍGNUµÄ±àÒëÆ÷Ô­Àí£¬ÔÙÒ»²½Ò»²½µÄ×Ô¼º½¨Á¢½»²æ±àÒë»·¾³£¨Ñ§Éú±È½ÏÓÐʱ¼ä£¬ÉÙÅÝMM£¬ÉÙÍæÓÎÏ·£¬Ê±¼ä¾Í¼·³öÀ´ÁË¡£ºÃºÃѧϰ£¬ÒÔºóMMÀ´ÅÝÄ㣬±ðÈËÍæÄã±àµÄÓÎÏ·¡££©¡£Èç¹ûÄãÊdzÌÐòÔ±£¨²»Êǽ»²æ±àÒëÆ÷µÄ¿ª·¢Õߣ©£¬½¨Òé²»ÒªÔÚÕâÉÏÃæÀË·Ñʱ¼äÁË£¬×¬Ç®Òª½ô£¬°ÑÕâ¸ö×÷ΪҵÓà°®ºÃ°É£¡

Host CPU£ºi686
RAM: 768MB
OS: Fedora 7

TARGET CPU :S3C2410A
RAM :64MB
OS : Linux-2.6.22.2/2.6.15.4

ÏÖÔÚ½øÈëÕýÌ⣬ÎÒÔÚFedora7Ï¿ìËÙ¡¢³É¹¦µØ½¨Á¢ARM£­LinuxµÄ½»²æ±àÒë»·¾³£¬ÊÇ¿´ÁË¡¶Ç¶ÈëʽÉè¼Æ¼°LinuxÇý¶¯³ÌÐò¿ª·¢Ö¸ÄÏ----»ùÓÚARM9´¦ÀíÆ÷£¨µÚ2°æ£©¡·ÖйØÓÚcrosstoolµÄ½éÉÜ¡£crosstoolÊÇÓÉÃÀ¹úÈËDan Kegel£¨±ÏÒµÓÚ¼Ó(Àû¸£ÄáÑÇ)Öݹ¤Ñ§Ôº£©¿ª·¢µÄÒ»Ì׿ÉÒÔ×Ô¶¯±àÒ벻ͬƥÅä°æ±¾gccºÍglibc£¬²¢×÷²âÊԵĽű¾³ÌÐò¡£Ð´ÕâƪÎÄÕÂʱµÄ×îа汾ÊÇ0.43¡£

ÏÂÔصØÖ·http://kegel.com/crosstool/crosstool-0.43.tar.gz

ÔÚhttp://kegel.com/crosstool/crosstool-0.43/buildlogs/¿ÉÒÔ¿´µ½¸÷ÖÖCPUºÍGCC°æ±¾ÄÇЩÒѾ­±àÒë³É¹¦£¬ÄÇЩ²¿·Ö³É¹¦£¬ÄÇЩ³¹µ×ʧ°Ü¡£Èç¹ûÄã²»ÊDZàÒëÆ÷¿ª·¢Õߣ¬¾Í°´×ÅÉÏÃæ×ö°É£¬ÎÒÏë¹úÄÚºÜÉÙÓÐÈË»á±ÈËû×öµÃºÃ¡£

ÄãÒ²¿ÉÒÔµ½http://kegel.com/crosstool/#download¿´¿´ÊÇ·ñÓиüеİ汾¡£

µÚÒ»²½£º±£Ö¤Äã×°Fedora7ʱ£¬°²×°ÁËÐèÒªµÄÈí¼þ¿ª·¢¹¤¾ß¡£ÔÚ¡¶ ARM Linux ½»²æ±àÒë ¹¤¾ßÁ´ ÖÆ×÷¹¥ÂÔ¡·ÖÐ˵£º¡°0¡¢ÖÆ×÷֮ǰȷ±£ÄãµÄ»ú×ÓÉÏÓÐÈçϼ¸¸ö¹¤¾ß£ºbison¡¢flex¡¢build-essential¡£¡± ÎҵĻú×ÓÉÏÓÐbisonºÍflex£¬ÖÁÓÚbuild-essentialÊÇ°üº¬Ò»¸öÔÚ½¨Á¢deb°ü¹ý³ÌÖÐÆð¹Ø¼ü×÷ÓõİüµÄÐÅÏ¢ÁÐ±í£¬Fedoraϲ¢²»ÐèÒª¡£

µÚ¶þ²½£ºÏÂÔØcrosstool£¬²¢½âѹµ½ÄãµÄ¹¤×÷Ŀ¼¡£

tar -xzvf crosstool-0.43.tar.gz
cd crosstool-0.43

µÚÈý²½£º²ì¿´crosstoolÎļþ¼ÐÖУ¬¿ÉÒÔ¿´µ½Ä¿Â¼ÏÂÓкܶà.sh½Å±¾ºÍ.datÅäÖÃÎļþ¡£ÕÒµ½ÄãÒª½»²æ±àÒëµÄCPUËù¶ÔÓ¦µÄ½Å±¾£¬ÈçÎÒÒª½»²æ±àÒëµÄCPUÊÇS3C2410A£¬ÔòÑ¡ÓÃdemo-arm9tdmi.sh¡£ÒÔÏÂÊÇÆäÄÚÈݺÍËùÐèµÄÐ޸ģº

#!/bin/sh
# This script has one line for each known working toolchain
# for this architecture. Uncomment the one you want.
# Generated by generate-demo.pl from buildlogs/all.dats.txt
set -ex

TARBALLS_DIR=/home/tekkaman/working/source
RESULT_TOP=/home/tekkaman/working/crosstool
//ÕâÁ½ÐÐÊÇÐèÒªÐ޸ĵIJÎÊý£¬TARBALLS_DIRÊÇÏÂÔصŤ¾ßÔ´ÂëѹËõ°üµÄ´æ·ÅĿ¼¡£
//RESULT_TOPÊÇÒªÉú³ÉµÄ¹¤¾ßÁ´µÄ´æ·ÅĿ¼,Ò»¶¨Òª¸Äµ½ÓÐдȨÏÞµÄĿ¼£¬²»È»ÎÞ·¨±àÒë¡£
//ÈçÓÃrootµÇ¼½øÐбàÒ룬¿ÉÒÔÎÞÐ轨Á¢ÒÔÉÏÎļþ¼Ð£¬ÔËÐÐʱ»á×Ô¶¯½¨Á¢¡£µ«²»ÍƼö£¡
//ÒÔÉÏÊÇÎÒµÄÐ޸ģ¬ËûÈË¿ÉÒÔ¸ù¾Ýʵ¼ÊÇé¿öÐ޸ġ£

export TARBALLS_DIR RESULT_TOP
GCC_LANGUAGES="c,c++"
export GCC_LANGUAGES
# Really, you should do the mkdir before running this,
# and chown /opt/crosstool to yourself so you don't need to run as root.
mkdir -p $RESULT_TOP
#eval `cat arm9tdmi.dat gcc-3.2.3-glibc-2.2.5.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-3.2.3-glibc-2.3.2.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-3.2.3-glibc-2.3.2-tls.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-3.3.6-glibc-2.2.5.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-3.3.6-glibc-2.3.2.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-3.3.6-glibc-2.3.2-tls.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-3.4.5-glibc-2.2.5.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-3.4.5-glibc-2.3.2.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-3.4.5-glibc-2.3.2-tls.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-3.4.5-glibc-2.3.5.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-3.4.5-glibc-2.3.5-tls.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-3.4.5-glibc-2.3.6.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-3.4.5-glibc-2.3.6-tls.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-4.0.2-glibc-2.3.2.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-4.0.2-glibc-2.3.2-tls.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-4.0.2-glibc-2.3.5.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-4.0.2-glibc-2.3.5-tls.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-4.0.2-glibc-2.3.6.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-4.0.2-glibc-2.3.6-tls.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-4.1.0-glibc-2.3.2.dat` sh all.sh --notest
eval `cat arm9tdmi.dat gcc-4.1.0-glibc-2.3.2-tls.dat` sh all.sh --notest
//ÉÏÃæ±íʾҪѡ¹¤¾ßÁ´µÄ°æ±¾ºÅ£¡"££"Æð×¢Ê͹¦ÄÜ£¡¿ÉÒÔÑ¡ÔñÒ»ÐУ¡
//ÕâÐÐÊÇĬÈϵŤ¾ßÁ´µÄ°æ±¾ºÅ£¨×îеģ©£¬ÎÒ¾ÍÊÇÓÃÕâÒ»ÐУ¬Ò²¿ÉÒÔÑ¡±ðµÄ¡£
echo Done.

µÚÈý²½£¨¿ÉÑ¡£©£º¸ù¾ÝÄãËùÑ¡µÄ¹¤¾ßÁ´µÄ°æ±¾ºÅ£¬´ò¿ªÏàÓ¦µÄ.datÎļþ£¬²ì¿´ËùÐèµÄÔ´Âë°ü£¬²¢ÏÂÔص½ ${TARBALLS_DIR} Ŀ¼ÖС£

ÀýÈ磺ÎÒÔÚdemo-arm9tdmi.shÖÐÑ¡µÄÊÇeval `cat arm9tdmi.dat gcc-4.1.0-glibc-2.3.2-tls.dat` sh all.sh --notest £¬ÄÇôÎҾʹò¿ªarm9tdmi.dat gcc-4.1.0-glibc-2.3.2-tls.dat£¬ÆäÄÚÈÝÈçÏ£º

BINUTILS_DIR=binutils-2.16.1
GCC_CORE_DIR=gcc-3.3.6
GCC_DIR=gcc-4.1.0
GLIBC_DIR=glibc-2.3.2
LINUX_DIR=linux-2.6.15.4
LINUX_SANITIZED_HEADER_DIR=linux-libc-headers-2.6.12.0
GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2
GDB_DIR=gdb-6.5
GLIBC_EXTRA_CONFIG="$GLIBC_EXTRA_CONFIG --with-tls --with-__thread --enable-kernel=2.4.18"

µ½ÍøÉÏÈ¥ÏÂÔغìÉ«±ê¼ÇµÄ.bz2Ô´Âë°ü£¬×¢ÒâÆä°æ±¾ºÅ£¬ÏÂÔغó´æ·Åµ½${TARBALLS_DIR}Ŀ¼Ï¡£×¢Ò⣺²»Òª½âѹ£¡

ÒÔÏÂÊÇ¡¶ ARM Linux ½»²æ±àÒë ¹¤¾ßÁ´ ÖÆ×÷¹¥ÂÔ¡·½éÉܵĿÉÏÂÔØÔ´Âë°üµÄÖйú¾µÏñÕ¾µã£¨ÎÒ²¢Ã»¶¼ÊÔ¹ý£©£º
http://mirrors.shlug.org/
http://www.cn.kernel.org/pub/linux
http://www.cn.kernel.org/pub/software
ftp://ftp.cn.kernel.org/pub/linux
ftp://ftp.cn.kernel.org/pub/software

ÕâÒ»²½¿ÉÒÔÊ¡ÂÔ£¬ÒòΪÈç¹ûÔËÐÐdemo-arm9tdmi.sh ʱÔÚ${TARBALLS_DIR}Ŀ¼ÏÂûÓÐÏàÓ¦µÄÔ´Âë°ü£¬»á×Ô¶¯ÏÂÔØÆä.bz2Ô´Âë°ü¡£µ«Êǽ¨ÒéÔÚWindowsÏÂÓÃѸÀ×Ϻã¬ÕâÑù¸üʡʱ¼ä¡£

¸ù¾Ý¡¶¹¹½¨Ç¶ÈëʽLinuxϵͳ¡·ÖеĽéÉÜ£¬Èç¹ûΪ²»Í¬µÄÄں˱àÒë½»²æ±àÒ빤¾ß£¬½»²æ±àÒ빤¾ßÒª¸ù¾ÝÆäÄÚºËÖØбàÒë¹ý¡£ÓÉÓÚÎÒÏëʹÓÃ×îеÄ2.6.22.2 Äںˣ¬ËùÒÔÔÚ±àÒëÍêÒÔÉÏÅäÖõŤ¾ßÁ´ºó£¬ÎÒ½«¡°LINUX_DIR=linux-2.6.15.4 ¡±¸Ä³É¡°LINUX_DIR=linux-2.6.22.2 ¡±,²¢ÏÂÔØlinux-2.6.22.2.tar.bz2µ½${TARBALLS_DIR}Ŀ¼Ï£¬ÖØбàÒëÁËÒ»´Î¡£

×îºóÒ»²½£º½øÈëcrosstool-0.43Ŀ¼£¬ÊäÈë./demo-arm9tdmi.sh,È»ºó¾ÍÊÇÅݲ衢¿´Êé¡£¾­¹ý²»µ½3СʱµÄ±àÒ루¹«Ë¾µÄÀõçÄÔËùÓõÄʱ¼ä£¬ÅäÖúõĿÉÒÔ¸ü¿ì£©£¬¾Í¿ÉÒÔÔÚ${RESULT_TOP}Ŀ¼Öп´µ½ÏëÒªµÄ¹¤¾ßÁ´¡¢Í·Îļþ¡¢¿âÎļþµÈÎļþÁË£¡Ò»°ã²»»áʧ°Ü£¬ÎÒ±àÁË2.6.15.4Äں˺Í2.6.22.2Äں˶¼Ë³Àû½áÊø£¬ÇÒÏÂÔص½²©´´2410-SʵÑéÏ䣨2.4.18Äںˣ©Àï²âÊÔ£¬Ö¤Ã÷±àÒë³öµÄHello,world£¡³ÌÐò£¨ÔÚ${RESULT_TOP}/gcc-4.1.0-glibc-2.3.2/arm-9tdmi-linux-gnu/tmpÎļþ¼ÐÖУ©¾ø¶Ô¿ÉÓ㨳ýÁËÐèÒª¿âÎļþµÄ³ÌÐò£¬ÒòΪ2410-SϵͳÖÐûÓÐÏàÓ¦µÄ¿âÎļþÎÞ·¨Ö´ÐС£¾²Ì¬±àÒëµÄ¶¼¿ÉÓã¡£©
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 3 ÌõÆÀÂÛ

  1. wlkdy ÓÚ 2007-08-19 10:52:36·¢±í:

    MOTO ºÜ¶àÐͺŵÄÖÇÄÜÊÖ»ú¶¼ÊÇ LINUXµÄ ±ÈÈçÎÒÓÃµÄ E6

  2. yorktown ÓÚ 2007-08-19 08:33:53·¢±í:

    ÒýÓÃ:
    Ô­ÌûÓÉ liuchang007 ÓÚ 2007-8-19 00:42 ·¢±í
    ºÇºÇÓÐʱÎÒÒ²»á¸ø×Ô¼ºµÄlinuxÊÖ»ú±àÒ»µãC³ÌÐò£¬ÓõÄarm-linux-gcc


    ÄãµÄʲôÊÖ»ú°¢£¡ ÎÒҲȥÂòÒ»Ö»°¢£¡

  3. liuchang007 ÓÚ 2007-08-19 00:42:37·¢±í:

    ºÇºÇÓÐʱÎÒÒ²»á¸ø×Ô¼ºµÄlinuxÊÖ»ú±àÒ»µãC³ÌÐò£¬ÓõÄarm-linux-gcc