FORUMS

[REFERENCE] How to compile an Android kernel

13,736 posts
Thanks Meter: 50,809
 
By nathanchance, Recognized Developer / Recognized Contributor on 26th June 2017, 05:38 AM
Post Reply Email Thread
20th February 2018, 06:39 AM |#171  
mashuto's Avatar
Senior Member
Thanks Meter: 287
 
More
Quote:
Originally Posted by nathanchance

I'll just try to update my compilation guide this weekend to include information about Clang.

Guess I'm not quite getting it yet. I'll look out for the updated guide, but no rush. In the meantime I'll keep researching and trying things and see if I can't figure it out as I go. Thanks again!
20th February 2018, 07:32 AM |#172  
nathanchance's Avatar
OP Recognized Developer / Recognized Contributor
Flag Mesa, AZ
Thanks Meter: 50,809
 
More
Quote:
Originally Posted by mashuto

Guess I'm not quite getting it yet. I'll look out for the updated guide, but no rush. In the meantime I'll keep researching and trying things and see if I can't figure it out as I go. Thanks again!

I just pushed some stuff so GCC 4.9 will compile, try it out.

Sent from my Google Pixel 2 XL using XDA Labs
20th February 2018, 02:57 PM |#173  
Senior Member
Thanks Meter: 63
 
More
hi sir @nathanchance, i have some question about your guide
so, im trying to compile kernel for my device, asus ze520kl, i found source from asus site, and compile it with google toolchain 4.9 aarch64
when command
Code:
$ make msm_defconfig
i dont really know which one to use, there are many defconfig here, so i decide to use msm one (maybe default one, i think)
and got this output
Code:
***
*** Can't find default configuration "arch/x86/configs/msm_defconfig"!
***
make[1]: *** [msm_defconfig] Error 1
make: *** [msm_defconfig] Error 2
i already export arch and subarch to arm64, but i dont know why they search defconfig file to arch/x86
when make clean and make mrproper doesnt give any error
any help would be appreciate
sorry for really really bad english
20th February 2018, 03:08 PM |#174  
mashuto's Avatar
Senior Member
Thanks Meter: 287
 
More
Quote:
Originally Posted by nathanchance

I just pushed some stuff so GCC 4.9 will compile, try it out.

Sent from my Google Pixel 2 XL using XDA Labs

Cool, definitely seemed to be working better, but still getting some errors telling me some .h files are not found when they very clearly exist. I may start with a clean source and see if I have maybe screwed something up in my prior attempts. I am wondering if maybe I am not using the correct defconfig, seemed fairly obvious that it should have been flash-custom_defconfig (since I want to compile for a custom rom), but this is all new to me, so Im not sure.

I will still also probably continue the search for clang, since as I said it seems to be the way things are going and if I am serious about this, its probably a good idea to learn.
20th February 2018, 03:24 PM |#175  
nathanchance's Avatar
OP Recognized Developer / Recognized Contributor
Flag Mesa, AZ
Thanks Meter: 50,809
 
More
Quote:
Originally Posted by EggyFrima

hi sir @nathanchance, i have some question about your guide
so, im trying to compile kernel for my device, asus ze520kl, i found source from asus site, and compile it with google toolchain 4.9 aarch64
when command

i dont really know which one to use, there are many defconfig here, so i decide to use msm one (maybe default one, i think)
and got this output

i already export arch and subarch to arm64, but i dont know why they search defconfig file to arch/x86
when make clean and make mrproper doesnt give any error
any help would be appreciate
sorry for really really bad english

If you type "echo $ARCH", does it return arm64? Shell variables unset if you close your terminal window as well.

Quote:
Originally Posted by mashuto

Cool, definitely seemed to be working better, but still getting some errors telling me some .h files are not found when they very clearly exist. I may start with a clean source and see if I have maybe screwed something up in my prior attempts. I am wondering if maybe I am not using the correct defconfig, seemed fairly obvious that it should have been flash-custom_defconfig (since I want to compile for a custom rom), but this is all new to me, so Im not sure.

I will still also probably continue the search for clang, since as I said it seems to be the way things are going and if I am serious about this, its probably a good idea to learn.

Are you sure you are using an out folder (adding "O=out" to the make command)?

Sent from my Google Pixel 2 XL using XDA Labs
20th February 2018, 03:31 PM |#176  
mashuto's Avatar
Senior Member
Thanks Meter: 287
 
More
Quote:
Originally Posted by nathanchance

Are you sure you are using an out folder (adding "O=out" to the make command)?

Sent from my Google Pixel 2 XL using XDA Labs

I wasnt because the first few times I tried with the out folder I ran into some permissions errors that I wasnt getting when I wasnt using the out folder. But I will give that a try when I get a chance at some point today.
20th February 2018, 03:37 PM |#177  
Senior Member
Thanks Meter: 63
 
More
Quote:
Originally Posted by nathanchance

If you type "echo $ARCH", does it return arm64? Shell variables unset if you close your terminal window as well.



Are you sure you are using an out folder (adding "O=out" to the make command)?

Sent from my Google Pixel 2 XL using XDA Labs

thanks for your reply
yes, it does give output arm64, and i still on same session when i type export command
20th February 2018, 03:42 PM |#178  
nathanchance's Avatar
OP Recognized Developer / Recognized Contributor
Flag Mesa, AZ
Thanks Meter: 50,809
 
More
Quote:
Originally Posted by mashuto

I wasnt because the first few times I tried with the out folder I ran into some permissions errors that I wasnt getting when I wasnt using the out folder. But I will give that a try when I get a chance at some point today.

It should be fine with that out flag, if it doesn't, hastebin the error.

Quote:
Originally Posted by EggyFrima

thanks for your reply
yes, it does give output arm64, and i still on same session when i type export command

Hmm and SUBARCH as well? There's no reason it should be using x86.

Sent from my Google Pixel 2 XL using XDA Labs
20th February 2018, 04:46 PM |#179  
mashuto's Avatar
Senior Member
Thanks Meter: 287
 
More
Quote:
Originally Posted by nathanchance

It should be fine with that out flag, if it doesn't, hastebin the error.
Sent from my Google Pixel 2 XL using XDA Labs

When using the out directory, I get one error doing make clean that I cant get past, its just one line, but this is what I get... And I am pretty sure this is probably more of a linux permission/user thing than anything to do with your guide here, but Ill post it anyways. I have tried taking ownership of all files, but that shouldnt matter since they should already be under my user accounts ownership... i think. Linux is still very new to me.

scripts/basic/fixdep.c:449:1: fatal error: opening dependency file scripts/basic/fixdep.d: Permission denied

I can run things as root, but that seems to cause other issues later and saw you specifically recommend not to run as root somewhere in this thread.
The Following User Says Thank You to mashuto For This Useful Post: [ View ] Gift mashuto Ad-Free
22nd February 2018, 07:53 PM |#180  
Senior Member
Thanks Meter: 63
 
More
when i type make clean, and mrproper i got this error, is it okay ? or do i did something wrong ?
24th February 2018, 03:50 AM |#181  
milouk's Avatar
Recognized Developer
Athens
Thanks Meter: 4,721
 
Donate to Me
More
Error when "make clean"
Hey first of all thanks for this helpful guide! Im trying to compile my first kernel for Nexus 5X bullhead. When typing
Code:
make clean
i get
Code:
Makefile:796: ***multiple target patterns. Stop.
My steps were :

1)
Code:
cd Desktop/bullhead_kernel
2)
Code:
git clone https://github.com/LineageOS/android_kernel_lge_bullhead.git
(got the lineage kernel source)
3)downloaded gcc-linaro-7.2.1-2017.11-i686_aarch64-linux-gnu.tar.xz from https://releases.linaro.org/componen...h64-linux-gnu/
4) Extracted gcc-linaro-7.2.1-2017.11-i686_aarch64-linux-gnu.tar.xz in /Desktop/bullhead_kernel
5)
Code:
cd Desktop/bullhead_kernel/gcc-linaro-7.2.1-2017.11-i686_aarch64-linux-gnu
6)
Code:
export CROSS_COMPILE=$(pwd)/bin/aarch64-linux-gnu-
7)
Code:
cd Desktop/bullhead_kernel
8)
Code:
export ARCH=arm64 && SUBARCH=arm64
9)
Code:
cd Desktop/bullhead_kernel/android_kernel_lge_bullhead
10)
Code:
make clean
Code:
Makefile:796: ***multiple target patterns. Stop
Any help would be much appreciated.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes