Cross-compilation sous Debian.

View: New views
4 Messages — Rating Filter:   Alert me  

Cross-compilation sous Debian.

by Wilfried Catteau :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Bonjour,

Je travaille sous Debian Etch AMD64 et je souhaite compiler pour
l'architecture i386. Le problème est que je n'arrive pas à compiler GCC
pour i386. J'ai suivi le tutoriel aux adresses
http://www.z0pe.org/howto/htc-univer...on-d-un-kernel 
<http://www.z0pe.org/howto/htc-universal/cross-compilation-d-un-kernel>
et http://wiki.debian.org/BuildingCrossCompilers

Après avoir crée et installé les paquets suivants:


binutils-i386-linux-gnu_2.17-3_amd64.deb
binutils-i486-linux-gnu_2.17-3_amd64.deb
libdb1-compat-i386-cross_2.1.3-9_all.deb
libc6-dev-i386-cross_2.3.6.ds1-13etch5_all.deb
linux-kernel-headers-i386-cross_2.6.18-7_all.deb
libc6-i386-cross_2.3.6.ds1-13etch5_all.deb


j'ai tenté de compiler GCC comme suit:


$ apt-get source gcc-4.1
$ cd gcc-4.1-4.1.1ds2
$ export GCC_TARGET=i386
$ debian/rules control
$ dpkg-buildpackage -us -uc -rfakeroot -b > ../gcc.build 2>&1 || echo
'Build error'


Et voici ce que j'obtiens dans le fichier gcc.build:


$ cat ../gcc.build
dpkg-buildpackage: source package is gcc-4.1
dpkg-buildpackage: source version is 4.1.1ds2-21
dpkg-buildpackage: source changed by Matthias Klose <doko@...>
dpkg-buildpackage: host architecture amd64
dpkg-buildpackage: source version without epoch 4.1.1ds2-21
dpkg-checkbuilddeps : dépendances de construction non trouvées :
libc6-dev-amd64-i386-cross
dpkg-buildpackage: Build dependencies/conflicts unsatisfied; aborting.
dpkg-buildpackage: (Use -d flag to override.)


je relance donc la compilation avec l'option -d et j'obtiens le message
d'erreur suivant:


$ tail -n 50 ../gcc.build
checking how to run the C++ preprocessor...
/home/willy/tmp/gcc/gcc-4.1-4.1.1ds2/build/./gcc/xgcc -shared-libgcc
-B/home/willy/tmp/gcc/gcc-4.1-4.1.1ds2/build/./gcc -nostdinc++
-L/home/willy/tmp/gcc/gcc-4.1-4.1.1ds2/build/i486-linux-gnu/64/libstdc++-v3/src
-L/home/willy/tmp/gcc/gcc-4.1-4.1.1ds2/build/i486-linux-gnu/64/libstdc++-v3/src/.libs
-B/usr/i486-linux-gnu/bin/ -B/usr/i486-linux-gnu/lib/ -isystem
/usr/i486-linux-gnu/include -isystem /usr/i486-linux-gnu/sys-include  
-m64 -E
loading cache ./config.cache within ltconfig
checking host system type... x86_64-pc-linux-gnu
checking build system type... x86_64-pc-linux-gnu
checking for objdir... .libs
checking for /home/willy/tmp/gcc/gcc-4.1-4.1.1ds2/build/./gcc/xgcc
option to produce PIC... -fPIC -DPIC
checking if /home/willy/tmp/gcc/gcc-4.1-4.1.1ds2/build/./gcc/xgcc PIC
flag -fPIC -DPIC works... yes
checking if /home/willy/tmp/gcc/gcc-4.1-4.1.1ds2/build/./gcc/xgcc static
flag -static works... no
finding the maximum length of command line arguments... (cached) 49153
checking if /home/willy/tmp/gcc/gcc-4.1-4.1.1ds2/build/./gcc/xgcc
supports -c -o file.o... (cached) yes
checking if /home/willy/tmp/gcc/gcc-4.1-4.1.1ds2/build/./gcc/xgcc
supports -fno-rtti -fno-exceptions ... yes
checking whether the linker
(/home/willy/tmp/gcc/gcc-4.1-4.1.1ds2/build/./gcc/collect-ld -m
elf_x86_64) supports shared libraries...
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking command to parse
/home/willy/tmp/gcc/gcc-4.1-4.1.1ds2/build/./gcc/nm output... failed
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
appending configuration tag "CXX" to libtool
checking for exception model to use... call frame
checking for compiler with PCH support... yes
checking for enabled PCH... yes
checking for underlying I/O to use... stdio
checking how to run the C preprocessor...
/home/willy/tmp/gcc/gcc-4.1-4.1.1ds2/build/./gcc/xgcc
-B/home/willy/tmp/gcc/gcc-4.1-4.1.1ds2/build/./gcc/
-B/usr/i486-linux-gnu/bin/ -B/usr/i486-linux-gnu/lib/ -isystem
/usr/i486-linux-gnu/include -isystem /usr/i486-linux-gnu/sys-include  
-m64 -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for C locale to use... gnu
checking for msgfmt... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking for library containing gettext... configure: error: Link tests
are not allowed after GCC_NO_EXECUTABLES.
make[3]: *** [configure-target-libstdc++-v3] Error 1
make[3]: Leaving directory `/home/willy/tmp/gcc/gcc-4.1-4.1.1ds2/build'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/willy/tmp/gcc/gcc-4.1-4.1.1ds2/build'
s=`cat status`; rm -f status; test $s -eq 0
make[1]: *** [stamps/05-build-stamp] Error 1
make[1]: Leaving directory `/home/willy/tmp/gcc/gcc-4.1-4.1.1ds2'
make: *** [stamps/05-build-stamp] Erreur 2


J'ai cherché sur Google, mais je n'ai trouvé aucune information pouvant
m'aider et c'est pourquoi je sollicite votre aide.

Willy.


--
To UNSUBSCRIBE, email to debian-devel-french-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: Cross-compilation sous Debian.

by Dominique Dumont-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Willy <wcatteau@...> writes:

> Je travaille sous Debian Etch AMD64 et je souhaite compiler pour
> l'architecture i386. Le problème est que je n'arrive pas à compiler
> GCC pour i386.

Ca serait pas plus simple de monter in chroot i386 sur ta machine,
d'y installer les packages gcc i386 et de compiler là-dedans ?

HTH

--
Dominique Dumont
"Delivering successful solutions requires giving people what they
need, not what they want." Kurt Bittner


--
To UNSUBSCRIBE, email to debian-devel-french-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: Cross-compilation sous Debian.

by Emmanuel Bouthenot-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Bonjour,

> Je travaille sous Debian Etch AMD64 et je souhaite compiler pour
> l'architecture i386. Le problème est que je n'arrive pas à compiler
> GCC pour i386.

Il s'agit juste de ça, il serait sans doutes bien plus efficace de
"bootstrapper" une debian 32 bits, ce qui se fait en une 10aine de
minutes via cdebootstrap par exemple.

cf. entre autres les paquets : (c)debootstrap, schroot, etc ...

A noté que ce genre de question aurait sans doutes plus sa place sur
la liste debian-user-french@

M.

--
Emmanuel Bouthenot
 mail : kolter@...
  gpg : 0x414EC36E
  jid : kolter@...
  irc : kolter@(freenode|oftc)


--
To UNSUBSCRIBE, email to debian-devel-french-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: Cross-compilation sous Debian.

by Wilfried Catteau :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Bonjour,

merci pour vos réponses. Si je n'arrive pas à compiler GCC, j'opterais
alors pour la solution que vous me proposez, bien qu'elle ne puisse
fonctionner pour produire du code powerpc à partir d'une Debian AMD64
(ce que je serai amené à faire ultérieurement). Je me suis aperçu qu'il
me manquait bien le paquet "libc6-dev-amd64-i386-cross" mais même après
l'avoir installé (ainsi que ceux dont il dépend), le problème persiste.

Je suis désolé si mon message ne convient pas vraiment à cette liste,
mais je pensais qu'elle était réservé aux développeurs sous Debian et
non au développement de Debian.

je posterai donc sur la liste debian-user-french.

Willy.





--
To UNSUBSCRIBE, email to debian-devel-french-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...

LightInTheBox - Buy quality products at wholesale price