FORUMS
Remove All Ads from XDA

[REFERENCE] How to compile an Android kernel

13,732 posts
Thanks Meter: 50,791
 
By nathanchance, Recognized Developer / Recognized Contributor on 26th June 2017, 05:38 AM
Post Reply Email Thread
13th February 2018, 11:31 AM |#161  
Junior Member
Thanks Meter: 2
 
More
Hey guys i have a problem, even though i ran the export ARCH=arm64 && export SUBARCH=arm64 command, when i run the make defconfig command it still searches in the wrong arch folder (arch/x86/configs/ while the config i need is in arch/arm64/configs/) I am really new to this so sorry if this is something stupid, but how do i fix this?
13th February 2018, 05:22 PM |#162  
krasCGQ's Avatar
Recognized Contributor
Flag Kendari
Thanks Meter: 4,926
 
More
Quote:
Originally Posted by TheHenkGameKing

Hey guys i have a problem, even though i ran the export ARCH=arm64 && export SUBARCH=arm64 command, when i run the make defconfig command it still searches in the wrong arch folder (arch/x86/configs/ while the config i need is in arch/arm64/configs/) I am really new to this so sorry if this is something stupid, but how do i fix this?

Is
Code:
make ARCH=arm64 <device>_defconfig
work?

Sent from my Redmi Note 4 using XDA Labs
The Following User Says Thank You to krasCGQ For This Useful Post: [ View ] Gift krasCGQ Ad-Free
13th February 2018, 11:13 PM |#163  
Junior Member
Thanks Meter: 2
 
More
@krasCGQ It worked, thanks a lot![COLOR="Silver"]

---------- Post added at 10:13 PM ---------- Previous post was at 10:12 PM ----------

[/COLOR @krasCGQ It worked, thanks a lot!
19th February 2018, 09:06 AM |#164  
nikkali25's Avatar
Senior Member
philippines
Thanks Meter: 299
 
More
help scripts/Makefile.fwinst:43: target '/lib/firmware/melfas_tk/mhs2041_j5y17.fw' given more than once in the same rule
scripts/Makefile.fwinst:43: target '/lib/firmware/melfas_tk/mhs2041_j7y17.fw' given more than once in the same rule
19th February 2018, 07:40 PM |#165  
mashuto's Avatar
Senior Member
Thanks Meter: 287
 
More
@nathanchance Just first wanted to say thanks for the guides. I am just getting into android dev and your rom build guide was very helpful and I found myself successful with that.

However, I have been less successful here getting a kernel to compile, specifically your flash kernel. I have a oneplus 5t and am currently using your flash kernel there and figured it would be a great place to start learning.

Anyways, I followed this guide as closely as possible, cloned your repo for the kernel, cloned the toolchain into another separate folder, followed the export commands, and went to start building.

I think I have the first couple make commands down, though I have seen when doing make clean the following warning: "symbol value 'm' invalid for KVM, followed by two errors that seem related to silentoldconfig. I do not always seem to get that though and can run the clean and mrproper fine. I think use your flash-custom_defconfig and go to the last step. During compiling I get a number of errors about memcpy and detected write beyond size of object passed, before the whole thing seems to finally error out. Not really sure where I have gone wrong. Any help would be greatly appreciated.
19th February 2018, 08:10 PM |#166  
nathanchance's Avatar
OP Recognized Developer / Recognized Contributor
Flag Mesa, AZ
Thanks Meter: 50,791
 
More
Quote:
Originally Posted by mashuto

@nathanchance Just first wanted to say thanks for the guides. I am just getting into android dev and your rom build guide was very helpful and I found myself successful with that.

However, I have been less successful here getting a kernel to compile, specifically your flash kernel. I have a oneplus 5t and am currently using your flash kernel there and figured it would be a great place to start learning.

Anyways, I followed this guide as closely as possible, cloned your repo for the kernel, cloned the toolchain into another separate folder, followed the export commands, and went to start building.

I think I have the first couple make commands down, though I have seen when doing make clean the following warning: "symbol value 'm' invalid for KVM, followed by two errors that seem related to silentoldconfig. I do not always seem to get that though and can run the clean and mrproper fine. I think use your flash-custom_defconfig and go to the last step. During compiling I get a number of errors about memcpy and detected write beyond size of object passed, before the whole thing seems to finally error out. Not really sure where I have gone wrong. Any help would be greatly appreciated.

GCC 4.9 does not build with my kernel. I'll probably need to add an error message for this. You'll need to either use a newer version of GCC (this Linaro 7.2.1 one is what I use when testing GCC) or use Clang, which is more involved.
19th February 2018, 08:23 PM |#167  
mashuto's Avatar
Senior Member
Thanks Meter: 287
 
More
Quote:
Originally Posted by nathanchance

GCC 4.9 does not build with my kernel. I'll probably need to add an error message for this. You'll need to either use a newer version of GCC (this Linaro 7.2.1 one is what I use when testing GCC) or use Clang, which is more involved.

I kind of had a hunch that was it. I think Ill try for clang since it seems to be the way everything is moving. But my initial searching didnt quite turn up any useful results yet. I have downloaded clang binaries, but thats about as far as I got (just dont have the time right now to spend all day on this). I will continue the search when I have more time later, but if its not too much to ask do you have any resources or tutorials to point me in the right direction for that?
19th February 2018, 08:32 PM |#168  
nathanchance's Avatar
OP Recognized Developer / Recognized Contributor
Flag Mesa, AZ
Thanks Meter: 50,791
 
More
Quote:
Originally Posted by mashuto

I kind of had a hunch that was it. I think Ill try for clang since it seems to be the way everything is moving. But my initial searching didnt quite turn up any useful results yet. I have downloaded clang binaries, but thats about as far as I got (just dont have the time right now to spend all day on this). I will continue the search when I have more time later, but if its not too much to ask do you have any resources or tutorials to point me in the right direction for that?

https://github.com/nathanchance/pixe...e-kernel-image

Feel free to ask more specific questions if you have them!
20th February 2018, 03:40 AM |#169  
mashuto's Avatar
Senior Member
Thanks Meter: 287
 
More
Quote:
Originally Posted by nathanchance

https://github.com/nathanchance/pixe...e-kernel-image

Feel free to ask more specific questions if you have them!

Thanks! So if I gather correctly, its really the make commands that change, using CC=path/to/clang (which I downloaded prebuilt from http://releases.llvm.org/download.html#5.0.1 it seems to build better, but I am definitely getting a few errors thrown, most of which seem to be file not found with <angled> include use quotes instead, which obviously seems to fail and then seems to cause the whole thing to fail since not everything has compiled correctly.

So if I understand, if I sync up the pixel 2 manifest, I can use that to then build the google included clang toolchain, and then use that for the flash kernel? Would that just be adding more steps here than necessary? Is that one different than what I downloaded?
20th February 2018, 06:26 AM |#170  
nathanchance's Avatar
OP Recognized Developer / Recognized Contributor
Flag Mesa, AZ
Thanks Meter: 50,791
 
More
Quote:
Originally Posted by mashuto

Thanks! So if I gather correctly, its really the make commands that change, using CC=path/to/clang (which I downloaded prebuilt from http://releases.llvm.org/download.html#5.0.1 it seems to build better, but I am definitely getting a few errors thrown, most of which seem to be file not found with <angled> include use quotes instead, which obviously seems to fail and then seems to cause the whole thing to fail since not everything has compiled correctly.

So if I understand, if I sync up the pixel 2 manifest, I can use that to then build the google included clang toolchain, and then use that for the flash kernel? Would that just be adding more steps here than necessary? Is that one different than what I downloaded?

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

Sent from my Google Pixel 2 XL using XDA Labs
The Following User Says Thank You to nathanchance For This Useful Post: [ View ]
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!
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