Add proper use of LLVM_RELEASE_VERSION for locating libraries.

Bug: http://b/31532493

As I have been updating to LLVM ~4.0, there are numerous locations where
3.8 is hard-coded, and unable to be overridden. This change adds a new
function for getting the ClangShortVersion(), which can look at
environment variables that override this value (particularly useful for
two-stage compilation, where version numbers change between builds).

Change-Id: Iaec19908cf47b3b2317844d6e1329f7bcd81f022
This commit is contained in:
Stephen Hines
2016-11-18 17:12:38 -08:00
parent ebedf678de
commit e55a4cc594

View File

@@ -136,7 +136,13 @@ func init() {
pctx.StaticVariable("ClangPath", "${ClangBase}/${HostPrebuiltTag}/${ClangVersion}")
pctx.StaticVariable("ClangBin", "${ClangPath}/bin")
pctx.StaticVariable("ClangAsanLibDir", "${ClangPath}/lib64/clang/3.8/lib/linux")
pctx.VariableFunc("ClangShortVersion", func(config interface{}) (string, error) {
if override := config.(android.Config).Getenv("LLVM_RELEASE_VERSION"); override != "" {
return override, nil
}
return "3.8", nil
})
pctx.StaticVariable("ClangAsanLibDir", "${ClangPath}/lib64/clang/${ClangShortVersion}/lib/linux")
pctx.VariableFunc("CcWrapper", func(config interface{}) (string, error) {
if override := config.(android.Config).Getenv("CC_WRAPPER"); override != "" {