On May 29, 2011, at 2:44 AM, Sisyphus wrote: > > ----- Original Message ----- From: "Andrew DeFaria" > >> Is it possible to build a 32 bit perl on a 64 bit machine and tell it to >> install into /usr/local/bin? I tried that but ended up with a 64 bit >> executable nonetheless (it's been a long time since I've built a perl...). > > On 64-bit MS Windows we can have both 32-bit and 64-bit perls, but I don't > know if Windows is a special case in this regard. > > (This is probably not the best place to ask about this, though I would think > there are people here who could provide a much better answer than I just did > :-) > > If it is possible, then I think you're going to need to use a different > compiler (ie 32-bit) than the one you tried. >
It depends on the system. For instance, on os x you can just use the -m32 flag in gcc when compiling. But shared libraries on os x are generally 'fat' and support multiple architectures which simplifies linking and loading. On linux, it's more complicated. It depends on the system. The last time I had to do this I needed to build a chroot environment to compile in. It might be easier these days. The debian amd64 faq has some approaches you can take. But it could also be out of date a bit. It's at least a starting point. http://wiki.debian.org/DebianAMD64Faq See the "Q: How do I build i386 debs on AMD64?" For actually running the apps you probably want to check out the ia32 section here http://www.debian-administration.org/articles/534