Commit Graph

311 Commits

Author SHA1 Message Date
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
Dan Willemsen 122d9f3e1d Merge "Execute the blueprint wrapper" 2015-12-18 23:15:48 +00: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 a3e4c4d321 Merge "Support "." in cpu and arch variant names" 2015-12-16 19:29:40 +00: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 27f3b7dc0b Merge "androidmk: Add support for LOCAL_MODULE_HOST_OS" 2015-12-16 18:30:36 +00: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 c7e4597461 Enforce linker version-scripts are valid
See build/ commit da9c00da5f7b

Change-Id: I65878931ab61124ae75e2c738cc733adfb107afc
2015-12-11 21:21:28 +00:00
Dan Willemsen 9301d8dfa1 Execute the blueprint wrapper
See https://github.com/google/blueprint/pull/86 for the blueprint change
and description.

Bug: 25448631
Change-Id: Ibadbfc8e2cf2592dcfd137156fc3681819078328
2015-12-10 16:23:10 -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 fafa3dc7e2 Merge "Handle multiple blueprint files in one dir" 2015-12-07 22:23:47 +00:00
Dan Willemsen 231b415995 Merge "Expose real GccVersion" 2015-12-07 22:19:49 +00:00
Alex Klyubin 3595a6aea8 Merge "Do not run zipalign when building APK." 2015-12-07 22:08:14 +00:00
Dan Willemsen 34fc3b1e84 Expose real GccVersion
In order to validate that the NDK STL paths exists, we need to know
the full path, including the Gcc version during the go execution. So
instead of returning a ninja variable reference, just return the
contents of the variable.

This also fixes a few invalid uses of armGccVersion to the proper
variable.

Change-Id: I54398ba4aa4000235b7d537a2c4efe3ecbbeec8b
2015-12-07 14:02:37 -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
Dan Willemsen 93c2831af1 Add Darwin-specific linker file flags
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
2015-12-04 15:12:42 -08:00
Alex Klyubin 03257b08b1 Do not run zipalign when building APK.
This changes the build system to no longer run zipalign when signapk
is also run. Running zipalign is no longer needed because signapk
takes care of alignment.

Bug: 25794543
Change-Id: I7bb43421c993bf32f09b0acce2a652376378964f
2015-12-04 11:58:32 -08:00
Colin Cross d9344d20ff androidmk: Add support for LOCAL_MODULE_HOST_OS
Change-Id: Ic1aba6cdcd394fbe2b1819b80fb997f00d9711dc
2015-12-02 11:26:17 -08:00
Colin Cross 4bd49c2ce1 androidmk: Add support for TARGET_BUILD_APPS
Change-Id: Iade2dd9fd5b8873d723d5f6f235775f447fb1d98
2015-12-01 18:06:33 -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
Colin Cross 979422c6c2 Add -pie to device executable builds
Change-Id: I8faf5a245f61fc412ba617ac762831d9fcdb8e73
2015-12-01 14:20:24 -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 41280a4225 pass ldflags to partial ld rules
x86 crt partial ld steps need to pass -m32 through ldflags.  Use gcc to
run partial ld instead of going directly to ld.  Allows reusing
ToolchainLdflags, which have linker arguments prefixed with "-Wl,".

Change-Id: I1e01ca5831061a11c9f550ab198d8e5b8dccf8bd
2015-11-24 21:33:29 +00:00
Colin Cross c4bde76832 Add toolchain cflags that are always used
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
2015-11-24 21:33:15 +00:00
Dan Willemsen b30a8118f5 Switch to clang 3.8
Change-Id: I8997bc4d765a18c789f2926da26610178a57be74
2015-11-24 21:11:15 +00:00
Dan Willemsen 6203ac009c Actually add version-script to ldflags
Change-Id: I6c3fff2fd3b7273f4c6c1d1df92ffeb8574b5158
2015-11-24 12:58:57 -08: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 6ba99aa281 Update build.ninja.in for bootstrap changes
Change-Id: I5c2c210c884fe4d4b3b23ccba6f2239ac082cd2c
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
Colin Cross e356ecba34 Merge "Re-export exported includes from whole_static_libs" 2015-11-19 23:23:20 +00: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