Manually inserting gtest include directories causes build failures in
manifests that don't have external/gtest. external/gtest already
exports its include directories so remove the manual include directory.
Change-Id: I6baac4bd3bea7dba3aa134d18b66f02a6dc9a54a
Add a new feature to cc modules that adds the cflags and libraries
necessary to implement AddressSanitizer, ThreadSanitizer, and
UndefinedBehaviorSanitizer.
Change-Id: Ibe5ffadc7ece56080a2521f2c7c00da9ef712584
cc needs to know what stl was selected, promote stl from a generic
feature implementation to a fixed type pointer.
Change-Id: I950ef947f7cd254fe3074f4ff240bb2b90b9116c
Exported cflags are needed by a variety of cc module types. Refactor
them into an object that can be composed into any cc module type.
Change-Id: I7427ba71085917ca3ec522abadfa2bf33ab43440
Add two cc properties: `generated_sources` and `generated_headers`,
instead of just adding genrule modules to `deps`. Label these with the
dep tagging mechanism, add the generated_headers paths to the include
paths, and add dependencies to generated headers for each compile.
Add dependencies so that regular sources can include generated yacc
headers, not just other generated lex/yacc files. Static/shared specific
sources still don't have dependencies to or from regular sources though.
Switch from an implicit dependency on generated files to an orderonly
dependency, since the depfile will take care of the necessary implicit
dependencies for incremental builds.
Change-Id: I436675acb1f57329d98b81c56dcb4384201a68ea
Blueprint now requres DependencyTags to be passed to AddDependency
calls. Use the tags to avoid setting member variables on modules, which
will be lost after the mutators have been called.
Change-Id: I8c1d9ed1db85a300e14394b911a516d361ba9f75
The deps property is handled by blueprint, which doesn't give the
flexibilty of handling it within soong. Switch to using objs instead.
Change-Id: Ib8273546578b31b186a3cf1566e80a5eb11943b7
The make macros add these to the linker lines even if the default
compiler flags are being skipped.
This also allows us to add another runpath for test binaries, which are
currently being installed in:
<out>/host/linux-x86/nativetest[64]/<test>/<binary>
So they need to use ../../lib[64] as a rpath.
Change-Id: Ia7e954cdf63bc627a8f71d01c953530355c248ab
Instead of having the baseCompiler adjust the Ldflags, teach
objectLinker about ToolchainLdflags. And don't assume that
ToolchainLdflags will work for Clang too, add a ToolchainClangLdflags
call.
Change-Id: I5f546e46f32edf3fcf75a44bee2c5ee103bc5de3
Disable installing static libraries for now by resetting the installer
when creating a static library variant.
Change-Id: I9360b5c57d95fc0712539accb9450b5fa402fade
Extract Soong's install path and put it in the generated Android.mk file
so that tests get installed in the correct place.
Change-Id: Id4726855c5677855406de20773a5da533bdd4cea
Refactor all of cc in order to use composition instead of inheritance.
All cc module types exported by cc are now *cc.Module objects, with
compilation, linking, and installing steps delegated to different
objects in order to form the full module type. Additional features that
modify dependencies and flags can be inserted in a features object list,
and custom module types can be created by adding a Customizer object
that can modify properties.
Change-Id: Ie1283d14920f7856f6947b0530606b2f4d58fab0
These are the environment variables used by make to override the
llvm/clang prebuilts. As far as I know, these should only be used when
building or testing a new clang drop.
I would have this handled by make and put in soong.variables, but I
expect this to be one of the first options removed from make and
exported from Soong to Kati.
Change-Id: I7a3a70ee44fc4b1e56a5e200e2a7ced77d4c5692
Currently, whole_static_libs with missing dependencies are silently
ignored. Instead, when getting the object files from the other module,
add its missing dependencies to the current module.
Change-Id: I12472dede2dfafdded56268bfd37f60063b637c4
We should be using libprofile_rt for clang builds, but we only need to
add either one if code coverage is enabled. This will be added again
when we get more complete support.
Bug: 26525326
Change-Id: Ic3da07c896be266bb35747a79c184e3d5bb8df70
Move the clang extra flags into the *ClangGlobal*flags variables,
instead of adding them to every clang-based module. This means that
they're only applied when !no_default_compiler_flags, like make.
Change-Id: I43b1378d1d932d9aecfd8724a492d0d7716f7631
That way we get the other special cc_test features (test_per_src,
multilib-both default, nativetest install path).
Restrict test_per_src to CCTest instead of allowing all CCBinaries to
use it.
Change-Id: I767540841fe5d1f9755883ee7c3d1f24004f9631
Explicitly allow installation into the data partition instead of using
"../data" for tests. At the same time, pipe through the information
required for vendor modules.
Change-Id: I6baf9d828c285e1080e43074beef8aebdbb38875
Only add them to the global C include paths if they exist. And make sure
to set up proper dependencies so that we notice when they are added or
removed.
Change-Id: Ia9df14f6ae6869927ad3d3a15fb5a8081f616a81
Unbundled builds may use a subset of the tree, which can bring in unused
modules but not their dependencies. Delay handling of dependency errors
for unbundled builds to ninja time, which will prevent errors if only
modules with satisified dependencies are built.
Change-Id: Ib93bae93fcfa0b55df500a30d8e35231ffb0987c
This centralizes verification and common operations, like converting the
path to a source file to the path for a built object.
It also embeds the configuration knowledge into the path, so that we can
remove "${SrcDir}/path" from the ninja file. When SrcDir is '.', that
leads to paths like './path' instead of just 'path' like make is doing,
causing differences in compiled binaries.
Change-Id: Ib4e8910a6e867ce1b7b420d927c04f1142a7589e
Darwin's ld does not support --version-script, but it does support
-unexported_symbols_list, -force_symbols_not_weak_list, and
-force_symbols_weak_list that all take files as arguments.
Instead of expecting these to be added to the ldflags manually, add
properties for them so that the dependencies are handled appropriately.
Also sanity checks the darwin vs non-darwin usages early, so that the
error message is faster and more obvious.
Change-Id: I42526cc4367b6ea9adfdbb58753e12824e8c321c
This defines another mutator between HostOrDevice and Arch that will
expand host modules into a module for each host type
(Darwin/Linux/Windows) that is currently being built.
Change-Id: I4c8ac6b616c229f6bd45ad8a35902652fb6a4fff
Some cflags are part of the toolchain selection and should not be
removed by no_default_compiler_flags = true, for example -m32 for x86
compiles. Removing all the cflags results in hacks such as in crt.mk
where the bare minimum cflags are reinserted.
Add new toolchain interface functions ToolchainCflags, ToolchainLdflags
and ToolchainClangCflags that will always be used.
Change-Id: I0ba02d7611e2afb9ad913319740e00c1bb2d654c
Allow architecture toolchains to register "features" supported by the
current variant, and then apply properties from the selected features.
Equivalent to the ARCH_*_HAS_* variables in the combo makefiles.
Change-Id: Ib6823be1c1a52da677d081db9f24336a072eaf39
Post-process the arch and cpu variants to treat the arch name or
"generic" as an empty variant. Filter out extra empty abis. Ignore
empty arches. Print a useful error message when appending properties
fails to find the target field, when an unknown architecture is used, or
when a toolchain has not been implemented for the selected
architecture.
Change-Id: I671d4cd04975f4f29aefc4267b3a624868ce6a75
whole_static_libs is used to reexport all the symbols from a static
library when encapsulating it into another static library or shared
library, so reexport the headers as well.
Removes the need for libcxx to explicitly export the headers from
libcxxabi.
Change-Id: I283e043f2d2e819e2fdfa43b3f0f7a4537ba79ff