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 ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| ||||
| 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 |