vchiq_core.c FreeBSD 14.0-CURRENT has compile errors: git -C /usr/src pull --ff-only Jan 19 2024 update

 vchiq_core.c  FreeBSD 14.0-CURRENT has compile errors

 

Standard update to /usr/src  code to the latest

git -C /usr/src pull --ff-only

 

time make -j4 buildkernel TARGET_ARCH=aarch64 KERNCONF=GENERIC-VCHIQ

 Below is the output:

So I have 3 choices, 
  1. edit the makefile and turn of the Warn Error message flags -Wall -Werror
  2. edit the source file and correct format statements
  3. Find the author of this modified file and ask about his setup to compile and then do the same setup 
  4. use KERNCONF=GENERIC?  This option did work to compile the FreeBSD kernel. So that I could start Poudriere to build GhostBSD arm64 packages.

What is the proper way to compile this file?:

https://cgit.freebsd.org/src/tree/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c

cc -target aarch64-unknown-freebsd14.0 --sysroot=/usr/obj/usr/src/arm64.aarch64/tmp -B/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin -c -O2
-pipe  -fno-strict-aliasing  -g -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -I/usr/src/sys/contrib/libfdt -I/usr/src
/sys/contrib/device-tree/include -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common    -DLINUX_DTS_VERSION=\""5.13
"\" -mstack-protector-guard=sysreg -mstack-protector-guard-reg=sp_el0 -mstack-protector-guard-offset=0 -fno-omit-frame-pointer -mno-omit
-leaf-frame-pointer -MD  -MF.depend.vchiq_kern_lib.o -MTvchiq_kern_lib.o -fdebug-prefix-map=./machine=/usr/src/sys/arm64/include -mgener
al-regs-only -ffixed-x18 -ffreestanding -fwrapv -fstack-protector -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-
qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -W
no-error=tautological-compare -Wno-error=empty-body -Wno-error=parentheses-equality -Wno-error=unused-function -Wno-error=pointer-sign -
Wno-error=shift-negative-value -Wno-address-of-packed-member -Wno-format-zero-length     -std=gnu99 -Werror /usr/src/sys/contrib/vchiq/i
nterface/vchiq_arm/vchiq_kern_lib.c -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I/usr/src/sys/contrib/vchiq
--- vchiq_2835_arm.o ---
ctfconvert -L VERSION -g vchiq_2835_arm.o
--- vchiq_kmod.o ---
cc -target aarch64-unknown-freebsd14.0 --sysroot=/usr/obj/usr/src/arm64.aarch64/tmp -B/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin -c -O2
-pipe  -fno-strict-aliasing  -g -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -I/usr/src/sys/contrib/libfdt -I/usr/src
/sys/contrib/device-tree/include -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common    -DLINUX_DTS_VERSION=\""5.13
"\" -mstack-protector-guard=sysreg -mstack-protector-guard-reg=sp_el0 -mstack-protector-guard-offset=0 -fno-omit-frame-pointer -mno-omit
-leaf-frame-pointer -MD  -MF.depend.vchiq_kmod.o -MTvchiq_kmod.o -fdebug-prefix-map=./machine=/usr/src/sys/arm64/include -mgeneral-regs-
only -ffixed-x18 -ffreestanding -fwrapv -fstack-protector -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wu
ndef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error
=tautological-compare -Wno-error=empty-body -Wno-error=parentheses-equality -Wno-error=unused-function -Wno-error=pointer-sign -Wno-erro
r=shift-negative-value -Wno-address-of-packed-member -Wno-format-zero-length     -std=gnu99 -Werror /usr/src/sys/contrib/vchiq/interface
/vchiq_arm/vchiq_kmod.c -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I/usr/src/sys/contrib/vchiq
--- vchiq_core.o ---
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c:397:3: 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, (unsigned int)bulk_userdata);
                ^~~~~~~~~~~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h:73:39: note: expanded from macro 'vchiq_log_trace'
                printf(VCHIQ_LOG_PREFIX fmt "\n", ##__VA_ARGS__); } while (0)
                                                    ^~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c:397:25: error: cast to smaller integer type 'unsigned int' from 'void *' [-W
error,-Wvoid-pointer-to-int-cast]
                (unsigned int)header, (unsigned int)bulk_userdata);
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h:73:39: note: expanded from macro 'vchiq_log_trace'
                printf(VCHIQ_LOG_PREFIX fmt "\n", ##__VA_ARGS__); } while (0)
                                                    ^~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c:657:27: error: cast to smaller integer type 'unsigned int' from 'char *' [-W
error,-Wpointer-to-int-cast]
                        state->id, slot_index, (unsigned int)data,
                                               ^~~~~~~~~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h:73:39: note: expanded from macro 'vchiq_log_trace'
                printf(VCHIQ_LOG_PREFIX fmt "\n", ##__VA_ARGS__); } while (0)
                                                    ^~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c:697: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, msgid,
                                                ^~~~~~~~~~~~~~~~~~~~
/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)
                                                    ^~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c:724:8: 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:73:39: note: expanded from macro 'vchiq_log_trace'
                printf(VCHIQ_LOG_PREFIX fmt "\n", ##__VA_ARGS__); } while (0)
                                                    ^~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c:737:8: 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)
                                                    ^~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c:753:11: error: cast to smaller integer type 'unsigned int' from 'VCHIQ_HEADE
R_T *' (aka 'struct vchiq_header_struct *') [-Werror,-Wpointer-to-int-cast]
                                        pos, (unsigned int)header, msgid,
                                             ^~~~~~~~~~~~~~~~~~~~
/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)
                                                    ^~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c:904:4: 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, size,
                        ^~~~~~~~~~~~~~~~~~~~
/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)
                                                    ^~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c:969:4: 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, size,
                        ^~~~~~~~~~~~~~~~~~~~
/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)
                                                    ^~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c:1054:4: error: cast to smaller integer type 'unsigned int' from 'VCHIQ_HEADE
R_T *' (aka 'struct vchiq_header_struct *') [-Werror,-Wpointer-to-int-cast]
                        (unsigned int)header, size,
                        ^~~~~~~~~~~~~~~~~~~~
/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)
                                                    ^~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c:1083:4: error: cast to smaller integer type 'unsigned int' from 'VCHIQ_HEADE
R_T *' (aka 'struct vchiq_header_struct *') [-Werror,-Wpointer-to-int-cast]
                        (unsigned int)header, size,
                        ^~~~~~~~~~~~~~~~~~~~
/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)
                                                    ^~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c:1387:6: error: cast to smaller integer type 'unsigned int' from 'void *' [-W
error,-Wvoid-pointer-to-int-cast]
                                        (unsigned int)bulk->data,
                                        ^~~~~~~~~~~~~~~~~~~~~~~~
/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)
                                                    ^~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c:1388:6: error: cast to smaller integer type 'unsigned int' from 'void *' [-W
error,-Wvoid-pointer-to-int-cast]
                                        (unsigned int)bulk->remote_data);
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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)
                                                    ^~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c:1399:6: error: cast to smaller integer type 'unsigned int' from 'void *' [-W
error,-Wvoid-pointer-to-int-cast]
                                        (unsigned int)bulk->data,
                                        ^~~~~~~~~~~~~~~~~~~~~~~~
/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)
                                                    ^~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c:1400:6: error: cast to smaller integer type 'unsigned int' from 'void *' [-W
error,-Wvoid-pointer-to-int-cast]
                                        (unsigned int)bulk->remote_data);
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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)
                                                    ^~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c:1536:15: error: cast to smaller integer type 'unsigned int' from 'VCHIQ_HEAD
ER_T *' (aka 'struct vchiq_header_struct *') [-Werror,-Wpointer-to-int-cast]
                        state->id, (unsigned int)header,
                                   ^~~~~~~~~~~~~~~~~~~~
/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)
                                                    ^~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c:1674:29: error: cast to smaller integer type 'int' from 'VCHIQ_HEADER_T *' (
aka 'struct vchiq_header_struct *') [-Werror,-Wpointer-to-int-cast]
                DEBUG_VALUE(PARSE_HEADER, (int)header);
                                          ^~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h:191:33: note: expanded from macro 'DEBUG_VALUE'
        do { debug_ptr[DEBUG_ ## d] = (v); dsb(sy); } while (0)
                                       ^
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c:1711:7: error: cast to smaller integer type 'unsigned int' from 'VCHIQ_HEADE
R_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: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_HEADE
R_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:156:6: error: cast to smaller integer type 'unsigned int' from 'struct b
ulk_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)
                                                    ^~~~~~~~~~~
/usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kern_lib.c:458:5: error: cast to smaller integer type 'unsigned int' from 'struct b
ulk_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
     3444.33 real     11827.22 user      1430.66 sys

make[1]: stopped in /usr/src

make: stopped in /usr/src
     3474.14 real     11863.80 user      1474.28 sys
root@generic-arm64:/usr/src #

 
 
Cgit FreeBSD source file history for vchiq_core.c file
 
Look for author here about this file

Directory of files
Hello friends,  September 10, 2023  I finally made the last edit to vchiq_core.c file and the compiled worked with out errors and complete building a kernel file.
So here is the workflow and the commands used to create a patch file, copy it to the GhostsBSD-src directory and test compile the ghostbsd 14.0-STABLE source files.  Pay it forward.  Read the fine Manual  FreeBSD Handbook

cd /usr/src/sys/contrib/vchiq/interface/vchiq_arm
git diff vchiq_core.c > vchiq_core.c.patch3
git diff vchiq_kern_lib.c > vchiq_kern_lib.c.patch3
cp -p vchiq_core.c.patch3 /usr/ghostbsd-src/sys/contrib/vchiq/interface/vchiq_arm/
cp -p vchiq_kern_libb.c.patch3 /usr/ghostbsd-src/sys/contrib/vchiq/interface/vchiq_arm/

 
cd /usr/ghostbsd-src/sys/contrib/vchiq/interface/vchiq_arm/
 
Perform a Dry Run test comparison --dry-run or -C ; small -c selects context diff format file.
patch -C < vchiq_core.c.patch3
patch -C < vchiq_kern_lib.c.patch3
 
Will patch matching files in the present directory.
patch  < vchiq_core.c.patch3
patch  < vchiq_kern_lib.c.patch3

 

~~~~~~~~~~~ Jan 19, 2024 update below  ~~~~~~~~~~~~~

This is my test result:

  1. Applied the email patch from link.

Result: Success, but only one PCM device is detected, which is the 3.5mm sound output.

  1. Applied the three patches manually: D37878, D37879, and D36431.

Result: Success, but only one PCM device is recognized namely the 3.5mm sound output.

  1. Applied the three patches manually: D37878, D37879   D36431. Then applied D43399 using the following commands:
$ patch <D36431.patch
$ patch <D37878.patch
$ patch <D37879.patch
$ git restore --source HEAD^  # Restore the files D43399 will use
$ patch <D43399.patch

Result: Encountered an error. Output details can be found here.

The discrepancy between my results and yours may be due to the version difference (I used FreeBSD 15). I think the reviewer will conduct similar tests. I will try to review the codes.

Comments

Popular posts from this blog

FreeBSD 14.0 Compiling kernel for Raspberry Pi 4B

HDMI Audio sound patches into GhostBSD source code /usr/ghost14/ghostbsd-src SOLVED Jan20 2024

How to install GhostBSD-Arm64 into a USB Flash Drive stick April 24, 2024 update edition.