VCHIQ patch and contrib code. Compiling with newer version LLVM / CLANG, and find errors in VCHIQ code

From: Fred Finster <fred_at_thegalacticzoo.com>
Date: Fri, 11 Aug 2023 05:29:50 UTC
Hello fellow  Rpi4B users

Is VCHIQ compiling and installing for your use on your Raspberry Pi 4B?

https://reviews.freebsd.org/D37878


The /usr/src  compile is breaking for me with -wunsigned_interger  cast 
being used (unsigned int) for a 32 bit result .

Try substituting  (unsigned long)  for a 64 bit result


/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c:1711:7: 
error: cast to smaller integer type 'unsigned int' from 'VCHIQ_HEADER_T 
*' (aka 'struct vchiq_header_struct *') [-Werror,-Wpointer-to-int-cast]
                                                 (unsigned int)header,
^~~~~~~~~~~~~~~~~~~~
--- vchiq_kern_lib.o ---
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kern_lib.c:156:6: 
error: cast to smaller integer type 'unsigned int' from 'struct 
bulk_waiter_node *' [-Werror,-Wpointer-to-int-cast]
                                         (unsigned int)waiter, waiter->pid);
                                         ^~~~~~~~~~~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h:68:39: note: 
expanded from macro 'vchiq_log_info'
                 printf(VCHIQ_LOG_PREFIX fmt "\n", ##__VA_ARGS__); } 
while (0)
                                                     ^~~~~~~~~~~
--- vchiq_core.o ---
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h:63:40: note: 
expanded from macro 'vchiq_log_warning'
                  printf(VCHIQ_LOG_PREFIX fmt "\n", ##__VA_ARGS__); } 
while (0)
                                                      ^~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c:1721:6: 
error: cast to smaller integer type 'unsigned int' from 'VCHIQ_HEADER_T 
*' (aka 'struct vchiq_header_struct *') [-Werror,-Wpointer-to-int-cast]
                                         (unsigned int)header,
                                         ^~~~~~~~~~~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h:58:39: note: 
expanded from macro 'vchiq_log_error'
                 printf(VCHIQ_LOG_PREFIX fmt "\n", ##__VA_ARGS__); } 
while (0)
                                                     ^~~~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
--- vchiq_kern_lib.o ---
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kern_lib.c:458:5: 
error: cast to smaller integer type 'unsigned int' from 'struct 
bulk_waiter_node *' [-Werror,-Wpointer-to-int-cast]
                                 (unsigned int)waiter, current->p_pid);
                                 ^~~~~~~~~~~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h:68:39: note: 
expanded from macro 'vchiq_log_info'
                 printf(VCHIQ_LOG_PREFIX fmt "\n", ##__VA_ARGS__); } 
while (0)
                                                     ^~~~~~~~~~~
2 errors generated.
*** [vchiq_kern_lib.o] Error code 1

make[2]: stopped in /usr/obj/usr/src/arm64.aarch64/sys/GENERIC-VCHIQ
--- vchiq_core.o ---
20 errors generated.
*** [vchiq_core.o] Error code 1

make[2]: stopped in /usr/obj/usr/src/arm64.aarch64/sys/GENERIC-VCHIQ
--- vchiq_kmod.o ---
ctfconvert -L VERSION -g vchiq_kmod.o
--- vchiq_arm.o ---
ctfconvert -L VERSION -g vchiq_arm.o
2 errors

make[2]: stopped in /usr/obj/usr/src/arm64.aarch64/sys/GENERIC-VCHIQ
      3279.77 real     11285.89 user      1322.10 sys

make[1]: stopped in /usr/src

make: stopped in /usr/src
root@generic-arm64:/usr/src #


Fred Finster

ps.  Does the  make -j4 buildkernel buildworld TARGET_ARCH=aarch64  
KERNCONF=GENERIC-VCHIQ
work, finish, & complete for other users?

root@generic-arm64:/usr/src # make -j4 buildworld buildkernel 
TARGET_ARCH=aarch64  KERNCONF=GENERIC-VCHIQ

Look forward to hearing your results.