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

Ben Huntsman ben@huntsmans.net
Sat, 13 Aug 2022 16:20:27 +0000


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

Ah, yes, that is what I thought.  The problem is that AIX's kernel doesn't =
have vprintf.  Only printf.  However, the change set you linked indicates t=
hat previously, osi_Msg used fprintf, and indeed that goes all the way back=
 to the beginning.  That's why I wonder how it worked on AIX in the past.  =
With no vprintf in the kernel, what alternative should we use here?

Thank you!

-Ben



________________________________
From: Jeffrey E Altman
Sent: Saturday, August 13, 2022 2:23 AM
To: Ben Huntsman; openafs-info@openafs.org
Subject: Re: [OpenAFS] linking afs.ext.64 on AIX fails with missing symbol =
vprintf

On 8/13/2022 1:57 AM, Ben Huntsman (ben@huntsmans.net<mailto:ben@huntsmans.=
net>) wrote:
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.


libc is a userspace library.   The failure is when linking the kernel modul=
e and there is no vprintf in the kernel.


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?


The vprintf usage in kernel on AIX was introduced by


  https://gerrit.openafs.org/14791




--_000_MWHPR0701MB367420F72B076B1AC707CF35A7669MWHPR0701MB3674_
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">
Ah, yes, that is what I thought.&nbsp; The problem is that AIX's kernel doe=
sn't have vprintf.&nbsp; Only printf.&nbsp; However, the change set you lin=
ked indicates that previously, osi_Msg used fprintf, and indeed that goes a=
ll the way back to the beginning.&nbsp; That's why I
 wonder how it worked on AIX in the past.&nbsp; With no vprintf in the kern=
el, what alternative should we use here?</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>
<div>
<div><br>
</div>
<div style=3D"font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12p=
t; color:rgb(0,0,0);">
<br>
<hr tabindex=3D"-1" style=3D"display:inline-block; width:98%;">
<b>From:</b> Jeffrey E Altman<br>
<b>Sent:</b> Saturday, August 13, 2022 2:23 AM<br>
<b>To:</b> Ben Huntsman; openafs-info@openafs.org<br>
<b>Subject:</b> Re: [OpenAFS] linking afs.ext.64 on AIX fails with missing =
symbol vprintf
<div><br>
</div>
</div>
<div class=3D"rps_2a2f">
<div>
<div class=3D"x_moz-cite-prefix">On 8/13/2022 1:57 AM, Ben Huntsman (<a hre=
f=3D"mailto:ben@huntsmans.net" target=3D"_blank" rel=3D"noopener noreferrer=
" data-auth=3D"NotApplicable" class=3D"x_moz-txt-link-abbreviated">ben@hunt=
smans.net</a>) wrote:<br>
</div>
<blockquote type=3D"cite">
<div class=3D"x_elementToProof" style=3D"font-family:Calibri,Arial,Helvetic=
a,sans-serif; font-size:12pt; color:rgb(0,0,0)">
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;&nbsp;</div>
<br>
</blockquote>
<p style=3D"margin-top: 0px; margin-bottom: 0px;">libc is a userspace libra=
ry.&nbsp;&nbsp; The failure is when linking the kernel module and there is =
no vprintf in the kernel.</p>
<p style=3D"margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<blockquote type=3D"cite">
<div class=3D"x_elementToProof" style=3D"font-family:Calibri,Arial,Helvetic=
a,sans-serif; font-size:12pt; color:rgb(0,0,0)">
The reference is from src/rx/rx_kcommon.c:</div>
<div class=3D"x_elementToProof" style=3D"font-family:Calibri,Arial,Helvetic=
a,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class=3D"x_elementToProof" style=3D"font-family:Calibri,Arial,Helvetic=
a,sans-serif; font-size:12pt; color:rgb(0,0,0)">
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 class=3D"x_elementToProof" style=3D"font-family:Calibri,Arial,Helvetic=
a,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class=3D"x_elementToProof" style=3D"font-family:Calibri,Arial,Helvetic=
a,sans-serif; font-size:12pt; color:rgb(0,0,0)">
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>
<br>
</blockquote>
<p style=3D"margin-top: 0px; margin-bottom: 0px;">The vprintf usage in kern=
el on AIX was introduced by
<br>
</p>
<p style=3D"margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<p style=3D"margin-top: 0px; margin-bottom: 0px;">&nbsp; <a href=3D"https:/=
/gerrit.openafs.org/14791" target=3D"_blank" rel=3D"noopener noreferrer" da=
ta-auth=3D"NotApplicable" class=3D"x_moz-txt-link-freetext">
https://gerrit.openafs.org/14791</a></p>
<p style=3D"margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<p style=3D"margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<p style=3D"margin-top: 0px; margin-bottom: 0px;"><br>
</p>
</div>
</div>
</div>
</body>
</html>

--_000_MWHPR0701MB367420F72B076B1AC707CF35A7669MWHPR0701MB3674_--