Commit graph

208 commits

Author SHA1 Message Date
Colin Cross
6002e056fd Make Test_per_src a property on all binaries
Change-Id: I36b84807cac3d8fd7ef50c8ffb8e2a85ddc10509
2015-09-17 15:21:42 -07:00
Dan Willemsen
47cf66b8d1 Add platform_sdk_version product variable
For libc to use

Change-Id: I5048509e27ea4e4dc7773e7bd33e7f7b4deca608
2015-09-16 16:48:54 -07:00
Dan Willemsen
cde6dce026 Merge "Allow 'sanitize' to be arch-specific." 2015-09-16 23:04:19 +00:00
Dan Willemsen
0eeea1e6f2 Merge "Port LOCAL_NO_LIBGCC from make" 2015-09-16 23:04:07 +00:00
Dan Willemsen
9e0cb35c29 Allow 'sanitize' to be arch-specific.
The usecase here is system/core/liblog, which wants to turn off
sanitizer only for the target module, since the target sanitizers depend
on liblog.

Change-Id: I99141574a1c4c4847aa8a72bdcc88901fd9b01cd
2015-09-16 15:41:55 -07:00
Dan Willemsen
d67be22400 Port LOCAL_NO_LIBGCC from make
Change-Id: Iba400de882547654b2a5184d420e38113d7545ee
2015-09-16 15:20:36 -07:00
Colin Cross
a6bc19e415 Check that a product variable is set
Store product variables in pointers so that we can only apply the
properties if the product variable was set to a value.  Also only apply
bool properties if they are true, adn rearrange the code to do the
cheapest checks first.

Remove device_uses_logd, it doesn't exist any more.

Change-Id: Icf42408f57bd611746f8d985bfceb50c7f95ea59
2015-09-16 14:19:55 -07:00
Colin Cross
b43a159c13 Replace asan with sanitize
LOCAL_ADDRESS_SANITIZER has been replaced with LOCAL_SANITIZE.

Change-Id: I81fe7e0c9135cfd4a222fae4012ab5082cc58f29
2015-09-16 14:19:55 -07:00
Dan Willemsen
8a12ccd282 Merge "Freeze environment reading after saving deps" 2015-09-15 23:57:07 +00:00
Dan Willemsen
f8e98b0804 Add libbenchmark's new dependency on libbase.
See https://android-review.googlesource.com/150583

Change-Id: I6f9700b3e51a3b681d3d91b88103eed31764f61e
2015-09-15 22:21:47 +00:00
Dan Willemsen
fa3924e480 Disallow using stlport.
See https://android-review.googlesource.com/149486

Change-Id: I577a16c8c52e2c7d939c3b5026e18ad90e4b9f26
2015-09-15 22:21:16 +00:00
Dan Willemsen
3bf6b47229 Update flags to match make
Change-Id: I8ba24723d5b507fa178255c124b11356719700cb
2015-09-15 22:20:03 +00:00
Dan Willemsen
c3c7556924 Merge "Add cortex-a53 cpu variant" 2015-09-15 22:19:48 +00:00
Colin Cross
2e238cfa31 Merge "Add support for include_files" 2015-09-15 21:06:44 +00:00
Dan Willemsen
e7680babe2 Freeze environment reading after saving deps
Any reads after the deps are saved won't show up as dependencies later.
So panic if new environment variables are read after saving deps.

Change-Id: Ia51deaf750804d3b99e69c001939a104c2d8c9f2
2015-09-15 20:30:03 +00:00
Dan Willemsen
00faa6d9da Add cortex-a53 cpu variant
Used in bionic

Change-Id: I5936f8468937fc259ef75d8278a592b8a7b07077
2015-09-15 13:25:38 -07:00
Dan Willemsen
98b26c576a Use the blueprint plugin infrastructure
Instead of using this hardcoded list, use the blueprint plugin
infrastructure to find them at build time and load them.

Bug: 23567252
Change-Id: Iae87e8c9bf020f4beb42c418b9a6bf8b0fe8b601
2015-09-15 00:31:30 +00:00
Colin Cross
39d97f2a56 Add support for include_files
Support include_files and local_include_files to pass -include arguments
to gcc.

Change-Id: Ie3f03218fcbc9732741da91671b20e240f3de3a6
2015-09-14 16:09:36 -07:00
Colin Cross
485e572aeb Read product variables from soong.variables
Refactor the soong.config loading code to support reading in
product variables from soong.variables.

Change-Id: I389e6bb5c501b53167267d5f5d0d25557811cf72
2015-09-14 16:09:36 -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
8f301d583f Fix duplicated ARCH_X86_HAVE_SSE* clauses
ARCH_X86_HAVE_SSE* should not have second_arch set, they always
apply to x86 regardless of TARGET_ARCH vs. TARGET_2ND_ARCH.

Change-Id: I21fa4c88e9c966a7181f3b17c95c06080b678556
2015-08-24 16:20:08 -07:00
Colin Cross
6e18ca49f8 Fix java resource glob file list location
The source path was being appended to the module out directory
to create the file list file, which was resulting in .. in the
source path moving the file list file up the directory tree.
Use SrcDirRelPath to convert the globbed resource directories
to be relatiave to $srcDir before appending them.

Also do the same fix to generated aidl, logtags, yacc, and lex
files.

Change-Id: I2e636bd30abf03bc1d80a897951a9812cc3e09ef
2015-08-24 16:19:43 -07:00
Colin Cross
cbac5fbe78 Update build.ninja.in for blueprint go 1.5 support
Change-Id: I2f13e34e25bf708260dba7ad384c609a8ee4bd13
2015-08-24 15:41:17 -07:00
Dan Willemsen
24f2f8df87 Update to new blueprint api for bootstrap.BinDir
And regenerate build.ninja.in

Change-Id: I35e8b0362799f94b33309d3944b411de5dbcf40a
2015-08-24 15:40:44 -07:00
Colin Cross
ff93bddda3 Merge remote-tracking branch 'aosp/master-soong'
Change-Id: Ie4d13a216466b2a8c193b6df05f360b7a59830e9
2015-08-06 14:32:04 -07:00
Colin Cross
a819f08275 Fix glob filename overlap
If resources and java files were compiled from the same directory,
ctx.Glob could try to create a glob file that had the same name
as the directory containing another glob file.  Namespace each
call to ctx.Glob so they never conflict.

Change-Id: I4db73af568a2ff2e708e9db64798073b1ed2ff61
2015-07-23 17:52:17 -07:00
Dan Willemsen
f5a959c99f Fix arm cflags
-mthumb-interwork was missing from the beginning.

The Clang cflags copy was only a shallow copy, so our clang-specific
fixups were affecting the GCC cflags as well.

The cortex-a15 replacement was removed from build/core with this change:
https://android-review.googlesource.com/#/c/143851

Change-Id: Ib6300e064f6ec4f6a7174d5e2aeacad1c359f7ea
2015-07-13 13:52:30 -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
3fde0c220a Merge "Fix libgcc/libatomic link order" into master-soong 2015-07-09 02:04:16 +00:00
Dan Willemsen
eba363ed67 Use same libgcc as Make for arm
The current make system uses the arm libgcc.a, not the thumb version.

Change-Id: I38efb80b0d14bbe9c56beeb50f3817307f076d89
2015-07-08 18:11:14 -07:00
Dan Willemsen
edc385f5eb Fix libgcc/libatomic link order
This is the equivalent commit to https://android-review.googlesource.com/144749

Change-Id: I79374f33766fa307fd031ffd0cbd9e9d37848324
2015-07-08 18:10:14 -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
Colin Cross
3cc00f1fd8 Refactor standard and rewrite properties to reduce duplication
Refactor calls to standardProperties and rewriteProperties into
translateSingleProperty that can be used for normal, suffix, and
target properties.

Change-Id: I04e060588d4feeba1da7802d68622fe9b20e2c8b
2015-07-07 12:26:26 -07:00
Colin Cross
aee540a439 Add version_script property
Add version_script property to cc_library to pass a file to
the linker with --version-script.

Change-Id: Ieefb04e15c8dfa72c2eb63b4349f8860222662b2
2015-07-07 10:34:19 -07:00
Dan Willemsen
2617316f6c androidbp: Optimize cc_library builds, share static lib
If the cflags are identical, and there aren't extra sources in the
static version of a cc_library, then we can re-use the static library in
the build of the shared library.

Change-Id: I54c59aa3edcc47bc777132461b8e6a84cef0587e
2015-07-06 14:32:51 -07:00
Dan Willemsen
2701212d05 androidbp: Implement static/shared property copying
During mutation, make deep copies of the blueprint modules, then start
modifying the property lists to apply the static/shared properties.

Change-Id: Idc7063f4d1cf7d173ae10418e3437f3e2b914f59
2015-07-06 13:52:26 -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
c41f63071e Use += for both assignments to LOCAL_C_INCLUDES
include_dirs and local_include_dirs properties both translate to
LOCAL_C_INCLUDES.  Use += for both assignments so they don't
clobber eachother.

Change-Id: Ie9e5e28ecd5a7ca76ab2a981e7d50d2c9b93ad92
2015-06-30 17:51:31 -07:00
Colin Cross
b3245e9cf6 androidbp: simplify translation by evaluating all expressions in Blueprint
Translation is getting complicated because the expressions supported
by Blueprint are difficult to support in Make.  Modify androidbp
to use context aware parsing so it can evaluate all expressions at
parse time, so it only needs to deal with constant values.

Change-Id: I57047645fb48475baecd0361f78a93ec0a26011e
2015-06-30 17:51:25 -07:00
Colin Cross
70a5f07663 Ignore some module types during translation
bootstrap_go_binary and bootstrap_go_package modules are part
of Blueprint and don't need to be translated.
toolchain_library modules are used by Soong to wrap gcc-provided
libraries are don't need to be translated.

Change-Id: I1602849060b6c85a43fc1ffb8e98c752d9d1512b
2015-06-30 12:35:47 -07:00
Colin Cross
b1a66c0cf7 Allow manually specifying translations for modules
Parse the comment block above each module or assignment looking
for directives in the form:
Android.mk:<directive>
If a block delimited by start and end directives is found, use it
as the Android.mk translation instead of trying to automatically
translate.  If an ignore directive is found, ignore the module
completely.

Change-Id: I34fe392899ed27ce3f640a2a71fbbaaedea67169
2015-06-30 12:35:44 -07:00
Colin Cross
b093124675 androidbp: make error handling stricter
Instead of putting errors into the translated Android.mk file where
they are unlikely to be seen and may cause strange build behavior,
make all errors fatal.  Also buffer to a byte buffer and then write
to the output file once we are sure there are no errors.

Change-Id: I247f405dd0a7c1d14c2681f86c7ac626e035ac2c
2015-06-30 12:32:03 -07:00
Colin Cross
26478b7fc5 Remove comments from translated Android.mk files
A bad recommendation from me lead to structuring the androidbp code
in a way that can't handle comments interspersed with module
definitions.  Since the translated Android.mk files don't really
need to be human readable, just strip all the comments.

Change-Id: I23e3f1860730bcb43b5e00a305267aa426ed80aa
2015-06-29 16:39:40 -07:00
Dan Willemsen
0a544695e9 Support the 'host' conditional in androidbp
Change-Id: I01eaa1ad2e05aaf8cbf00286d7272d0f45bb18aa
2015-06-29 22:11:40 +00:00
Dan Willemsen
3a4045d3b1 androidbp: Refactor Target/Device duplication to mutation
This is just another mutation in soong, implement it as a mutation in
androidbp as well.

Change-Id: Id72cba58db8603cace9d8ae5d8fbbd08167867cd
2015-06-29 22:06:55 +00:00
Dan Willemsen
49f50454c1 Support 'cc_library' in androidbp
Change-Id: I0a0ee48aac786a422e68e14ba14fc6186296214d
2015-06-29 22:03:26 +00:00
Dan Willemsen
ead184adaf androidbp: Add module tests
Change-Id: I563c901c8c65496f4de13d4dea38d2e7ee629fff
2015-06-29 21:47:59 +00:00
Dan Willemsen
f33877b0e9 androidbp: Test valueToString
Change-Id: I358cf4bb020fc4db14792e2cdffc18bc2f89f4d4
2015-06-29 21:46:22 +00:00