This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Compiling and linking 32 bit code on a 64 machine (AMD Opteron)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]