Unix Technical Forum

compilation for 64-bit machine

This is a discussion on compilation for 64-bit machine within the HP-UX Operating System forums, part of the Unix Operating Systems category; --> Hi, I am using gcc 3.4.3 on HP-UX11.11 (64-bit machine) I need to build a 64-bit library component . ...


Go Back   Unix Technical Forum > Unix Operating Systems > HP-UX Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-17-2008, 05:47 AM
niteshkpatil@gmail.com
 
Posts: n/a
Default compilation for 64-bit machine

Hi,

I am using gcc 3.4.3 on HP-UX11.11 (64-bit machine)
I need to build a 64-bit library component .
I am building the library component using the compiler options like
"-mpa-risc-2-0" "-march=2.0",

Even though the build is successfully done, I am unable to link this
component to my main application. I get an error such as (ld:
Mismatched ABI (not an ELF file).

And I am not sure whether the library is built for 64-bit model even
though i mention "-mpa-risc-2-0"?
Do I have to specify some other options?
Can the gcc 3.4.3 compiler on HP-UX 11.11 be used to build a 64-bit
library component ?

Looking forward to see some solutions.
Thanks in advance,

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-17-2008, 05:47 AM
Rick Jones
 
Posts: n/a
Default Re: compilation for 64-bit machine

niteshkpatil@gmail.com wrote:
> I am using gcc 3.4.3 on HP-UX11.11 (64-bit machine)


Obtained from where? HP DSPP, the Porting Archives, or elsewhere?

> I need to build a 64-bit library component .
> I am building the library component using the compiler options like
> "-mpa-risc-2-0" "-march=2.0",


PA 2.0 can still be 32-bit. I suppose that gcc might have used 2.0 as
they synonym for 64-bit but I don't think that would have been a good
decision.

> Even though the build is successfully done, I am unable to link this
> component to my main application. I get an error such as (ld:
> Mismatched ABI (not an ELF file).


What does the "file" command say about your objects/library after it
is built?

> And I am not sure whether the library is built for 64-bit model even
> though i mention "-mpa-risc-2-0"?
> Do I have to specify some other options?


Anything burried in the gcc manpage(s)?

> Can the gcc 3.4.3 compiler on HP-UX 11.11 be used to build a 64-bit
> library component ?


Unless you have specific gccisms (ie non-portable code) or specific
budgetary limitations, it might be good/better/best to buy a copy of
the HP ANSI compilers. Fewer issues with knowing that the requisite
runtime environment is present on other systems on which you wish to
run the application(s).

rick jones
--
oxymoron n, commuter in a gas-guzzling luxury SUV with an American flag
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-17-2008, 05:47 AM
niteshkpatil@gmail.com
 
Posts: n/a
Default Re: compilation for 64-bit machine

when I run the file command on the library component, it shows the
following message,

%file libtest.a
%libtest.a : archive file -PA-RISC2.0 relocatable library

The gcc man pages for the HP-UX 11.11 machine I am using is follows,
Target specific options:
-mwsio Generate cpp defines for workstation IO
-msio Generate cpp defines for server IO
-mlinker-opt Enable linker optimizations
-mno-long-calls Generate long calls only when needed
-mlong-calls Always generate long calls
-mno-big-switch Do not generate code for huge switch
statements
-mbig-switch Generate code for huge switch statements
-mno-fast-indirect-calls Do not generate fast indirect calls
-mfast-indirect-calls Generate fast indirect calls
-mno-long-load-store Do not emit long load/store sequences
-mlong-load-store Emit long load/store sequences
-mno-soft-float Do not use software floating point
-msoft-float Use software floating point
-mno-gas Do not assume code will be assembled by GAS
-mgas Assume code will be assembled by GAS
-mno-portable-runtime Do not use portable calling conventions
-mportable-runtime Use portable calling conventions
-mno-disable-indexing Do not disable indexed addressing
-mdisable-indexing Disable indexed addressing
-mno-jump-in-delay Do not put jumps in call delay slots
-mjump-in-delay Put jumps in call delay slots
-mspace-regs Do not disable space regs
-mno-space-regs Disable space regs
-mno-disable-fpregs Do not disable FP regs
-mdisable-fpregs Disable FP regs
-mpa-risc-2-0 Generate PA2.0 code (requires binutils 2.10
or later
)
-mpa-risc-1-1 Generate PA1.1 code
-mpa-risc-1-0 Generate PA1.0 code
-mnosnake Generate PA1.0 code
-msnake Generate PA1.1 code
-march= Specify architecture for code generation.
Values ar
e 1.0, 1.1, and 2.0. 2.0 requires gas snapshot 19990413 or later.
-mschedule= Specify CPU for scheduling purposes

I read somewhere that, -mpl64 can bue used....but it does not work with
the gcc compiler I am using...

anyway....thanks for the help...

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-17-2008, 05:47 AM
Rick Jones
 
Posts: n/a
Default Re: compilation for 64-bit machine

niteshkpatil@gmail.com wrote:
> when I run the file command on the library component, it shows the
> following message,


> %file libtest.a
> %libtest.a : archive file -PA-RISC2.0 relocatable library


it is just 32-bit then. using the HP ANSI compiler on hello world shows:

$ cc -c hello.c
$ file hello.o
hello.o: PA-RISC2.0 relocatable object
$ cc +DD64 -c hello.c
$ file hello.o
hello.o: ELF-64 relocatable object file - PA-RISC 2.0 (LP64)

$ cc -o hello hello.c
/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (hello.o) was detected. The linked output may not run on a PA 1.x system.
$ file hello
hello: PA-RISC2.0 shared executable dynamically linked -not stripped
$ cc +DD64 -o hello hello.c
$ file hello
hello: ELF-64 executable object file - PA-RISC 2.0 (LP64)

Basically, 64-bit objects/executables/libraries will say ELF... You
can check that out on some of the supplied libraries on the system
under /usr/lib etc...

rick jones
--
denial, anger, bargaining, depression, acceptance, rebirth...
where do you want to be today?
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:39 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com