This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Compiling and linking 32 bit code on a 64 machine (AMD Opteron)
- From: Daniel Jacobowitz <drow at false dot org>
- To: "CARTER-HITCHIN, David, GBM" <David dot CARTER-HITCHIN at rbos dot com>
- Cc: "'binutils at sourceware dot org'" <binutils at sourceware dot org>
- Date: Thu, 22 Jun 2006 08:32:34 -0400
- Subject: Re: Compiling and linking 32 bit code on a 64 machine (AMD Opteron)
- References: <3B4C77997DD0254B86D3C9454476B6BC057A5C@lonms00812.fm.rbsgrp.net>
On Thu, Jun 22, 2006 at 01:15:54PM +0100, CARTER-HITCHIN, David, GBM wrote:
> I also have some -Lpath switches to pick up the 32 bit libraries.
> Interestingly, at one point, ld tries to find libgcc_s.so, but can't find
> it. It does find the 64 bit version under my GCC 3.4.6 installation, but
> can't find the 32 bit one because that's called libgcc_s.so.1 - there is a
> symlink called libgcc_s_32.so to libgcc_s.so.1, but nothing called
> libgcc_s.so here, so I created a link called that to point to libgcc_s.so.1.
> Perhaps that is a GCC question, but did I do the Right Thing(tm)?
If you had to do this, your GCC is not configured properly. GCC should
be generating -lgcc_s_32 automatically in this configuration.
>From the rest of your problems, it looks to me like you're not linking
correctly. Are you giving those options to ld directly? Or to gcc
using -Wl? Don't. Instead, let GCC do all the heavy lifting. If -m32
is in your CFLAGS, you must also use it at link time. The correct way
to do this is to include $(CFLAGS) in your link rules.
--
Daniel Jacobowitz
CodeSourcery