regymm/buildroot

build error

Closed this issue · 5 comments

Refers to comments build error

I tried your solution but not work, and i found that board/riscv/nommu/patches/linux-headers already soft link to board/riscv/nommu/patches/linux. So i try to fix this, fortunately build successfully.

I try to fix those, which seams to use ILP32 for GNU C pre-defined:

// arch/riscv/include/uapi/asm/unistd.h
#ifdef __LP64__
#define __ARCH_WANT_NEW_STAT
#define __ARCH_WANT_SET_GET_RLIMIT
#endif

#ifdef __ILP32__
#define __ARCH_WANT_STAT64
#define __ARCH_WANT_TIME32_SYSCALLS
#define __ARCH_WANT_SET_GET_RLIMIT
#endif /* __ILP32__ */

and another build error, for not found struct kernel_stat for uclibc package

// libc/sysdeps/linux/common-generic/bits/kernel_stat.h
#ifdef __NR_stat64
#define kernel_stat64	stat
#else
#define kernel_stat	stat
#endif

Thanks for your patches. I will check those for my project later.

Thanks for pointing out the problem. I mistook the macro name ILP32 in my code. If you also define __ARCH_WANT_NEW_STAT, probably the second build error won't occur any more.

I've pushed the fix. Now I'll try solving the poll: Function not implemented problem and sleep problem.

I tried modified rootfs inittab and rcS file, but those Function not implemented, is it same with your error output?

[    0.226063] devtmpfs: mounted
[    0.252708] Freeing unused kernel image (initmem) memory: 132K
[    0.253004] This architecture does not have kernel memory protection.
[    0.253540] Run /sbin/init as init process
[    0.253731]   with arguments:
[    0.253865]     /sbin/init
[    0.254000]   with environment:
[    0.254149]     HOME=/
[    0.254267]     TERM=linux
sh: waitpid: Function not implemented
sh: waitpid: Function not implemented
mount: mounting devpts on /dev/pts failed: No such file or directory
sh: waitpid: Function not implemented
sh: waitpid: Function not implemented
mount: mounting tmpfs on /dev/shm failed: No such file or directory
sh: waitpid: Function not implemented
sh: waitpid: Function not implemented
sh: can't open '/proc/sys/kernel/hotplug': No such file or directory
sh: waitpid: Function not implemented
mkdir: can't create directory '/': Function not implemented
sh: waitpid: Function not implemented
sh: waitpid: Function not implemented
mount: mounting devpts on /dev/pts failed: No such file or directory
mdev: can't stat '/': Function not implemented

Yes. Actually if you type ls / and press enter, you can see ls actually works. Busybox just calls the poll() function(which, in uclibc, seems to be implemented by select, which then traces back to pselect and ppoll syscalls) every time a character is input and somehow the underlining syscall(s) is not compiled into the kernel.

Btw, I do have encountered the "handed init" problem, don't know why, maybe some wrong file types in the rootfs. But now fresh build shouldn't have the problem. I use qemu-system-riscv32 -m 128M -machine virt -nographic -kernel output/images/Image -bios none -drive file=output/images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 to run QEMU.