Ceci est une ancienne révision du document !


Compilation croisée (cross-compiling) pour architecture arm

Ceci est un article détaillé de compilation_croisee pour architecture arm! L'article cité précédemment donne la plus part des indications nécessaire. Il y a juste une lacune et une erreur. La lacune et qu'il faut installer les sources pour MPFR et le bug et qu'il manque deux accolade dans un fichier source de gcc (4.4.1). Pour vous faciliter la tâche et vous permettre de boire un café de plus aujourd'hui, je vous présente un petit scripte qu'il télécharge, compile et install le tout tout seul.

Le scripte utilise des sudo pour les make install. Affin de vous demander le mot de passe tout au début pour que vous puissiez aller boir un café tranquilement, un sudo echo et placé en tête.
#!/bin/bash

# Ask for the sudo password at the beginning so that you can go drinking coffee
sudo echo "This script needs to be run as root."

### BINUTILS

wget http://ftp.gnu.org/gnu/binutils/binutils-2.20.tar.bz2
tar xvf binutils-2.20.tar.bz2
cd binutils-2.20

cd gas/config
cat <<END >tc-arm.patch
--- tc-arm.c    2009-08-30 00:10:59.000000000 +0200
+++ fix_tc-arm.c        2010-02-11 13:46:23.541598748 +0100
@@ -2486,8 +2486,10 @@
       frag->tc_frag_data.first_map = symbolP;
     }
   if (frag->tc_frag_data.last_map != NULL)
+    {
     know (S_GET_VALUE (frag->tc_frag_data.last_map) < S_GET_VALUE (symbolP));
   frag->tc_frag_data.last_map = symbolP;
+    }
 }
 
 /* We must sometimes convert a region marked as code to data during
END
patch -p0 tc-arm.c tc-arm.patch
cd -

./configure --target=arm-linux
make all
sudo make install

cd ..

### MPFR
wget http://ftp.gnu.org/gnu/mpfr/mpfr-2.4.2.tar.bz2
tar xvf mpfr-2.4.2.tar.bz2
cd mpfr-2.4.2

./configure --target=arm-linux
make all
sudo make install

cd ..

### GCC 4.4
wget http://ftp.gnu.org/gnu/gcc/gcc-4.4.3/gcc-4.4.3.tar.bz2
tar xvf gcc-4.4.3.tar.bz2 
cd gcc-4.4.3

./configure --enable-languages=c,c++ --disable-threads --disable-shared --disable-checking --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --target=arm-linux

make all-gcc
sudo make install-gcc

cd ..

### Clean

rm -rf binutils-2.20
rm -rf gcc-4.4.3
rm -rf mpfr-2.4.2
rm -f binutils-2.20.tar.bz2
rm -f gcc-4.4.3.tar.bz2
rm -f mpfr-2.4.2.tar.bz2
  • tutoriel/xcompile_arm.1265914578.txt.gz
  • Dernière modification: Le 18/04/2011, 14:50
  • (modification externe)