Closed michaeljclark closed 6 years ago
I spent a lot of time mucking with buildroot in early December and coudn't get it to work due to similar sorts of errors with gcc and linux header version dependencies. I tried fixing it but I gave up hacking on buildroot and went ahead and made a tiny busybox+dropbear linux root image builder. Caveat: it requires sudo as it loop mounts an ext4 filesystem
There is obviously some buildroot patches I must be missing or I'm on the wrong branch. When I run it a third time, the build log is shorter, but I get the same error.
$ make qemu
make -C /home/mclark/src/sifive/freedom-u-sdk/buildroot RISCV=/opt/riscv/toolchain PATH=/opt/riscv/toolchain/bin:/home/mclark/bin:/home/mclark/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/opt/riscv/toolchain/bin:/opt/riscv/qemu/bin:/opt/riscv/musl-riscv-toolchain-7.2.0-7/bin O=/home/mclark/src/sifive/freedom-u-sdk/work/buildroot_initramfs
make[1]: Entering directory '/home/mclark/src/sifive/freedom-u-sdk/buildroot'
>>> toolchain-external undefined Configuring
Incorrect selection of kernel headers: expected 4.6.x, got 4.13.x
package/pkg-generic.mk:185: recipe for target '/home/mclark/src/sifive/freedom-u-sdk/work/buildroot_initramfs/build/toolchain-external-undefined/.stamp_configured' failed
make[1]: *** [/home/mclark/src/sifive/freedom-u-sdk/work/buildroot_initramfs/build/toolchain-external-undefined/.stamp_configured] Error 1
make[1]: Leaving directory '/home/mclark/src/sifive/freedom-u-sdk/buildroot'
Makefile:87: recipe for target '/home/mclark/src/sifive/freedom-u-sdk/work/buildroot_initramfs/images/rootfs.tar' failed
make: *** [/home/mclark/src/sifive/freedom-u-sdk/work/buildroot_initramfs/images/rootfs.tar] Error 2
It's possibly my linux toolchain version. My linux toolchain is top-of-tree default master branch of riscv-gnu-toolchain
as of 01-Feb-2018
$ /opt/riscv/toolchain-20180201/bin/riscv64-unknown-linux-gnu-gcc --version
riscv64-unknown-linux-gnu-gcc (GCC) 7.1.1 20170509
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Try unset RISCV before running make in a clean checkout of freedom-u-sdk. It will use it's own known-to-work toolchain then.
On Feb 24, 2018 1:57 PM, "Michael Clark" notifications@github.com wrote:
I spent a lot of time mucking with buildroot in early December and coudn't get it to work due to similar sorts of errors with gcc and linux header version dependencies. I tried fixing it but I gave up hacking on buildroot and went ahead and made a tiny busybox+dropbear linux root image builder. Caveat: it requires sudo as it loop mounts an ext4 filesystem
There is obviously some buildroot patches I must be missing or I'm on the wrong branch. When I run it a third time, the build log is shorter, but I get the same error.
$ make qemu make -C /home/mclark/src/sifive/freedom-u-sdk/buildroot RISCV=/opt/riscv/toolchain PATH=/opt/riscv/toolchain/bin:/home/mclark/bin:/home/mclark/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/opt/riscv/toolchain/bin:/opt/riscv/qemu/bin:/opt/riscv/musl-riscv-toolchain-7.2.0-7/bin O=/home/mclark/src/sifive/freedom-u-sdk/work/buildroot_initramfs make[1]: Entering directory '/home/mclark/src/sifive/freedom-u-sdk/buildroot'
toolchain-external undefined Configuring Incorrect selection of kernel headers: expected 4.6.x, got 4.13.x package/pkg-generic.mk:185: recipe for target '/home/mclark/src/sifive/freedom-u-sdk/work/buildroot_initramfs/build/toolchain-external-undefined/.stamp_configured' failed make[1]: [/home/mclark/src/sifive/freedom-u-sdk/work/buildroot_initramfs/build/toolchain-external-undefined/.stamp_configured] Error 1 make[1]: Leaving directory '/home/mclark/src/sifive/freedom-u-sdk/buildroot' Makefile:87: recipe for target '/home/mclark/src/sifive/freedom-u-sdk/work/buildroot_initramfs/images/rootfs.tar' failed make: [/home/mclark/src/sifive/freedom-u-sdk/work/buildroot_initramfs/images/rootfs.tar] Error 2
It's possibly my linux toolchain version. My linux toolchain is top-of-tree default master branch of riscv-gnu-toolchain as of 01-Feb-2018
$ /opt/riscv/toolchain-20180201/bin/riscv64-unknown-linux-gnu-gcc --version riscv64-unknown-linux-gnu-gcc (GCC) 7.1.1 20170509 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sifive/freedom-u-sdk/issues/34#issuecomment-368263420, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDPiiye_9_VN2SXRkXxq6urtXDB4R19ks5tYIWygaJpZM4SSDeI .
Oh that's good to know. I'll give it a try.
We probably should have master (default branch) in riscv-gnu-toolchain pointing at a newer toolchain. I'll try and figure out which branch freedom-u-sdk is using...
We have quite a few repos that build private copies of the toolchain (freedom, freedom-u-sdk, freedom-e-sdk, riscv-tools (if built separately) and riscv-gnu-toolchain (if built separately). Hopefully, we'll be able to fix some of these issues by using packaged dependencies instead of submodules. At some point...
@palmer-dabbelt @jim-wilson what branch of riscv-gnu-toolchain does freedom-u-sdk depend on? linux-headers-4.15-rc3? master in riscv-gnu-toolchain seems to be a little behind.
Appears to be the issue. The build is getting a lot further... it is still building...
I'll leave the issue open as its likely many folk will have RISCV
set.
We should probably add a test for the headers if an external toolchain is being used.
We could perhaps add it to the README.md when we give it a README.md. I can make a PR...
Hacky but works: in buildroot/support/scripts/check-kernel-headers.sh change the line return 1; -> return 0;
the documentation now includes a comment about this gotcha
Trying to build a fresh checkout of
freedom-u-sdk
usingmake qemu
.QEMU builds okay, but then I get an error with buildroot. I've done
git submodule update --init --recursive
and everything is up-to-date.