Steps to replace the clang prebuilt with self-built one

121 views
Skip to first unread message

Lu Pang

unread,
Jan 19, 2025, 8:48:04 PMJan 19
to android-llvm
Hi,

We are trying to build our own Clang/LLVM toolchain for Android platform. We followed this document, trying to reproduce the build of clang-r522817.

We compiled the LLVM on a x86 Linux host and used the following command to start the build:
python toolchain/llvm_android/build.py --pgo --bolt --lto --mlgo --no-build windows --skip-tests

The output is a directory named "clang-dev" which seems like clang prebuilts in AOSP but lacks a lib64 subdiretory. The later part of the document that explains how to update the compiler is outdated and points to an internal link of Google. Therefore, it would be great if we can get some guidance on how to use our own toolchain to build the android system.

Thanks!

Yi Kong

unread,
Jan 21, 2025, 1:20:10 AMJan 21
to Lu Pang, android-llvm
Hi Lu,

Can you try `python toolchain/llvm_android/build.py --pgo --bolt --lto --mlgo --no-build windows --create-tar --build-name clang-r522817`, and use the produced tarball? FYI, you can go to https://ci.android.com to find the original build, and look up the original build command from the build logs.

-Yi

--
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 visit https://groups.google.com/d/msgid/android-llvm/1b890b4b-86ca-4afc-babf-13beb1efbd0en%40googlegroups.com.

Lu Pang

unread,
Jan 24, 2025, 2:09:31 PMJan 24
to android-llvm
Hi Yi,

Thanks for reply! I found the build commands in BUILD_INFO right under the clang directory. BTW, to use the a clang prebuilt, we just need to change "ClangDefaultVersion" field in build/soong/cc/config/global.go right?

Best,
Lu

Pirama Arumuga Nainar

unread,
Jan 24, 2025, 2:22:48 PMJan 24
to Lu Pang, android-llvm
On Fri, Jan 24, 2025 at 11:09 AM 'Lu Pang' via android-llvm <androi...@googlegroups.com> wrote:
Hi Yi,

Thanks for reply! I found the build commands in BUILD_INFO right under the clang directory. BTW, to use the a clang prebuilt, we just need to change "ClangDefaultVersion" field in build/soong/cc/config/global.go right?

You also need to change ClangDefaultShortVersion in global.go to match the LLVM major revision of the new clang prebuilt.


Best,
Lu

在2025年1月21日星期二 UTC+8 14:20:10<Yi Kong> 写道:
Hi Lu,

Can you try `python toolchain/llvm_android/build.py --pgo --bolt --lto --mlgo --no-build windows --create-tar --build-name clang-r522817`, and use the produced tarball? FYI, you can go to https://ci.android.com to find the original build, and look up the original build command from the build logs.

-Yi

On Mon, 20 Jan 2025 at 09:48, 'Lu Pang' via android-llvm <androi...@googlegroups.com> wrote:
Hi,

We are trying to build our own Clang/LLVM toolchain for Android platform. We followed this document, trying to reproduce the build of clang-r522817.

We compiled the LLVM on a x86 Linux host and used the following command to start the build:
python toolchain/llvm_android/build.py --pgo --bolt --lto --mlgo --no-build windows --skip-tests

The output is a directory named "clang-dev" which seems like clang prebuilts in AOSP but lacks a lib64 subdiretory. The later part of the document that explains how to update the compiler is outdated and points to an internal link of Google. Therefore, it would be great if we can get some guidance on how to use our own toolchain to build the android system.

Thanks!

--
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 visit https://groups.google.com/d/msgid/android-llvm/1b890b4b-86ca-4afc-babf-13beb1efbd0en%40googlegroups.com.

--
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.
Reply all
Reply to author
Forward
0 new messages