Building toolchains for compiling Android kernel on aarch64 host

142 views
Skip to first unread message

Amani Gall

unread,
Nov 7, 2024, 7:11:16 PMNov 7
to Android Building

I am using a free ARM (aarch64) compute instance from Oracle Cloud as a development machine. I would like to compile an Kernel for my Android phone (arm64), but I'm having trouble with selecting the appropriate toolchain.

Google provides Android-specific toolchains, aarch64-linux-android- and arm-linux-androideabi-, but these are primarily distributed for x86_64 hosts.

After a couple of hours of searching the internet, I found mentions that I could use the host (or native) compiler for my system, which happens to be aarch64-linux-gnu- and arm-linux-gnueabi-. However, these toolchains target a generic Linux environment, and I'm not sure if they would be suitable for compiling a kernel for an Android device. I'm particularly concerned about potential optimization issues or compatibility problems that might arise from using these toolchains.

Questions:
  1. Is it appropriate to use the generic Linux toolchains (*-linux-gnu-) for compiling an Android kernel?
  2. What's the recommended approach to build the Android-specific toolchains (*-linux-android-) on an aarch64 host?

I am having difficulty finding answers on my own and would appreciate detailed explanations.

Environment:
  • Host: aarch64 (ARM64)
  • Host OS: Ubuntu 22.04.4 LTS
  • Target: Android phone (arm64)

enh

unread,
Nov 8, 2024, 8:49:04 AMNov 8
to android-...@googlegroups.com
On Thu, Nov 7, 2024 at 7:11 PM Amani Gall <amanir...@gmail.com> wrote:

I am using a free ARM (aarch64) compute instance from Oracle Cloud as a development machine. I would like to compile an Kernel for my Android phone (arm64), but I'm having trouble with selecting the appropriate toolchain.

Google provides Android-specific toolchains, aarch64-linux-android- and arm-linux-androideabi-, but these are primarily distributed for x86_64 hosts.

After a couple of hours of searching the internet, I found mentions that I could use the host (or native) compiler for my system, which happens to be aarch64-linux-gnu- and arm-linux-gnueabi-. However, these toolchains target a generic Linux environment, and I'm not sure if they would be suitable for compiling a kernel for an Android device. I'm particularly concerned about potential optimization issues or compatibility problems that might arise from using these toolchains.

Questions:
  1. Is it appropriate to use the generic Linux toolchains (*-linux-gnu-) for compiling an Android kernel?
  2. What's the recommended approach to build the Android-specific toolchains (*-linux-android-) on an aarch64 host?
"don't" ... that isn't something we do, so it isn't supported --- we currently only use x86-64, and don't provide or support any toolchains that run on arm64 hosts.
 

I am having difficulty finding answers on my own and would appreciate detailed explanations.

Environment:
  • Host: aarch64 (ARM64)
  • Host OS: Ubuntu 22.04.4 LTS
  • Target: Android phone (arm64)

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/android-building/9448ef45-e086-403e-993a-992244823c72n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages