Thomas David Rivers
2011-Mar-09 20:49 UTC
bin/139146 still not right in FreeBSD 8.2 (-m32 on amd64)?
Just installed a fresh 8.2-stable on a brand-spanking-new 64-bit machine... But, when I try to build 32-bit programs I get problems linking, and I stumbled onto PR bin/139146. The PR mentions this quick test: uname -sr && echo "int main () { }" > t.c && gcc -v --help 2>&1 | grep m32 && gcc -m32 t.c which I try to get this output: FreeBSD 8.2-RELEASE -m32 Generate 32bit i386 code /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 So - I'm wondering what the proper approach is on amd64 to build 32-bit applications? - Thanks! - - Dave Rivers - -- rivers@dignus.com Work: (919) 676-0847 Get your mainframe programming tools at http://www.dignus.com
Josh Carroll
2011-Mar-09 20:53 UTC
bin/139146 still not right in FreeBSD 8.2 (-m32 on amd64)?
On Wed, Mar 9, 2011 at 12:15 PM, Thomas David Rivers <rivers@dignus.com> wrote:> > Just installed a fresh 8.2-stable on a brand-spanking-new 64-bit > machine... > > But, when I try to build 32-bit programs I get problems linking, > and I stumbled onto PR bin/139146. > > The PR mentions this quick test: > > ?uname -sr && echo "int main () { }" > t.c && gcc -v --help 2>&1 | grep m32 && gcc -m32 t.cAdd -B/usr/lib32 to the gcc command line, e.g.: echo "int main () { }" > t.c && gcc -v --help 2>&1 | grep m32 && gcc -m32 -B/usr/lib32 t.c Then it should work. Josh
Thomas David Rivers
2011-Mar-09 21:09 UTC
bin/139146 still not right in FreeBSD 8.2 (-m32 on amd64)?
Thanks everyone! -B/usr/lib32 worked around the issue... - Dave Rivers - -- rivers@dignus.com Work: (919) 676-0847 Get your mainframe programming tools at http://www.dignus.com
Mark Linimon
2011-Mar-09 21:13 UTC
bin/139146 still not right in FreeBSD 8.2 (-m32 on amd64)?
On Wed, Mar 09, 2011 at 03:15:39PM -0500, Thomas David Rivers wrote:> But, when I try to build 32-bit programs I get problems linking, > and I stumbled onto PR bin/139146.That one was closed as a duplicate of gnu/112215. I've forwarded your email to GNATS with the followup redirected there. mcl
Dimitry Andric
2011-Mar-14 23:16 UTC
bin/139146 still not right in FreeBSD 8.2 (-m32 on amd64)?
On 2011-03-09 21:15, Thomas David Rivers wrote:> Just installed a fresh 8.2-stable on a brand-spanking-new 64-bit > machine... > > But, when I try to build 32-bit programs I get problems linking, > and I stumbled onto PR bin/139146....> /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 -lgccI committed a fix for this in r219648, so at least: - gcc -m32 uses the correct library path to find crt startup objects - ld uses the correct library path to find libraries - simple 'hello world' type programs link and run However, this does *not* solve the problem completely, as the system headers in /usr/include/machine will still be amd64 specific. This can result in various kinds of brokenness. Please be careful. If you want to reliably build i386 executables, you should still use a native i386 installation.
We are trying to compile i386 on a FreeBSD 8.2r amd64. we are getting an error stating that libstdc++.so.6, is missing. COMPACT6x and COMPACT7x have been installed. But this does not solve the problem. Is it possible to compile i386 on and amd64 system? -- View this message in context: http://freebsd.1045724.n5.nabble.com/bin-139146-still-not-right-in-FreeBSD-8-2-m32-on-amd64-tp3965590p4725801.html Sent from the freebsd-stable mailing list archive at Nabble.com.
On Tue, Aug 23, 2011 at 2:26 PM, noel beck <nbeck@hobsoft.com.mt> wrote:> We are trying to compile i386 on a FreeBSD 8.2r amd64. > we are getting an error stating that libstdc++.so.6, is missing. > COMPACT6x and COMPACT7x have been installed. But this does not solve the > problem. > Is it possible to compile i386 on and amd64 system? >I believe compiler flags to /lib32 is required (-L/usr/lib32 or something)
Maybe off topic? 1: echo "int main(void) { return 0; }" > t.c 2: setenv LDEMULATION elf_i386_fbsd 3: gcc -c -m32 -o t.o t.c 4: gcc -nostartfiles -o a.out t.o -L/usr/lib32 /usr/lib32/crt1.o /usr/lib32/crti.o 5: file a.out a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked (uses shared libs), for FreeBSD 8.2, not stripped 6: uname -m amd64 2: q.v. info binutils -> Selecting The Target System Maybe there is a more comfortable way. Michael Am Tuesday 23 August 2011 09:46:11 schrieb Edho Arief:> On Tue, Aug 23, 2011 at 2:26 PM, noel beck <nbeck@hobsoft.com.mt> wrote: > > We are trying to compile i386 on a FreeBSD 8.2r amd64. > > we are getting an error stating that libstdc++.so.6, is missing. > > COMPACT6x and COMPACT7x have been installed. But this does not solve the > > problem. > > Is it possible to compile i386 on and amd64 system? > > I believe compiler flags to /lib32 is required (-L/usr/lib32 or something) > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"