Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cross Compile Kernel for ARM
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
jgreen01
n00b
n00b


Joined: 07 Sep 2021
Posts: 2

PostPosted: Tue Sep 07, 2021 12:55 am    Post subject: Cross Compile Kernel for ARM Reply with quote

I'm trying to cross compile a kernel for my ASUS C201 Chromebook with Rockchip RK3288-C and I need a little help.

Creating bootable media for depthcharge based devices
This is the Gentoo guide I've been following to create a bootable Micro SD to install Gentoo onto my chromebook. The guide is pretty good, but I ran into an error while trying to cross compile the kernel.

Full disclosure: I'm new to Gentoo, ARM, and cross compiling, but I'm trying my best to learn and do it right. Also please correct me if I'm wrong mods, I wasn't sure if this post belongs to the ARM or Kernel forum.

Here's where I'm at: I've created a crossdev repo following these directions (Custom repository for crossdev), and I created a minimal .config for my kernel. But when I run make it gives me a ton of assembler errors like
Code:
Error: selected processor does not support xyz in ARM mode


See below complete output.

Code:
gentoo# echo $ARCH                                                     
arm
gentoo# echo $CROSS_COMPILE
arm-linux-musleabihf-
gentoo# make zImage dtbs
  SYSHDR  arch/arm/include/generated/uapi/asm/unistd-common.h
  SYSHDR  arch/arm/include/generated/uapi/asm/unistd-oabi.h
  SYSHDR  arch/arm/include/generated/uapi/asm/unistd-eabi.h
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  LEX     scripts/dtc/dtc-lexer.lex.c
  YACC    scripts/dtc/dtc-parser.tab.[ch]
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTCC  scripts/dtc/yamltree.o
  HOSTLD  scripts/dtc/dtc
  HOSTCXX scripts/gcc-plugins/arm_ssp_per_task_plugin.so
  HOSTCC  scripts/selinux/genheaders/genheaders
  HOSTCC  scripts/selinux/mdp/mdp
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/recordmcount
  HOSTCC  scripts/sorttable
  HOSTCC  scripts/asn1_compiler
  HOSTCC  scripts/extract-cert
  SYSNR   arch/arm/include/generated/asm/unistd-nr.h
  GEN     arch/arm/include/generated/asm/mach-types.h
  SYSTBL  arch/arm/include/generated/calls-oabi.S
  SYSTBL  arch/arm/include/generated/calls-eabi.S
  HOSTCC  scripts/mod/mk_elfconfig
  CC      scripts/mod/empty.o
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  CC      scripts/mod/devicetable-offsets.s
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
  CC      kernel/bounds.s
  CC      arch/arm/kernel/asm-offsets.s
  CALL    scripts/checksyscalls.sh
  CALL    scripts/atomic/check-atomics.sh
  CC      init/main.o
/tmp/ccSL7Oxl.s: Assembler messages:
/tmp/ccSL7Oxl.s:2329: Error: selected processor does not support `cpsid i' in ARM mode
/tmp/ccSL7Oxl.s:2696: Error: selected processor does not support `cpsid i' in ARM mode
/tmp/ccSL7Oxl.s:2777: Error: selected processor does not support `cpsie i' in ARM mode
/tmp/ccSL7Oxl.s:2860: Error: selected processor does not support `dsb ' in ARM mode
/tmp/ccSL7Oxl.s:3110: Error: selected processor does not support `cpsie i' in ARM mode
/tmp/ccSL7Oxl.s:3256: Error: selected processor does not support `cpsid i' in ARM mode
/tmp/ccSL7Oxl.s:3266: Error: selected processor does not support `dmb ishst' in ARM mode
/tmp/ccSL7Oxl.s:3275: Error: selected processor does not support `dmb ishst' in ARM mode
/tmp/ccSL7Oxl.s:3291: Error: selected processor does not support `dmb ish' in ARM mode
/tmp/ccSL7Oxl.s:3301: Error: selected processor does not support `dsb ishst' in ARM mode
/tmp/ccSL7Oxl.s:3304: Error: selected processor does not support `sev' in ARM mode
/tmp/ccSL7Oxl.s:3319: Error: architectural extension `mp' is not allowed for the current base architecture
/tmp/ccSL7Oxl.s:3320: Error: selected processor does not support `pldw [r4]' in ARM mode
/tmp/ccSL7Oxl.s:3323: Error: selected processor does not support `pld [r4]' in ARM mode
/tmp/ccSL7Oxl.s:3329: Error: selected processor does not support `ldrex r3,[r4]' in ARM mode
/tmp/ccSL7Oxl.s:3331: Error: selected processor does not support `strex r1,r2,[r4]' in ARM mode
make[1]: *** [scripts/Makefile.build:280: init/main.o] Error 1
make: *** [Makefile:1822: init] Error 2


While searching I found a few mentions of setting -march, -mcpu, and -mfpu to different values, but everything I've tried doesn't work.

Does anyone have an idea how to get this to work? Where did I go wrong here?
Back to top
View user's profile Send private message
alamahant
Veteran
Veteran


Joined: 23 Mar 2019
Posts: 1834

PostPosted: Tue Sep 07, 2021 11:55 am    Post subject: Reply with quote

Welcome to Gentoo!

I suspect you created a repo for cross-compile but you didnt prepare the toolchain for cross-compile.
Plz see this
https://wiki.gentoo.org/wiki/Cross_build_environment
For chromebook CPU flags like march,mtune etc plz see
https://wiki.gentoo.org/wiki/Asus_Chromebook_C201
and on installation
https://wiki.gentoo.org/wiki/Asus_Chromebook_C201

I am not purporting to deter you from using a cross-build environment to compile the kernel BUT would it not be easier if lets say you first installed a Debian armhf image,boot into it and then use THAT as a basis to mount the Gentoo partitions and chroot into it?
Plz see
https://wiki.debian.org/InstallingDebianOn/Asus/C201#Installing_to_an_SD_card_using_the_ChromeOS_kernel
As i understand it this method will use the chromeOS kernel and a debian armhf debootstrap to prepare an sd card or usb which later you can boot into.
Then from an armhf environment maybe it will be easier to install an armhf Gentoo.
BUT i am not certain.
It seems though much tougher than an RPI Gentoo install.
Good Luck!
_________________
:)


Last edited by alamahant on Tue Sep 07, 2021 12:16 pm; edited 2 times in total
Back to top
View user's profile Send private message
crocket
Guru
Guru


Joined: 29 Apr 2017
Posts: 499

PostPosted: Tue Sep 07, 2021 12:04 pm    Post subject: Reply with quote

Simplicity is the highest form of sophistication. Avoid cross-compilation. Compile kernel on your asus chromebook.

I utilized cross-compilation, but the complexity wasn't worth the faster build time. The complexity was consuming my precious time.
Kernel compilation doesn't consume your time.
Back to top
View user's profile Send private message
jgreen01
n00b
n00b


Joined: 07 Sep 2021
Posts: 2

PostPosted: Thu Sep 09, 2021 4:16 am    Post subject: Reply with quote

Thanks crocket and alamahant!

Yeah the cross compile is definitely feels like a time-sink but I'll double check that cross compile guide before I give up. I do have an unstable debian system running on it now, so I could probably use it to compile a kernel or maybe even just copy its kernel outright.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum