[OpenAFS-devel] Compiling libafs with ibm-clang

Ben Huntsman ben@huntsmans.net
Tue, 10 Dec 2024 00:49:08 +0000


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

Hi everyone-
   Looking at using the new IBM clang-based compiler on AIX to compile the =
kernel extension.  There are several major problems, some of which are that=
 some of the declarations in the OpenAFS codebase don't match up with the A=
IX headers.  Obviously we can't change those.  So I am not entirely sure wh=
at the best approach would be.  Here are some samples:

1:
In file included from /home/build/openafs/src/external/heimdal/hcrypto/sha2=
56.c:34:
In file included from /home/build/openafs/src/crypto/hcrypto/kernel/config.=
h:30:
In file included from /home/build/openafs/src/afs/sysincludes.h:276:
../sys/socketvar.h:158:57: error: array has incomplete element type 'struct=
 free_sock_hash_bucket'
extern struct free_sock_hash_bucket free_sock_hash_table[];
                                                        ^

2:
In file included from /home/build/openafs/src/external/heimdal/hcrypto/sha2=
56.c:34:
/home/build/openafs/src/crypto/hcrypto/kernel/config.h:91:21: error: static=
 declaration of 'getpid' follows non-static declaration
static_inline pid_t getpid(void) {return 1;};
                    ^
../h/proc.h:1344:15: note: previous declaration is here
extern pid_t    getpid(void);
                ^


3:
In file included from /home/build/openafs/src/external/heimdal/hcrypto/sha2=
56.c:34:
/home/build/openafs/src/crypto/hcrypto/kernel/config.h:99:75: error: too fe=
w arguments to function call, expected 4, have 1
static_inline void _afscrypto_abort(void) {osi_Panic("hckernel aborting\n")=
;}
                                           ~~~~~~~~~                      ^


4:
In file included from /home/build/openafs/src/external/heimdal/hcrypto/sha2=
56.c:34:
/home/build/openafs/src/crypto/hcrypto/kernel/config.h:116:19: error: stati=
c declaration of 'gettimeofday' follows non-static declaration
static_inline int gettimeofday(struct timeval *tp, void *tzp)
                  ^
../h/time.h:248:12: note: previous declaration is here
extern int gettimeofday(struct timeval *__restrict__, void *__restrict__);
           ^

I'm more than happy to work through all of these, if someone would provide =
some guidance as to what the preferred solution might be, especially for th=
e first one I listed.

Thanks in advance!

-Ben


--_000_BYAPR07MB587951374D5BF43AB38BD9DDA73D2BYAPR07MB5879namp_
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 class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
Hi everyone-</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
&nbsp; &nbsp;Looking at using the new IBM clang-based compiler on AIX to co=
mpile the kernel extension.&nbsp; There are several major problems, some of=
 which are that some of the declarations in the OpenAFS codebase don't matc=
h up with the AIX headers.&nbsp; Obviously we can't
 change those.&nbsp; So I am not entirely sure what the best approach would=
 be.&nbsp; Here are some samples:</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
1:</div>
<div class=3D"elementToProof" style=3D"line-height: normal; margin: 0px; fo=
nt-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helveti=
ca, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
In file included from /home/build/openafs/src/external/heimdal/hcrypto/sha2=
56.c:34:</div>
<div class=3D"elementToProof" style=3D"line-height: normal; margin: 0px; fo=
nt-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helveti=
ca, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
In file included from /home/build/openafs/src/crypto/hcrypto/kernel/config.=
h:30:</div>
<div class=3D"elementToProof" style=3D"line-height: normal; margin: 0px; fo=
nt-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helveti=
ca, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
In file included from /home/build/openafs/src/afs/sysincludes.h:276:</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
<b>../sys/socketvar.h:158:57: error: array has incomplete element type 'str=
uct free_sock_hash_bucket'</b></div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
extern struct free_sock_hash_bucket free_sock_hash_table[];</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
<b>&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; ^</b></div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
2:</div>
<div class=3D"elementToProof" style=3D"line-height: normal; margin: 0px; fo=
nt-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helveti=
ca, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
In file included from /home/build/openafs/src/external/heimdal/hcrypto/sha2=
56.c:34:</div>
<div class=3D"elementToProof" style=3D"line-height: normal; margin: 0px; fo=
nt-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helveti=
ca, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>/home/build/openafs/src/crypto/hcrypto/kernel/config.h:91:21: error: sta=
tic declaration of 'getpid' follows non-static declaration</b></div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
static_inline pid_t getpid(void) {return 1;};</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
<b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^<=
/b></div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
<b>../h/proc.h:1344:15: note: </b>previous declaration is here</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
extern pid_t&nbsp; &nbsp; getpid(void);</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
<b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^</b></div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
3:</div>
<div class=3D"elementToProof" style=3D"line-height: normal; margin: 0px; fo=
nt-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helveti=
ca, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
In file included from /home/build/openafs/src/external/heimdal/hcrypto/sha2=
56.c:34:</div>
<div class=3D"elementToProof" style=3D"line-height: normal; margin: 0px; fo=
nt-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helveti=
ca, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>/home/build/openafs/src/crypto/hcrypto/kernel/config.h:99:75: error: too=
 few arguments to function call, expected 4, have 1</b></div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
static_inline void _afscrypto_abort(void) {osi_Panic(&quot;hckernel abortin=
g\n&quot;);}</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
<b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; ~~~~~~~~~&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; ^</b></div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
4:</div>
<div class=3D"elementToProof" style=3D"line-height: normal; margin: 0px; fo=
nt-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helveti=
ca, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
In file included from /home/build/openafs/src/external/heimdal/hcrypto/sha2=
56.c:34:</div>
<div class=3D"elementToProof" style=3D"line-height: normal; margin: 0px; fo=
nt-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helveti=
ca, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<b>/home/build/openafs/src/crypto/hcrypto/kernel/config.h:116:19: error: st=
atic declaration of 'gettimeofday' follows non-static declaration</b></div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
static_inline int gettimeofday(struct timeval *tp, void *tzp)</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
<b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^</b></di=
v>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
<b>../h/time.h:248:12: note: </b>previous declaration is here</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
extern int gettimeofday(struct timeval *__restrict__, void *__restrict__);<=
/div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
<b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^</b></div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
I'm more than happy to work through all of these, if someone would provide =
some guidance as to what the preferred solution might be, especially for th=
e first one I listed.</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
Thanks in advance!</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
-Ben</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
&nbsp;</div>
</body>
</html>

--_000_BYAPR07MB587951374D5BF43AB38BD9DDA73D2BYAPR07MB5879namp_--