Documentation on how to build 32bit applications on amd64?

Anonymous swell.k at gmail.com
Fri Aug 13 17:58:20 UTC 2010


Yuri <yuri at rawbw.com> writes:

> --- output of 64 bit executable (gcc -o m m.c) ---
> match: off=0 so=3 eo=4
> match: off=4 so=3 eo=4
>
> --- output of 32 bit executable built on 64 bit system with flags (gcc
> -B/usr/lib32 -m32 -o m m.c) ---
> match: off=0 so=3 eo=0

I guess machine-dependent headers are involved.

  $ cc -m32 -B/usr/lib32 a.c
  $ ./a.out
  match: off=0 so=3 eo=0
  $ ln -s /usr/src/sys/i386/include machine
  $ cc -m32 -B/usr/lib32 -isystem. a.c
  $ ./a.out
  match: off=0 so=3 eo=4
  match: off=4 so=3 eo=4

Same thing is happening for mmap()
  http://docs.freebsd.org/cgi/mid.cgi?20100524.134955.2300883222251175323.okuno.kohji


More information about the freebsd-questions mailing list