[1063] in RedHat Linux List

home help back first fref pref prev next nref lref last post

Re: Compiling with Redhat 4.0

daemon@ATHENA.MIT.EDU (Ian Burrell)
Sat Oct 26 03:27:59 1996

To: redhat-list@redhat.com
Date: Sat, 26 Oct 1996 00:25:29 -0700 (PDT)
In-Reply-To: <961025163222_74757.2544_EHL100-1@CompuServe.COM> from "Levy Lazarre" at Oct 25, 96 12:32:22 pm
From: Ian Burrell <iburrell@leland.Stanford.EDU>
Reply-To: iburrell@leland.Stanford.EDU
Resent-From: redhat-list@redhat.com

> I have a question for the gcc experts in this forum.
> I am in a situation where I must compile a program using
> some static libraries provided as .a files. My problem 
> is that these libraries are in a.out format while my 
> compiler is ELF(gcc-2.7). Consequently, the linker
> refuses to use those libraries and I get a lot of undefined
> references. I have read the gcc how-to but I couldn't find
> a reference to my problem.
> My questions are:
> 1)Is there a way to force the linker to use a.out libs? (Hopeful thinking!)
> 2) Should I drop back to an old version of gcc or binutils?
>    If so, which version, where do I get it?
>  

You could install a gcc cross-compiler that compiles a.out; this is
contained in the GCC binary package (get it from
ftp://tsx.mit.edu/pub/Linux/packages/GCC/).  You would then compile
your sources with the -bi486-linuxaout flag.

However, you can convert static libraries from a.out to ELF.  Only the
symbol names are different (a.out prepends an underscore); once you
change the names ld doesn't care about the object format.  Use
'objcopy --remove-leading-char' on each object file in the library.
There is a script at the end of the release notes from binutils
2.6.0.15 and earlier.


 - Ian

-- 
          -- Ian Burrell == iburrell@leland.stanford.edu **
           <URL:http://www-leland.stanford.edu/~iburrell/>
No matter how much you know, you will never know enough.


--
  PLEASE read the Red Hat FAQ, Tips, HOWTO and the MAILING LIST ARCHIVES!
  ________________________________________________________________________
  http://www.redhat.com/RedHat-FAQ   http://www.redhat.com/RedHat-HOWTO 
  http://www.redhat.com/RedHat-Tips  http://www.redhat.com/mailing-lists
  ------------------------------------------------------------------------
To unsubscribe: mail -s unsubscribe redhat-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post