Re: gcc -m32 option on amd64.

看板FB_hackers作者時間18年前 (2007/08/13 14:38), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串7/7 (看更多)
On Friday 27 Jul 2007 3:50 pm, Peter Jeremy wrote: > On 2007-Jul-27 15:13:48 +0530, Sharad Chandra <sharadc@niksun.com> wrote: > >I am trying gcc -m32 on freebsd 6.1 amd64 env, but it does not seems to be > >working. i also installed /usr/port/lang/linux-libgcc/ but did not help > >what i did is=> > >echo "main () {}" > t.c; gcc -m32 t.c > >/usr/bin/ld: skipping > >incompatible > > /usr/local/lib/gcc/x86_64-portbld-freebsd6.1/4.2.0/gcc/x86_64-portbld-fre > >ebsd6.1/4.2.0/libgcc.a when searching for -lgcc > >/usr/bin/ld: cannot find -lgcc > >collect2: ld returned 1 exit status > > > >how can we make this working? > > You are using gcc 4.2 from ports. I suspect this only includes the > 64-bit libraries. gcc in the base system includes both 32-bit and > 64-bit libraries by default but it still suffers the same problem. Yes, gcc looks for library in /usr/lib, whereas libraries for 32 is in /usr/lib32, and there is a switch -B in gcc which tells from where to pick the library, I did gcc -m32 -B /usr/lib32 t.c and this is working now. > I had a go at fixing the problem in amd64/112215 but this has other > problems and needs more work. Note that non-trivial code will break > because <machine/XXXX.h> points at amd64 headers whilst the -m32 > compiler needs i386 headers in many cases. There's a non-trivial > amount of work needed to actually get cross-building working. I > suggest you look throught the FreeBSD-amd64 archives. Thanks Sharad Chandra _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
文章代碼(AID): #16l_o200 (FB_hackers)
文章代碼(AID): #16l_o200 (FB_hackers)