Re: Need help building for aarch64 kernel 5.2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 12, 2019 at 2:27 PM Dick Hollenbeck <dick@xxxxxxxxxxx> wrote:
>
> Hi Experts,
>
> I really need some help please.
>
> Here is the result of my first build attempt on a tree made from pristine
> Linux 5.2.21
>
> and the corresponding RT patch, which applied cleanly:
>
>
>
> $ /i/runtime/arm64/kernel/build-arm64-rt.sh
> make[1]: Entering directory '/ssd/build/linux-5.2.y'
>   GEN     Makefile
> scripts/kconfig/conf  --syncconfig Kconfig
>   GEN     Makefile
>   Using /ssd/linux-5.2.y as source for kernel
>   CALL    /ssd/linux-5.2.y/scripts/atomic/check-atomics.sh
>   CALL    /ssd/linux-5.2.y/scripts/checksyscalls.sh
>   CHK     include/generated/compile.h
>   GZIP    kernel/config_data.gz
>   CC      kernel/configs.o
>   AR      kernel/built-in.a
>   GEN     .version
>   CHK     include/generated/compile.h
>   UPD     include/generated/compile.h
>   CC      init/version.o
>   AR      init/built-in.a
>   LD      vmlinux.o
>   MODPOST vmlinux.o
>   MODINFO modules.builtin.modinfo
> kernel/sched/core.o: In function `migrate_enable':
> core.c:(.text+0x3750): undefined reference to `takedown_cpu_task'
> core.c:(.text+0x3750): relocation truncated to fit: R_AARCH64_ADR_PREL_PG_HI21 against
> undefined symbol `takedown_cpu_task'
> core.c:(.text+0x3754): undefined reference to `takedown_cpu_task'
> /ssd/linux-5.2.y/Makefile:1054: recipe for target 'vmlinux' failed
> make[1]: *** [vmlinux] Error 1
> make[1]: Leaving directory '/ssd/build/linux-5.2.y'
> Makefile:179: recipe for target 'sub-make' failed
> make: *** [sub-make] Error 2
>
>
> Am I right to think that this pointer, takedown_cpu_task, is more that some maximum
> distance away from object file "core.o" in the link image for the build setup?
>
>
> How are other globals avoiding this same problem, what't the best fix?


Hi Dick,

I've been building for arm64 for some time without issue. I generally
use git, but using the patch is fine too. Here are the general steps.

1. Download the base version. It's not on the kernel.org home page but
you can find it here (https://cdn.kernel.org/pub/linux/kernel/v5.x/)
 wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.2.21.tar.xz

2. Extract the kernel
 tar -xf linux-5.2.21.tar.xz

3. Change into the directory
 cd linux-5.2.21

4. Pull the patch. The main git devel page is a nice reference:
https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git
If you look for the Commit messages with an [ANNOUNCE] prefix and
click on that such as "[ANNOUNCE] v5.2.21-rt13" then this brings up a
nice write-up Sebastian does with the URL of the RT patch. So in this
case the following command works:
wget https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patch-5.2.21-rt13.patch.xz

5. Extract the patch
 unxz patch-5.2.21-rt13.patch.xz

6. Apply the patch
 patch -p1 < patch-5.2.21-rt13.patch

7. Make the default config. This is where you customize the config to
turn on things like CONFIG_PREEMPT_RT_FULL. This is done with 'make
ARCH=arm64 menuconfig' or 'make ARCH=arm64 xconfig'
 make ARCH=arm64 defconfig

8. Check that you have a proper arm64 cross compiler in your PATH, the
exact prefix of your compiler may be different, but this is a good
test to see that we have the prefix correct for the next command.
 aarch64-linux-gnu-gcc --version

9. Build the Image (actual u-boot binary for arm64 kernels). The Image
file is located in arch/arm64/boot/
  make -j4 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image

I hope this helps. Good luck!

-Paul



[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux