LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-27-2008, 04:14 PM   #1
ron7000
Member
 
Registered: Nov 2007
Location: CT
Posts: 248

Rep: Reputation: 26
linking to x86 libraries on an ia64 machine


I have an sgi altix machine, it's itanium 2 architecture running Novell SLES 10, gcc 4 compiler.

I wrote some C++ code that has to link to 3rd party libraries which are only available for x86_64 linux and not specifically for ia64.

Is there a way to compile my C++ code and link such that it can use the libraries?
Right now when I try it the compilers says skipping incompatible .a file.

we have some other software that when we run it, we have a script first that does a setenv ARCH lnx86 before it executes the script and it works fine. So that gives me the impression at least there is a way to read x86_64 library files, which are *.a files, on an ia64 machine.
 
Old 05-27-2008, 04:26 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

Short answer: "Yes, you probably can".

Longer answer:
1. You're aware, of course, that x86 (32-bit) and Itanium (64-bit) are completely different architectures.

2. As such, the binaries (.o objects, .a libraries, .so shared libraries, executable programs, etc) have a signature in their header differentiating one from the other.

3. Most (not necessarily all, but more) 64-bit OS's have parallel 32-bit and 64-bit environments (i.e. every standard shared library has both a 64-bit veresion as well as a 32-bit equivalent).

The same goes for development packages: you'll usually have parallel 32- and 64-bit binaries.

4. You should be aware that I64 and Itanium are also completely different architectures.

5. Having said all that, you're going to have to sort out for yourself just what combinations your OS does and doesn't support.

I would start out by trying to build a "hello world", in both 32- and 64-bit versions, and see what happens.

These links might help:

http://en.wikipedia.org/wiki/X86-64#History_of_Intel_64

http://en.wikipedia.org/wiki/Itanium

Last edited by paulsm4; 05-27-2008 at 04:39 PM.
 
Old 05-28-2008, 11:06 AM   #3
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
Other platforms may have the ability to use the IA32 emulation capabilities of Itanium (both hardware and software emulation), but linux, AFAIK, does not support this (and never did). I do not believe support for the IA32 portion of the ABI is normative to implementors, and the linux people decided that mixed code was a bad idea at the beginning.

So my short answer is, “no, you probably can’t.”
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking old libraries to new one? winterhunter Linux - Software 7 10-24-2005 04:37 AM
Oracle 9i installation on Red Hat Enterprise AS 3 (on a machine ia64) ErickEtManuel Linux - Software 1 06-15-2005 11:42 AM
Linking program with .a libraries rudy2 Programming 2 04-22-2005 05:36 AM
Linking Libraries, Dependencies Killbot_5000 Linux - Software 4 09-28-2004 08:59 AM
Linking to shared libraries? Griffon26 Programming 1 10-20-2001 05:29 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration