Kernel compile on Rubik Pi 3 running Ubuntu 24.04

Hi team :waving_hand:

I am trying to build the linux-ubuntu kernel following the instructions here: Linux Kernel | RUBIK Pi Documentation

I am building directly on the Rubik Pi. I flashed and am running Ubuntu 24.04 on the board, it works great by the way. :slight_smile:

However, when trying to update the kernel configation by performing a build, I get all the way to the fakeroot debian/rules binary step, but it fails. Do you have any ideas on how to proceed? Thanks!

ubuntu@ubuntu:~/linux-ubuntu$ fakeroot debian/rules binary
Debug: install-arch-headers
dh_testdir
dh_testroot
rm -rf /home/ubuntu/linux-ubuntu/debian/tmp-headers /home/ubuntu/linux-ubuntu/debian/linux-libc-dev
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- HOSTCC=aarch64-linux-gnu-gcc-13 CC=aarch64-linux-gnu-gcc-13 BINDGEN=bindgen-0.65 KERNELRELEASE=6.8.0-1055- CONFIG_DEBUG_SECTION_MISMATCH=y KBUILD_BUILD_VERSION="55" CFLAGS_MODULE="-DPKG_ABI=1055" PYTHON=python3 O=/home/ubuntu/linux-ubuntu/debian/tmp-headers INSTALL_HDR_PATH=/home/ubuntu/linux-ubuntu/debian/linux-libc-dev/usr -j8 headers_install
make[1]: Entering directory '/home/ubuntu/linux-ubuntu'
make[2]: Entering directory '/home/ubuntu/linux-ubuntu/debian/tmp-headers'
  UPD     include/generated/uapi/linux/version.h
  WRAP    arch/arm64/include/generated/uapi/asm/kvm_para.h
  WRAP    arch/arm64/include/generated/uapi/asm/ioctl.h
  HOSTCC  scripts/basic/fixdep
  WRAP    arch/arm64/include/generated/uapi/asm/errno.h
  WRAP    arch/arm64/include/generated/uapi/asm/ioctls.h
  WRAP    arch/arm64/include/generated/uapi/asm/ipcbuf.h
  WRAP    arch/arm64/include/generated/uapi/asm/msgbuf.h
  WRAP    arch/arm64/include/generated/uapi/asm/resource.h
  WRAP    arch/arm64/include/generated/uapi/asm/sembuf.h
  WRAP    arch/arm64/include/generated/uapi/asm/poll.h
  WRAP    arch/arm64/include/generated/uapi/asm/shmbuf.h
  WRAP    arch/arm64/include/generated/uapi/asm/siginfo.h
  WRAP    arch/arm64/include/generated/uapi/asm/socket.h
  WRAP    arch/arm64/include/generated/uapi/asm/sockios.h
  WRAP    arch/arm64/include/generated/uapi/asm/stat.h
  WRAP    arch/arm64/include/generated/uapi/asm/termbits.h
  WRAP    arch/arm64/include/generated/uapi/asm/swab.h
  WRAP    arch/arm64/include/generated/uapi/asm/termios.h
  WRAP    arch/arm64/include/generated/uapi/asm/types.h

<snip>

  HDRINST usr/include/rdma/vmw_pvrdma-abi.h
  HDRINST usr/include/rdma/rdma_user_ioctl_cmds.h
  HDRINST usr/include/rdma/rdma_user_rxe.h
  HDRINST usr/include/rdma/qedr-abi.h
  HDRINST usr/include/rdma/hfi/hfi1_ioctl.h
  HDRINST usr/include/rdma/hfi/hfi1_user.h
  HDRINST usr/include/rdma/mlx5_user_ioctl_cmds.h
  HDRINST usr/include/rdma/mlx4-abi.h
  HDRINST usr/include/rdma/cxgb4-abi.h
  HDRINST usr/include/rdma/hns-abi.h
  HDRINST usr/include/rdma/mthca-abi.h
  HDRINST usr/include/rdma/irdma-abi.h
  HDRINST usr/include/rdma/mlx5-abi.h
  HDRINST usr/include/rdma/efa-abi.h
  HDRINST usr/include/rdma/ib_user_sa.h
  HDRINST usr/include/rdma/erdma-abi.h
  HDRINST usr/include/rdma/rvt-abi.h
  HDRINST usr/include/rdma/rdma_netlink.h
  HDRINST usr/include/rdma/rdma_user_ioctl.h
  HDRINST usr/include/rdma/ib_user_verbs.h
  HDRINST usr/include/rdma/ocrdma-abi.h
  HDRINST usr/include/scsi/cxlflash_ioctl.h
  HDRINST usr/include/regulator/regulator.h
  HDRINST usr/include/scsi/scsi_bsg_mpi3mr.h
  HDRINST usr/include/scsi/fc/fc_ns.h
  HDRINST usr/include/scsi/fc/fc_fs.h
  HDRINST usr/include/scsi/fc/fc_els.h
  HDRINST usr/include/scsi/fc/fc_gs.h
  HDRINST usr/include/scsi/scsi_bsg_ufs.h
  HDRINST usr/include/scsi/scsi_netlink.h
  HDRINST usr/include/scsi/scsi_netlink_fc.h
  HDRINST usr/include/scsi/scsi_bsg_fc.h
  HDRINST usr/include/sound/asoc.h
  HDRINST usr/include/sound/intel/avs/tokens.h
  HDRINST usr/include/sound/sb16_csp.h
  HDRINST usr/include/sound/emu10k1.h
  HDRINST usr/include/sound/firewire.h
  HDRINST usr/include/sound/hdsp.h
  HDRINST usr/include/sound/hdspm.h
  HDRINST usr/include/sound/snd_sst_tokens.h
  HDRINST usr/include/sound/scarlett2.h
  HDRINST usr/include/sound/asequencer.h
  HDRINST usr/include/sound/sof/header.h
  HDRINST usr/include/sound/sof/fw.h
  HDRINST usr/include/sound/sof/abi.h
  HDRINST usr/include/sound/sof/tokens.h
  HDRINST usr/include/sound/qcom/msm_audio.h
  HDRINST usr/include/sound/sfnt_info.h
  HDRINST usr/include/sound/asound.h
  HDRINST usr/include/sound/compress_offload.h
  HDRINST usr/include/sound/snd_ar_tokens.h
  HDRINST usr/include/sound/asound_fm.h
  HDRINST usr/include/sound/skl-tplg-interface.h
  HDRINST usr/include/sound/tlv.h
  HDRINST usr/include/sound/usb_stream.h
  HDRINST usr/include/sound/compress_params.h
  HDRINST usr/include/video/edid.h
  HDRINST usr/include/video/uvesafb.h
  HDRINST usr/include/video/sisfb.h
  HDRINST usr/include/xen/gntdev.h
  HDRINST usr/include/xen/privcmd.h
  HDRINST usr/include/xen/gntalloc.h
  HDRINST usr/include/xen/evtchn.h
  HDRINST usr/include/linux/version.h
  HDRINST usr/include/asm/sigcontext.h
  HDRINST usr/include/asm/ptrace.h
  HDRINST usr/include/asm/ucontext.h
  HDRINST usr/include/asm/perf_regs.h
  HDRINST usr/include/asm/fcntl.h
  HDRINST usr/include/asm/param.h
  HDRINST usr/include/asm/mman.h
  HDRINST usr/include/asm/setup.h
  HDRINST usr/include/asm/signal.h
  HDRINST usr/include/asm/byteorder.h
  HDRINST usr/include/asm/auxvec.h
  HDRINST usr/include/asm/posix_types.h
  HDRINST usr/include/asm/hwcap.h
  HDRINST usr/include/asm/statfs.h
  HDRINST usr/include/asm/kvm.h
  HDRINST usr/include/asm/bitsperlong.h
  HDRINST usr/include/asm/bpf_perf_event.h
  HDRINST usr/include/asm/unistd.h
  HDRINST usr/include/asm/sve_context.h
  HDRINST usr/include/asm/ioctls.h
  HDRINST usr/include/asm/ioctl.h
  HDRINST usr/include/asm/resource.h
  HDRINST usr/include/asm/sockios.h
  HDRINST usr/include/asm/socket.h
  HDRINST usr/include/asm/sembuf.h
  HDRINST usr/include/asm/stat.h
  HDRINST usr/include/asm/siginfo.h
  HDRINST usr/include/asm/ipcbuf.h
  HDRINST usr/include/asm/kvm_para.h
  HDRINST usr/include/asm/shmbuf.h
  HDRINST usr/include/asm/poll.h
  HDRINST usr/include/asm/swab.h
  HDRINST usr/include/asm/types.h
  HDRINST usr/include/asm/msgbuf.h
  HDRINST usr/include/asm/termios.h
  HDRINST usr/include/asm/termbits.h
  HDRINST usr/include/asm/errno.h
  INSTALL /home/ubuntu/linux-ubuntu/debian/linux-libc-dev/usr/include
make[2]: Leaving directory '/home/ubuntu/linux-ubuntu/debian/tmp-headers'
make[1]: Leaving directory '/home/ubuntu/linux-ubuntu'
mkdir /home/ubuntu/linux-ubuntu/debian/linux-libc-dev/usr/include/aarch64-linux-gnu
mv /home/ubuntu/linux-ubuntu/debian/linux-libc-dev/usr/include/asm /home/ubuntu/linux-ubuntu/debian/linux-libc-dev/usr/include/aarch64-linux-gnu/
rm -rf /home/ubuntu/linux-ubuntu/debian/tmp-headers
Debug: build-arch
Debug: /home/ubuntu/linux-ubuntu/debian/stamps/stamp-prepare-perarch
rm -rf /home/ubuntu/linux-ubuntu/debian/build/tools-perarch
install -d /home/ubuntu/linux-ubuntu/debian/build/tools-perarch
rsync -a --exclude debian --exclude debian.master --exclude debian.qcom --exclude .git -a ./ /home/ubuntu/linux-ubuntu/debian/build/tools-perarch/
[ -d /home/ubuntu/linux-ubuntu/debian/stamps/ ] || mkdir /home/ubuntu/linux-ubuntu/debian/stamps/; touch /home/ubuntu/linux-ubuntu/debian/stamps/stamp-prepare-perarch
Debug: /home/ubuntu/linux-ubuntu/debian/stamps/stamp-build-perarch
chmod 755 /home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/autogen.sh
cd /home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip && ./autogen.sh
+ autoreconf -i -f -v
autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force 
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac,
libtoolize: and rerunning libtoolize and aclocal.
libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
autoreconf: configure.ac: not using Intltool
autoreconf: configure.ac: not using Gtkdoc
autoreconf: running: aclocal --force 
autoreconf: running: /usr/bin/autoconf --force
configure.ac:30: warning: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:30: You should run autoupdate.
./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
configure.ac:30: the top level
configure.ac:31: warning: whitespace-separated list contains macros;
configure.ac:31: in a future version of Autoconf they will not be expanded
configure.ac:31: note: `dnl' is a macro
./lib/autoconf/headers.m4:217: AC_CHECK_HEADERS is expanded from...
configure.ac:31: the top level
configure.ac:44: warning: whitespace-separated list contains macros;
configure.ac:44: in a future version of Autoconf they will not be expanded
configure.ac:44: note: `dnl' is a macro
./lib/autoconf/functions.m4:117: AC_CHECK_FUNCS is expanded from...
configure.ac:44: the top level
configure.ac:55: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:55: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:1553: AC_ARG_WITH is expanded from...
configure.ac:55: the top level
configure.ac:55: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:55: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:1553: AC_ARG_WITH is expanded from...
configure.ac:55: the top level
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:16: installing './compile'
configure.ac:16: installing './config.guess'
configure.ac:16: installing './config.sub'
configure.ac:15: installing './install-sh'
configure.ac:15: installing './missing'
libsrc/Makefile.am: installing './depcomp'
autoreconf: Leaving directory '.'
chmod 755 /home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/configure
cd /home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip && ./configure --prefix=/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/bin
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... aarch64-unknown-linux-gnu
checking host system type... aarch64-unknown-linux-gnu
checking how to print strings... printf
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert aarch64-unknown-linux-gnu file names to aarch64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert aarch64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for file... file
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... (cached) gcc
checking whether the compiler supports GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to enable C11 features... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking whether make sets $(MAKE)... (cached) yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for egrep... (cached) /usr/bin/grep -E
checking for arpa/inet.h... yes
checking for fcntl.h... yes
checking for netdb.h... yes
checking for netinet/in.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for sys/socket.h... yes
checking for syslog.h... yes
checking for unistd.h... (cached) yes
checking for int32_t... yes
checking for size_t... yes
checking for ssize_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint8_t... yes
checking for GNU libc compatible realloc... yes
checking for memset... yes
checking for mkdir... yes
checking for regcomp... yes
checking for socket... yes
checking for strchr... yes
checking for strerror... yes
checking for strstr... yes
checking for strtoul... yes
checking for libudev.h... yes
checking for udev_new in -ludev... yes
checking whether to use the libwrap (TCP wrappers) library... (default)
checking for hosts_access in -lwrap... no
checking whether to use fortify... default
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libsrc/Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
cd /home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip && make install CFLAGS="-g -O2 -static" CROSS_COMPILE=aarch64-linux-gnu-
make[1]: Entering directory '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip'
Making install in libsrc
make[2]: Entering directory '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/libsrc'
  CC       libusbip_la-names.lo
  CC       libusbip_la-usbip_host_driver.lo
  CC       libusbip_la-usbip_device_driver.lo
  CC       libusbip_la-usbip_common.lo
  CC       libusbip_la-usbip_host_common.lo
  CC       libusbip_la-vhci_driver.lo
  CC       libusbip_la-sysfs_utils.lo
  CCLD     libusbip.la
make[3]: Entering directory '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/libsrc'
 /usr/bin/mkdir -p '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/bin/lib'
 /bin/bash ../libtool   --mode=install /usr/bin/install -c   libusbip.la '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/bin/lib'
libtool: install: /usr/bin/install -c .libs/libusbip.lai /home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/bin/lib/libusbip.la
libtool: install: /usr/bin/install -c .libs/libusbip.a /home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/bin/lib/libusbip.a
libtool: install: chmod 644 /home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/bin/lib/libusbip.a
libtool: install: ranlib /home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/bin/lib/libusbip.a
libtool: finish: PATH="/home/ubuntu/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin" ldconfig -n /home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/bin/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/bin/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/libsrc'
make[2]: Leaving directory '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/libsrc'
Making install in src
make[2]: Entering directory '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/src'
  CC       usbip.o
  CC       utils.o
  CC       usbip_network.o
  CC       usbip_attach.o
  CC       usbip_detach.o
  CC       usbip_list.o
  CC       usbip_bind.o
  CC       usbip_unbind.o
  CC       usbip_port.o
  CCLD     usbip
  CC       usbipd.o
  CCLD     usbipd
make[3]: Entering directory '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/src'
 /usr/bin/mkdir -p '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/bin/sbin'
  /bin/bash ../libtool   --mode=install /usr/bin/install -c usbip usbipd '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/bin/sbin'
libtool: install: /usr/bin/install -c usbip /home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/bin/sbin/usbip
libtool: install: /usr/bin/install -c usbipd /home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/bin/sbin/usbipd
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/src'
make[2]: Leaving directory '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/src'
make[2]: Entering directory '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip'
make[3]: Entering directory '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip'
make[3]: Nothing to be done for 'install-exec-am'.
 /usr/bin/mkdir -p '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/bin/include/usbip'
 /usr/bin/install -c -m 644 libsrc/usbip_common.h libsrc/vhci_driver.h libsrc/usbip_host_driver.h libsrc/list.h libsrc/sysfs_utils.h libsrc/usbip_host_common.h '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/bin/include/usbip'
 /usr/bin/mkdir -p '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/bin/share/man/man8'
 /usr/bin/install -c -m 644 doc/usbip.8 doc/usbipd.8 '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip/bin/share/man/man8'
make[3]: Leaving directory '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip'
make[2]: Leaving directory '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip'
make[1]: Leaving directory '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/usb/usbip'
make -C /home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/power/cpupower \
	CROSS_COMPILE=aarch64-linux-gnu- \
	CROSS=aarch64-linux-gnu- \
	STATIC=true \
	CPUFREQ_BENCH=false
make[1]: Entering directory '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/power/cpupower'
  CC       lib/cpufreq.o
  CC       lib/cpupower.o
  CC       lib/cpuidle.o
  CC       lib/acpi_cppc.o
  CC       lib/powercap.o
  LD       libcpupower.so.0.0.1
  CC       utils/helpers/amd.o
  CC       utils/helpers/msr.o
  CC       utils/helpers/sysfs.o
  CC       utils/helpers/misc.o
  CC       utils/helpers/cpuid.o
  CC       utils/helpers/pci.o
  CC       utils/helpers/bitmask.o
  CC       utils/idle_monitor/nhm_idle.o
  CC       utils/idle_monitor/snb_idle.o
  CC       utils/idle_monitor/hsw_ext_idle.o
  CC       utils/idle_monitor/amd_fam14h_idle.o
  CC       utils/idle_monitor/cpuidle_sysfs.o
  CC       utils/idle_monitor/mperf_monitor.o
  CC       utils/idle_monitor/cpupower-monitor.o
  CC       utils/idle_monitor/rapl_monitor.o
  CC       utils/cpupower.o
  CC       utils/cpufreq-info.o
  CC       utils/cpufreq-set.o
  CC       utils/cpupower-set.o
  CC       utils/cpupower-info.o
  CC       utils/cpuidle-info.o
  CC       utils/cpuidle-set.o
  CC       utils/powercap-info.o
  CC       cpupower
/usr/bin/ld: cannot find -lpci: No such file or directory
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:222: cpupower] Error 1
make[1]: Leaving directory '/home/ubuntu/linux-ubuntu/debian/build/tools-perarch/tools/power/cpupower'
make: *** [debian/rules.d/2-binary-arch.mk:666: /home/ubuntu/linux-ubuntu/debian/stamps/stamp-build-perarch] Error 2

May I kindly ask which operating system is used on the computer that compiles your code?

I am running this compilation directly on the Rubik Pi! :partying_face:

So this is Ubuntu 24.04 / aarch64 native.

(I did also run a build on an x86 machine with the cross-compilation instructions, and those worked…so something is broken on the aarch64 compile instructions or Makefile)

Based on the error message, the issue is likely due to the absence of the aarch64 version of libpci-dev.
Please install it using the following command and then re-build:
sudo apt install libpci-dev:arm64

1 Like

This worked, thanks @kinkin ! (I did have to also install some other missing utils I needed such as xz-dev, liblzma-dev, libcap-dev and a few others…but I can now successfully build kernels directly on the Rubik Pi! :partying_face:

Excellent news! :smiling_face_with_three_hearts: Thank you for your response.

I’ve been trying the fakeroot debian/rules to build instead of the rubikpi_build found in the other repository. I get to almost the end of fakeroot debian/rules binary and I get the following error:
In file included from /home/ubuntu/kernel/linux-ubuntu/debian/build/tools-perarch/tools/perf/util/evsel.c:43:
/home/ubuntu/kernel/linux-ubuntu/debian/build/tools-perarch/tools/perf/util/trace-event.h:149:63: error: operator ‘>=’ has no left operand
149 | #if defined(LIBTRACEEVENT_VERSION) && (LIBTRACEEVENT_VERSION >= MAKE_LIBTRACEEVENT_VERSION(1, 5, 0))
| ^~
error: command ‘/usr/bin/aarch64-linux-gnu-gcc-13’ failed with exit code 1

I can probably hack around this but I’m wondering if someone else has seen this and knows what might be wrong.

Please run the following command and then recompile.
sudo apt install libtraceevent-dev libtracefs-dev libbpf-dev

1 Like

Thanks that worked better. Since I was still seeing issues I did a clean and fresh build. As expected this takes a long time since I am doing it on the target. During the fakeroot debain/rules binary step I get an install error:
install: cannot stat ‘/home/ubuntu/kernel/linux-ubuntu/debian/build/tools-perarch/tools/perf/libperf-jvmti.so’: No such file or directory

I see that I can probably modify debian/rules.d/2-binary-arch.mk and remove the lines looking for that file, but maybe I have another package missing?

For context will attach the long of the binary step.
binary-log.txt (116.4 KB)

OK a few edits worked but what was missing: linux-tools-6.8.0-1056-qcom.
That provided libperf-jvmti.so, sudo apt-get install linux-tools-$(uname -r) will install that package.

So it seems there are quite a few packages missing from the instructions if compiling natively on the Rubik Pi, using the default Ubuntu installation. I unfortunately have already wiped mine and re-installed for some other testing, but if you are able to run history on yours @sidneym we should gather the list of required packages and add them to the instructions here: Linux Kernel | RUBIK Pi Documentation

Thank you for sharing.
May I confirm that the build is now successful?
Additionally, could you kindly share the specific edits you referred to as “a few edits worked”?

Thank you for your suggestion. We will optimize the documentation accordingly in the follow-up.

I updated the 2-binary-arch.mk to ignore error codes on the steps that didn’t work:

git stash list -p stash@{0}
stash@{0}: On master-next: Fix build break due to missing linux-tools package

diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index d5638ebf99ee..0f913529e07c 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -366,7 +366,7 @@ endif
 ifeq ($(do_tools_perf),true)
        $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/perf $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
 ifeq ($(do_tools_perf_jvmti),true)
-       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/libperf-jvmti.so $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
+       -$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/libperf-jvmti.so $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
 endif
 ifeq ($(do_tools_perf_python),true)
        # Link the subdirectory that contains the .so rather than the file itself. Its name is
@@ -691,10 +691,10 @@ ifeq ($(do_tools_perf),true)
                $(kmake) prefix=/usr HAVE_CPLUS_DEMANGLE_SUPPORT=1 CROSS_COMPILE=$(CROSS_COMPILE) NO_LIBPERL=1 WERROR=0
 endif
 ifeq ($(do_tools_bpftool),true)
-       mv $(builddirpa)/tools/bpf/bpftool/vmlinux $(builddirpa)/vmlinux
-       $(kmake) CROSS_COMPILE=$(CROSS_COMPILE) -C $(builddirpa)/tools/bpf/bpftool
+       -mv $(builddirpa)/tools/bpf/bpftool/vmlinux $(builddirpa)/vmlinux
+       -$(kmake) CROSS_COMPILE=$(CROSS_COMPILE) -C $(builddirpa)/tools/bpf/bpftool
 ifneq ($(do_tools_bpftool_stub),true)
-       $(builddirpa)/tools/bpf/bpftool/bpftool btf dump file $(builddirpa)/vmlinux format c > $(builddirpa)/vmlinux.h
+       -$(builddirpa)/tools/bpf/bpftool/bpftool btf dump file $(builddirpa)/vmlinux format c > $(builddirpa)/vmlinux.h
 else
        echo '#error "Kernel does not support CONFIG_DEBUG_INFO_BTF"' > $(builddirpa)/vmlinux.h
 endif
@@ -740,7 +740,7 @@ endif
 ifeq ($(do_tools_perf),true)
        install -m755 $(builddirpa)/tools/perf/perf $(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)
 ifeq ($(do_tools_perf_jvmti),true)
-       install -m755 $(builddirpa)/tools/perf/libperf-jvmti.so $(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)
+       -install -m755 $(builddirpa)/tools/perf/libperf-jvmti.so $(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)
 endif
 ifeq ($(do_tools_perf_python),true)
        install -d $(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)/lib
stash@{0}: On master-next: Fix build break due to missing linux-tools package

FWIW here are the packages that I needed (still needed the minor edits I mentioned)
packages-installed.txt (29.6 KB)

Interesting, I didn’t need to update any .mk files, I just needed to install all the required packages (which I now wish I had saved the list of!). But with the proper apt-get install of packages, my compile and installation worked fine, and I rebooted into the new kernel.

Thank you both for sharing. :smiling_face_with_three_hearts: