[OpenAFS-devel] AIX build fails with missing symbol .krb5_c_make_random_key

Ben Huntsman ben@huntsmans.net
Sun, 14 Aug 2022 21:12:53 +0000


--_000_MWHPR0701MB367426DAEFAB3FEFC496FEF3A7699MWHPR0701MB3674_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi there-
   Yes, on AIX 6.1 we need to be building 64-bit, as there is no 32-bit on =
6.1.  The 32-bit kernel is available on AIX 5.3 and below.  On XL C, the de=
fault is -q32.

   So, we should probably tweak something to always build as 64-bit on AIX =
6.1...  Alternatively, for userland stuff, the krb5-libs package provides b=
oth 32-bit and 64-bit libraries...  It is interesting that krb5-config isn'=
t doing the right thing for 32-bit...

Thanks!

-Ben

________________________________
From: Benjamin Kaduk <kaduk@mit.edu>
Sent: Sunday, August 14, 2022 1:40 PM
To: Ben Huntsman <ben@huntsmans.net>
Cc: Ken Hornstein <kenh@cmf.nrl.navy.mil>; openafs-devel@openafs.org <opena=
fs-devel@openafs.org>
Subject: Re: [OpenAFS-devel] AIX build fails with missing symbol .krb5_c_ma=
ke_random_key

On Sun, Aug 14, 2022 at 07:41:43PM +0000, Ben Huntsman wrote:
> Hi Ben-
>    Thanks for the reply!
>
>    My krb5-config and openafs's config.log are attached.
>
>    When I ran configure, I used the argument --with-krb5=3D/opt/freeware

Thanks!

It looks like your /opt/freeware/bin/krb5-config is trying to use 64-bit
libraries, but at least configure is trying to build for 32-bit:

configure:40672: checking for krb5-config
configure:40696: found /opt/freeware/bin/krb5-config
configure:40708: result: /opt/freeware/bin/krb5-config
configure:41045: checking for krb5 support in krb5-config
configure:41058: result: yes
configure:41066: checking for --deps support in krb5-config
configure:41079: result: no
configure:41108: checking for krb5_init_context
configure:41108: cc -o conftest   -I/opt/freeware/include    conftest.c
-L/opt/freeware/lib64
-Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib
-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-brtl -lpthreads -lkrb5
-lk5crypto
-lcom_err  >&5
ld: 0711-736 ERROR: Input file /opt/freeware/lib64/libkrb5.so:
        XCOFF64 object files are not allowed in 32-bit mode.

So if the krb5-config output gets rejected, configure will fall back to
some heuristics for how to link krb5, and those heuristics are wrong in
this case.

I'm not super familiar with the mechanisms to get 32- vs 64-bit output from
the compiler/linker on AIX, but random googling suggests that maybe passing
CFLAGS=3D-q64 to configure would affect that aspect of things?  (It might
break something else, of course.)

For what it's worth, most of the OS-specific build settings are in
src/cf/osconf.m4, and for rs_aix61 we currently show:

        rs_aix61)
                CC=3D"cc"
                DBG=3D"-g"
                LIBSYS_AIX_EXP=3D"afsl.exp"
                MT_CC=3D"xlc_r"
                SHLIB_SUFFIX=3D"o"
                XCFLAGS=3D"-K -D_NONSTD_TYPES -D_MBI=3Dvoid"
                XLIBS=3D"${LIB_AFSDB} ${LIB_libintl} -ldl"
                SHLIB_LINKER=3D"${MT_CC} -bM:SRE -berok"
                AIX32=3D"no"
                AIX64=3D"yes"
                TSM_IMPORTS=3D"-bI:/lib/aio.exp -bI:/lib/netinet.exp -bI:/l=
ib/sockets.exp -bI:/lib/statcmd.exp"
                TSM_LIBS=3D"-lsys -lcsys -lc"
                ;;

The AIX32 and AIX64 variables are not widely used in the buildsystem, but
the one place they do show up suggest that this does indicate that we
"expect to" be building 64-bit libraries on this system.  Perhaps there's
some skew in compiler defaults between when that was written and what you
have.

-Ben

--_000_MWHPR0701MB367426DAEFAB3FEFC496FEF3A7699MWHPR0701MB3674_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<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">
Hi there-</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
&nbsp; &nbsp;Yes, on AIX 6.1 we need to be building 64-bit, as there is no =
32-bit on 6.1.&nbsp; The 32-bit kernel is available on AIX 5.3 and below.&n=
bsp; On XL C, the default is -q32.&nbsp;&nbsp;</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;So, we should probably tweak something to always build as 64-b=
it on AIX 6.1...&nbsp; Alternatively, for userland stuff, the krb5-libs pac=
kage provides both 32-bit and 64-bit libraries...&nbsp; It is interesting t=
hat krb5-config isn't doing the right thing for 32-bit...</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">
Thanks!<br>
<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 id=3D"appendonsend"></div>
<hr style=3D"display:inline-block;width:98%" tabindex=3D"-1">
<div id=3D"divRplyFwdMsg" dir=3D"ltr"><font face=3D"Calibri, sans-serif" st=
yle=3D"font-size:11pt" color=3D"#000000"><b>From:</b> Benjamin Kaduk &lt;ka=
duk@mit.edu&gt;<br>
<b>Sent:</b> Sunday, August 14, 2022 1:40 PM<br>
<b>To:</b> Ben Huntsman &lt;ben@huntsmans.net&gt;<br>
<b>Cc:</b> Ken Hornstein &lt;kenh@cmf.nrl.navy.mil&gt;; openafs-devel@opena=
fs.org &lt;openafs-devel@openafs.org&gt;<br>
<b>Subject:</b> Re: [OpenAFS-devel] AIX build fails with missing symbol .kr=
b5_c_make_random_key</font>
<div>&nbsp;</div>
</div>
<div class=3D"BodyFragment"><font size=3D"2"><span style=3D"font-size:11pt;=
">
<div class=3D"PlainText">On Sun, Aug 14, 2022 at 07:41:43PM +0000, Ben Hunt=
sman wrote:<br>
&gt; Hi Ben-<br>
&gt;&nbsp;&nbsp;&nbsp; Thanks for the reply!<br>
&gt; <br>
&gt;&nbsp;&nbsp;&nbsp; My krb5-config and openafs's config.log are attached=
.<br>
&gt; <br>
&gt;&nbsp;&nbsp;&nbsp; When I ran configure, I used the argument --with-krb=
5=3D/opt/freeware<br>
<br>
Thanks!<br>
<br>
It looks like your /opt/freeware/bin/krb5-config is trying to use 64-bit<br=
>
libraries, but at least configure is trying to build for 32-bit:<br>
<br>
configure:40672: checking for krb5-config&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
configure:40696: found /opt/freeware/bin/krb5-config&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;
<br>
configure:40708: result: /opt/freeware/bin/krb5-config&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;
<br>
configure:41045: checking for krb5 support in krb5-config&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
configure:41058: result: yes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
configure:41066: checking for --deps support in krb5-config&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
configure:41079: result: no&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp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&nbsp;&nbsp;&nbsp;&nbsp;
<br>
-Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-brtl -lpthreads -lkrb5<br>
-lk5crypto&nbsp;&nbsp;&nbsp;&nbsp; <br>
-lcom_err&nbsp; &gt;&amp;5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
ld: 0711-736 ERROR: Input file /opt/freeware/lib64/libkrb5.so:&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; XCOFF64 object files are not all=
owed in 32-bit mode.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;
<br>
<br>
So if the krb5-config output gets rejected, configure will fall back to<br>
some heuristics for how to link krb5, and those heuristics are wrong in<br>
this case.<br>
<br>
I'm not super familiar with the mechanisms to get 32- vs 64-bit output from=
<br>
the compiler/linker on AIX, but random googling suggests that maybe passing=
<br>
CFLAGS=3D-q64 to configure would affect that aspect of things?&nbsp; (It mi=
ght<br>
break something else, of course.)<br>
<br>
For what it's worth, most of the OS-specific build settings are in<br>
src/cf/osconf.m4, and for rs_aix61 we currently show:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs_aix61)&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; CC=3D&quot;cc&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; DBG=3D&quot;-g&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; LIBSYS_AIX_EXP=3D&quot;afsl.exp&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; MT_CC=3D&quot;xlc_r&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; SHLIB_SUF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;&nbsp;&nb=
sp;&nbsp;&nbsp; ;;<br>
<br>
The AIX32 and AIX64 variables are not widely used in the buildsystem, but<b=
r>
the one place they do show up suggest that this does indicate that we<br>
&quot;expect to&quot; be building 64-bit libraries on this system.&nbsp; Pe=
rhaps there's<br>
some skew in compiler defaults between when that was written and what you<b=
r>
have.<br>
<br>
-Ben<br>
</div>
</span></font></div>
</body>
</html>

--_000_MWHPR0701MB367426DAEFAB3FEFC496FEF3A7699MWHPR0701MB3674_--