- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Compiling Cobject in HP-UNIX
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-23-2009 04:04 AM
тАО10-23-2009 04:04 AM
Hi,
We are in the process of server migration to Itanium.
It was found out during migration that we are required to recompile a *.c file in order to generate an executable object on the Itanium.
I tried compiling the *.c file but got an error 'unsatisfied symbol "mainz" '(file attached)
C
Some one please help me in compiling my *.c script on the itanium platform, this is subject to the delivery of the requirement now...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-23-2009 04:23 AM
тАО10-23-2009 04:23 AM
Re: Compiling Cobject in HP-UNIX
Presumably the PA system you are migrating from had a full ANSI C compiler... one would imagine you'll need the same thing on the Integrity system...
http://www.hp.com/go/ansic
HTH
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-23-2009 05:17 AM
тАО10-23-2009 05:17 AM
Re: Compiling Cobject in HP-UNIX
The linker can't find the main() function [which is required in C programs] because the .c file which provides it isn't in this compilation pass.
To compile just this file into an object to be linked later, the "-c" option could be used. But I suspect the larger problem here is that you may not know how these .c files are laid out, what they mean to each other, etc.
Is there an INSTALL or README file somewhere? A configure script or Makefile? If this is a source package provided to you as a customer with the intent of you building your own, I would expect some documentation on the proper way to build this. Otherwise, if you didn't write it and the person(s) who did are unavailable and left no documentation, guessing on how to compile this is very unlikely to succeed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-23-2009 05:47 AM - edited тАО10-01-2011 04:37 PM
тАО10-23-2009 05:47 AM - edited тАО10-01-2011 04:37 PM
Re: Compiling C object in HP-UX
>we are required to recompile a *.c file
Well you compiled the file but you need a bunch more files to link with. Unless you were trying to create a shlib? (You can't do that with the bundled C compiler.)
>Duncan: http://www.hp.com/go/ansic
These are not the droids you want. The correct link for Integrity is:
http://www.hp.com/go/aCC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-23-2009 06:24 AM
тАО10-23-2009 06:24 AM
Re: Compiling Cobject in HP-UNIX
Curses - damn jedi mind trick gets me every time...
anyway I've diff'd those 2 links in my head now - will try and get it right next time...
in the meantime:
you can go about your business - move along, move along
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2009 10:44 PM
тАО10-26-2009 10:44 PM
Re: Compiling Cobject in HP-UNIX
In line with the query posted, I am now able to compile the *.c source code using the command below
--> gcc -shared -o TFICM.o TFICM.c
output: TFICM.o
--> gcc -shared -o TFICM.so TFICM.o
output: TFICM.so
The file above TFICM.so is the executable file that we had to generate.
I am now not sure if the file created(TFICM.so) is correct or not.
I am now facing an error when running a custom process which says:
Error loading TFICM * is not a valid load module: Bad magic number
Please let me know as to why would this error be thrown and also the corrective measures required to rectify this.
Thank you in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-27-2009 02:18 AM - edited тАО10-01-2011 04:36 PM
тАО10-27-2009 02:18 AM - edited тАО10-01-2011 04:36 PM
Re: Compiling C object in HP-UX
> gcc -shared -o TFICM.so TFICM.o
>The file above TFICM.so is the executable file that we had to generate.
Do you want an executable or a shlib? Your command above (-shared) creates a shlib.
>I am now facing an error when running a custom process which says:
Error loading TFICM * is not a valid load module: Bad magic number
Your TFICM.so seems fine if you are trying to dynamically load it with dlopen(3). You do need to make sure it is 32 or 64 to match who loads it.
What does "file TFICM.so" show?
If you need a 64 bit version, you need to port your code to 64 bit and then compile and link with -mlp64.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-27-2009 03:18 AM
тАО10-27-2009 03:18 AM
Re: Compiling Cobject in HP-UNIX
Thank you for your suggestion i tried creating the *.so file again using the below commands:
--> gcc -shared -mlp64 -o TFICM.o TFICM.c
output: TFICM.o
--> gcc -shared -mlp64 -o TFICM.so TFICM.o
output: TFICM.so
file TFICM.o --
TFICM.o: ELF-64 shared object file - IA64
file TFICM.so
TFICM.so: ELF-64 shared object file - IA64
I did want to create an executable as this is what is expected to be generated from the *.c code.
I was suggested to use "-shared" option by one of our consultants, I am not aware of any options used with gcc/cc as I am not from the background.
Can the TFICM.so file generated using the above commands be used as an executable?
Please suggest a way forward to generate an executable from the *.c file.
Note: We are taking up this activity on the Itanium server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-27-2009 11:05 PM
тАО10-27-2009 11:05 PM
Re: Compiling Cobject in HP-UNIX
Thanks a lot for the option suggested.
This worked a great deal, helping me to run my custom application error free.
Below are the steps used:
1)
--> gcc -c -mlp64 -o TFICM.o TFICM.c
output: TFICM.o
file TFICM.o
TFICM.o: ELF-64 relocatable object file - IA64
2)
--> gcc -shared -mlp64 -o TFICM.so TFICM.o
output: TFICM.so
file TFICM.so
TFICM.so: ELF-64 shared object file - IA64
-------------------
Please confirm a point below helping me completing this activity:
1) We have used GCC compiler above to compile the *.c code on ITANIUM server, should we use the aCC compiler instead because I have read somwher that aCC compiler is compatible with ITANIUM server?
Thanking you again for all the help.
Awaiting your response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2009 02:49 AM - edited тАО10-01-2011 04:37 PM
тАО10-28-2009 02:49 AM - edited тАО10-01-2011 04:37 PM
Re: Compiling C object in HP-UX
>1) We have used gcc compiler above to compile the *.c code on Integrity server, should we use the aCC compiler instead because I have read somewhere that aCC compiler is compatible ...
If you want performance on Integrity, you should use aC++ (and optimize). If you have only C sources, gcc and cc are binary compatible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2009 04:49 AM
тАО10-28-2009 04:49 AM
Re: Compiling Cobject in HP-UNIX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2009 01:58 AM - edited тАО10-01-2011 04:38 PM
тАО10-29-2009 01:58 AM - edited тАО10-01-2011 04:38 PM
Re: Compiling C object in HP-UX
>Thanks a lot Dennis, helped me a lot
You might want to look at the following to see how many points to assign to each reply and if you are happy, you should close it and say it has a solution:
http://forums.itrc.hp.com/service/forums/helptips.do?#34
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2009 02:05 AM
тАО10-29-2009 02:05 AM
Re: Compiling Cobject in HP-UNIX
I wil surely rate the solution.
One question before i do that:
I tried to compile the same using an aCC compiler but i think option -mlp64 is not supported by aCC compiler, resulting in an error:
aCC: warning 901: unknown option: `-mlp64':
Kindly suggest me an option for aCC to produce a ELF-64 *.o file
If possible please list the steps to produce the *.so file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2009 02:36 AM - edited тАО10-01-2011 04:39 PM
тАО10-29-2009 02:36 AM - edited тАО10-01-2011 04:39 PM
Re: Compiling C object in HP-UX
>i think option -mlp64 is not supported by aCC compiler
The options are +DD64 and +DD32.
>If possible please list the steps to produce the *.so file
The option is: -b -o TFICM.so ...
http://docs.hp.com/en/14487/libs.htm#createlib
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2009 02:44 AM
тАО10-29-2009 02:44 AM
Re: Compiling Cobject in HP-UNIX
I was just drafting this message and received your response.
1)
I found the +DD64 option and generated the *.o file
Command:
aCC -c +DD64 -o TFICM.o TFICM.c
file TFICM.o
TFICM.o: ELF-64 relocatable object file - IA64
Should this be the same as with the gcc compiler?
2)
I am now stuck with generating the *.so file which i want to create as a shared object.
"-shared" option is not supported by aCC compiler
I am searching for an equivalent command for aCC compiler but not able to find yet
Please help me...
Thank you in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2009 02:54 AM - edited тАО10-01-2011 04:39 PM
тАО10-29-2009 02:54 AM - edited тАО10-01-2011 04:39 PM
Re: Compiling C object in HP-UX
>Should this be the same as with the gcc compiler?
It should do the same but faster. :-)
>"-shared" option is not supported by aCC driver
You use the -b option to create a shlib.
- Tags:
- shlib
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2009 02:56 AM - edited тАО10-01-2011 04:40 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2009 03:03 AM
тАО10-29-2009 03:03 AM
Re: Compiling Cobject in HP-UNIX
I have used aCC for both compiling and linking now, resulting in a different error.
Earlier I had used the gcc compiler and my custom application was working fine.
Should I again compile it with gcc compiler and leave it as it is?
I am not aware of what difference it would make on an Itanium server.
My vendor had also mentioned about aCC.
What do you mean by "the names would be mangled"?
I am getting a little nervous now as i am approaching my delvery date.
It is a C source file that i am trying to compile and link
Should the type of compiler used to compile and link matter at all??
Banking on you again!!!! :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2009 04:15 AM
тАО10-29-2009 04:15 AM
Re: Compiling Cobject in HP-UNIX
I have now been able to successfully test my custom application component.
Steps used to generate the exceutable file is as below.
--> cc -c +z +DD64 TFICM.c
output: TFICM.o
--> cc -b +DD64 -o TFICM.so TFICM.o
output: TFICM.so
Thank you for all the help.
Hope to not see any more issues :)
Thank you again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-30-2009 02:13 AM - edited тАО10-01-2011 04:41 PM
тАО10-30-2009 02:13 AM - edited тАО10-01-2011 04:41 PM
Re: Compiling C object in HP-UX
>Should I again compile it with gcc compiler and leave it as it is? I am not aware of what difference it would make on an Itanium server.
Just compile with cc. It will be faster if you optimize.
>My vendor had also mentioned about aCC.
aC++ is the name of the product. It contains the aCC, cc, c89 and c99 drivers.
>What do you mean by "the names would be mangled"?
If you compile your C sources with a C++ compiler, your symbols are mangled so C++ overloading works.
>It is a C source file that I am trying to compile and link Should the type of compiler used to compile and link matter at all?
Most definitely. Use cc to compile and link.
>Steps used to generate the executable file is as below.
$ cc -c +z +DD64 TFICM.c
$ cc -b +DD64 -o TFICM.so TFICM.o
For Integrity, you don't need +z. And if you like, you can combine the two steps for trivial single source load modules:
cc -b +DD64 -o TFICM.so TFICM.c
If you need to debug, you can add -g. If you want to optimize, +O2 or -O. And there is +wlint if you want to clean up your code.