Bianbu 2.2.1/debian and correct creation of deb packages

I built the gcc-15.2.0 deb package for Bianbu 2.2.1 and Debian. For the Bianbu installation, I had to additionally build the latest binutils. For Debian, I didn’t need to create a package, as the required version is already in the repository.
And here’s something I noticed. The gcc-15.2.0 deb package I built weighs 1.01 GB, which is a bit confusing, to say the least. Meanwhile, gcc-14_14.2.0-19_riscv64.deb from the repository is only 529,260 bytes.
Perhaps I did something wrong during the compilation process.

Now I found instructions , which describe the process of creating a deb package in detail. And dpkg-buildpackage -sa -uc -us -etest@spacemit.com -mtest@spacemit.com always gives me an error. I can’t build a deb package this way!
I only managed to build it with sudo fpm…

I’d still like to understand the requirements for creating deb packages, what information is required (licenses, vendors, etc.), and how to properly build packages for bianbu 2.2.1?

Could you provide the specific error information?

Yes, there were problems right from the start:

  1. Initially, it wouldn’t let me configure

configure.ac:35: error: Please use exactly Autoconf 2.69 instead of 2.71

I managed to get around this by installing both versions of auconf and creating a hard link from autoconf to auconf2.69. After that, configuration ran without errors.

  1. Then, various errors arose related to missing programs or libraries.

  2. Eventually, the build started running, despite the build limitation on the number of cores (like -j$(($(nproc)-2)) and the like). It wouldn’t build with the limitation, always trying to load all 8 cores… I finally managed to fix this by adding
    DEB_BUILD_OPTIONS=“parallel=$(($(nproc)/2-1))”
    DEBUILD_OPTIONS=“-j$(($(nproc)/2+1))” to the environment.
    After that, the system stopped freezing during the build, but the build still failed with the error
    dh_auto_install: error: make -j5 install DESTDIR=/gcc-15.2.0/debian/gcc-15 AM_UPDATE_INFO_DIR=no returned exit code 2

  3. I finally got around to changing the build command to look like this:
    time dpkg-buildpackage -us -uc -ariscv64 --host-type riscv64-linux-gnu | tee build.log
    But the above error still persisted, and now it’s popping up with a message about insufficient resources, either on disk or memory.

  4. I tried various options, but I can’t even remember them now, as they always resulted in similar errors. I didn’t bother remembering or saving the logs or taking screenshots.

  5. Eventually, I got around to using sudo fpm, which allowed me to build the package in two stages, although not right away – various difficulties arose as well.
    sudo fpm -s dir -t deb -n gcc-15 -v 15.2.0 --iteration 1 -C …/…/gcc-pkg --description “GCC 15.2.0 for RISC-V64 (rv64imafd lp64d)” --license “GPL-3.0-or-later” --vendor “GNU Project” --url “https://gcc.gnu.org/” -p gcc-15_15.2.0_riscv64.deb usr

P.S. I found your instructions mentioned above after the build was finished and I saw the final size of the deb package.
Here are the last configured rules

Summary

#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
export DEB_CFLAGS_MAINT_APPEND = -Wno-error=format-security
export DEB_CXXFLAGS_MAINT_APPEND = -Wno-error=format-security

%:
dh $@

override_dh_auto_configure:
./configure
–prefix=/usr/local/gcc-15.2.0
–host=riscv64-linux-gnu
–build=riscv64-linux-gnu
–target=riscv64-linux-gnu
–enable-languages=c,c++,objc,obj-c++
–disable-multilib
–enable-lto
–with-system-zlib
CFLAGS=“-O2 -w -Wno-error=format-security”
CXXFLAGS=“-O2 -w -Wno-error=format-security”
CC=riscv64-linux-gnu-gcc
CXX=riscv64-linux-gnu-g++
AR=riscv64-linux-gnu-ar
RANLIB=riscv64-linux-gnu-ranlib

override_dh_auto_build:
dh_auto_build

override_dh_auto_test:
echo “Skipping tests”