<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://webfault.org/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
  <title>Michael VERGOZ - x86_64</title>
  <link>http://webfault.org/</link>
  <description></description>
  <language>fr</language>
  <pubDate>Wed, 25 Mar 2009 17:59:15 +0000</pubDate>
  <copyright>Copyright 2007 - Michael Vergoz</copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Compiler depuis un x86 vers un x86_64 avec GCC</title>
    <link>http://webfault.org/post/2007/09/14/Compiler-depuis-un-x86-vers-un-x86_64-avec-GCC</link>
    <guid isPermaLink="false">urn:md5:6c72938397aec219e076d5e6a6fcd1da</guid>
    <pubDate>Fri, 14 Sep 2007 16:19:00 +0000</pubDate>
    <dc:creator>Michael Vergoz</dc:creator>
        <category>Portage / Cross dev</category>
        <category>ARM</category><category>ELF</category><category>GCC</category><category>x86</category><category>x86_64</category>    
    <description>    &lt;p&gt;Au départ je pensais que la compilation d'un fichier &lt;a href=&quot;http://webfault.org/index.php?tag/ELF&quot;&gt;ELF&lt;/a&gt; &lt;a href=&quot;http://webfault.org/index.php?tag/x86_64&quot;&gt;x86_64&lt;/a&gt; puis un &lt;a href=&quot;http://webfault.org/index.php?tag/x86&quot;&gt;x86&lt;/a&gt; demandait forcément une cross compilation (CBUILD) d'un toolchain x86_64. Et en fait pas du tout, visiblement &lt;a href=&quot;http://webfault.org/index.php?tag/GCC&quot;&gt;GCC&lt;/a&gt; intégre par défaut la possibilité de compiler vers un x86_64 depuis un x86 (et inversement) par contre pour changer totalement de processeur, typiquement de l'&lt;a href=&quot;http://webfault.org/index.php?tag/ARM&quot;&gt;ARM&lt;/a&gt;, il est nécessaire de cross compiler des toolchain et là c'est pas la même histoire...&lt;/p&gt;


&lt;p&gt;Un petit test :&lt;/p&gt;
&lt;pre&gt;root@zef:~# gcc -o test.bin test.c -m64
root@zef:~# file test.bin
test.bin: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.6.0, dynamically linked (uses shared libs), not stripped
root@zef:~# gcc -o test.bin test.c -m32
root@zef:~# file test.bin
test.bin: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.0, dynamically linked (uses shared libs), not stripped&lt;/pre&gt;


&lt;p&gt;Il faut savoir un truc c'est que ça ne fonctionne pas toujours. Par exemple si vous voulez compiler Apache 1.3 depuis un x86 vers du x86_64 eh bien cela ne sera pas possible car le Makefile d'Apache peut compiler des fichiers puis les executer pendant la compilation.
La solution c'est d'avoir un CHOST x86_64 + support lib32 qui compile pour du x86_64 et x86.&lt;/p&gt;</description>
    
    
    
      </item>
    
</channel>
</rss>