Operating System - Linux
1748185 Members
4533 Online
108759 Solutions
New Discussion юеВ

Re: How do you generate ELF object file output using g++ compiler?

 
SOLVED
Go to solution
Maribeth Romeo
Frequent Advisor

How do you generate ELF object file output using g++ compiler?


I am trying to compile a C++ program using g++. I need the object files to be "ELF-64 relocatable object file - PA-RISC 2.0 (LP64)" files. When I use g++ to compile, I end up with "PA-RISC1.1 relocatable object" object files. How can I tell the g++ compiler to change the object file format? I don't have HP's c++ compiler, so I'm stuck with g++. Thanks.

 

 

-------------------------------

P.S. This Thread has been moved from HP-UX --> Netwrking to HP-UX --> Languages & Scripting - Forum Moderator

9 REPLIES 9
Piergiacomo Perini
Trusted Contributor

Re: How do you generate ELF object file output using g++ compiler?

Hi Maribeth,

i don't use g++, but in order to obtain ELF objects in HP's c++ compiler
"+DAportable" option in used.
Maybe something similar in g++?

regards
Maribeth Romeo
Frequent Advisor

Re: How do you generate ELF object file output using g++ compiler?

Well, that's exactly what I'm trying to figure out. I don't know what that option is. I've been pouring over the gcc documentation, but haven't found it yet.
Piergiacomo Perini
Trusted Contributor

Re: How do you generate ELF object file output using g++ compiler?

right, DAportable seems not be a option of g++.
So, try to "googleize" or try this
http://lists.gnu.org/archive/html/

regards
Peter Godron
Honored Contributor

Re: How do you generate ELF object file output using g++ compiler?

Maribeth,
-melf according to doc:
"Generate an executable in the ELF format, rather than the default'mmo' format used by the mmix simulalator"
Maribeth Romeo
Frequent Advisor

Re: How do you generate ELF object file output using g++ compiler?

That's not an option for HP-UX. The doc says, "-melf - Legacy no-op option only recognized with the cris-axis-elf and cris-axis-linuxgnu targets."

If you type "gcc -melf my.c" on the command line, you will get "invalid options 'elf'"

This doesn't seem like an unreasonable thing to do, does it?
Ermin Borovac
Honored Contributor
Solution

Re: How do you generate ELF object file output using g++ compiler?

You'll need 64-bit version of gcc. One place you can it from is http://www.hp.com/go/gcc, click on 'GCC for HP-UX' link and download HP-GCC PA-RISC LP64 (either 3.x or 4.x).
Arunvijai_4
Honored Contributor

Re: How do you generate ELF object file output using g++ compiler?

Hello,

You need to download 64 bit GCC for generating 64 bit objects. Default GCC what you download is capable of generating 32 bit objects. You can download from,

http://h21007.www2.hp.com/dspp/tech/tech_TechSoftwareDetailPage_IDX/1,1703,7663,00.html

Remember to download 64 bit version. It is HP Supported GCC.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Muthukumar_5
Honored Contributor

Re: How do you generate ELF object file output using g++ compiler?

You have to use +DA2.0 option with aCC or cc compiler.

http://groups.google.com/group/comp.soft-sys.ace/browse_thread/thread/74e72c0f9078d9b9/ba55ca761d7c8fa0%23ba55ca761d7c8fa0?sa=X&oi=groupsr&start=0&num=3

--
Muthu
Easy to suggest when don't know about the problem!
Maribeth Romeo
Frequent Advisor

Re: How do you generate ELF object file output using g++ compiler?

You are all right. I chose to use aCC only because of time constraints. I have to pay for it, but it is probably quicker than getting another version of gcc. Thanks to all of you.