compile llvm-project for android on linux arm

375 views
Skip to first unread message

Jakob

unread,
Dec 28, 2021, 6:03:15 PM12/28/21
to android-llvm
Hello!

I've been working with the 'llvm-toolchain' of the android project to compile my custom llvm-project to generate a cross-compiler for android. I noticed that the 'build.py' script is using the prebuilt toolchain to compile 'llvm-project'. Since there is no prebuilt toolchain for linux arm I wasn't able to accomplish the same on the arm64 machine.

Now my question is: Isn't it possible to use an other compiler to compile 'llvm-project' for android? What's the reason that I need to use the prebuilt version here and how are those prebuilt ones created? Would I be able to generate my own toolchain with linux-arm?

Thanks already.
Best,
Jakob

Stephen Hines

unread,
Jan 20, 2022, 6:29:08 PM1/20/22
to Jakob, android-llvm
Hi Jakob,

I just found this email (apparently misclassified as spam by GMail).

On Tue, Dec 28, 2021 at 3:03 PM Jakob <jakobk...@gmail.com> wrote:
Hello!

I've been working with the 'llvm-toolchain' of the android project to compile my custom llvm-project to generate a cross-compiler for android. I noticed that the 'build.py' script is using the prebuilt toolchain to compile 'llvm-project'. Since there is no prebuilt toolchain for linux arm I wasn't able to accomplish the same on the arm64 machine.

We currently only use x86-64 Linux machines and Apple (both x86-64 and AArch64) machines to compile our toolchains.
 

Now my question is: Isn't it possible to use an other compiler to compile 'llvm-project' for android? What's the reason that I need to use the prebuilt version here and how are those prebuilt ones created? Would I be able to generate my own toolchain with linux-arm?

Yes, you can use a different starting toolchain, although you'd have to modify the scripts to support that. We have to start with known toolchains so that we can create hermetic, reproducible builds of the toolchain that can be validated. If you're just using this for your own experiments, you should be able to configure it with a different starting toolchain, and also produce a toolchain that is hosted on that platform as well.

We've had some folks interested in host tools for AArch64 Linux machines, but it isn't prioritized very highly for us. If you want to contribute in this area, we'd be glad to look at patches and help with suggestions.

Thanks,
Steve
 

Thanks already.
Best,
Jakob

--
You received this message because you are subscribed to the Google Groups "android-llvm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-llvm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-llvm/8ced1934-43ca-41a7-b503-167fb595182dn%40googlegroups.com.

Jakob

unread,
Jan 29, 2022, 7:29:03 AM1/29/22
to Stephen Hines, android-llvm
Hi Stephen,

Thanks for your response.

On 21. Jan 2022, at 00:28, Stephen Hines <srh...@google.com> wrote:

Hi Jakob,

I just found this email (apparently misclassified as spam by GMail).

On Tue, Dec 28, 2021 at 3:03 PM Jakob <jakobk...@gmail.com> wrote:
Hello!

I've been working with the 'llvm-toolchain' of the android project to compile my custom llvm-project to generate a cross-compiler for android. I noticed that the 'build.py' script is using the prebuilt toolchain to compile 'llvm-project'. Since there is no prebuilt toolchain for linux arm I wasn't able to accomplish the same on the arm64 machine.

We currently only use x86-64 Linux machines and Apple (both x86-64 and AArch64) machines to compile our toolchains.

I just realized that AArch64 works on darwin. It's a bit unintentional that the prebuilts are universal  (x86-64 and AArch64) while being located within the 'darwin-x86' directory. Since I'm running this on the Apple M1 I'll start from there.

 

Now my question is: Isn't it possible to use an other compiler to compile 'llvm-project' for android? What's the reason that I need to use the prebuilt version here and how are those prebuilt ones created? Would I be able to generate my own toolchain with linux-arm?

Yes, you can use a different starting toolchain, although you'd have to modify the scripts to support that. We have to start with known toolchains so that we can create hermetic, reproducible builds of the toolchain that can be validated. If you're just using this for your own experiments, you should be able to configure it with a different starting toolchain, and also produce a toolchain that is hosted on that platform as well.

We've had some folks interested in host tools for AArch64 Linux machines, but it isn't prioritized very highly for us. If you want to contribute in this area, we'd be glad to look at patches and help with suggestions.

I might still look into creating host tools for AArch64 Linux if I have some time to unify the workflow.

Very much appreciate your extensive response.

Best,
Jakob
Reply all
Reply to author
Forward
0 new messages