Date: Fri, 13 Aug 2010 20:22:58 +0400 From: Anonymous <swell.k@gmail.com> To: Yuri <yuri@rawbw.com> Cc: freebsd-questions@freebsd.org Subject: Re: Documentation on how to build 32bit applications on amd64? Message-ID: <86sk2iwkgt.fsf@gmail.com> In-Reply-To: <4C656E8F.8090105@rawbw.com> (yuri@rawbw.com's message of "Fri, 13 Aug 2010 09:10:55 -0700") References: <4C656E8F.8090105@rawbw.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Yuri <yuri@rawbw.com> writes: > I need to build 32 bit apps the same way as they would be built on i386. > > When I run 64-bit gcc I get this: > gcc -m32 -o m m.c > /usr/bin/ld: skipping incompatible /usr/lib/libgcc.a when searching > for -lgcc > /usr/bin/ld: skipping incompatible /usr/lib/libgcc.a when searching > for -lgcc > /usr/bin/ld: cannot find -lgcc > > When I run 32bit gcc I get this: > /gcc-4.5.0-32/bin/gcc -m32 -o m m.c > /var/tmp//ccif89DB.s: Assembler messages: > /var/tmp//ccif89DB.s:11: Error: suffix or operands invalid for `push' > /var/tmp//ccif89DB.s:14: Error: `-12(%ebp)' is not a valid 64 bit > base/index expression > > In first case libgcc.so isn't found, and specifying -L/usr/lib32 > doesn't help. > In the second case 32bit compiler runs 64-bit assembler which is wrong. > This was already discussed several times. I only remember recent threads[1][2]. I've built a few ports with not many dependencies but stumbled on unrelated issues before ever trying smth like emulators/wine. [1] http://docs.freebsd.org/cgi/mid.cgi?201007291718.12687.tijl [2] http://docs.freebsd.org/cgi/mid.cgi?86tyobk6bu.fsf ftp://ftp.lissyara.su/users/Guest/cc32wrapper (improved wrapper) > Is there a documentation how to cross compile 32 bit apps on 64 bit > platform? The only documented way is by using 32bit chroot.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86sk2iwkgt.fsf>