Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Something in the buildroot dependency broke the build process #455

Open
Doralitze opened this issue Jul 5, 2024 · 6 comments
Open

Something in the buildroot dependency broke the build process #455

Doralitze opened this issue Jul 5, 2024 · 6 comments

Comments

@Doralitze
Copy link

Describe the bug
Since this week, the build process for for the qemu/generic target does not work anymore. The build process fails at the opensbi stage. Changing the version of that dependency from 1.2 to 1.1, 1.3 or 1.5 did not yield success. Steps to reproduce:

git clone --recursive https://github.com/keystone-enclave/keystone.git
cd keystone

export KEYSTONE_PLATFORM=generic
export KEYSTONE_BITS=64
export BUILDROOT_CONFIGFILE=qemu_riscv64_virt_defconfig
export BUILDROOT_TARGET=all

After that, add the following lines to buildroot/configs/qemu_riscv64_virt_defconfig:

BR2_GCC_VERSION_12_X=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y # Only this line should be required but I included the complete patch for better reproducability
BR2_TOOLCHAIN_BUILDROOT_FORTRAN=y
BR2_GCC_ENABLE_OPENMP=y
BR2_GCC_ENABLE_GRAPHITE=y
BR2_PACKAGE_HOST_GDB=y
BR2_TARGET_OPTIMIZATION="-O3"
BR2_PACKAGE_HOST_KEYSTONE_SDK=y
BR2_PACKAGE_MOST=y
BR2_PACKAGE_NANO=y
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y

and finally issue make. This should fail at the opensbi stage with the following tail of build-generic64/build.log:

make[1]: Entering directory '/home/leondietrich/keystone/buildroot'
/usr/bin/make -j1 O=/home/leondietrich/keystone/build-generic64/buildroot.build HOSTCC="/usr/bin/gcc" HOSTCXX="/usr/bin/g++" syncconfig
  GEN     /home/leondietrich/keystone/build-generic64/buildroot.build/Makefile
/home/leondietrich/keystone/build-generic64/buildroot.build/.config:3515:warning: override: reassigning to symbol BR2_ROOTFS_OVERLAY
#
# configuration written to /home/leondietrich/keystone/build-generic64/buildroot.build/.config
#
>>> opensbi 1.2 Extracting
gzip -d -c /home/leondietrich/keystone/buildroot/dl/opensbi/opensbi-1.2.tar.gz | tar --strip-components=1 -C /home/leondietrich/keystone/build-generic64/buildroot.build/build/opensbi$
>>> opensbi 1.2 Patching
>>> opensbi 1.2 Configuring
>>> opensbi 1.2 Building
PATH="/home/leondietrich/keystone/build-generic64/buildroot.build/host/bin:/home/leondietrich/keystone/build-generic64/buildroot.build/host/sbin:/home/leondietrich/miniforge3/bin:/ho$
 AS-DEP    platform/generic/../../src/trap.dep
Makefile:231: /home/leondietrich/keystone/build-generic64/buildroot.build/build/opensbi-1.2/build/platform/generic/kconfig/auto.conf.cmd: No such file or directory
make[3]: *** No rule to make target '/home/leondietrich/keystone/build-generic64/buildroot.build/build/keystone-sm-619d4cc1267b57ad/plat/generic/configs/defconfig', needed by '/home/leondietrich/$
make[3]: *** Waiting for unfinished jobs....
<command-line>: fatal error: /home/leondietrich/keystone/build-generic64/buildroot.build/build/opensbi-1.2/build/platform/generic/kconfig/autoconf.h: No such file or directory
compilation terminated.
 AS-DEP    platform/generic/../../src/mprv.dep
<command-line>: fatal error: /home/leondietrich/keystone/build-generic64/buildroot.build/build/opensbi-1.2/build/platform/generic/kconfig/autoconf.h: No such file or directory
compilation terminated.
make[2]: *** [package/pkg-generic.mk:293: /home/leondietrich/keystone/build-generic64/buildroot.build/build/opensbi-1.2/.stamp_built] Error 2
make[1]: *** [Makefile:82: _all] Error 2
make[1]: Leaving directory '/home/leondietrich/keystone/buildroot'

The files that the build script complains about to be missing are not present indeed. In fact they have not been produced at this point at all, making me think that something with the linux build script or its configuration is off.

Build Failure
If you ran into build problems, please add these information
(1) Results of git submodule status

➜   git submodule status
 c92cc8796ed951f0604e9272677a9cdfcd93680f buildroot (2023.02.2)
 cb35d1dba01da51b1489fb109f1b5598bd655267 overlays/keystone/board/cva6/cva6-sdk (v0.3.0-16-gcb35d1d)
 132d25d51d6b9d14ae59f949c769e0e1a53101c5 overlays/microchip (linux4microchip-2023.04-9-g132d25d)
 f615c3f3e78b9fd60f4803b823b49e55420a36ce runtime/test/cmocka (cmocka-1.1.5-27-gf615c3f)
 046854b2ac02c69f1037ec24cd17b3700b1e3906 scripts/ci/utils/relay_ft245r (heads/master)

(2) Your Linux distribution (e.g., Ubuntu 14.04)
6.5.0-41-generic #41~22.04.2-Ubuntu
(3) The branch you're working on (e.g., master or dev)
master

Screenshots or Error Log

mkdir -p /home/leondietrich/keystone//build-generic64
mkdir -p /home/leondietrich/keystone//build-generic64/buildroot.build
mkdir -p /home/leondietrich/keystone//build-generic64/overlay
 >>>  (INF) Configuring Buildroot with qemu_riscv64_virt_defconfig
make -C /home/leondietrich/keystone//buildroot O=/home/leondietrich/keystone//build-generic64/buildroot.build BR2_EXTERNAL=/home/leondietrich/keystone//overlays/keystone qemu_riscv64_virt_defconfig
make[1]: Entering directory '/home/leondietrich/keystone/buildroot'
 >>>  (INF) Setting up overlay
mkdir -p /home/leondietrich/keystone//build-generic64/overlay/root/.ssh
ssh-keygen -C 'root@keystone' -t rsa -f /home/leondietrich/keystone//build-generic64/overlay/root/.ssh/id-rsa -N ''
Generating public/private rsa key pair.
mkdir -p /home/leondietrich/keystone/build-generic64/buildroot.build/build/buildroot-config/lxdialog
PKG_CONFIG_PATH="" make CC="/usr/bin/gcc" HOSTCC="/usr/bin/gcc" \
    obj=/home/leondietrich/keystone/build-generic64/buildroot.build/build/buildroot-config -C support/kconfig -f Makefile.br conf
/usr/bin/gcc -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE  -I/home/leondietrich/keystone/build-generic64/buildroot.build/build/buildroot-config -DCONFIG_=\"\"  -MM *.c > /home/leondietrich/keystone/build-generic64/buildroot.build/build/buildroot-config/.depend 2>/dev/null || :
/usr/bin/gcc -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE  -I/home/leondietrich/keystone/build-generic64/buildroot.build/build/buildroot-config -DCONFIG_=\"\"   -c conf.c -o /home/leondietrich/keystone/build-generic64/buildroot.build/build/buildroot-config/conf.o
/usr/bin/gcc -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE  -I/home/leondietrich/keystone/build-generic64/buildroot.build/build/buildroot-config -DCONFIG_=\"\"  -I. -c /home/leondietrich/keystone/build-generic64/buildroot.build/build/buildroot-config/zconf.tab.c -o /home/leondietrich/keystone/build-generic64/buildroot.build/build/buildroot-config/zconf.tab.o
Your identification has been saved in /home/leondietrich/keystone//build-generic64/overlay/root/.ssh/id-rsa
Your public key has been saved in /home/leondietrich/keystone//build-generic64/overlay/root/.ssh/id-rsa.pub
The key fingerprint is:
SHA256:U5aAwhZ7ufYARN4qPG2fhSVVn/YVIl6aIvE9EGXyjsw root@keystone
The key's randomart image is:
+---[RSA 3072]----+
|   o+. oo=++ o . |
|   o+o.oo.Bo=.. .|
|   .+.=..o+B+   .|
| . . + =+o+... . |
|  + + = SE .  .  |
|   + o = .       |
|      o .        |
|                 |
|                 |
+----[SHA256]-----+
cp -f /home/leondietrich/keystone//build-generic64/overlay/root/.ssh/{id-rsa.pub,authorized_keys} 
touch /home/leondietrich/keystone//build-generic64/overlay/.done
/usr/bin/gcc -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE  -I/home/leondietrich/keystone/build-generic64/buildroot.build/build/buildroot-config -DCONFIG_=\"\"   /home/leondietrich/keystone/build-generic64/buildroot.build/build/buildroot-config/conf.o /home/leondietrich/keystone/build-generic64/buildroot.build/build/buildroot-config/zconf.tab.o  -o /home/leondietrich/keystone/build-generic64/buildroot.build/build/buildroot-config/conf
rm /home/leondietrich/keystone/build-generic64/buildroot.build/build/buildroot-config/zconf.tab.c
  GEN     /home/leondietrich/keystone/build-generic64/buildroot.build/Makefile
#
# configuration written to /home/leondietrich/keystone/build-generic64/buildroot.build/.config
#
make[1]: Leaving directory '/home/leondietrich/keystone/buildroot'
echo "BR2_ROOTFS_OVERLAY=\"/home/leondietrich/keystone//build-generic64/overlay \"" >> /home/leondietrich/keystone//build-generic64/buildroot.build/.config
echo "BR2_CCACHE_DIR=/home/leondietrich/.buildroot-ccache" >> /home/leondietrich/keystone//build-generic64/buildroot.build/.config
 >>>  (INF) Building Buildroot
set -o pipefail ; make -C /home/leondietrich/keystone//buildroot O=/home/leondietrich/keystone//build-generic64/buildroot.build BR2_EXTERNAL=/home/leondietrich/keystone//overlays/keystone all 2>&1 | \
            tee /home/leondietrich/keystone//build-generic64/build.log | LC_ALL=C grep -of scripts/grep.patterns
>>> host-skeleton  Extracting
>>> host-skeleton  Patching
>>> host-skeleton  Configuring
>>> host-skeleton  Building
>>> host-skeleton  Installing to host directory
>>> host-pkgconf 1.6.3 Extracting
>>> host-pkgconf 1.6.3 Patching
>>> host-pkgconf 1.6.3 Updating config.sub and config.guess
>>> host-pkgconf 1.6.3 Patching libtool
>>> host-pkgconf 1.6.3 Configuring
>>> host-pkgconf 1.6.3 Building
>>> host-pkgconf 1.6.3 Installing to host directory
>>> host-libzlib 1.2.13 Extracting
>>> host-libzlib 1.2.13 Patching
>>> host-libzlib 1.2.13 Configuring
>>> host-libzlib 1.2.13 Building
>>> host-libzlib 1.2.13 Installing to host directory
>>> host-zlib  Extracting
>>> host-zlib  Patching
>>> host-zlib  Configuring
>>> host-zlib  Building
>>> host-zlib  Installing to host directory
>>> host-util-linux 2.38 Extracting
>>> host-util-linux 2.38 Patching
>>> host-util-linux 2.38 Updating config.sub and config.guess
>>> host-util-linux 2.38 Patching libtool
>>> host-util-linux 2.38 Configuring
>>> host-util-linux 2.38 Building
>>> host-util-linux 2.38 Installing to host directory
>>> host-e2fsprogs 1.46.5 Extracting
>>> host-e2fsprogs 1.46.5 Patching
>>> host-e2fsprogs 1.46.5 Updating config.sub and config.guess
>>> host-e2fsprogs 1.46.5 Patching libtool
>>> host-e2fsprogs 1.46.5 Configuring
>>> host-e2fsprogs 1.46.5 Building
>>> host-e2fsprogs 1.46.5 Installing to host directory
>>> host-attr 2.5.1 Extracting
>>> host-attr 2.5.1 Patching
>>> host-attr 2.5.1 Updating config.sub and config.guess
>>> host-attr 2.5.1 Patching libtool
>>> host-attr 2.5.1 Configuring
>>> host-attr 2.5.1 Building
>>> host-attr 2.5.1 Installing to host directory
>>> host-acl 2.3.1 Extracting
>>> host-acl 2.3.1 Patching
>>> host-acl 2.3.1 Updating config.sub and config.guess
>>> host-acl 2.3.1 Patching libtool
>>> host-acl 2.3.1 Configuring
>>> host-acl 2.3.1 Building
>>> host-acl 2.3.1 Installing to host directory
>>> host-fakeroot 1.30.1 Extracting
>>> host-fakeroot 1.30.1 Patching
>>> host-fakeroot 1.30.1 Updating config.sub and config.guess
>>> host-fakeroot 1.30.1 Patching libtool
>>> host-fakeroot 1.30.1 Configuring
>>> host-fakeroot 1.30.1 Building
>>> host-fakeroot 1.30.1 Installing to host directory
>>> host-makedevs  Extracting
>>> host-makedevs  Patching
>>> host-makedevs  Configuring
>>> host-makedevs  Building
>>> host-makedevs  Installing to host directory
>>> host-m4 1.4.19 Extracting
>>> host-m4 1.4.19 Patching
>>> host-m4 1.4.19 Updating config.sub and config.guess
>>> host-m4 1.4.19 Patching libtool
>>> host-m4 1.4.19 Configuring
>>> host-m4 1.4.19 Building
>>> host-m4 1.4.19 Installing to host directory
>>> host-bison 3.8.2 Extracting
>>> host-bison 3.8.2 Patching
>>> host-bison 3.8.2 Updating config.sub and config.guess
>>> host-bison 3.8.2 Patching libtool
>>> host-bison 3.8.2 Configuring
>>> host-bison 3.8.2 Building
>>> host-bison 3.8.2 Installing to host directory
>>> host-gawk 5.2.0 Extracting
>>> host-gawk 5.2.0 Patching
>>> host-gawk 5.2.0 Updating config.sub and config.guess
>>> host-gawk 5.2.0 Patching libtool
>>> host-gawk 5.2.0 Configuring
>>> host-gawk 5.2.0 Building
>>> host-gawk 5.2.0 Installing to host directory
>>> host-binutils 2.38 Extracting
>>> host-binutils 2.38 Patching
>>> host-binutils 2.38 Updating config.sub and config.guess
>>> host-binutils 2.38 Patching libtool
>>> host-binutils 2.38 Configuring
>>> host-binutils 2.38 Building
>>> host-binutils 2.38 Installing to host directory
>>> host-gmp 6.2.1 Extracting
>>> host-gmp 6.2.1 Patching
>>> host-gmp 6.2.1 Updating config.sub and config.guess
>>> host-gmp 6.2.1 Patching libtool
>>> host-gmp 6.2.1 Configuring
>>> host-gmp 6.2.1 Building
>>> host-gmp 6.2.1 Installing to host directory
>>> host-isl 0.25 Extracting
>>> host-isl 0.25 Patching
>>> host-isl 0.25 Updating config.sub and config.guess
>>> host-isl 0.25 Patching libtool
>>> host-isl 0.25 Configuring
>>> host-isl 0.25 Building
>>> host-isl 0.25 Installing to host directory
>>> host-mpfr 4.1.1 Extracting
>>> host-mpfr 4.1.1 Patching
>>> host-mpfr 4.1.1 Updating config.sub and config.guess
>>> host-mpfr 4.1.1 Patching libtool
>>> host-mpfr 4.1.1 Configuring
>>> host-mpfr 4.1.1 Building
>>> host-mpfr 4.1.1 Installing to host directory
>>> host-mpc 1.2.1 Extracting
>>> host-mpc 1.2.1 Patching
>>> host-mpc 1.2.1 Updating config.sub and config.guess
>>> host-mpc 1.2.1 Patching libtool
>>> host-mpc 1.2.1 Configuring
>>> host-mpc 1.2.1 Building
>>> host-mpc 1.2.1 Installing to host directory
>>> host-gcc-initial 12.3.0 Extracting
>>> host-gcc-initial 12.3.0 Patching
>>> host-gcc-initial 12.3.0 Updating config.sub and config.guess
>>> host-gcc-initial 12.3.0 Patching libtool
>>> host-gcc-initial 12.3.0 Configuring
>>> host-gcc-initial 12.3.0 Building
>>> host-gcc-initial 12.3.0 Installing to host directory
>>> skeleton-init-common  Extracting
>>> skeleton-init-common  Patching
>>> skeleton-init-common  Configuring
>>> skeleton-init-common  Building
>>> skeleton-init-common  Installing to staging directory
>>> skeleton-init-common  Fixing libtool files
>>> skeleton-init-common  Installing to target
>>> skeleton-init-sysv  Extracting
>>> skeleton-init-sysv  Patching
>>> skeleton-init-sysv  Configuring
>>> skeleton-init-sysv  Building
>>> skeleton-init-sysv  Installing to target
>>> skeleton  Extracting
>>> skeleton  Patching
>>> skeleton  Configuring
>>> skeleton  Building
>>> skeleton  Installing to target
>>> linux-headers 5.15.43 Extracting
>>> linux-headers 5.15.43 Patching
>>> linux-headers 5.15.43 Configuring
>>> linux-headers 5.15.43 Building
>>> linux-headers 5.15.43 Installing to staging directory
>>> linux-headers 5.15.43 Fixing libtool files
>>> linux-headers 5.15.43 Installing to target
>>> glibc 2.36-81-g4f4d7a13edfd2fdc57c9d76e1fd6d017fb47550c Extracting
>>> glibc 2.36-81-g4f4d7a13edfd2fdc57c9d76e1fd6d017fb47550c Patching
>>> glibc 2.36-81-g4f4d7a13edfd2fdc57c9d76e1fd6d017fb47550c Updating config.sub and config.guess
>>> glibc 2.36-81-g4f4d7a13edfd2fdc57c9d76e1fd6d017fb47550c Patching libtool
>>> glibc 2.36-81-g4f4d7a13edfd2fdc57c9d76e1fd6d017fb47550c Configuring
>>> glibc 2.36-81-g4f4d7a13edfd2fdc57c9d76e1fd6d017fb47550c Building
>>> glibc 2.36-81-g4f4d7a13edfd2fdc57c9d76e1fd6d017fb47550c Installing to staging directory
>>> glibc 2.36-81-g4f4d7a13edfd2fdc57c9d76e1fd6d017fb47550c Fixing libtool files
>>> glibc 2.36-81-g4f4d7a13edfd2fdc57c9d76e1fd6d017fb47550c Installing to target
>>> host-gcc-final 12.3.0 Extracting
>>> host-gcc-final 12.3.0 Patching
>>> host-gcc-final 12.3.0 Updating config.sub and config.guess
>>> host-gcc-final 12.3.0 Patching libtool
>>> host-gcc-final 12.3.0 Configuring
>>> host-gcc-final 12.3.0 Building
>>> host-gcc-final 12.3.0 Installing to host directory
>>> toolchain-buildroot  Extracting
>>> toolchain-buildroot  Patching
>>> toolchain-buildroot  Configuring
>>> toolchain-buildroot  Building
>>> toolchain-buildroot  Installing to target
>>> toolchain  Extracting
>>> toolchain  Patching
>>> toolchain  Configuring
>>> toolchain  Building
>>> toolchain  Installing to staging directory
>>> toolchain  Fixing libtool files
>>> toolchain  Installing to target
>>> busybox 1.36.0 Extracting
>>> busybox 1.36.0 Patching
>>> busybox 1.36.0 Configuring
>>> busybox 1.36.0 Building
>>> busybox 1.36.0 Installing to target
>>> host-expat 2.5.0 Extracting
>>> host-expat 2.5.0 Patching
>>> host-expat 2.5.0 Updating config.sub and config.guess
>>> host-expat 2.5.0 Patching libtool
>>> host-expat 2.5.0 Configuring
>>> host-expat 2.5.0 Building
>>> host-expat 2.5.0 Installing to host directory
>>> host-libiberty 2.32 Extracting
>>> host-libiberty 2.32 Patching
>>> host-libiberty 2.32 Updating config.sub and config.guess
>>> host-libiberty 2.32 Patching libtool
>>> host-libiberty 2.32 Configuring
>>> host-libiberty 2.32 Building
>>> host-libiberty 2.32 Installing to host directory
>>> host-ncurses 6.4-20230429 Extracting
>>> host-ncurses 6.4-20230429 Patching
>>> host-ncurses 6.4-20230429 Updating config.sub and config.guess
>>> host-ncurses 6.4-20230429 Patching libtool
>>> host-ncurses 6.4-20230429 Configuring
>>> host-ncurses 6.4-20230429 Building
>>> host-ncurses 6.4-20230429 Installing to host directory
>>> host-gdb 11.2 Extracting
>>> host-gdb 11.2 Patching
>>> host-gdb 11.2 Updating config.sub and config.guess
>>> host-gdb 11.2 Patching libtool
>>> host-gdb 11.2 Configuring
>>> host-gdb 11.2 Building
>>> host-gdb 11.2 Installing to host directory
>>> ifupdown-scripts  Extracting
>>> ifupdown-scripts  Patching
>>> ifupdown-scripts  Configuring
>>> ifupdown-scripts  Building
>>> ifupdown-scripts  Installing to target
>>> initscripts  Extracting
>>> initscripts  Patching
>>> initscripts  Configuring
>>> initscripts  Building
>>> initscripts  Installing to target
>>> host-kmod 30 Extracting
>>> host-kmod 30 Patching
>>> host-kmod 30 Updating config.sub and config.guess
>>> host-kmod 30 Patching libtool
>>> host-kmod 30 Configuring
>>> host-kmod 30 Building
>>> host-kmod 30 Installing to host directory
>>> ncurses 6.4-20230429 Extracting
>>> ncurses 6.4-20230429 Patching
>>> ncurses 6.4-20230429 Updating config.sub and config.guess
>>> ncurses 6.4-20230429 Patching libtool
>>> ncurses 6.4-20230429 Configuring
>>> ncurses 6.4-20230429 Building
>>> ncurses 6.4-20230429 Installing to staging directory
>>> ncurses 6.4-20230429 Fixing package configuration files
>>> ncurses 6.4-20230429 Fixing libtool files
>>> ncurses 6.4-20230429 Installing to target
>>> slang 2.3.3 Extracting
>>> slang 2.3.3 Patching
>>> slang 2.3.3 Updating config.sub and config.guess
>>> slang 2.3.3 Patching libtool
>>> slang 2.3.3 Configuring
>>> slang 2.3.3 Building
>>> slang 2.3.3 Installing to staging directory
>>> slang 2.3.3 Fixing libtool files
>>> slang 2.3.3 Installing to target
>>> most 5.2.0 Extracting
>>> most 5.2.0 Patching
>>> most 5.2.0 Updating config.sub and config.guess
>>> most 5.2.0 Patching libtool
>>> most 5.2.0 Configuring
>>> most 5.2.0 Building
>>> most 5.2.0 Installing to target
>>> nano 7.2 Extracting
>>> nano 7.2 Patching
>>> nano 7.2 Updating config.sub and config.guess
>>> nano 7.2 Patching libtool
>>> nano 7.2 Configuring
>>> nano 7.2 Building
>>> nano 7.2 Installing to target
>>> host-patchelf 0.13 Extracting
>>> host-patchelf 0.13 Patching
>>> host-patchelf 0.13 Updating config.sub and config.guess
>>> host-patchelf 0.13 Patching libtool
>>> host-patchelf 0.13 Configuring
>>> host-patchelf 0.13 Building
>>> host-patchelf 0.13 Installing to host directory
>>> host-libtool 2.4.6 Extracting
>>> host-libtool 2.4.6 Patching
>>> host-libtool 2.4.6 Updating config.sub and config.guess
>>> host-libtool 2.4.6 Configuring
>>> host-libtool 2.4.6 Building
>>> host-libtool 2.4.6 Installing to host directory
>>> host-autoconf 2.71 Extracting
>>> host-autoconf 2.71 Patching
>>> host-autoconf 2.71 Updating config.sub and config.guess
>>> host-autoconf 2.71 Patching libtool
>>> host-autoconf 2.71 Configuring
>>> host-autoconf 2.71 Building
>>> host-autoconf 2.71 Installing to host directory
>>> host-automake 1.16.5 Extracting
>>> host-automake 1.16.5 Patching
>>> host-automake 1.16.5 Updating config.sub and config.guess
>>> host-automake 1.16.5 Patching libtool
>>> host-automake 1.16.5 Configuring
>>> host-automake 1.16.5 Building
>>> host-automake 1.16.5 Installing to host directory
>>> host-gettext-tiny 0.3.2 Extracting
>>> host-gettext-tiny 0.3.2 Patching
>>> host-gettext-tiny 0.3.2 Configuring
>>> host-gettext-tiny 0.3.2 Building
>>> host-gettext-tiny 0.3.2 Installing to host directory
>>> host-gettext  Extracting
>>> host-gettext  Patching
>>> host-gettext  Configuring
>>> host-gettext  Building
>>> host-gettext  Installing to host directory
>>> host-flex 2.6.4 Extracting
>>> host-flex 2.6.4 Patching
>>> host-flex 2.6.4 Updating config.sub and config.guess
>>> host-flex 2.6.4 Configuring
>>> host-flex 2.6.4 Gettextizing
>>> host-flex 2.6.4 Autoreconfiguring
>>> host-flex 2.6.4 Patching libtool
>>> host-flex 2.6.4 Building
>>> host-flex 2.6.4 Installing to host directory
>>> host-dtc 1.6.1 Extracting
>>> host-dtc 1.6.1 Patching
>>> host-dtc 1.6.1 Configuring
>>> host-dtc 1.6.1 Building
>>> host-dtc 1.6.1 Installing to host directory
>>> host-libffi 3.4.4 Extracting
>>> host-libffi 3.4.4 Patching
>>> host-libffi 3.4.4 Updating config.sub and config.guess
>>> host-libffi 3.4.4 Configuring
>>> host-libffi 3.4.4 Autoreconfiguring
>>> host-libffi 3.4.4 Patching libtool
>>> host-libffi 3.4.4 Building
>>> host-libffi 3.4.4 Installing to host directory
>>> host-ninja 1.11.1.g95dee.kitware.jobserver-1 Extracting
>>> host-ninja 1.11.1.g95dee.kitware.jobserver-1 Patching
>>> host-ninja 1.11.1.g95dee.kitware.jobserver-1 Configuring
>>> host-ninja 1.11.1.g95dee.kitware.jobserver-1 Building
>>> host-ninja 1.11.1.g95dee.kitware.jobserver-1 Installing to host directory
>>> host-autoconf-archive 2022.09.03 Extracting
>>> host-autoconf-archive 2022.09.03 Patching
>>> host-autoconf-archive 2022.09.03 Updating config.sub and config.guess
>>> host-autoconf-archive 2022.09.03 Patching libtool
>>> host-autoconf-archive 2022.09.03 Configuring
>>> host-autoconf-archive 2022.09.03 Building
>>> host-autoconf-archive 2022.09.03 Installing to host directory
>>> host-python3 3.11.3 Extracting
>>> host-python3 3.11.3 Patching
>>> host-python3 3.11.3 Updating config.sub and config.guess
>>> host-python3 3.11.3 Configuring
>>> host-python3 3.11.3 Autoreconfiguring
>>> host-python3 3.11.3 Patching libtool
>>> host-python3 3.11.3 Building
>>> host-python3 3.11.3 Installing to host directory
>>> host-python-setuptools 65.6.3 Extracting
>>> host-python-setuptools 65.6.3 Patching
>>> host-python-setuptools 65.6.3 Configuring
>>> host-python-setuptools 65.6.3 Building
>>> host-python-setuptools 65.6.3 Installing to host directory
>>> host-meson 1.0.0 Extracting
>>> host-meson 1.0.0 Patching
>>> host-meson 1.0.0 Configuring
>>> host-meson 1.0.0 Building
>>> host-meson 1.0.0 Installing to host directory
>>> host-pcre 8.45 Extracting
>>> host-pcre 8.45 Patching
>>> host-pcre 8.45 Updating config.sub and config.guess
>>> host-pcre 8.45 Patching libtool
>>> host-pcre 8.45 Configuring
>>> host-pcre 8.45 Building
>>> host-pcre 8.45 Installing to host directory
>>> host-libglib2 2.72.3 Extracting
>>> host-libglib2 2.72.3 Patching
>>> host-libglib2 2.72.3 Configuring
>>> host-libglib2 2.72.3 Building
>>> host-libglib2 2.72.3 Installing to host directory
>>> host-pixman 0.42.2 Extracting
>>> host-pixman 0.42.2 Patching
>>> host-pixman 0.42.2 Updating config.sub and config.guess
>>> host-pixman 0.42.2 Configuring
>>> host-pixman 0.42.2 Autoreconfiguring
>>> host-pixman 0.42.2 Patching libtool
>>> host-pixman 0.42.2 Building
>>> host-pixman 0.42.2 Installing to host directory
>>> host-slirp 4.7.0 Extracting
>>> host-slirp 4.7.0 Patching
>>> host-slirp 4.7.0 Configuring
>>> host-slirp 4.7.0 Building
>>> host-slirp 4.7.0 Installing to host directory
>>> host-qemu 7.2.1 Extracting
>>> host-qemu 7.2.1 Patching
>>> host-qemu 7.2.1 Configuring
>>> host-qemu 7.2.1 Building
>>> host-qemu 7.2.1 Installing to host directory
>>> urandom-scripts  Extracting
>>> urandom-scripts  Patching
>>> urandom-scripts  Configuring
>>> urandom-scripts  Building
>>> urandom-scripts  Installing to target
>>> opensbi 1.2 Extracting
>>> opensbi 1.2 Patching
>>> host-keystone-sdk 4ca1cd1b4faefc77 Syncing from source dir /home/leondietrich/keystone//sdk
>>> host-keystone-sdk 4ca1cd1b4faefc77 Configuring
>>> host-keystone-sdk 4ca1cd1b4faefc77 Building
>>> host-keystone-sdk 4ca1cd1b4faefc77 Installing to host directory
>>> keystone-sm 619d4cc1267b57ad Syncing from source dir /home/leondietrich/keystone//sm
>>> keystone-sm 619d4cc1267b57ad Configuring
>>> keystone-sm 619d4cc1267b57ad Building
>>> keystone-sm 619d4cc1267b57ad Installing to target
>>> opensbi 1.2 Configuring
>>> opensbi 1.2 Building
make[2]: *** [package/pkg-generic.mk:293: /home/leondietrich/keystone/build-generic64/buildroot.build/build/opensbi-1.2/.stamp_built] Error 2
make[1]: *** [Makefile:82: _all] Error 2
make: *** [Makefile:93: buildroot] Error 2

Additional context
Besides the patch regarding the configuration file, the installation and repository are clean. The manual hosted here has been followed. This procedure yielded sane results last week but redoing it this week did not work. Yet, rewinding to a commit on master that is older than this week did not fix the issue.

@grg-haas
Copy link
Collaborator

grg-haas commented Jul 5, 2024

Hi @Doralitze ! Thank you for your detailed issue report. One thing I see is that you seem to be building OpenSBI 1.2, whereas the generic platform is currently configured for OpenSBI 1.1:

BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.1"

I could imagine that with the minor version bump, OpenSBI could have moved to a slightly different build system, maybe involving autoconf or Kconfig based on the build errors you're getting. If you want to use OpenSBI 1.2, you may need to specify the OpenSBI configuration in one of these formats -- I'm unsure personally what this would look like. If you want to use OpenSBI 1.1, I'd recommend cleaning your build directory and rebuilding to see if some stale Buildroot configuration options are inadvertently leading you to build 1.2 instead.

@Doralitze
Copy link
Author

Doralitze commented Jul 6, 2024 via email

@benlarsendk
Copy link

benlarsendk commented Jul 14, 2024

I have a similar issue, looking in the build.log, it seems it's not finding g++.
Looking in the folder, it doesn't exist either.

CMake Error at macros.cmake:68 (message): Check for working C compiler: /home/bonne/Projects/Keystone/keystone/build-generic64/buildroot.build/host/bin/riscv64-buildroot-linux-gnu-g++ -- not working

@Doralitze
Copy link
Author

I have a similar issue, looking in the build.log, it seems it's not finding g++. Looking in the folder, it doesn't exist either.

CMake Error at macros.cmake:68 (message): Check for working C compiler: /home/bonne/Projects/Keystone/keystone/build-generic64/buildroot.build/host/bin/riscv64-buildroot-linux-gnu-g++ -- not working

That's actually a different issue and can be fixed by enabling the build of a C++ compiler in the toolchain. Insert BR2_TOOLCHAIN_BUILDROOT_CXX=y into your defconfig and it should work.

@its-valentinvp
Copy link

Hey @Doralitze,
We ran into the same build error as we tried to port Keystone to the VisionFive 2 Board. The problem is that OpenSBI added KConfig in newer versions, but in Buildroot the necessary files are not generated automatically. We tried to fix this to, but we quickly decided to just remove the KConfig System completely again with a OpenSbi patch. See #467 and check the file opensbi-remove-kconfig.patch. We also needed some further changes to get the newer OpenSBI to work. All necessary changes are in our PR too. Feel free to contact me if you need some help with this :)

@NingL-coder
Copy link

When I try to build the Keystone on QEMU following tutorial, I also meet the same question.
GIT_DIR=. PATH="/keystone/build-generic64/buildroot.build/host/bin:/keystone/build-generic64/buildroot.build/host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" CROSS_COMPILE=/keystone/build-generic64/buildroot.build/host/bin/riscv64-buildroot-linux-gnu- PLATFORM=generic PLATFORM_DIR=/keystone/build-generic64/buildroot.build/build/keystone-sm-bcad394833343eec//plat/ PLATFORM_RISCV_TOOLCHAIN_DEFAULT=1 /usr/bin/make -C /keystone/build-generic64/buildroot.build/build/opensbi-1.2 AS-DEP platform/generic/../../src/trap.dep Makefile:231: /keystone/build-generic64/buildroot.build/build/opensbi-1.2/build/platform/generic/kconfig/auto.conf.cmd: No such file or directory make[3]: *** No rule to make target '/keystone/build-generic64/buildroot.build/build/keystone-sm-bcad394833343eec/plat/generic/configs/defconfig', needed by '/keystone/build-generic64/buildroot.build/build/opensbi-1.2/build/platform/generic/kconfig/.config'. Stop. make[3]: *** Waiting for unfinished jobs.... AS-DEP platform/generic/../../src/mprv.dep <command-line>:1: fatal error: /keystone/build-generic64/buildroot.build/build/opensbi-1.2/build/platform/generic/kconfig/autoconf.h: No such file or directory compilation terminated. <command-line>:1: fatal error: /keystone/build-generic64/buildroot.build/build/opensbi-1.2/build/platform/generic/kconfig/autoconf.h: No such file or directory compilation terminated. make[2]: *** [package/pkg-generic.mk:289: /keystone/build-generic64/buildroot.build/build/opensbi-1.2/.stamp_built] Error 2 make[1]: *** [Makefile:83: _all] Error 2 make[1]: Leaving directory '/keystone/buildroot'
Is there a method to this problem now, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants