You are not logged in.

#1 2017-09-03 15:30:01

LPFaile
Member
Registered: 2017-08-31
Posts: 5

Crosscompile kerel sources for arch pi 3

I try to compile the kernel sources of arch pi 3. I want to modify the kerenl sources to include a new system call. For raspbian i just find the kernel source  and use a crosscompile toolchain on my X86 with ubuntu.
For Arch pi 3 i can not find the kernel sources. I found this https://archlinuxarm.org/packages/aarch64/linux-aarch64 and  https://archlinuxarm.org/packages/aarch … 64-headers. I try to compile by using a ready toolchain for armv8 that i find here https://archlinuxarm.org/wiki/Distcc_Cross-Compiling. I just run at kernel source make ARCH=arm64 CROSS_COMPILE=/path to my crosscompile/ clean. And I achieve some errors.
Someone can guide me on this?

Offline

#2 2017-09-03 15:58:10

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,740

Re: Crosscompile kerel sources for arch pi 3

Are you trying to do a cross compile on an Arch Linux host? or are you trying to compile Archlnux ARM on Ubuntu?

The reason I ask is that Arch linux ARM is a separate distribution than is Arch Linux.  You will need to ask them https://archlinuxarm.org/
They are a active, supportive community, but they are separate from Arch Linux.

I am leaving this open for the time being in the event this is really about cross compilation on an Arch host.  Please clarify.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2017-09-04 16:29:06

LPFaile
Member
Registered: 2017-08-31
Posts: 5

Re: Crosscompile kerel sources for arch pi 3

Yes I try to crosscompile Arrchlinux ARM on arch linux host. Whatever I will post too on archlinuxarm too.

Offline

#4 2017-09-04 18:01:26

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Crosscompile kerel sources for arch pi 3

To my knowledge you cannot compile armv7h or aarch64 on x86_64 native.  You can use distcc and the correct toolchain and initiate the compile on the ARM device using the x86_64 host as a slave.  I do this all the time. 

https://archlinuxarm.org/wiki/Distcc_Cross-Compiling
https://wiki.archlinux.org/index.php/Distcc


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2017-09-04 18:05:56

LPFaile
Member
Registered: 2017-08-31
Posts: 5

Re: Crosscompile kerel sources for arch pi 3

I  have see this links, but I need to modify the kernel sources to include a new system call, at the distributed way is not exist kernel sources, no local not at the raspberry, right?

Offline

#6 2017-09-04 18:16:27

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Crosscompile kerel sources for arch pi 3

Any patches you apply should be listed in the PKGBUILD like any other.  I am not sure I understand what you're wanting to do.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#7 2017-09-04 18:36:01

LPFaile
Member
Registered: 2017-08-31
Posts: 5

Re: Crosscompile kerel sources for arch pi 3

I want to modife the kernel source to include a new system call. For this i need to have the kernel folder or l ocal or on the raspberry. You means that i must make a patch that include the modification od the kernel sources?
Can you give me any link of how can be make it this?

Offline

#8 2017-09-05 07:37:01

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: Crosscompile kerel sources for arch pi 3

LPFaile wrote:

some errors

It would be kinda helpful if we knew what exactly you did and what exactly happened. Just sayin'.

That being said, you've definitely got your CROSS_COMPILE set wrong. The x-compiler binaries need to be in $PATH and then you set CROSS_COMPILE to the prefix of their filenames. See

https://wiki.linaro.org/HowTo/BuildArm64Kernel

Offline

#9 2017-09-05 12:14:35

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Crosscompile kerel sources for arch pi 3

mich41 wrote:
LPFaile wrote:

some errors

It would be kinda helpful if we knew what exactly you did and what exactly happened. Just sayin'.

That being said, you've definitely got your CROSS_COMPILE set wrong. The x-compiler binaries need to be in $PATH and then you set CROSS_COMPILE to the prefix of their filenames. See

https://wiki.linaro.org/HowTo/BuildArm64Kernel

Our own wiki details this exact task: https://wiki.archlinux.org/index.php/Di … _Linux_ARM


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#10 2017-09-06 17:27:27

LPFaile
Member
Registered: 2017-08-31
Posts: 5

Re: Crosscompile kerel sources for arch pi 3

HI
First of all I want to thanks for the help. If I didnt include the error is because i though that the process in himsef was the error. Also If you think that is more related with ARM forum, that may it is, we can follow there
The error that i achieved is:

HOSTCC  scripts/basic/bin2c
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --silentoldconfig Kconfig
drivers/ras/Kconfig:33: can't open file "arch/x86/ras/Kconfig"
make[3]: *** [scripts/kconfig/Makefile:39: silentoldconfig] Error 1
make[2]: *** [Makefile:547: silentoldconfig] Error 2
scripts/Makefile.clean:14: arch/arm64/crypto/Makefile: No such file or directory
make[1]: *** No rule to make target 'arch/arm64/crypto/Makefile'.  Stop.
make: *** [Makefile:1307: _clean_arch/arm64/crypto] Error 2

Note that the same error i achieved if i compile the packadge from https://archlinuxarm.org/packages/aarch … 64-headers on X86 using a croos compile and also directly on Raspberry. What i think is that this packadge does not containe the kernel source, contain a patch to add to the base kernel. I think this because does not exist a folder arch/arm64/crypto/Makefile that exist at the v4.x kernel.

Offline

#11 2017-09-07 06:58:17

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: Crosscompile kerel sources for arch pi 3

Well, obviously you need complete source. I don't know what's going on with those missing files. The PKGBUILD you linked simply downloads full 4.13 source from kernel.org so maybe just redownload it from this link manually, unpack it and check if it compiles. Then apply your syscall changes and compile again.

Offline

Board footer

Powered by FluxBB