Commit graph

36 commits

Author SHA1 Message Date
Dan Willemsen
490fd49557 Support cross-compiling Windows binaries on Linux
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
2015-11-30 15:28:31 -08:00
Colin Cross
3b336c2056 Add mips64
Change-Id: I2b4adbc1a1568b66515243005beda2c56a4a0519
2015-11-24 21:34:54 +00:00
Colin Cross
023f1e8e8f Add mips
Change-Id: Icb05292877a60939542ce09d9774e4b9d1353502
2015-11-24 21:34:46 +00:00
Colin Cross
6371b387b7 Add x86_64
Change-Id: Ib0f31d147546ae187697867c6a0b937266bb9b39
2015-11-24 21:34:36 +00:00
Colin Cross
b0cba6a00f Add x86
Change-Id: I28e78cd49b184e0aa50c1c562b6bf719300e0832
2015-11-24 21:34:26 +00:00
Colin Cross
85a8897454 move arch variant structs down a level
Use blueprint's new anonymous embedded struct feature to move the arch
variant properties down a level, replacing arch.cortex_a9.srcs with
arch.arm.cortex_a9.srcs, while still supporting top-level properties
like arch.arm.srcs.

Change-Id: I14820b75b31586ef1e16a4812dcb1f5fdf1ff941
2015-11-23 16:33:37 -08:00
Colin Cross
c5c24ade63 Add arch features
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
2015-11-23 14:55:26 -08:00
Colin Cross
eeabb89426 make arch and variant parsing more robust
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
2015-11-23 14:18:26 -08:00
Colin Cross
5602b5888e Add armv8-a arch variant
Change-Id: I7f6655f52068568e699fcd0f2a16202254cd3786
2015-11-16 18:06:32 -08:00
Colin Cross
cfad119eaf Add support for defaults modules
Add a cc_defaults module, which will prepend any matching properties to
modules that reference it with a "defaults" property.

Change-Id: I5908dd98d204f71b29ad95a4ab85403aa1621ca2
2015-11-03 15:46:08 -08:00
Colin Cross
6362e27848 Remove EarlyMutators and DynamicDependencies
EarlyMutators are identical to BottomUpMutators, except they run before
DynamicDependencies.  DynamicDependencies can be replaced with a
BottomUpMutator.  Replace both EarlyMutators and DynamicDependencies
with BottomUpMutators, which allows setting the order between all
mutators through registration order.

Change-Id: Id1305d798d3d2da592061c89d7c10a71780b71a3
2015-11-03 15:46:08 -08:00
Colin Cross
06a931bdb6 Replace extendProperties with pathtools.AppendProperties
Blueprint has a generic AppendProperties/AppendMatchingProperties now,
use it, and replace all bool properties that might be modified by a
mutator with *bool, which provides the correct replace-if-set semantics
for append.

Also remove uses of ContainsProperty except when explicitly checking if
a property was set in a blueprints file.

Change-Id: If523af61d6b4630e79504d7fc2840f36e98571cc
2015-11-03 15:46:08 -08:00
Colin Cross
6d27f3428e Fix gofmt
Change-Id: Idce816555f5d785a401f876f899af29b98c9c064
2015-10-28 17:23:16 -07:00
Dan Willemsen
60c3dfb19a Add cortex_a53_64 and cortex_a53_a57
Renames cortex_a53 to cortex_a53_64, since we need to set options for
both. Also adds the cortex_a53_a57 big/little configuration.

Change-Id: Ia0e8104867f9aed7cbf5be8be1ead6ddc30c42c4
2015-10-16 17:29:12 -07:00
Dan Willemsen
96dc9f3f4a Fix X86_SSE3 -> X86_SSSE3
Change-Id: Ic89e13560e88920b133fab349e7c035b8fbea99f
2015-10-16 16:31:15 -07:00
Colin Cross
4225f65920 Set host and device arches from product variables
Read the host and device arches from soong.variables.

Bug: 23567214
Change-Id: Ie44db4dcf431a4c7dddcdc26117d4daa734c1f67
2015-09-17 15:21:42 -07:00
Dan Willemsen
00faa6d9da Add cortex-a53 cpu variant
Used in bionic

Change-Id: I5936f8468937fc259ef75d8278a592b8a7b07077
2015-09-15 13:25:38 -07:00
Colin Cross
7f64b6de31 Support product variables
Allow modules to vary their properties based on product variables.
For now, DEVICE_USES_LOGD, DEVICE_USES_JEMALLOC, and DEVICE_USES_DLMALLOC,
and BOARD_MALLOC_ALIGNMENT are supported.

Product variables can provide a value (only bool and int supported for
now), and if any of the product variable properties contains a "%d"
then Sprintf will be called with the property value as the format
and the product variable value convert to an int as the only argument.

For example:

    product_variables: {
        dlmalloc_alignment: {
            cflags: ["-DMALLOC_ALIGNMENT=%d"],
        },
    },

will cause -DMALLOC_ALIGNMENT=16 to be added to any top level
properties called "cflags".

Change-Id: I74882a6ab4914d3e222f8d06cfac371b7b829ae5
2015-08-24 16:20:08 -07:00
Colin Cross
01432f6b11 Add support for x86_sse3 and x86_sse4 arch sections
Change-Id: I26b642808c66bc4562b3079edbe482febf9b2435
2015-07-09 18:01:05 -07:00
Colin Cross
463a90e587 use init functions to register module types, etc.
Instead of putting all the blueprint registrations in soong_build,
put them all in init() functions.  This puts the registration next
to the implementation.

Change-Id: Ide1a749518f5e9d1367a18ab3bb1d91da3310c76
2015-07-09 17:57:18 -07:00
Dan Willemsen
ffce3fcf33 Enable host multilib
Change-Id: I17405452a141d9ce15e4093f6610e8a9eceb98a9
2015-07-08 13:02:19 -07:00
Colin Cross
ec19363c23 Add cpu-variant properties
Add nested properties that can vary based on the specific cpu type,
for example cortex-a9 or cortex-a15.

Change-Id: I107d6e30527c11d0bdd9bf17fb29513ffb07f9cc
2015-07-07 14:38:24 -07:00
Dan Willemsen
2ef08f4458 Add exclude_* and remove arch_subtract / "-file"
To align with the current make build system, add exclude_srcs and
exclude_java_resource_dirs. These replace the functionality of
arch_subtract and glob exclusions that use "-file" to exclude a file.

Change-Id: I91c23d5e3c9409f2d9f7921f950153a03a68ad61
2015-07-01 20:59:39 +00:00
Colin Cross
7d5136f033 Improve property comments for docs
Improve the comments associated with properties to work better with
Blueprint's auto-documenting feature.

Make all properties structs into named types so that thet types can be
found using reflection and cross-referenced to the source code to
auto-extract docs.

Remove the leading <property>: text from properties, the documentation
will include the lowercased name of the property.

Add filter tags to the nested arch properties.

Change-Id: I4ef5db86358886fe61456c24eb2dbe6f7b876115
2015-06-29 10:36:02 -07:00
Colin Cross
3ab7d8835f Use proptools.CloneEmptyProperties
CloneEmptyProperties is much faster than CloneProperties followed
by ZeroProperties.  Cuts >100ms off soong_build runtime, which will
become more important when we start calling soong_build a second
time to automatically generate documentation.

Change-Id: I45d948b36d9937a21b13dab068c3ce9a60b5a59b
2015-05-19 13:03:01 -07:00
Colin Cross
d3ba039f74 Separate HostOrDevice out of Arch
Take HostOrDevice out of Arch, and put it into AndroidModuleBase
instead.  Also separate out the host vs. device mutator from
ArchMutator.  This will make it possible for genrules to depend
on a host tool, regardless of which host arches it is compiled
for.

Change-Id: I22bbfd28b65c3eebdfa101a712f90dd615148dc8
2015-05-09 00:10:19 +00:00
Colin Cross
b05bff2f26 Add per target archtecture properties
At least libcutils and boringssl need to set source files that
apply to x86 or x86_64, but only on the host or on the device.
Add new properties that can contain arch variant properties:
target.android_arm
target.android_arm64
target.android_mips
target.android_mips64
target.android_x86
target.android_x86_64
target.linux_x86
target.linux_x86_64
target.darwin_x86
target.darwin_x86_64

Change-Id: I5a7076653a7367a63daa7f7e34a6a28f5cbdfbe7
2015-04-30 16:35:06 -07:00
Colin Cross
2fe6687847 Support java libraries, binaries, and prebuilts
Add support for compiling java libraries (.jar files with
or without .dex), java binaries (.jar files with a wrapper
script to run them), and java prebuilts (for the SDK .jars)

Change-Id: Id624da64c92cf20c6d9577c6bb06e5b212af0d1b
2015-04-03 16:24:44 -07:00
Colin Cross
28d76590f1 Use ContainsProperty to support default values
Instead of setting a string property to magic default value and then
checking for it later, call ctx.ContainsProperty to determine if it
was set.  Use the same method on the clang bool property, which
couldn't be set to a magic value.

blueprint's ModuleContext.ContainsProperty only works on a single
property, not on all arch variant properties -
ModuleContext.ContainsProperty("clang") will return false if
clang was not set but arch.arm.clang was set - so track which
properties were extended inside extendProperties, and override
ModuleContext.ContainsProperty in AndroidModuleContext to also
check the extended properties.

Change-Id: I03cbe71dc69344972e23d6c794da9be05e720c45
2015-03-27 17:54:50 -07:00
Colin Cross
f8209413f1 Support target: { android64: {...}} for linker
The linker and a few other executables and libraries need to know
if they are a 32-bit process running on a 64-bit host.  Add
android64 and android32 target types to set custom cflags.

Change-Id: I142378e2d5be17a87ff761257dacc1734b093048
2015-03-27 15:58:24 -07:00
Dan Albert
be96168ee3 Add support for building NDK modules.
Change-Id: I2c5ede530e40a635e26ae45950580ef450e7dcc6
2015-03-26 21:58:12 -07:00
Colin Cross
f6566ed2ba Add new AndroidModuleContext helper functions
Add Host(), Device(), and Debug() to AndroidModuleContext to allow
build rule generators to easily determine build options.

Change-Id: Ib93a462cb45189399063f641b3a8df175db0592e
2015-03-25 11:33:08 -07:00
Colin Cross
70b4059e3f Update import paths for changes to blueprint
Blueprint has been modified to include a canonical import path,
update soong to match.

Change-Id: If29d31afbf3bf2e6364961a66456fa5f8f738455
2015-03-23 12:57:34 -07:00
Colin Cross
5049f02e60 Add gensrcs module type
gensrcs allows sources to be generated by a specified command.

Change-Id: I725086fcdcd72bfe6c07fb8903e7b520678a247f
2015-03-19 10:51:41 -07:00
Colin Cross
c472d57f57 Refactor cc compiling to shared ccBase and ccDynamic initialization
Refactor common code out of NewCC* to initialize the ccBase,
ccDynamic, and ccLibrary structures.  Also adds an enum for the
default multilib values.

Change-Id: Iaeffe86bf2568b6054be4ddcee725818af45e14f
2015-03-17 15:11:14 -07:00
Colin Cross
3f40fa460d Add soong_build primary builder
Initial build logic for building android with soong.  It can build
a variety of C and C++ files for arm/arm64 and host.

Change-Id: I10eb37c2c2a50be6af1bb5fd568c0962b9476bf0
2015-03-13 20:28:16 -07:00