Commit Graph

117 Commits

Author SHA1 Message Date
Dan Willemsen
110a89d2c5 Fix arm[64] cflags
Limit arm cpu variants to armv7-a-neon only, and handle a generic
armv7-a-neon cpu variant. Add arm64 cortex-a53 cpu variant. Sanity check
the arch variant against supported versions.

Change-Id: I8ecdea4cd36d9c82e1f29b158efc131f8b1cbc4d
2016-03-30 00:40:14 +00:00
Colin Cross
a23446680f Use correct install paths in generated Android.mk
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
2016-03-24 13:14:12 -07:00
Colin Cross
ca860ac720 Refactor cc
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
2016-03-21 17:31:04 -07:00
Dan Willemsen
b50381684a Split Allow_missing_dependencies from Unbundled_build
There are stripped down branches used to build other things than just
unbundled apps (like the AOSP llvm branch used to build llvm prebuilts).

Change-Id: Id772eac8c4622458591b52f9f27723fdb83f9a85
2016-03-16 12:35:33 -07:00
Dan Willemsen
0f6042e317 Fix optional intermediates path for unbundled builds
On an unbundled build, if an include directory was missing, I generated
an intermediate path with PathForModuleOut. That included another copy
of $OUT_DIR, which I didn't notice. This fails if $OUT_DIR is an
absolute directory. Just manually set up the path for now.

Change-Id: I3821d562c929e69ed2fccb7e88affed384a7789e
2016-03-11 17:04:02 -08:00
Dan Willemsen
e23dfb7fdc Support missing include dirs for unbundled branches
Treat absolute paths specified from a module (include_dirs, etc) like
actual module dependencies. If it doesn't exist, produce a ninja error
instead of refusing to create the ninja file.

Change-Id: I662b9bb2af04b2006984a07d1ccb700b63dde582
2016-03-11 15:15:50 -08:00
Dan Willemsen
6553f5ef57 Propagate missing dependencies when using whole_static_libs
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
2016-03-11 21:52:34 +00:00
Dan Willemsen
f3af6ce631 Merge "Replace Device_uses_{dl,je}malloc with Malloc_not_svelte" 2016-03-04 23:53:36 +00:00
Dan Willemsen
f778e12c57 Remove useless LOCAL_ACP_UNAVAILABLE
The make build system no longer needs LOCAL_ACP_UNAVAILABLE.

Change-Id: Ieef1415488853add9c5f5ab24219f9c6d3d13aa5
2016-03-01 23:10:25 -08:00
Dan Willemsen
97cae01e92 Replace Device_uses_{dl,je}malloc with Malloc_not_svelte
This no longer switches between dlmalloc and jemalloc, it just changes
the jemalloc cflags for non-svelte devices.

Change-Id: Ic6975de89a53a42e4735dbdcde68367ebfc42f9b
2016-03-01 17:30:59 -08:00
Dan Willemsen
0084d78abf DeviceUsesClang should default to true
It defaults to true in Make now.

Change-Id: Id216c35d4a4fc87ce19067a357561a7fc814cbbb
2016-03-01 17:22:37 -08:00
Dan Willemsen
97750520a4 Refactor Android.mk generation
Now, instead of combining multiple binaries into a single BUILD_PREBUILT
definition, use separate instances for every module variant. This fixes
HOST vs HOST_CROSS prebuilts, and should be saner overall. From make,
these should look the same, we're only just using one instance of
prebuilt_internal per BUILD_PREBUILT call instead of multiple.

With that simplification, we don't have to store as much state, and can
directly write into the buffer.

Also switch from io.WriteString to fmt.Fprintln, which will require
fewer explicit string concatentations, and we don't need to worry about
newlines.

Allow the module-provided functions to return errors.

Change-Id: If30453b21fa21387f635626618d8fabfc78e6859
2016-02-09 19:56:22 -08:00
Dan Willemsen
07cd051a17 Add windows x86_64
Bug: 26957718
Change-Id: I5cfa2f44c27eac0805d21865c45546ed3c2c2103
2016-02-08 16:07:22 -08:00
Dan Willemsen
7f730fd0ad Fix USE_SOONG[_FOR_KATI]
Make was depending on the installed path for ckati/makeparallel, since I
didn't want to hardcode intermediate paths.

For modules in USE_SOONG, we export the intermediate paths, so we don't
need to install.

Change-Id: I90bf3ad1461e239a8a40fd0c8ddbc679cf00d126
2016-01-14 11:24:27 -08:00
Dan Willemsen
468cc31584 Mips builds in the megadevice now
Some of the dsp variants still have problems, but they also don't build
under make.

Change-Id: Ied9b4a1766de5d8a61d74a0ec629e0e68bfe3bc4
2016-01-13 23:34:15 -08:00
Dan Willemsen
322acafe9e Add Mega_device configuration option
This lets you configure soong to build for every supported architecture
in one build. Installation is disabled, since it's not actually setting
up multiple devices, and would try to install multiple versions to a
single path.

Configurations that do not build are commented out.

Change-Id: I92ddea0b9ddbd53e12187c7f581b8ac5bd5fdec3
2016-01-13 14:39:11 -08:00
Colin Cross
4f6e4e6235 Export all modules
Export all modules to out/soong/Android.mk, even if they have a
corresponding Android.mk file next to the Android.bp file.

Change-Id: I14b67b1108f0c0ed8f9d9202c4af3a37f5cbf7d1
2016-01-11 16:29:06 -08:00
Dan Willemsen
6b827c21d2 Remove Dlmalloc_alignment
Bug: http://b/26403338
Change-Id: I03121ea12cee7044c863bc281260d186130eeeb1
2016-01-06 14:52:03 -08:00
Dan Willemsen
496e3952ea Allow Brillo-specific version scripts
Change-Id: Ie7ba6200ed813f7eb53687c2b672e34eff16263b
2016-01-05 14:28:19 -08:00
Dan Willemsen
80a7c2ab82 Improve path component validation
Detect when a specific path component tries to escape the path that came
before it -- so that a user-provided value can't use '..' to escape the
directories laid out by the build system.

Change-Id: I02d52d9baadb7152448a34f4e8b573fe3c032b12
2015-12-21 15:34:11 -08:00
Dan Willemsen
782a2d116a Refactor install paths
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
2015-12-21 15:03:15 -08:00
Dan Willemsen
7b310eefb7 Make global C include paths optional
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
2015-12-18 15:55:52 -08:00
Colin Cross
d779da4bb3 Sort modules before writing to Android.mk
Sort the modules before writing them to the Android.mk file to prevent
it changing every time soong rebuilts itself.  Avoids unnecessary
makefile reparses by kati when it sees Android.mk change.

Change-Id: Ie2cebb25a82d131ee5b556f8e4b3b317d080692c
2015-12-18 13:13:15 -08:00
Colin Cross
6ff5138355 Delay dependency errors to ninja time for unbundled builds
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
2015-12-18 13:13:15 -08:00
Colin Cross
66fe5656b4 Merge "Make all soong modules optional when building in make" 2015-12-18 19:03:12 +00:00
Colin Cross
09d3e97d4e Merge "Fix gofmt" 2015-12-18 19:03:03 +00:00
Colin Cross
da536e9a36 Merge "Add pointer and bool support for product variables" 2015-12-18 19:02:56 +00:00
Colin Cross
346aa13c4a Make all soong modules optional when building in make
When building inside make, Soong is not responsible for installing any
modules, so make everything optional.

Change-Id: I1190c78663c9d5ff6f511ca43b317031c619afe7
2015-12-17 17:25:10 -08:00
Colin Cross
1604ecf5cc Fix gofmt
Change-Id: Ib5e4db599a6dd858b3a1b1cdb75017b01eac4911
2015-12-17 17:25:10 -08:00
Colin Cross
dd0dbe631e Add pointer and bool support for product variables
Change-Id: I90c07878f3c23a6bab1530daa1a80ae1685ab154
2015-12-17 17:25:10 -08:00
Colin Cross
a716addb53 Support "." in cpu and arch variant names
cortex-a53.a57 is a valid cpu variant, and needs to be translated to
cortex_a53_a57 when used as a field name.  Replace
dashToUnderscoreReplacer with a replacer that also converts "." to "_".

Change-Id: I1c496249b50d8e3a8d2bd830bc890f43ad9ee29e
2015-12-16 11:07:39 -08:00
Colin Cross
1ef47568f3 Skip generating prebuilts entries for disabled modules
Change-Id: I5b17588789acb77bc5cfe2150a3a5decfd5bd01d
2015-12-15 18:08:14 -08:00
Colin Cross
7b66f15763 Add brillo cflags
Add __BRILLO__ to global cflags when building for a brillo product.

Bug: 26165350
Change-Id: I0100a8821b763075d1873d0d48fd5bd217afb580
2015-12-15 16:23:07 -08:00
Dan Willemsen
5ba07e8fe4 Only change behavior when actually embedded in make
The change to enable embedding in make change the default behavior to
produce an Android.mk file, change the ninja builddir, and add the
-soong suffix to the end of target names. These don't make sense if
we're not building inside make, so detect if we're running under make
by checking for a .soong.in_make file in the builddir.

Change-Id: I1a0f4c1becb327c769b8a130cafef11d83eb49f4
2015-12-15 13:05:56 -08:00
Dan Willemsen
34cc69e4bf Use Path instead of string for file paths
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
2015-12-09 14:29:12 -08:00
Dan Willemsen
de4c3e7b44 Handle multiple blueprint files in one dir
If there are multiple blueprint files in one directory, say an
Android.bp, and a build=['other.bp'] entry that pulls in another
blueprint file from the same directory, we'd look for a matching
Android.mk twice. This would cause duplicate glob rules.

Instead, keep track of blueprint directories rather than files.

Change-Id: I4f224e51337ffd5e5e48257ac3458c2d8b2061fa
2015-12-07 13:05:54 -08:00
Colin Cross
8316319294 Add unbundled_build product variable
Change-Id: Ieffbc13ae1273200ed4af93e97c3142b707a7cf1
2015-12-01 16:32:06 -08:00
Dan Willemsen
218f65628e Hybrid soong/mk build using prebuilts
Change-Id: I96daa69af27bd19c8bfbe327a1318f51c738fc03
2015-12-01 15:08:01 -08:00
Dan Willemsen
14e5c2af10 Blueprint API: PackageContext is now an Interface
Change-Id: I656ae3b4657514faa4a1d12d6a33e9cefd8efb84
2015-12-01 12:55:28 -08:00
Dan Willemsen
0effe06597 Change soong parameter name disabled -> enabled
This looks cleaner when we need to enable windows builds for modules.

Change-Id: I61553e2124e08002b0bd9e35c1406c905718f2f7
2015-11-30 16:51:14 -08:00
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
b9ec7b43ca Delete androidbp
androidbp is gone, replaced with combining kati ninja output for
makefiles with blueprint ninja output for soong.

Change-Id: I00b9e28877abf2ceb2223d3ccf0637bc1b7571bb
2015-11-19 15:42:32 -08:00
Dan Willemsen
c94a768a2a Use Rule-local implicit dependencies
Depends on https://github.com/google/blueprint/pull/78

This uses the new CommandDeps field to move implicit dependencies
embedded in the Command string next to the definition, instead of having
to specify them in every BuildParam struct. This should make it easier
to verify dependencies.

Change-Id: I2711b160920e22fa962a436e1f7041272166f50f
2015-11-17 19:05:07 -08:00