Unix Technical Forum

Building a Proper Shared Library

This is a discussion on Building a Proper Shared Library within the HP-UX Operating System forums, part of the Unix Operating Systems category; --> What is the proper command for building a shared library on HPUX? For example what is the equivalent of ...


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

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-16-2008, 07:01 PM
Michael B Allen
 
Posts: n/a
Default Building a Proper Shared Library

What is the proper command for building a shared library on HPUX?

For example what is the equivalent of the following for gcc for example?

gcc -shared -Wl,-soname,libfoo.0.8 f1.o f2.o f3.o \
-L/usr/local/lib -lc -lutil -o libfoo.so.0.8.1

or HPUX's cc:

cc -shared -soname libfoo.so.0.8 f1.o f2.o f3.o \
-L/usr/local/lib -lc -lutil -o libfoo.so.0.8.1

Thanks,
Mike
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-16-2008, 07:01 PM
ranga
 
Posts: n/a
Default Re: Building a Proper Shared Library


Michael B Allen wrote:
> What is the proper command for building a shared library on HPUX?
>
> For example what is the equivalent of the following for gcc for

example?
>
> gcc -shared -Wl,-soname,libfoo.0.8 f1.o f2.o f3.o \
> -L/usr/local/lib -lc -lutil -o libfoo.so.0.8.1
>
> or HPUX's cc:
>
> cc -shared -soname libfoo.so.0.8 f1.o f2.o f3.o \
> -L/usr/local/lib -lc -lutil -o libfoo.so.0.8.1


you need position independent code to build a shared library
the gcc option is -fpic/-fPIC

so gcc->cc:

-fpic -> +z
-fPIC -> +Z
-shared -> -b
-soname -> -Wl,+h

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 06:25 AM.


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