Operating System - HP-UX
1753448 Members
5897 Online
108794 Solutions
New Discussion юеВ

shared library must be position independent" error when making Resin with Apache on HP 9000

 
SOLVED
Go to solution
Andrew Chou
Occasional Contributor

shared library must be position independent" error when making Resin with Apache on HP 9000

I try to compile Resin 2.1.14 with Apache 2.0.x bundled with HP-UX. When I did
$ ./configure --with-apxs=/opt/hpws/apache/bin/apxs

It seems to be ok other than the linker is not GNU but OS-bundled ld.

When I do 'make', I get the error below. The first line is a warning so I suppose it's ok. But the next line is a real error, which I have no idea what it means.

Could some one help on this?
Thanks,

----errors----
/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (jni_vfs.o) was detected. The linked output may not run on a PA 1.x system.

/usr/ccs/bin/ld: DP relative code in file std.o - shared library must be position independent. Use +z or +Z to recompile.
*** Error exit code 1
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: shared library must be position independent" error when making Resin with Apache on HP 9000

The file its complaining about either does not exist or is not on the path variable SHLIB_PATH.

If it exists, which I think it does.

echo $SHLIB_PATH

SHLIB_PATH=$SHLIB_PATH:/usr/ccs/bin
export SHLIB_PATH

Try the compile again.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ermin Borovac
Honored Contributor
Solution

Re: shared library must be position independent" error when making Resin with Apache on HP 9000

As the error message indicates linker is trying to create a shared library but objects that it's including in the shared library haven't been compiled with '+z' or '+Z' option.

You can try defining CFLAGS environment variable as follows.

/* if you are using hp's cc */
$ export CFLAGS="+Z"

/* if you are using gcc */
$ export CFLAGS="-fPIC"

Run 'make distclean' and configure again.
Andrew Chou
Occasional Contributor

Re: shared library must be position independent" error when making Resin with Apache on HP 9000

Thanks to Ermin and Steven for such quick helps.