{"id":770,"date":"2008-12-19T23:35:16","date_gmt":"2008-12-20T07:35:16","guid":{"rendered":"http:\/\/multimedia.cx\/eggs\/?p=770"},"modified":"2008-12-20T00:19:39","modified_gmt":"2008-12-20T08:19:39","slug":"32-bit-shuffling","status":"publish","type":"post","link":"https:\/\/multimedia.cx\/eggs\/32-bit-shuffling\/","title":{"rendered":"32-bit Shuffling"},"content":{"rendered":"<p>I decided to put that <a href=\"http:\/\/multimedia.cx\/eggs\/cross-compiled-fate\/\">cross compiling effort<\/a> on hold. I can&#8217;t get any cross compilers compiled and even if I could, if seems like a silly effort without any special hardware to test, or until I budget time to figure out how <a href=\"http:\/\/bellard.org\/qemu\/\">qemu<\/a> works. (Though I am still pondering a <a href=\"http:\/\/multimedia.cx\/eggs\/fate-on-mips\/\">MIPS-based laptop<\/a>; if anyone knows where to find a Alpha-400 or Razorbook or any of the other dozen names it&#8217;s marketed under, for cheaper than <a href=\"http:\/\/www.geeks.com\/details.asp?invtid=ALPHA-400&#038;cpc=SCH\">Geek&#8217;s.com sells them<\/a>, let me know.)<\/p>\n<p>However, I am always reorganizing, always shuffling things around. When I <a href=\"http:\/\/multimedia.cx\/eggs\/64-bit-builds-are-a-go\/\">got a Mac Mini<\/a> in the first month of this year, I only meant for it to run x86_64 <a href=\"http:\/\/fate.multimedia.cx\/\">FATE cycles<\/a> in a VMware Fusion session, and maybe native Mac OS X cycles. Now, the little box serves as my primary home desktop; I have fully migrated off of my old Windows XP desktop. So every time there was new code in <a href=\"http:\/\/ffmpeg.org\/\">FFmpeg<\/a> SVN, the Mac Mini would run FATE cycles for x86_32\/Linux, x86_64\/Linux, and Mac OS X, all in parallel &#8212; and there are only 2 CPU cores and 3 GB of memory in play here. Things could slow down during primetime.<\/p>\n<p>After I migrated to the Mac Mini as my primary desktop, I completely decommissioned and stowed the old WinXP box (which has a little more overall processing power than the Mac Mini). It didn&#8217;t take long before I realized that I should slap 64-bit Linux on the thing and put it back into service as a dedicated FATE box.<\/p>\n<p>I quickly migrated all the x86_64 configurations over to the new box, thus easing the load on the Mac Mini. However, I think it would be useful to migrate the x86_32 configurations over as well. x86_64 is alleged to be able to run x86_32 binaries as well, just as long as any dependent 32-bit libraries are installed. <\/p>\n<p>So the goal is to get this x86_64 Linux box building 32-bit binaries. Things I have tried in order to achieve this end:<\/p>\n<ul>\n<li>I installed the libc6-dev-i386 package on this Ubuntu-based machine; I understand that&#8217;s crucial to running basic 32-bit binaries.<\/li>\n<li>As a baseline, I tried getting the native gcc compiler (4.3.2) to build a 32-bit binary.<\/li>\n<li>I have a bunch of compilers already installed on the 64-bit machine that I copied wholesale from the old x86_64 VMware session. I tried to convince them to compile 32-bit binaries.<\/li>\n<li>I also have a bunch of gcc versions sitting on the x86_32 VMware session. Armed with the knowledge the x86_64 machines allegedly run x86_32 binaries, I copied the directories whole to the new machine.<\/li>\n<\/ul>\n<p>The short story is that nothing worked. At the very least, I figured out that x86_32 is not a suitable arch to specify to FFmpeg&#8217;s configure script; these are the suitable x86_32 strings: &#8220;i386|i486|i586|i686|i86pc|BePC&#8221;. But that only goes so far toward solving the problem. Running the 32-bit compiled compilers makes ld segfault during FFmpeg&#8217;s detection. The transplanted 64-bit compilers failed during the configuration due to a failure to locate a suitable libgcc.a. I likely explicitly disabled multilib (&#8211;disable-multilib) when building them because&#8230; probably because it&#8217;s the only way they would compile. I&#8217;m pretty sure that multilib in this context pertains to building a 64-bit compiler that can spit out both 32- and 64-bit binaries. But I can never get 64-bit gcc to build with multilib. And if you google for the error message in question &#8212; something about not finding gnu\/stubs-32.h &#8212; you will just find pages upon pages of forum posts from people who are trying to compile gcc on 64-bit platforms and who eventually arrive at the solution to &#8212; you guessed it &#8212; configure with &#8211;disable-multilib. After all, who really needs to wants to compile 32-bit binaries on a 64-bit machine?<\/p>\n<p>The native compiler solution got the farthest, but that bombed out on an inline assembly error related to H.264. This was another concern I had about the whole process: is the Makefile set up to compile raw ASM files correctly via YASM? (I know that YASM != inline ASM, but the 2 topics are tangentially related.)<\/p>\n<p>Sometime back in the early days of FATE, someone asked why I didn&#8217;t run the 32- and 64-bit FATE configurations from the same 64-bit machine. <em>Is this a good enough answer?<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It doesn&#8217;t sound like it should be that hard, but I am having a difficult time getting 32-bit binaries compiled on 64-bit Linux.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[118,117,108],"class_list":["post-770","post","type-post","status-publish","format-standard","hentry","category-fate-server","tag-compilers","tag-cross-compiler","tag-fate"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/770","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/comments?post=770"}],"version-history":[{"count":10,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/770\/revisions"}],"predecessor-version":[{"id":794,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/770\/revisions\/794"}],"wp:attachment":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/media?parent=770"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/categories?post=770"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/tags?post=770"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}