Which version clang/llvm used in NDK r16b?

559 views
Skip to first unread message

yjb745...@gmail.com

unread,
Sep 26, 2018, 4:45:34 AM9/26/18
to android-llvm
I had found llvm clang git repo, but how can I find which commit/tag/branch of llvm/clang the NDK r16b ?
It seems that there are no tag or branch for different NDK.

Thanks !  : )

yjb745...@gmail.com

unread,
Sep 26, 2018, 5:00:13 AM9/26/18
to android-llvm
Or how to build clang-4053586 from git repo? (Android version: 5.0.300080).

在 2018年9月26日星期三 UTC+8下午4:45:34,yjb745...@gmail.com写道:

Stephen Hines

unread,
Sep 26, 2018, 5:10:22 AM9/26/18
to yjb745...@gmail.com, android-llvm
https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86/+/master/clang-4053586/manifest_4053586.xml should be the repo manifest that was used to construct this build (assuming that is what r16b reports itself as when calling clang --version). You can download that file and do:

repo init -m manifest_4053586.xml
repo sync

This should bring you a working tree for the toolchain build. For this particular version, you need to invoke external/clang/build.py to create the prebuilts. Newer revisions now use toolchain/llvm_android/build.py.

Thanks,
Steve

--
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 post to this group, send email to androi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

yjb745...@gmail.com

unread,
Sep 26, 2018, 5:29:28 AM9/26/18
to android-llvm
This problem has been bothering me for a long time. Thank you very much!!! Orz

在 2018年9月26日星期三 UTC+8下午5:10:22,Stephen Hines写道:

yjb745...@gmail.com

unread,
Sep 26, 2018, 11:47:49 AM9/26/18
to android-llvm
BTW,  invocation of build.py will take much space and time, and i just need the executable clang binary file, can I just put the clang project into llvm/tools, and cmake and make (just follow llvm getting start tutorial)? Is there a difference between invocation of build.py and cmake-make it myself ?

Thank you very much~


在 2018年9月26日星期三 UTC+8下午5:10:22,Stephen Hines写道:
https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86/+/master/clang-4053586/manifest_4053586.xml should be the repo manifest that was used to construct this build (assuming that is what r16b reports itself as when calling clang --version). You can download that file and do:

Pirama Arumuga Nainar

unread,
Sep 26, 2018, 11:51:55 AM9/26/18
to yjb745...@gmail.com, android-llvm
The difference would be that build.py sets up a hermetic build using glibc2.15 so the produced binary works across a variety of distros.  Other than that, just using CMake should give you a Clang for testing.

Stephen Hines

unread,
Sep 26, 2018, 11:54:59 AM9/26/18
to Pirama Arumuga Nainar, yjb745...@gmail.com, android-llvm
That version of build.py doesn't use cmake, and the tree is not set up for that. I would strongly suggest that you use build.py if you want the easiest way to guarantee a working build.

Thanks,
Steve

ridwan hafidh

unread,
Sep 26, 2018, 8:35:12 PM9/26/18
to android-llvm
Is that mean this will work on older than glibc <2.15.. like glibc 2.12 on centos 6 or possibly centos 5?

yjb745...@gmail.com

unread,
Sep 27, 2018, 2:57:10 AM9/27/18
to android-llvm
Hi Steve,

I  spent hours for building toolchains from build.py, and got the clang whose version is same as NDK r16 release. But I still have some doubts. T^T

1. The clang binary file is little smaller than NDK r16 in stage2. It seems that all binary files are smaller. Is this phenomenon normal? (And clang in stage1 seems a little bigger.)
2. What is the difference between stage1 and stage2?
3. If I want to get the same toolchain with NDK r16, need some other specify flags for build.py? I just pass "--multi-stage" to build.py.

I am very sincerely grateful for your instruction.
Thanks! : )

Jingbo

在 2018年9月26日星期三 UTC+8下午11:54:59,Stephen Hines写道:

Dan Albert

unread,
Sep 27, 2018, 3:14:48 AM9/27/18
to yjb745...@gmail.com, android-llvm
Just some thoughts be about why there could be a size difference, no evidence to support either:

1. Build is only mostly hermetic (seems most likely to me)
2. Stripped vs non-stripped binaries (this is usually a large difference)

The first stage builds clang with an older version of clang. The second stage rebuilds clang with the first stage compiler. In other words, the second stage compiler builds itself.

Stephen Hines

unread,
Sep 27, 2018, 3:29:37 AM9/27/18
to Dan Albert, yjb745...@gmail.com, android-llvm
Dan is most likely right about it being somewhat non-hermetic in the past. One other thing that might be different here - are you looking at the right binaries for your NDK vs. local build? The Linux build will build binaries for Linux and Windows (32-bit and 64-bit). You probably want to compare against the ones that end up in stage2-install or windows-i386-install (32-bit) or windows-x86-install (64-bit).

Thanks,
Steve

yjb745...@gmail.com

unread,
Jan 9, 2019, 11:28:35 PM1/9/19
to android-llvm
Hello~
It seems that Git repository had changed recently. There are no manifest files, at least I didn't find them. And I just found a similar file repo.prop (https://android.googlesource.com/platform/prebuilts/clang/host/darwin-x86/+/ndk-release-r16/clang-4053586/repo.prop)

Can I repo from the repo.prop file? How?
Thands~ :)

在 2018年9月26日星期三 UTC+8下午5:10:22,Stephen Hines写道:
https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86/+/master/clang-4053586/manifest_4053586.xml should be the repo manifest that was used to construct this build (assuming that is what r16b reports itself as when calling clang --version). You can download that file and do:

Dan Albert

unread,
Jan 10, 2019, 12:03:52 AM1/10/19
to yjb745...@gmail.com, android-llvm
Not directly, but it does have all the information needed to reconstruct the manifest file (I don't know of any tools to do this for you, but it wouldn't be hard to write).

Stephen Hines

unread,
Jan 10, 2019, 12:51:13 AM1/10/19
to Dan Albert, yjb745...@gmail.com, android-llvm
Just get it from a branch that didn't delete the path (which we have to do to save on repo size as toolchains age). The manifest for that build should always be the same. https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86/+/pie-dr1-dev/clang-4053586/ seems to have it.

Steve

yjb745...@gmail.com

unread,
Jan 10, 2019, 1:17:38 AM1/10/19
to android-llvm
Thanks, I'll try it~

在 2019年1月10日星期四 UTC+8下午1:03:52,Dan Albert写道:

yjb745...@gmail.com

unread,
Jan 10, 2019, 1:18:43 AM1/10/19
to android-llvm
Get it~
Thanks again~ :) 

在 2019年1月10日星期四 UTC+8下午1:51:13,Stephen Hines写道:
Reply all
Reply to author
Forward
0 new messages