Commit graph

14532 commits

Author SHA1 Message Date
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
768e5b49e1 Merge changes I92ddea0b,Ice8474ae,If63cc6ce,I1d6f1388,Ic3da07c8, ...
* changes:
  Add Mega_device configuration option
  Toolchain modules use GCC
  Apply ToolchainLdflags to clang builds
  Add Clang Asflags for mips
  Remove libgcov for now to fix X86 devices
  Change clang extra flags behavior
2016-01-14 07:03:10 +00:00
Dan Willemsen
59b381a405 Add kati to root.bp
Change-Id: Iedf8401fb02d704916666fb15c5ae30951a57ac7
2016-01-14 00:25:38 +00: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
Dan Willemsen
fc9c28ca02 Toolchain modules use GCC
Don't use clang cflags if the device uses clang by default.

Change-Id: Ice8474ae1f5e6f37fc8b47b1679d7fbdb9249e5a
2016-01-13 14:01:42 -08:00
Dan Willemsen
6dd0660905 Apply ToolchainLdflags to clang builds
Otherwise we're missing -m32 and -m64 in x86/x86_64 builds.

Change-Id: If63cc6ce12795921584437e4cee4530c0dfb634f
2016-01-13 13:32:26 -08:00
Dan Willemsen
32968a2a48 Add Clang Asflags for mips
Like make, it needs -fPIC to be added to compile successfully.

Change-Id: I1d6f1388c42a84f331bbce1ecd669669441d986e
2016-01-13 13:32:26 -08:00
Dan Willemsen
415cb0ff14 Remove libgcov for now to fix X86 devices
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
2016-01-13 13:32:26 -08:00
Dan Willemsen
ac5e1cb30f Change clang extra flags behavior
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
2016-01-13 13:32:26 -08:00
Dan Willemsen
a60cfde3f1 Merge "Align flags with make" 2016-01-13 21:32:04 +00:00
Dan Willemsen
7a0f848998 Align flags with make
This pulls a number of cflag changes from make since our last sync.

Change-Id: I8c77fc215ed7677b8ac15a6d39143b519068dd55
2016-01-12 23:30:13 -08:00
Colin Cross
6ec1c7b964 Search all bionic subdirectories
Some bionic subdirectories need to be built with soong, and others with
makefiles.  Search the bionic subdirectories invidivdually so the
bionic/Android.bp file doesn't prevent bionic/Android.mk from being parsed.

Change-Id: I66846f0175a5a01266adc0b792820bb82ffd1e14
2016-01-11 16:29:10 -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
Colin Cross
a45ee70112 Remove art and libnativehelper from root Android.bp
art and libnativehelper have collisions between the top level directory
name and a module name, remove them from the root Android.bp file until
they have an Android.bp file to avoid a glob dependency on the directory.

Bug: 25797955
Change-Id: Ibd33df17450b171ec2390653e4cf3b00fc242831
2016-01-11 16:29:03 -08:00
Dan Willemsen
e0378dd4df Allow libnativehelper to be missing
Some branches may not include libnativehelper, or anything that depends
on jni.h

Change-Id: Id8bb9c101aecfacc5d62048818ea0c1c88b7d77c
2016-01-07 18:57:34 -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
10d52fd9eb Allow building non-gtest tests with cc_test
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
2016-01-05 15:15:11 -08:00
Dan Willemsen
496e3952ea Allow Brillo-specific version scripts
Change-Id: Ie7ba6200ed813f7eb53687c2b672e34eff16263b
2016-01-05 14:28:19 -08:00
Dan Willemsen
cf7c71bc47 Use xcrun and xcode-select to auto-configure mac sdk
This roughly matches what make uses, but with less string parsing.
Also use a full path to "ar", so that we can depend on it.

Change-Id: I5e9d4c06b6cbbbfbf93e563dace128943db21b02
2015-12-22 15:53:01 -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
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