Operating System - Linux
1754323 Members
2409 Online
108813 Solutions
New Discussion юеВ

Re: error Expected EM_IA_64 but found EM_PARISC

 
anat heilper
Frequent Advisor

error Expected EM_IA_64 but found EM_PARISC

Hi,
I'm compiling an application on hp 11.23 Itanium, and i received the following message: Mismatched machine types. Expected EM_IA_64 but found EM_PARISC in file my_prog.out

can someone point me what i did wrong?
10 REPLIES 10
Dennis Handly
Acclaimed Contributor

Re: error Expected EM_IA_64 but found EM_PARISC

You have mixed a PA64 object with IPF objects.
You need to use file(1) on your objects and look for:
ELF-64 relocatable object file - PA-RISC 2.0 (LP64)

This bad object could be in an archive lib.
anat heilper
Frequent Advisor

Re: error Expected EM_IA_64 but found EM_PARISC

Hi,
i looked what caused the issue,
and i saw that the problem was that i included , and according to the man pages,
i need to add a compilation flag -D_POSIX_C_SOURCE=199506L in a multi threaded application.
Thanks,
Anat
Dennis Handly
Acclaimed Contributor

Re: error Expected EM_IA_64 but found EM_PARISC

>saw that the problem was that i included ,

This won't cause that problem.
If you to use threads with HP compilers, you should use the -mt option.
anat heilper
Frequent Advisor

Re: error Expected EM_IA_64 but found EM_PARISC

Hi,
I'm using the /opt/ansic/bin/cc compiler.
what does the -mt do? Where can I see documentation of that?
Thanks,
Anat
rick jones
Honored Contributor

Re: error Expected EM_IA_64 but found EM_PARISC

If all else fails, I would try docs.hp.com. I suspect that the manuals also came along for the ride when you installed the compiler, but being a networking rather than compiler guy I tend to think of websites first :)

Likely as not when you changed your makefile (?) to include the -D stuff, you caused something to be recompiled that had not been recompiled before. Just a guess.
there is no rest for the wicked yet the virtuous have no pillows
Dennis Handly
Acclaimed Contributor

Re: error Expected EM_IA_64 but found EM_PARISC

>what does the -mt do? Where can I see documentation of that?

http://docs.hp.com/en/8759/options.htm#opt-mt
Dennis Handly
Acclaimed Contributor

Re: error Expected EM_IA_64 but found EM_PARISC

Did you ever solve your problem and find that bad PA object?
anat heilper
Frequent Advisor

Re: error Expected EM_IA_64 but found EM_PARISC

hi, the problem was adding the flag -D_POSIX_C_SOURCE=199506L

ASNat
AwadheshPandey
Honored Contributor

Re: error Expected EM_IA_64 but found EM_PARISC

Mismatched Machine Types

The "Mismatched machine types" message indicates a file of the wrong architecture on the link line. This is most likely caused by the use of an incorrect directory on a -L option. For example:


% cc +DD64 -L/lib/pa20_64 -lm foo.c
ld: Mismatched machine types. Expected EM_IA_64 but found
EM_PARISC in file /lib/pa20_64/libm.sl
Fatal error.


The error message itself identifies the problem library. In this case /lib/pa20_64/libm.sl is the source of the problem. The correct version of the library for the architecture will need to be located.

go to chap 5 Linkers and Loaders in the link http://h30097.www3.hp.com/docs/porting/tru64-to-hpux/CHPLNKRX.HTM
It's kind of fun to do the impossible