- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: gcc -shared in HPUX 11 32 bit
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
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
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
11-12-2001 02:26 AM
11-12-2001 02:26 AM
I compiled a few files using
"gcc -fPIC" to obtain *.o.
Then, I run
"gcc -shared -o abc.so *.o"
The error I got is as follows:
"/usr/bin/ld: DP relative code in file /var/tmp/ccKSMmXd.o - shared library must
be position
independent. Use +z or +Z to recompile.
collect2: ld returned 1 exit status"
I could not find the file "ccKSMmXd.o" in that directory. Can anyone advise what is wrong with it? The system is HPUX 11 (32-bit)
-Bryan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2001 02:37 AM
11-12-2001 02:37 AM
Re: gcc -shared in HPUX 11 32 bit
As it says, recompile but this time pass the +z flag to gcc.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2001 05:30 PM
11-12-2001 05:30 PM
Re: gcc -shared in HPUX 11 32 bit
I read from somewhere that the -fPIC should equivalent to +z/+Z , right?
I was not able to obtain the output file (*.so) I need, using the gcc -shared command.
Please advise.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2001 11:20 PM
11-12-2001 11:20 PM
Re: gcc -shared in HPUX 11 32 bit

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2001 12:44 AM
11-13-2001 12:44 AM
Re: gcc -shared in HPUX 11 32 bit
However, error occured when I am running gcc - shared. What confused me is that the error is related to 'ld'.
Could it be because of the 32-bit environment? Or, perhaps some 64-bit shared library files are required?
Please advise.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2001 02:13 AM
11-13-2001 02:13 AM
SolutionYou can NOT mix 32-bit and 64-bit object in an excutable. They must all be the same bitness. As for -fPIC, that is the gcc equivalent of +z.
Typically this type of error happens to me when the linker (ld) is trying to build a shared object and one of the objects was NOT build with the position indepent code flag (-fPIC/+z). Are you linking these objects (either the *.o or *.so) with any other libraries (other than libc)?
-Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2001 12:16 AM
11-15-2001 12:16 AM
Re: gcc -shared in HPUX 11 32 bit
I think I am mixing up the shared libraries required. I dont have the 64 bit shared libraries required.
Thanks for your advise