How to build Clang toolchains for Android NDK from source code

2,028 views
Skip to first unread message

Lixi

unread,
Oct 31, 2016, 10:39:46 PM10/31/16
to android-ndk
we have some source changes to LLVM/Clang need add into NDK. After download and change "external/llvm" and build NDK from source. It find out that the changes never works. The code in "external/llvm" is dead code and the binary clang/clang.exe is already in NDK source code dir after repo sync which path is below. Does somebody knows how to build Clang toolchains for Android NDK from LLVM/Clang source code? Most Thanks!

The binary clang/clang.exe is already in NDK source code dir below:
https://android.googlesource.com/platform/prebuilts/clang/host/darwin-x86
https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86
https://android.googlesource.com/platform/prebuilts/clang/host/windows-x86

The binary clang/clang.exe is just copy from NDK source code dir. Not build from source code.
android-ndk-r13\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe
android-ndk-r13\toolchains\llvm\prebuilt\linux-x86_64\bin\clang

alan

unread,
Nov 1, 2016, 12:39:27 PM11/1/16
to android-ndk

Lixi

unread,
Nov 2, 2016, 7:27:55 AM11/2/16
to android-ndk
Thanks for answer. I had read it before post this topic. It's just do the copy work, there is nothing more in it.

alan

unread,
Nov 2, 2016, 6:08:31 PM11/2/16
to android-ndk

Lixi

unread,
Nov 6, 2016, 9:07:42 AM11/6/16
to android-ndk
Thanks for answer again. I checked it, but find out it's saying how to build gcc toolchains from source use the build-gcc.sh. I'm sorry to say there is nothing about llvm toolchains which it's already prebuilt binaries placed in below:
https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86/+/refs/heads/master/clang-3362437/bin/
And there is nothing I can find about how to build it with Google searching or in it's WIKI.
Thanks.

Dan Albert

unread,
Nov 9, 2016, 5:04:37 PM11/9/16
to android-ndk
It looks like I need to delete some old docs. The doc you're looking for is https://android.googlesource.com/platform/ndk/+/master/docs/Toolchains.md

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+unsubscribe@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/2c2b8a7b-5ef8-4cee-a73b-24d6eb6004a3%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Lixi

unread,
Nov 30, 2016, 11:06:43 AM11/30/16
to android-ndk
Thank you very much! With this link and some test (most times one change need a total rebuild) I finally make it works!
The work also need this:
https://android.googlesource.com/platform/external/clang/+/dev/ToolchainPrebuilts.md
Thanks Again!

To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.

To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
Auto Generated Inline Image 1
Reply all
Reply to author
Forward
0 new messages