Closed IEXWER closed 6 years ago
Hi @IEXWER,
First, if you are compiling a kernel on your RPi3 directly, you don't need the cross-compilation directives (you can just use e.g. make distclean
rather than make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- distclean
).
Second, the "dangerous relocation" problem is a known issue with the version of binutils
shipped on the image (2.30). It is fixed upstream in a later release; and (if using gcc-6.4.0
or gcc-6.4.0-r1
) the earlier version also works. So, to compile a kernel locally on your RPi3, you can either:
gcc-6.4.0-r1
and binutils-2.29.1-r1
(see my instructions here); orgcc-7.3.0-r1
and binutils-2.30-r2
; to do so, start from a fresh copy of the image, then run genup
(as root) which will update your gcc
and binutils
to these versions, and then perform your normal kernel build steps (make distclean
etc.) as described here (but ignore the steps before the sentence "Now, suppose you wish to build the most modern version of the 4.14.y kernel...")Hope that helps! sakaki
OK,I fix the problem and install my kernel.It works nice.Thanks.
But I want to know how to transplant another linux like ubuntu to this board.
If you have another image or rootfs, even if it is 32bit, you can start by running it in a chroot
from within the booted gentoo-on-rpi3-64bit
image, see e.g. my wiki post here.
Otherwise, porting other distros is a bit out of scope for an issue on this project. I suggest you look/post on the "Operating system distributions" board of the Raspberry Pi forum (here).
There is e.g. an Ubuntu 18.04 installer available from one of the contributors on there (see this post), but I haven't tried it myself. Good luck!
Ok,thanks.I will try it.
I'm very glad to get your help.
No problem ^-^
Closing as title issue has been addressed.
OK, I still follow the wiki to compile a linux system in my raspberry 3b with img in this git. When i compile kernel, the message show in my window.
lib/vsprintf.o:(ksymtab+vsprintf+0x8): dangerous relocation: unsupported relo cation lib/vsprintf.o:(ksymtab+vsscanf+0x0): dangerous relocation: unsupported reloc ation lib/vsprintf.o:(ksymtab+vsscanf+0x8): dangerous relocation: unsupported reloc ation lib/vsprintf.o:(ksymtab_gpl+bprintf+0x0): dangerous relocation: unsupported r elocation lib/vsprintf.o:(_ksymtab_gpl+bprintf+0x8): dangerous relocation: unsupported r elocation lib/vsprintf.o:(___ksymtab_gpl+bstrprintf+0x0): dangerous relocation: unsupport ed relocation lib/vsprintf.o:(ksymtab_gpl+bstr_printf+0x8): dangerous relocation: unsupport ed relocation lib/vsprintf.o:(_ksymtab_gpl+vbinprintf+0x0): dangerous relocation: unsupport ed relocation lib/vsprintf.o:(ksymtab_gpl+vbin_printf+0x8): dangerous relocation: unsupport ed relocation lib/win_minmax.o:(_ksymtab+minmax_running_max+0x0): dangerous relocation: unsu pported relocation lib/win_minmax.o:(_ksymtab+minmax_running_max+0x8): dangerous relocation: unsu pported relocation drivers/firmware/efi/libstub/lib-sort.stub.o: In function `efistub_$d': efistub_sort.c:(.init_ksymtab+sort+0x0): dangerous relocation: unsupported r elocation efistub_sort.c:(.init___ksymtab+sort+0x8): dangerous relocation: unsupported r elocation aarch64-unknown-linux-gnu-ld: warning: creating a DT_TEXTREL in a shared object. make: *** [Makefile:1021: vmlinux] Error 1
I think, is there a wrong step in my operation? My step is below. Because the img has crossdev ,so i don't need to setup crossdev. Then i download the kernel source code from raspberry github.The kernel'branch is rpi-4.14.y.The release tag raspberrypi-kernel_1.20180417-1 Merge remote-tracking branch 'stable/linux-4.14.y' into rpi-4.14.y.
and type make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- distclean make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- bcmrpi3_defconfig make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- menuconfig after this type, i just exit the menuconfig, delete .config file ,download .config file in this repository to replace it. In the end, after type nice -n 19 make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- -j$(nproc) the error emerge.The log message. That's all what i have done.
My english is poor,If there has some place you can't understand,please tell me. I will use the google translation to communicate with you. Thank you.