• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2016 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package config
16
17import (
18	"runtime"
19	"slices"
20	"strings"
21
22	"android/soong/android"
23	"android/soong/remoteexec"
24)
25
26var (
27	pctx = android.NewPackageContext("android/soong/cc/config")
28
29	// Flags used by lots of devices.  Putting them in package static variables
30	// will save bytes in build.ninja so they aren't repeated for every file
31	commonGlobalCflags = []string{
32		// Enable some optimization by default.
33		"-O2",
34
35		// Warnings enabled by default. Reference:
36		// https://clang.llvm.org/docs/DiagnosticsReference.html
37		"-Wall",
38		"-Wextra",
39		"-Winit-self",
40		"-Wpointer-arith",
41		"-Wunguarded-availability",
42
43		// Warnings treated as errors by default.
44		// See also noOverrideGlobalCflags for errors that cannot be disabled
45		// from Android.bp files.
46
47		// Using __DATE__/__TIME__ causes build nondeterminism.
48		"-Werror=date-time",
49		// Detects forgotten */& that usually cause a crash
50		"-Werror=int-conversion",
51		// Detects unterminated alignment modification pragmas, which often lead
52		// to ABI mismatch between modules and hard-to-debug crashes.
53		"-Werror=pragma-pack",
54		// Same as above, but detects alignment pragmas around a header
55		// inclusion.
56		"-Werror=pragma-pack-suspicious-include",
57		// Detects dividing an array size by itself, which is a common typo that
58		// leads to bugs.
59		"-Werror=sizeof-array-div",
60		// Detects a typo that cuts off a prefix from a string literal.
61		"-Werror=string-plus-int",
62		// Detects for loops that will never execute more than once (for example
63		// due to unconditional break), but have a non-empty loop increment
64		// clause. Often a mistake/bug.
65		"-Werror=unreachable-code-loop-increment",
66
67		// Warnings that should not be errors even for modules with -Werror.
68
69		// Making deprecated usages an error causes extreme pain when trying to
70		// deprecate anything.
71		"-Wno-error=deprecated-declarations",
72
73		// Warnings disabled by default.
74
75		// We should encourage use of C23 features even when the whole project
76		// isn't C23-ready.
77		"-Wno-c23-extensions",
78		// Designated initializer syntax is recommended by the Google C++ style
79		// and is OK to use even if not formally supported by the chosen C++
80		// version.
81		"-Wno-c99-designator",
82		// Detects uses of a GNU C extension equivalent to a limited form of
83		// constexpr. Enabling this would require replacing many constants with
84		// macros, which is not a good trade-off.
85		"-Wno-gnu-folding-constant",
86		// AIDL generated code redeclares pure virtual methods in each
87		// subsequent version of an interface, so this warning is currently
88		// infeasible to enable.
89		"-Wno-inconsistent-missing-override",
90		// Detects designated initializers that are in a different order than
91		// the fields in the initialized type, which causes the side effects
92		// of initializers to occur out of order with the source code.
93		// In practice, this warning has extremely poor signal to noise ratio,
94		// because it is triggered even for initializers with no side effects.
95		// Individual modules can still opt into it via cflags.
96		"-Wno-error=reorder-init-list",
97		"-Wno-reorder-init-list",
98		// Incompatible with the Google C++ style guidance to use 'int' for loop
99		// indices; poor signal to noise ratio.
100		"-Wno-sign-compare",
101		// Poor signal to noise ratio.
102		"-Wno-unused",
103
104		// Global preprocessor constants.
105
106		"-DANDROID",
107		"-DNDEBUG",
108		"-UDEBUG",
109		"-D__compiler_offsetof=__builtin_offsetof",
110		// Allows the bionic versioning.h to indirectly determine whether the
111		// option -Wunguarded-availability is on or not.
112		"-D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__",
113
114		// -f and -g options.
115
116		// Emit address-significance table which allows linker to perform safe ICF. Clang does
117		// not emit the table by default on Android since NDK still uses GNU binutils.
118		"-faddrsig",
119
120		// Emit debugging data in a modern format (DWARF v5).
121		"-fdebug-default-version=5",
122
123		// Force clang to always output color diagnostics. Ninja will strip the ANSI
124		// color codes if it is not running in a terminal.
125		"-fcolor-diagnostics",
126
127		// Turn off FMA which got enabled by default in clang-r445002 (http://b/218805949)
128		"-ffp-contract=off",
129
130		// Google C++ style does not allow exceptions, turn them off by default.
131		"-fno-exceptions",
132
133		// Disable optimizations based on strict aliasing by default.
134		// The performance benefit of enabling them currently does not outweigh
135		// the risk of hard-to-reproduce bugs.
136		"-fno-strict-aliasing",
137
138		// Disable line wrapping for error messages - it interferes with
139		// displaying logs in web browsers.
140		"-fmessage-length=0",
141
142		// Using simple template names reduces the size of debug builds.
143		"-gsimple-template-names",
144
145		// Use zstd to compress debug data.
146		"-gz=zstd",
147
148		// Make paths in deps files relative.
149		"-no-canonical-prefixes",
150	}
151
152	commonGlobalConlyflags = []string{}
153
154	commonGlobalAsflags = []string{
155		"-D__ASSEMBLY__",
156		// TODO(b/235105792): override global -fdebug-default-version=5, it is causing $TMPDIR to
157		// end up in the dwarf data for crtend_so.S.
158		"-fdebug-default-version=4",
159	}
160
161	// Compilation flags for device code; not applied to host code.
162	deviceGlobalCflags = []string{
163		"-ffunction-sections",
164		"-fdata-sections",
165		"-fno-short-enums",
166		"-funwind-tables",
167		"-fstack-protector-strong",
168		"-Wa,--noexecstack",
169		"-D_FORTIFY_SOURCE=2",
170
171		"-Wstrict-aliasing=2",
172
173		"-Werror=return-type",
174		"-Werror=non-virtual-dtor",
175		"-Werror=address",
176		"-Werror=sequence-point",
177		"-Werror=format-security",
178	}
179
180	commonGlobalLldflags = []string{
181		"-fuse-ld=lld",
182		"-Wl,--icf=safe",
183		"-Wl,--no-demangle",
184	}
185
186	deviceGlobalCppflags = []string{
187		"-fvisibility-inlines-hidden",
188	}
189
190	// Linking flags for device code; not applied to host binaries.
191	deviceGlobalLdflags = []string{
192		"-Wl,-z,noexecstack",
193		"-Wl,-z,relro",
194		"-Wl,-z,now",
195		"-Wl,--build-id=md5",
196		"-Wl,--fatal-warnings",
197		"-Wl,--no-undefined-version",
198		// TODO: Eventually we should link against a libunwind.a with hidden symbols, and then these
199		// --exclude-libs arguments can be removed.
200		"-Wl,--exclude-libs,libgcc.a",
201		"-Wl,--exclude-libs,libgcc_stripped.a",
202		"-Wl,--exclude-libs,libunwind_llvm.a",
203		"-Wl,--exclude-libs,libunwind.a",
204	}
205
206	deviceGlobalLldflags = append(append(deviceGlobalLdflags, commonGlobalLldflags...),
207		"-Wl,--compress-debug-sections=zstd",
208	)
209
210	hostGlobalCflags = []string{}
211
212	hostGlobalCppflags = []string{}
213
214	hostGlobalLdflags = []string{}
215
216	hostGlobalLldflags = commonGlobalLldflags
217
218	commonGlobalCppflags = []string{
219		// -Wimplicit-fallthrough is not enabled by -Wall.
220		"-Wimplicit-fallthrough",
221
222		// Enable clang's thread-safety annotations in libcxx.
223		"-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS",
224
225		// libc++'s math.h has an #include_next outside of system_headers.
226		"-Wno-gnu-include-next",
227	}
228
229	// These flags are appended after the module's cflags, so they cannot be
230	// overridden from Android.bp files.
231	//
232	// NOTE: if you need to disable a warning to unblock a compiler upgrade
233	// and it is only triggered by third party code, add it to
234	// extraExternalCflags (if possible) or noOverrideExternalGlobalCflags
235	// (if the former doesn't work). If the new warning also occurs in first
236	// party code, try adding it to commonGlobalCflags first. Adding it here
237	// should be the last resort, because it prevents all code in Android from
238	// opting into the warning.
239	noOverrideGlobalCflags = []string{
240		"-Werror=bool-operation",
241		"-Werror=dangling",
242		"-Werror=format-insufficient-args",
243		"-Werror=implicit-int-float-conversion",
244		"-Werror=int-in-bool-context",
245		"-Werror=int-to-pointer-cast",
246		"-Werror=pointer-to-int-cast",
247		"-Werror=xor-used-as-pow",
248		"-Wimplicit-int-float-conversion",
249		// http://b/161386391 for -Wno-void-pointer-to-enum-cast
250		"-Wno-void-pointer-to-enum-cast",
251		// http://b/161386391 for -Wno-void-pointer-to-int-cast
252		"-Wno-void-pointer-to-int-cast",
253		// http://b/161386391 for -Wno-pointer-to-int-cast
254		"-Wno-pointer-to-int-cast",
255		"-Werror=fortify-source",
256		// http://b/315246135 temporarily disabled
257		"-Wno-unused-variable",
258		// Disabled because it produces many false positives. http://b/323050926
259		"-Wno-missing-field-initializers",
260		// http://b/323050889
261		"-Wno-packed-non-pod",
262
263		"-Werror=address-of-temporary",
264		"-Werror=incompatible-function-pointer-types",
265		"-Werror=null-dereference",
266		"-Werror=return-type",
267
268		// http://b/72331526 Disable -Wtautological-* until the instances detected by these
269		// new warnings are fixed.
270		"-Wno-tautological-constant-compare",
271		"-Wno-tautological-type-limit-compare",
272		// http://b/145211066
273		"-Wno-implicit-int-float-conversion",
274		// New warnings to be fixed after clang-r377782.
275		"-Wno-tautological-overlap-compare", // http://b/148815696
276		// New warnings to be fixed after clang-r383902.
277		"-Wno-deprecated-copy",                      // http://b/153746672
278		"-Wno-range-loop-construct",                 // http://b/153747076
279		"-Wno-zero-as-null-pointer-constant",        // http://b/68236239
280		"-Wno-deprecated-anon-enum-enum-conversion", // http://b/153746485
281		"-Wno-deprecated-enum-enum-conversion",
282		"-Wno-error=pessimizing-move", // http://b/154270751
283		// New warnings to be fixed after clang-r399163
284		"-Wno-non-c-typedef-for-linkage", // http://b/161304145
285		// New warnings to be fixed after clang-r428724
286		"-Wno-align-mismatch", // http://b/193679946
287		// New warnings to be fixed after clang-r433403
288		"-Wno-error=unused-but-set-variable",  // http://b/197240255
289		"-Wno-error=unused-but-set-parameter", // http://b/197240255
290		// New warnings to be fixed after clang-r468909
291		"-Wno-error=deprecated-builtins", // http://b/241601211
292		"-Wno-error=deprecated",          // in external/googletest/googletest
293		// New warnings to be fixed after clang-r522817
294		"-Wno-error=invalid-offsetof",
295
296		// Allow using VLA CXX extension.
297		"-Wno-vla-cxx-extension",
298		"-Wno-cast-function-type-mismatch",
299	}
300
301	noOverride64GlobalCflags = []string{}
302
303	// Extra cflags applied to third-party code (anything for which
304	// IsThirdPartyPath() in build/soong/android/paths.go returns true;
305	// includes external/, most of vendor/ and most of hardware/)
306	extraExternalCflags = []string{
307		"-Wno-enum-compare",
308		"-Wno-enum-compare-switch",
309
310		// http://b/72331524 Allow null pointer arithmetic until the instances detected by
311		// this new warning are fixed.
312		"-Wno-null-pointer-arithmetic",
313
314		// Bug: http://b/29823425 Disable -Wnull-dereference until the
315		// new instances detected by this warning are fixed.
316		"-Wno-null-dereference",
317
318		// http://b/145211477
319		"-Wno-pointer-compare",
320		"-Wno-final-dtor-non-final-class",
321
322		// http://b/165945989
323		"-Wno-psabi",
324
325		// http://b/199369603
326		"-Wno-null-pointer-subtraction",
327
328		// http://b/175068488
329		"-Wno-string-concatenation",
330
331		// http://b/239661264
332		"-Wno-deprecated-non-prototype",
333
334		"-Wno-unused",
335		"-Wno-deprecated",
336
337		// http://b/315250603 temporarily disabled
338		"-Wno-error=format",
339	}
340
341	// Similar to noOverrideGlobalCflags, but applies only to third-party code
342	// (see extraExternalCflags).
343	// This section can unblock compiler upgrades when a third party module that
344	// enables -Werror and some group of warnings explicitly triggers newly
345	// added warnings.
346	noOverrideExternalGlobalCflags = []string{
347		// http://b/151457797
348		"-fcommon",
349		// http://b/191699019
350		"-Wno-format-insufficient-args",
351		// http://b/296321508
352		// Introduced in response to a critical security vulnerability and
353		// should be a hard error - it requires only whitespace changes to fix.
354		"-Wno-misleading-indentation",
355		// Triggered by old LLVM code in external/llvm. Likely not worth
356		// enabling since it's a cosmetic issue.
357		"-Wno-bitwise-instead-of-logical",
358
359		"-Wno-unused",
360		"-Wno-unused-parameter",
361		"-Wno-unused-but-set-parameter",
362		"-Wno-unqualified-std-cast-call",
363		"-Wno-array-parameter",
364		"-Wno-gnu-offsetof-extensions",
365		"-Wno-pessimizing-move",
366	}
367
368	llvmNextExtraCommonGlobalCflags = []string{
369		// Do not report warnings when testing with the top of trunk LLVM.
370		"-Wno-everything",
371	}
372
373	// Flags that must not appear in any command line.
374	IllegalFlags = []string{
375		"-w",
376		"-pedantic",
377		"-pedantic-errors",
378		"-Werror=pedantic",
379	}
380
381	CStdVersion               = "gnu23"
382	CppStdVersion             = "gnu++20"
383	ExperimentalCStdVersion   = "gnu2x"
384	ExperimentalCppStdVersion = "gnu++2b"
385
386	// prebuilts/clang default settings.
387	ClangDefaultBase         = "prebuilts/clang/host"
388	ClangDefaultVersion      = "clang-r547379"
389	ClangDefaultShortVersion = "20"
390
391	// Directories with warnings from Android.bp files.
392	WarningAllowedProjects = []string{
393		"device/",
394		"vendor/",
395	}
396
397	VersionScriptFlagPrefix = "-Wl,--version-script,"
398
399	VisibilityHiddenFlag  = "-fvisibility=hidden"
400	VisibilityDefaultFlag = "-fvisibility=default"
401)
402
403func init() {
404	if runtime.GOOS == "linux" {
405		commonGlobalCflags = append(commonGlobalCflags, "-fdebug-prefix-map=/proc/self/cwd=")
406	}
407
408	pctx.StaticVariable("CommonGlobalConlyflags", strings.Join(commonGlobalConlyflags, " "))
409	pctx.StaticVariable("CommonGlobalAsflags", strings.Join(commonGlobalAsflags, " "))
410	pctx.StaticVariable("DeviceGlobalCppflags", strings.Join(deviceGlobalCppflags, " "))
411	pctx.StaticVariable("DeviceGlobalLdflags", strings.Join(deviceGlobalLdflags, " "))
412	pctx.StaticVariable("DeviceGlobalLldflags", strings.Join(deviceGlobalLldflags, " "))
413	pctx.StaticVariable("HostGlobalCppflags", strings.Join(hostGlobalCppflags, " "))
414	pctx.StaticVariable("HostGlobalLdflags", strings.Join(hostGlobalLdflags, " "))
415	pctx.StaticVariable("HostGlobalLldflags", strings.Join(hostGlobalLldflags, " "))
416
417	pctx.VariableFunc("CommonGlobalCflags", func(ctx android.PackageVarContext) string {
418		flags := slices.Clone(commonGlobalCflags)
419
420		// http://b/131390872
421		// Automatically initialize any uninitialized stack variables.
422		// Prefer zero-init if multiple options are set.
423		if ctx.Config().IsEnvTrue("AUTO_ZERO_INITIALIZE") {
424			flags = append(flags, "-ftrivial-auto-var-init=zero")
425		} else if ctx.Config().IsEnvTrue("AUTO_PATTERN_INITIALIZE") {
426			flags = append(flags, "-ftrivial-auto-var-init=pattern")
427		} else if ctx.Config().IsEnvTrue("AUTO_UNINITIALIZE") {
428			flags = append(flags, "-ftrivial-auto-var-init=uninitialized")
429		} else {
430			// Default to zero initialization.
431			flags = append(flags, "-ftrivial-auto-var-init=zero")
432		}
433
434		// Workaround for ccache with clang.
435		// See http://petereisentraut.blogspot.com/2011/05/ccache-and-clang.html.
436		if ctx.Config().IsEnvTrue("USE_CCACHE") {
437			flags = append(flags, "-Wno-unused-command-line-argument")
438		}
439
440		if ctx.Config().IsEnvTrue("ALLOW_UNKNOWN_WARNING_OPTION") {
441			flags = append(flags, "-Wno-error=unknown-warning-option")
442		}
443
444		switch ctx.Config().Getenv("CLANG_DEFAULT_DEBUG_LEVEL") {
445		case "debug_level_0":
446			flags = append(flags, "-g0")
447		case "debug_level_1":
448			flags = append(flags, "-g1")
449		case "debug_level_2":
450			flags = append(flags, "-g2")
451		case "debug_level_3":
452			flags = append(flags, "-g3")
453		case "debug_level_g":
454			flags = append(flags, "-g")
455		default:
456			flags = append(flags, "-g")
457		}
458
459		return strings.Join(flags, " ")
460	})
461
462	pctx.VariableFunc("DeviceGlobalCflags", func(ctx android.PackageVarContext) string {
463		return strings.Join(deviceGlobalCflags, " ")
464	})
465
466	pctx.VariableFunc("NoOverrideGlobalCflags", func(ctx android.PackageVarContext) string {
467		flags := noOverrideGlobalCflags
468		if ctx.Config().IsEnvTrue("LLVM_NEXT") {
469			flags = append(noOverrideGlobalCflags, llvmNextExtraCommonGlobalCflags...)
470			IllegalFlags = []string{} // Don't fail build while testing a new compiler.
471		}
472		return strings.Join(flags, " ")
473	})
474
475	pctx.StaticVariable("NoOverride64GlobalCflags", strings.Join(noOverride64GlobalCflags, " "))
476	pctx.StaticVariable("HostGlobalCflags", strings.Join(hostGlobalCflags, " "))
477	pctx.StaticVariable("NoOverrideExternalGlobalCflags", strings.Join(noOverrideExternalGlobalCflags, " "))
478	pctx.StaticVariable("CommonGlobalCppflags", strings.Join(commonGlobalCppflags, " "))
479	pctx.StaticVariable("ExternalCflags", strings.Join(extraExternalCflags, " "))
480
481	// Everything in these lists is a crime against abstraction and dependency tracking.
482	// Do not add anything to this list.
483	commonGlobalIncludes := []string{
484		"system/core/include",
485		"system/logging/liblog/include",
486		"system/media/audio/include",
487		"hardware/libhardware/include",
488		"hardware/libhardware_legacy/include",
489		"hardware/ril/include",
490		"frameworks/native/include",
491		"frameworks/native/opengl/include",
492		"frameworks/av/include",
493	}
494	pctx.PrefixedExistentPathsForSourcesVariable("CommonGlobalIncludes", "-I", commonGlobalIncludes)
495
496	pctx.StaticVariable("CLANG_DEFAULT_VERSION", ClangDefaultVersion)
497	pctx.StaticVariable("CLANG_DEFAULT_SHORT_VERSION", ClangDefaultShortVersion)
498
499	pctx.StaticVariableWithEnvOverride("ClangBase", "LLVM_PREBUILTS_BASE", ClangDefaultBase)
500	pctx.StaticVariableWithEnvOverride("ClangVersion", "LLVM_PREBUILTS_VERSION", ClangDefaultVersion)
501	pctx.StaticVariable("ClangPath", "${ClangBase}/${HostPrebuiltTag}/${ClangVersion}")
502	pctx.StaticVariable("ClangBin", "${ClangPath}/bin")
503
504	pctx.StaticVariableWithEnvOverride("ClangShortVersion", "LLVM_RELEASE_VERSION", ClangDefaultShortVersion)
505	pctx.StaticVariable("ClangAsanLibDir", "${ClangBase}/linux-x86/${ClangVersion}/lib/clang/${ClangShortVersion}/lib/linux")
506
507	pctx.StaticVariable("WarningAllowedProjects", strings.Join(WarningAllowedProjects, " "))
508
509	// These are tied to the version of LLVM directly in external/llvm, so they might trail the host prebuilts
510	// being used for the rest of the build process.
511	pctx.SourcePathVariable("RSClangBase", "prebuilts/clang/host")
512	pctx.SourcePathVariable("RSClangVersion", "clang-3289846")
513	pctx.SourcePathVariable("RSReleaseVersion", "3.8")
514	pctx.StaticVariable("RSLLVMPrebuiltsPath", "${RSClangBase}/${HostPrebuiltTag}/${RSClangVersion}/bin")
515	pctx.StaticVariable("RSIncludePath", "${RSLLVMPrebuiltsPath}/../lib64/clang/${RSReleaseVersion}/include")
516
517	rsGlobalIncludes := []string{
518		"external/clang/lib/Headers",
519		"frameworks/rs/script_api/include",
520	}
521	pctx.PrefixedExistentPathsForSourcesVariable("RsGlobalIncludes", "-I", rsGlobalIncludes)
522
523	pctx.VariableFunc("CcWrapper", func(ctx android.PackageVarContext) string {
524		if override := ctx.Config().Getenv("CC_WRAPPER"); override != "" {
525			return override + " "
526		}
527		return ""
528	})
529
530	pctx.StaticVariableWithEnvOverride("RECXXPool", "RBE_CXX_POOL", remoteexec.DefaultPool)
531	pctx.StaticVariableWithEnvOverride("RECXXLinksPool", "RBE_CXX_LINKS_POOL", remoteexec.DefaultPool)
532	pctx.StaticVariableWithEnvOverride("REClangTidyPool", "RBE_CLANG_TIDY_POOL", remoteexec.DefaultPool)
533	pctx.StaticVariableWithEnvOverride("RECXXLinksExecStrategy", "RBE_CXX_LINKS_EXEC_STRATEGY", remoteexec.LocalExecStrategy)
534	pctx.StaticVariableWithEnvOverride("REClangTidyExecStrategy", "RBE_CLANG_TIDY_EXEC_STRATEGY", remoteexec.LocalExecStrategy)
535	pctx.StaticVariableWithEnvOverride("REAbiDumperExecStrategy", "RBE_ABI_DUMPER_EXEC_STRATEGY", remoteexec.LocalExecStrategy)
536	pctx.StaticVariableWithEnvOverride("REAbiLinkerExecStrategy", "RBE_ABI_LINKER_EXEC_STRATEGY", remoteexec.LocalExecStrategy)
537}
538
539var HostPrebuiltTag = pctx.VariableConfigMethod("HostPrebuiltTag", android.Config.PrebuiltOS)
540
541func ClangPath(ctx android.PathContext, file string) android.SourcePath {
542	type clangToolKey string
543
544	key := android.NewCustomOnceKey(clangToolKey(file))
545
546	return ctx.Config().OnceSourcePath(key, func() android.SourcePath {
547		return clangPath(ctx).Join(ctx, file)
548	})
549}
550
551var clangPathKey = android.NewOnceKey("clangPath")
552
553func clangPath(ctx android.PathContext) android.SourcePath {
554	return ctx.Config().OnceSourcePath(clangPathKey, func() android.SourcePath {
555		clangBase := ClangDefaultBase
556		if override := ctx.Config().Getenv("LLVM_PREBUILTS_BASE"); override != "" {
557			clangBase = override
558		}
559		clangVersion := ClangDefaultVersion
560		if override := ctx.Config().Getenv("LLVM_PREBUILTS_VERSION"); override != "" {
561			clangVersion = override
562		}
563		return android.PathForSource(ctx, clangBase, ctx.Config().PrebuiltOS(), clangVersion)
564	})
565}
566