About 32bit binary on amd64

Kohji Okuno okuno.kohji at jp.panasonic.com
Mon May 24 09:59:10 UTC 2010


Thank you for your comments.

In my usage, it works good by the patch appended to this mail.

> On May 24, 2010, at 2:49 AM, pluknet wrote:
> 
>> On 24 May 2010 08:49, Kohji Okuno <okuno.kohji at jp.panasonic.com> wrote:
>>> Hi all,
>>> 
>>> I want to compile 32bit binary on amd64, but I met with the problem.
>>> Could you teach me the best solution, please?
>>> 
>>> 
>>> My environment is FreeBSD 8.1-PRERELEASE #0: Tue May 18 12:01:26 JST 2010.
>>> 
>>> I compiled and executed test.c as below on amd64.
>>> 
>> [...]
>>> 
>>> % gcc -m32 -B/usr/lib32 test.c
>>> % ./a.out
>>> mmap: Invalid argument
>> 
>> AFAIK, it still doesn't work on FreeBSD. You need something like 32bit
>> chroot environment.
>> There's also about:
>> http://www.freebsd.org/projects/ideas/#p-freebsd-amd64-gcc-m32
> 
> -m32 is busted on FreeBSD; I don't remember the full details but I think it had something to do with the linking stage of things...
> Thanks,
> -Garrett
-------------- next part --------------
A non-text attachment was scrubbed...
Name: machine_amd64.patch
Type: text/x-patch
Size: 30011 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20100524/b44db130/machine_amd64.bin


More information about the freebsd-current mailing list