[OpenAFS] linking afs.ext.64 on AIX fails with missing symbol vprintf

Ben Huntsman ben@huntsmans.net
Sat, 13 Aug 2022 05:57:41 +0000


--_000_MWHPR0701MB3674039C4659C58B11EF9213A7669MWHPR0701MB3674_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

After a few tweaks to some of the source files (which I will submit later),=
 I have all the code for afs.ext.64 compiling, but it fails to link due to =
a missing symbol .vprintf.  The AIX man pages show that this is included in=
 /lib/libc.a, and nm confirms it.  Here is the error:

        /usr/bin/ld -b"binder:/usr/lib/bind glink:/usr/lib/glink64.o" -bnoe=
ntry -b h:4  -D0 -T512 -b64 -bloadmap:afs.ext.64.loadmap  -bmap:afs.ext.64.=
map -o afs.ext.64  sha256-kernel.o  rand-timer-kernel.o  afs_atomlist.o  af=
s_lhash.o  afs_analyze.o  afs_axscache.o   afs_buffer.o         afs_bypassc=
ache.o  afs_callback.o       afs_cbqueue.o     afs_cell.o  afs_chunk.o     =
          afs_conn.o  afs_daemons.o       afs_dcache.o  afs_dir.o          =
       afs_disconnected.o      afs_dynroot.o           afs_error.o  afs_icl=
.o  afs_init.o  afs_lock.o  afs_mariner.o  afs_memcache.o   afs_fetchstore.=
o        afs_osi.o               afs_osidnlc.o   afs_osi_alloc.o         af=
s_osi_pag.o  afs_osi_uio.o  afs_osi_vget.o  afs_osi_vm.o  afs_segments.o  a=
fs_server.o  afs_stat.o  afs_syscall.o  afs_tokens.o  afs_user.o  afs_util.=
o  afs_vcache.o  afs_vnop_access.o  afs_vnop_attrs.o  afs_vnop_create.o  af=
s_vnop_dirops.o  afs_vnop_fid.o  afs_vnop_flock.o  afs_vnop_link.o  afs_vno=
p_lookup.o  afs_vnop_open.o  afs_vnop_read.o  afs_vnop_readdir.o  afs_vnop_=
remove.o  afs_vnop_rename.o  afs_vnop_strategy.o  afs_vnop_symlink.o  afs_v=
nop_write.o  afs_volume.o  afs_warn.o  xdr_update.o         xdr_refernce.o =
 Kvice.xdr.o     xdr_arrayn.o    xdr_array.o     xdr_int32.o     xdr_int64.=
o     Kvice.cs.o      fcrypt.o                rx.o            rx_call.o    =
   rx_conn.o       rx_peer.o       rx_rdwr.o       rx_clock.o      rx_event=
.o      rx_globals.o    rx_identity.o   rx_kmutex.o     rx_knet.o       rx_=
kcommon.o    rx_misc.o       rx_null.o       rx_opaque.o     rx_getaddr.o  =
  rx_packet.o     rx_multi.o      rx_stats.o      opr_rbtree.o    xdr_rx.o =
       xdr_mem.o       xdr_len.o       Kvldbint.cs.o   Kvldbint.xdr.o  Kcal=
lback.ss.o  Krxstat.ss.o    Krxstat.xdr.o   rxstat.o        crypt_conn.o   =
 AFS_component_version_number.o afs_exporter.o   rxkad_client.o  rxkad_comm=
on.o  xdr_afsuuid.o   xdr.o           Ktoken.xdr.o    md5.o           evp.o=
           evp-algs.o      rand-kernel.o    alloc-kernel.o         aes.o   =
        rijndael-alg-fst.o  sha.o               n-fold.o        crypto.o   =
     crypto-algs.o    crypto-aes.o   crypto-context.o  crypto-copy.o       =
  crypto-ct.o     crypto-evp.o    crypto-data.o   crypto-keyblock.o  crypto=
-store-int.o  crypto-random.o  afs_uuid.o osi_assem.o  osi_config.o  osi_gc=
pags.o  osi_groups.o  osi_file.o  osi_inode.o  osi_misc.o  osi_sleep.o  osi=
_timeout.o  osi_vcache.o  osi_vm.o  rand-fortuna-kernel.o afs_call.o  afs_p=
ioctl.o  osi_vfsops.o  osi_vnodeops.o   -m -eafs_config -bexport:/project/o=
penafs/lib/afs.exp -bI:/lib/kernex.exp -bI:/lib/syscalls.exp -bI:/lib/socke=
ts.exp  -bI:/lib/netinet.exp  -bI:/project/openafs/lib/extras.exp   -lsys -=
lcsys  -b64 -bI:/project/openafs/lib/export64.exp
ld: 0711-224 WARNING: Duplicate symbol: vnodefops
ld: 0711-224 WARNING: Duplicate symbol: .___memmove64
ld: 0711-224 WARNING: Duplicate symbol: ___memmove64
ld: 0711-224 WARNING: Duplicate symbol: .___memset64
ld: 0711-224 WARNING: Duplicate symbol: ___memset64
ld: 0711-224 WARNING: Duplicate symbol: .ip_stripoptions
ld: 0711-224 WARNING: Duplicate symbol: .soclose
ld: 0711-224 WARNING: Duplicate symbol: soclose
ld: 0711-224 WARNING: Duplicate symbol: Trconflag
ld: 0711-224 WARNING: Duplicate symbol: .sounlock
ld: 0711-224 WARNING: Duplicate symbol: sounlock
ld: 0711-224 WARNING: Duplicate symbol: .close
ld: 0711-224 WARNING: Duplicate symbol: close
ld: 0711-224 WARNING: Duplicate symbol: .___memcmp64
ld: 0711-224 WARNING: Duplicate symbol: ___memcmp64
ld: 0711-224 WARNING: Duplicate symbol: .kioctl
ld: 0711-224 WARNING: Duplicate symbol: .lookupname
ld: 0711-224 WARNING: Duplicate symbol: lookupname
ld: 0711-224 WARNING: Duplicate symbol: .socreate
ld: 0711-224 WARNING: Duplicate symbol: socreate
ld: 0711-224 WARNING: Duplicate symbol: .soreserve
ld: 0711-224 WARNING: Duplicate symbol: soreserve
ld: 0711-224 WARNING: Duplicate symbol: .sobind
ld: 0711-224 WARNING: Duplicate symbol: sobind
ld: 0711-344 See the loadmap file afs.ext.64.loadmap for more information.
ld: 0711-319 WARNING: Exported symbol not defined: afs_setTimeHost
ld: 0711-319 WARNING: Exported symbol not defined: rxevent_nFree
ld: 0711-319 WARNING: Exported symbol not defined: rxevent_nPosted
ld: 0711-319 WARNING: Exported symbol not defined: freeSQEList_lock
ld: 0711-319 WARNING: Exported symbol not defined: rxevent_lock
ld: 0711-317 ERROR: Undefined symbol: .vprintf
make: 1254-004 The error code from the last command is 8.

The reference is from src/rx/rx_kcommon.c:

void
osi_Msg(const char *fmt, ...)
{
    va_list ap;
    va_start(ap, fmt);
#if defined(AFS_LINUX_ENV)
    vprintk(fmt, ap);
#else
    vprintf(fmt, ap);
#endif
    va_end(ap);
}


Just as another sloppy fix I tried several variants of print functions that=
 could substitute on AIX, but they all fail with a missing symbol.  How did=
 this work on AIX in the past?

Thank you!

-Ben


--_000_MWHPR0701MB3674039C4659C58B11EF9213A7669MWHPR0701MB3674_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
After a few tweaks to some of the source files (which I will submit later),=
 I have all the code for afs.ext.64 compiling, but it fails to link due to =
a missing symbol .vprintf.&nbsp; The AIX man pages show that this is includ=
ed in /lib/libc.a, and nm confirms it.&nbsp;
 Here is the error:</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
<br>
</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
&nbsp; &nbsp; &nbsp; &nbsp; /usr/bin/ld -b&quot;binder:/usr/lib/bind glink:=
/usr/lib/glink64.o&quot; -bnoentry -b h:4 &nbsp;-D0 -T512 -b64 -bloadmap:af=
s.ext.64.loadmap &nbsp;-bmap:afs.ext.64.map -o afs.ext.64 &nbsp;sha256-kern=
el.o &nbsp;rand-timer-kernel.o &nbsp;afs_atomlist.o &nbsp;afs_lhash.o &nbsp=
;afs_analyze.o &nbsp;afs_axscache.o
 &nbsp; afs_buffer.o &nbsp; &nbsp; &nbsp; &nbsp; afs_bypasscache.o &nbsp;af=
s_callback.o &nbsp; &nbsp; &nbsp; afs_cbqueue.o &nbsp; &nbsp; afs_cell.o &n=
bsp;afs_chunk.o &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; afs_conn.o=
 &nbsp;afs_daemons.o &nbsp; &nbsp; &nbsp; afs_dcache.o &nbsp;afs_dir.o &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; afs_disconnected.o &nbs=
p; &nbsp; &nbsp;afs_dynroot.o &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; afs_error.=
o &nbsp;afs_icl.o
 &nbsp;afs_init.o &nbsp;afs_lock.o &nbsp;afs_mariner.o &nbsp;afs_memcache.o=
 &nbsp; afs_fetchstore.o &nbsp; &nbsp; &nbsp; &nbsp;afs_osi.o &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; afs_osidnlc.o &nbsp; afs_osi_alloc.o &n=
bsp; &nbsp; &nbsp; &nbsp; afs_osi_pag.o &nbsp;afs_osi_uio.o &nbsp;afs_osi_v=
get.o &nbsp;afs_osi_vm.o &nbsp;afs_segments.o &nbsp;afs_server.o &nbsp;afs_=
stat.o &nbsp;afs_syscall.o
 &nbsp;afs_tokens.o &nbsp;afs_user.o &nbsp;afs_util.o &nbsp;afs_vcache.o &n=
bsp;afs_vnop_access.o &nbsp;afs_vnop_attrs.o &nbsp;afs_vnop_create.o &nbsp;=
afs_vnop_dirops.o &nbsp;afs_vnop_fid.o &nbsp;afs_vnop_flock.o &nbsp;afs_vno=
p_link.o &nbsp;afs_vnop_lookup.o &nbsp;afs_vnop_open.o &nbsp;afs_vnop_read.=
o &nbsp;afs_vnop_readdir.o &nbsp;afs_vnop_remove.o
 &nbsp;afs_vnop_rename.o &nbsp;afs_vnop_strategy.o &nbsp;afs_vnop_symlink.o=
 &nbsp;afs_vnop_write.o &nbsp;afs_volume.o &nbsp;afs_warn.o &nbsp;xdr_updat=
e.o &nbsp; &nbsp; &nbsp; &nbsp; xdr_refernce.o &nbsp;Kvice.xdr.o &nbsp; &nb=
sp; xdr_arrayn.o &nbsp; &nbsp;xdr_array.o &nbsp; &nbsp; xdr_int32.o &nbsp; =
&nbsp; xdr_int64.o &nbsp; &nbsp; Kvice.cs.o &nbsp; &nbsp; &nbsp;fcrypt.o &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; &nbsp;rx.o &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rx_call.=
o &nbsp; &nbsp; &nbsp; rx_conn.o &nbsp; &nbsp; &nbsp; rx_peer.o &nbsp; &nbs=
p; &nbsp; rx_rdwr.o &nbsp; &nbsp; &nbsp; rx_clock.o &nbsp; &nbsp; &nbsp;rx_=
event.o &nbsp; &nbsp; &nbsp;rx_globals.o &nbsp; &nbsp;rx_identity.o &nbsp; =
rx_kmutex.o &nbsp; &nbsp; rx_knet.o &nbsp; &nbsp; &nbsp; rx_kcommon.o &nbsp=
; &nbsp;rx_misc.o &nbsp; &nbsp; &nbsp; rx_null.o &nbsp; &nbsp; &nbsp; rx_op=
aque.o &nbsp; &nbsp; rx_getaddr.o
 &nbsp; &nbsp;rx_packet.o &nbsp; &nbsp; rx_multi.o &nbsp; &nbsp; &nbsp;rx_s=
tats.o &nbsp; &nbsp; &nbsp;opr_rbtree.o &nbsp; &nbsp;xdr_rx.o &nbsp; &nbsp;=
 &nbsp; &nbsp;xdr_mem.o &nbsp; &nbsp; &nbsp; xdr_len.o &nbsp; &nbsp; &nbsp;=
 Kvldbint.cs.o &nbsp; Kvldbint.xdr.o &nbsp;Kcallback.ss.o &nbsp;Krxstat.ss.=
o &nbsp; &nbsp;Krxstat.xdr.o &nbsp; rxstat.o &nbsp; &nbsp; &nbsp; &nbsp;cry=
pt_conn.o &nbsp; &nbsp;AFS_component_version_number.o
 afs_exporter.o &nbsp; rxkad_client.o &nbsp;rxkad_common.o &nbsp;xdr_afsuui=
d.o &nbsp; xdr.o &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Ktoken.xdr.o &nbsp; &nb=
sp;md5.o &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; evp.o &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; evp-algs.o &nbsp; &nbsp; &nbsp;rand-kernel.o &nbsp; &nbsp;alloc-k=
ernel.o &nbsp; &nbsp; &nbsp; &nbsp; aes.o &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; rijndael-alg-fst.o &nbsp;sha.o &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; n-fold.o &nbsp; &nbsp; &nbsp;
 &nbsp;crypto.o &nbsp; &nbsp; &nbsp; &nbsp;crypto-algs.o &nbsp; &nbsp;crypt=
o-aes.o &nbsp; crypto-context.o &nbsp;crypto-copy.o &nbsp; &nbsp; &nbsp; &n=
bsp; crypto-ct.o &nbsp; &nbsp; crypto-evp.o &nbsp; &nbsp;crypto-data.o &nbs=
p; crypto-keyblock.o &nbsp;crypto-store-int.o &nbsp;crypto-random.o &nbsp;a=
fs_uuid.o osi_assem.o &nbsp;osi_config.o &nbsp;osi_gcpags.o &nbsp;osi_group=
s.o
 &nbsp;osi_file.o &nbsp;osi_inode.o &nbsp;osi_misc.o &nbsp;osi_sleep.o &nbs=
p;osi_timeout.o &nbsp;osi_vcache.o &nbsp;osi_vm.o &nbsp;rand-fortuna-kernel=
.o afs_call.o &nbsp;afs_pioctl.o &nbsp;osi_vfsops.o &nbsp;osi_vnodeops.o &n=
bsp; -m -eafs_config -bexport:/project/openafs/lib/afs.exp -bI:/lib/kernex.=
exp -bI:/lib/syscalls.exp
 -bI:/lib/sockets.exp &nbsp;-bI:/lib/netinet.exp &nbsp;-bI:/project/openafs=
/lib/extras.exp &nbsp; -lsys -lcsys &nbsp;-b64 -bI:/project/openafs/lib/exp=
ort64.exp
<div>ld: 0711-224 WARNING: Duplicate symbol: vnodefops</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: .___memmove64</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: ___memmove64</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: .___memset64</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: ___memset64</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: .ip_stripoptions</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: .soclose</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: soclose</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: Trconflag</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: .sounlock</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: sounlock</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: .close</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: close</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: .___memcmp64</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: ___memcmp64</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: .kioctl</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: .lookupname</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: lookupname</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: .socreate</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: socreate</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: .soreserve</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: soreserve</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: .sobind</div>
<div>ld: 0711-224 WARNING: Duplicate symbol: sobind</div>
<div>ld: 0711-344 See the loadmap file afs.ext.64.loadmap for more informat=
ion.</div>
<div>ld: 0711-319 WARNING: Exported symbol not defined: afs_setTimeHost</di=
v>
<div>ld: 0711-319 WARNING: Exported symbol not defined: rxevent_nFree</div>
<div>ld: 0711-319 WARNING: Exported symbol not defined: rxevent_nPosted</di=
v>
<div>ld: 0711-319 WARNING: Exported symbol not defined: freeSQEList_lock</d=
iv>
<div>ld: 0711-319 WARNING: Exported symbol not defined: rxevent_lock</div>
<div>ld: 0711-317 ERROR: Undefined symbol: .vprintf</div>
<div>make: 1254-004 The error code from the last command is 8.</div>
<br>
</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
The reference is from src/rx/rx_kcommon.c:</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
<br>
</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
void
<div>osi_Msg(const char *fmt, ...)</div>
<div>{</div>
<div>&nbsp; &nbsp; va_list ap;</div>
<div>&nbsp; &nbsp; va_start(ap, fmt);</div>
<div>#if defined(AFS_LINUX_ENV)</div>
<div>&nbsp; &nbsp; vprintk(fmt, ap);</div>
<div>#else</div>
<div>&nbsp; &nbsp; vprintf(fmt, ap);</div>
<div>#endif</div>
<div>&nbsp; &nbsp; va_end(ap);</div>
<div>}</div>
<br>
</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
<br>
</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
Just as another sloppy fix I tried several variants of print functions that=
 could substitute on AIX, but they all fail with a missing symbol.&nbsp; Ho=
w did this work on AIX in the past?</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
<br>
</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
Thank you!</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
<br>
</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
-Ben</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
<br>
</div>
</body>
</html>

--_000_MWHPR0701MB3674039C4659C58B11EF9213A7669MWHPR0701MB3674_--