This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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: 32 bit libraries in a 64 bit world?


On Thu, Aug 13, 2009 at 04:31:17PM -0700, Brian McGrew wrote:
> Good afternoon y¹all!  I¹ve asked this question once before, so forgive me,
> but I never got a conclusive answer and now it¹s time that I have to make
> something happen :-)
> 
> We've ported our applications from Fedora Core 5 32 bit to CentOS 5.3 x86_64
> and so far our own code is working great.
> 
> Now we need to link to a set of third party libraries that are 32 bit and
> since the vendor is in the middle of bankruptcy they're not going to port
> the code for us and getting the source code is even more of a stretch.
> 
> Is there anything I can do?  Some kind of a wrapper or conversion program or
> something???  These are dynamic libraries I'm linking to using the standard
> gcc-4.1.2 that comes with the machine.  If I need to upgrade gcc or other
> libraries on the box, I can do that too.

32-bit and 64-bit x86_64 have different ABI's.  Arguments are passed in
different registers, and the stack is setup differently.  The 32-bit library
would not be able to access any external, such as system calls or variables.
In addition, some 32-bit instructions are not valid when the program is in
64-bit mode (there are altivernative encodings for the instructions that work
in 64-bit, but the one generated by 32-bit compilers would not work).

-- 
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
meissner@linux.vnet.ibm.com


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