Operating System - HP-UX
1751744 Members
5479 Online
108781 Solutions
New Discussion юеВ

Re: problems linking with -lrwtool_v2

 
Eric Krohn
New Member

problems linking with -lrwtool_v2

I'm building a shared library on HP-UX 11.23 PA-RISC. The code is compiled -AA, so I thought that means I need to link with -lrwtool_v2 instead of -lrwtool. However, the symlink for librwtool_v2.sl does not exist on the system:
% ls -lF /lib/librwtool*
-r-xr-xr-x 1 bin bin 1388544 Jul 14 2004 /lib/librwtool.1*
-r-xr-xr-x 1 bin bin 1429504 Jul 5 2006 /lib/librwtool.2*
-r--r--r-- 1 bin bin 1412324 Jul 5 2006 /lib/librwtool.a
lrwxrwxrwx 1 bin bin 13 Jan 12 13:29 /lib/librwtool.sl@ -> ./librwtool.2
-r-xr-xr-x 1 bin bin 2772992 Jul 5 2006 /lib/librwtool_v2.2*
-r--r--r-- 1 bin bin 3711576 Jul 5 2006 /lib/librwtool_v2.a

I link with:
aCC -AA -mt +DAportable +Z -DRW_DONT_USE_MEMPOOL -L. -L/lib
-L/export/sgc/16_0_hpps_bld/bld/lib -L/export/sgc/extern/16_0_hpps/lib -b +Z
-o libxscPublish.sl xscPublish.p xscLdapIf.p +p +w +W392,431,655,684,818 -I. -
I/include -I/export/sgc/16_0_hpps_bld/bld/include -I/export/sgc/extern/16_
0_hpps/include -I/opt/vbroker8.0full/include -I/opt/vbroker8.0full/include/di
spatch -I/opt/vbroker8.0full/include/stubs -I/opt/wsdtx/src/src -I /export/
sgc/extern/16_0_hpps/include/xercesc -g -DINCLUDE_FSTREAM -D_VIS_L
ONG_LONG -D_VIS_LONG_DOUBLE -D_VIS_UNICODE -D_VIS_STREAM_WCHAR -lxscConf
ig -lxscCipher -lrwtool_v2 -lxscTrace -L/opt/ldap/lib -lldap -llber

and get this linker error:
/usr/ccs/bin/ld: DP relative code in file /lib/librwtool_v2.a(cstring.o) - share
d library must be position independent. Use +z or +Z to recompile.

presumably because the linker finds the static rather than the shared library.

So are we really missing the librwtool_v2.sl? Or should I be using a different library, like -lrwtool (though I thought that was for -AP)?

% what /opt/aCC/bin/aCC
/opt/aCC/bin/aCC:
$Revision: 92453-07 linker linker crt0.o B.11.53 060807 $
HP aC++ B3910B A.03.80
HP aC++ B3910B A.03.73 Classic Iostream Library
HP aC++ B3910B A.03.73 Language Support Library
3 REPLIES 3
Dennis Handly
Acclaimed Contributor

Re: problems linking with -lrwtool_v2

>I thought that means I need to link with -lrwtool_v2 instead of -lrwtool.

Exactly.

>the symlink for librwtool_v2.sl does not exist on the system:

Then you'll have to manually add it back.
# ln -s librwtool_v2.2 /usr/lib/librwtool_v2.sl

This symlink should be on the core OS.
swlist -l file | grep lib/librwtool_v2

>% ls -lF /lib/librwtool*
>-L/lib

Don't use /lib, use /usr/lib. The latter -L is the default, remove it.
Eric Krohn
New Member

Re: problems linking with -lrwtool_v2

Thanks, Dennis.

The -L/lib resulted from a missing Makefile variable -- fixed now.

>>the symlink for librwtool_v2.sl does not exist on the system:

>Then you'll have to manually add it back.
># ln -s librwtool_v2.2 /usr/lib/librwtool_v2.sl

>This symlink should be on the core OS.
>swlist -l file | grep lib/librwtool_v2

Our system administrator manually created the symlink, but is concerned about why it was not automatically created on HP-UX 11.23. He says:
"Can you ask if the link is still part of the OS on HP-UX 11.23 [PA-RISC], I
don't see it in 11.23 swlist, but it's there on HP-UX 11.11."

Running swlist -l file | grep lib/librwtool_v2 on 11.11 PA-RISC:
OS-Core.CORE-SHLIBS: /usr/lib/librwtool_v2.2
OS-Core.CORE-SHLIBS: /usr/lib/librwtool_v2.sl
PHSS_33946.CORE-SHLIBS: /usr/lib/librwtool_v2.2
PHSS_33946.CORE-SHLIBS: /usr/lib/librwtool_v2.sl
PHSS_33946.LANG-MIN: /usr/lib/librwtool_v2.a
ProgSupport.LANG-MIN: /usr/lib/librwtool_v2.a

but on 11.23 PA-RISC the /usr/lib/librwtool_v2.sl is omitted:
OS-Core.CORE-SHLIBS: /usr/lib/librwtool_v2.2
PHSS_35055.CORE-SHLIBS: /usr/lib/librwtool_v2.2
PHSS_35055.LANG-MIN: /usr/lib/librwtool_v2.a
ProgSupport.LANG-MIN: /usr/lib/librwtool_v2.a
Dennis Handly
Acclaimed Contributor

Re: problems linking with -lrwtool_v2

>but is concerned about why it was not automatically created on HP-UX 11.23. He says:
"Can you ask if the link is still part of the OS on HP-UX 11.23 [PA-RISC], I don't see it in 11.23 swlist, but it's there on HP-UX 11.11."

Hmm. The -AA librwtool_v2 was added to 11.11 in 2002 in a patch.
11.23 for IPF was released in 2003 and the .so symlinks were there.
11.23 for PA was released in 2004 and the .sl symlinks don't seem to be present. :-(

And unfortunately following patches for PA didn't create the symlinks, assuming they were there.

So you are the first to report this problem in 5+ years.
If you have a support contract, please contact the Response Center and report this bug.