General
cancel
Showing results for 
Search instead for 
Did you mean: 

HP-UX equivalent for -shared option to ld

SOLVED
Go to solution
Wim Rombauts
Honored Contributor

HP-UX equivalent for -shared option to ld

I am attempting a first compile from (open-)sourcecode on HP-UX.
I have worked myself through the configure script (after some downloads of additional modules) and now I am running "make".
Make fails however with the message "ld: Unrecognized argument: -shared"
I found this option specified in Makefile. This should probably be something else on HP-UX. Has someone of you an idea what it should be ?
5 REPLIES
Wim Rombauts
Honored Contributor

Re: HP-UX equivalent for -shared option to ld

In case it is important (I am new to compiling and building, so I don't know) : Here si the command :

ld +h liblwgeom.so.1 -b -shared -o liblwgeom.so.1
Dennis Handly
Acclaimed Contributor
Solution

Re: HP-UX equivalent for -shared option to ld

You should NOT be using ld directly. Instead use the appropriate driver commands.
And for ld specific options, use -Wl,+h,liblwgeom.so.1.
(Just leave out -shared.)
Wim Rombauts
Honored Contributor

Re: HP-UX equivalent for -shared option to ld

I am not running ld manually, I am running make, but it was failing on an ld command.

I have been able to remove the "-shared" option. Make continues now, but fails later on with messages :
ld: unsatisfied symbol "libiconv_open" in file shp2pgsql.o
ld: unsatisfied symbol "libiconv_close" in file shp2pgsql.o
ld: unsatisfied symbol "libiconv" in file shp2pgsql.o

This despite the fact I added /usr/local/lib/hpux32 to SHLIB_PATH, which contains libiconv.so

Any further ideas ? Anyone of you who has some more expirience with compiling open source code on HP-UX ?
Dennis Handly
Acclaimed Contributor

Re: HP-UX equivalent for -shared option to ld

>I am running make, but it was failing on an ld command.

It doesn't matter that you are using make. It shouldn't be used directly.
If you have a LD macro, it should be set to $(CC) or $(CXX).

>fails later on with messages: ld: unsatisfied symbol "libiconv_open"

Have you specified -liconv with a -L path?

>I added /usr/local/lib/hpux32 to SHLIB_PATH, which contains libiconv.so

SHLIB_PATH is useless during linking, you need -L path.
Wim Rombauts
Honored Contributor

Re: HP-UX equivalent for -shared option to ld

Dennis, you were of great help.

Setting the environment variable LDFLAGS to "-L/usr/local/bin/hpux32" fixed this last issue. I could complete the make commands.