Commit graph

1860 commits

Author SHA1 Message Date
Colin Cross
55708f3fb3 Support owner property
Support owner properties in Android.bp files and propagate the value
to make using LOCAL_MODULE_OWNER.

Bug: 36413696
Test: builds
Change-Id: Iac1cf7f2a14c9e3e6d85d6e09d5adb08a7078d00
2017-03-20 13:33:45 -07:00
Colin Cross
de89fb8707 Add support for binary and static library and prebuilts
Add cc_prebuilt_library_static and cc_prebuilt_binary module types.

Bug: 35576244
Test: Add cc_prebuilt_library_static and cc_prebuilt_binary modules
      and verify they are used
Change-Id: I708ec7b1ed1a0eddae083159575ae04d5ea25a37
2017-03-17 14:06:28 -07:00
Colin Cross
dfee1bcf43 Rename to cc_prebuilts_library_shared
Rename cc_prebuilts_shared_library to cc_prebuilts_library_shared
to match cc_library_shared.

Test: builds
Change-Id: I2f48263c3a0830a99ace4e2374de4a702d48c2e4
2017-03-17 14:06:28 -07:00
Colin Cross
c3e7fa65b4 Fix installing prebuilts with no source module
Prebuilts that were not overriding a source module would never
get UsePrebuilt set, which would cause SkipInstall() to be called,
and prevent the module from being exported to make.

Test: prebuilt_test.go
Change-Id: Ib09300efff26f09245331e9919ae2db82b0c3625
2017-03-17 14:06:25 -07:00
Treehugger Robot
6bdcc8ddd6 Merge "Fixed the issue of dependencyTag in prebuilt.go" 2017-03-17 18:46:51 +00:00
Colin Cross
054350e8f1 Merge "Use a minimal set of mutators, module types, and singletons for tests" 2017-03-17 05:05:03 +00:00
Colin Cross
795c377e14 Use a minimal set of mutators, module types, and singletons for tests
Calling android.NewContext() in tests results in a context that
contains all the mutators, module types, and singletons, which
causes unexpected interactions in unit tests.  Create an empty
context instead, and add in only the necessary mutators, module
types, and singletons.

Bug: 36366816
Test: soong tests
Change-Id: Ic61262c37e3436b3ad4ccaca18b737021c304be6
2017-03-16 16:50:10 -07:00
Treehugger Robot
33edec5651 Merge "Have AndroidMk skip emitting LOCAL_MODULE_TAGS="optional"" 2017-03-16 23:44:41 +00:00
Vishwath Mohan
83d9f71cc5 Allow custom ar flags to be set.
Adds the ability to set custom flags for ar in Soong, similar to how
they can currently be set for make.

Bug: 36290748
Test: sanitize.go is able to correct set custom ar flags for CFI. CFI
enabled Soong components build and boot without issue.

Change-Id: I3212793aa84ba51df910c184d8bb376b3650376e
2017-03-16 14:06:30 -07:00
Dan Willemsen
a8b5502773 Refactor compressWholeFile to take a zipEntry
Test: m -j vts; compare android-vts.zip
Test: soong_zip -C ./ -f short_test.sh -f log -o test.zip
Change-Id: I9a843c6f8436ecfacc7948915e50f25c04497057
2017-03-15 21:53:58 -07:00
Dan Willemsen
10462b3fd5 Preserve executable bit in soong_zip
Bug: 36292596
Test: m -j vts; zipinfo out/host/linux-x86/vts/android-vts.zip
Change-Id: If595641544cc387019d93b99e0a7890e0b7a9453
2017-03-15 19:13:30 -07:00
Dan Willemsen
01a405a481 Add LinuxBionic toolchain and switch
This adds a toolchain definition for LinuxBionic that only supports
Clang/64-bit. It pulls pieces from the x86_linux_host and x86_64_device
configs, and uses the android clang triple, with some manual overrides.

To enable building this, set your soong.config file to:

 {"Host_bionic": true}

Bug: 31559095
Test: out/soong/{Android,make-vars}-aosp_arm64.mk the same with or
      without host bionic turned on
Test: No change to out/soong/build.ninja before/after this change
Change-Id: Id97dda8bd9aa670c32aed31fbe6aaa8175e70b59
2017-03-15 14:18:42 -07:00
Dan Willemsen
0e2d97b4b1 Stop making the ndk headers host-specific
This breaks when I enable a second host configuration for host bionic.

Make non-arch modules !Device and !Host by adding "Generic" as the zero
value. Make the SkipDeviceInstall config only apply to Device modules.

Test: out/soong/build.ninja is identical expect for comments
Change-Id: I6e2bd3814a9968554d3901a508d822d5c79d08a0
2017-03-15 20:20:22 +00:00
Dan Willemsen
7752bca25d Enable large-address-aware for 32-bit windows
Bug: 36046324
Test: m -j winsdk-tools
Change-Id: I232d7dac9a6708542e70392801259141bec297c6
2017-03-14 13:37:26 -07:00
Jiyong Park
4c48f724e1 install *.so in different paths for their types
Shared libraries are now installed to different directories depending on
their types.

* NDK libraries: /system/lib/ndk
* VNDK libraries: /system/lib/vndk
* VNDK-ext libraries: /system/lib/vndk-ext
* Framework-only libraries: /system/lib
* Vendor-only libraries: /vendor/lib
* Same-process HALs: /vendor/lib/sameprocess

In addition, a new module type vndk_ext_library is added. It is almost
identical to cc_shared_library but it introduces another attribute
'extends'. This is use to reference the vndk library that this vndk-ext
library is extending.

For example, in order to extend a vndk library libFoo:

cc_library {
  name: "libFoo",
  srcs: [...]
}
---------------------
vndk_ext_library {
  name: "libFoo-extended",
  srcs: [...]
  extends: "libFoo"
}

Then, libFoo will be installed as /system/lib/vndk/libFoo.so and
libFoo-extended will be installed as /system/lib/vndk-ext/libFoo.so.
Note that file name of the latter is libFoo.so, not libFoo-extended.so:
file name of an extending module is automatically set to that of the
extended module.

Bug: 33681361
Test: build & run. Libraries must be in the correct directories.
Change-Id: Ia1eb3940605d582a252c78da0f3a5b36fdab062b
2017-03-14 09:13:44 +09:00
Dan Willemsen
300151ba19 Always use the standard OSX SDK tools
Instead of whatever happens to be in PATH.

Test: port install gcc5; attempt to build host binaries
Change-Id: If4af32596edd6fd3e459c3d574ab0ff495f236ff
2017-03-13 12:40:30 -07:00
Nan Zhang
2502e12ba9 Fixed the issue of dependencyTag in prebuilt.go
Directly using blueprint.BaseDependencyTag might cause issues because
if other modules also use blueprint.BaseDependencyTag, the
different type of modules will be mixed when fetched based on Tag.

Test: m -j out/soong/build.ninja
Change-Id: I290ca2eea063e5daa4f572985b105b958fa1d0fd
2017-03-09 18:50:31 -08:00
Jeff Gaston
4f2feeee50 Have AndroidMk skip emitting LOCAL_MODULE_TAGS="optional"
Also somewhat consolidate the way in which properties are converted

Bug: 34671474
Test: make blueprint_tools

Change-Id: Idf0d6d63b8539ab6e514a6043d1f88836899864b
2017-03-08 16:00:14 -08:00
Dan Willemsen
0c3919e996 Fix OUT_DIR_COMMON_BASE with soong_ui
Currently, Kati is the only one that is respecting OUT_DIR_COMMON_BASE,
causing the build to fail when ninja tries to match up the Soong and
Kati ninja files.

The soong_ui.bash script change is necessary to move the microfactory
built outputs to the correct location.

The config.go change takes care of setting OUT_DIR in the environment of
every subprocess, so that we could remove the OUT_DIR_COMMON_BASE
handling from Make once the USE_SOONG_UI=false path goes away.

Bug: 35929763
Test: m -j blueprint_tools
Test: OUT_DIR=... m -j blueprint_tools
Test: OUT_DIR_COMMON_BASE=... m -j blueprint_tools
Change-Id: I4184f2b4392d32c5bea51e51162a48df0e5c90d5
2017-03-02 19:42:21 -08:00
Treehugger Robot
88744e25d4 Merge "Add frameworks/hardware/interfaces and system/hardware/interface" 2017-03-02 18:38:38 +00:00
Hridya Valsaraju
d8860e3cb7 Add frameworks/hardware/interfaces and system/hardware/interface
Add frameworks/hardware/interfaces and system/hardware/interfaces
to Soong build target.

Bug: 35882393
Test: make

Change-Id: I63af71f23e8a61425cf673a2340111ffa6404203
2017-03-02 08:52:58 -08:00
Dan Willemsen
abc56d4fc7 Fix dist if $DIST_DIR/logs doesn't exist
Bug: 35886901
Test: rm -rf out; m -j dist
Change-Id: I1008d9eef884d60766e35a543e72df5df01d61de
2017-03-01 17:39:32 -08:00
Ryan Campbell
469a18aae2 Support path exclusion for native coverage.
Specify list of paths to exclude from coverage instrumentation.

Test: make NATIVE_COVERAGE=true COVERAGE_PATHS=hardware/interfaces
COVERAGE_EXCLUDE_PATHS=hardware/interfaces/graphics
Bug: 35769817

Change-Id: I3bf10e5e5697d140d6cff73d000768b00aa28ca4
2017-02-27 11:08:34 -08:00
Treehugger Robot
4c46af8943 Merge "Updates for the new ckati drop" 2017-02-24 23:20:23 +00:00
Josh Gao
664806a843 Merge "Add libwinpthread, link it into win32 binaries." 2017-02-24 21:02:24 +00:00
Dan Willemsen
c38d366d78 Updates for the new ckati drop
We can start removing out directories again in multiproduct_kati, since
the opendir bug has been fixed.

Add --color_warnings to the Kati command line. Since this is different
from Make, take this opportunity to reorder the command line to make
more sense. This wasn't done before because kati forces a regen whenever
the command line changes.

Test: USE_SOONG_UI=true m -j blueprint_tools
Change-Id: I5ad03359fbc16db482722946202297c1ae0f2b90
2017-02-24 10:53:23 -08:00
Josh Gao
7bd4c5c339 Add libwinpthread, link it into win32 binaries.
Bug: http://b/31665213
Test: wine adb.exe
Test: wine fastboot.exe
Change-Id: I6d6ff69f0c016e2654119a09161685841cbccc7e
2017-02-23 17:57:03 -08:00
Dan Albert
9383f82428 Merge "Add preprocessed_ndk_headers." 2017-02-23 21:06:47 +00:00
Treehugger Robot
3c776d1b74 Merge "Remove cpusets and schedboost product variables" 2017-02-23 19:16:06 +00:00
Colin Cross
d2906e5deb Remove cpusets and schedboost product variables
They are no longer needed, remove them.

Bug: 35129304
Bug: 35128496
Test: builds
Change-Id: Ib144ddc2db40bc4f38a4e06ca40eabe85814e03c
2017-02-23 09:44:22 -08:00
Dan Willemsen
fde8534680 Don't use runtime.Version() to find the current go version
That will be the go version at compile time. So read $GOROOT/VERSION, or
fall back to executing `$GOROOT/bin/go version` to find the go version
currently in GOROOT.

Test: Ensure everything rebuilds when switching between go1.8rc2 and go1.8
Change-Id: I8738a7aa249a088b1e0668af260fa3974844dab7
2017-02-22 22:03:04 -08:00
Dan Albert
269fab82eb Add preprocessed_ndk_headers.
Prototypes in the bionic headers are annotated with `__INTRODUCED_IN`
tags that are processed by bionic/tools/versioner into their usable
form (tags replaced with `#if __ANDROID_API__ >= foo` guards). We've
previously done this as a periodic manual step with the results
checked in to prebuilts/ndk, but that's been a huge hassle for me.
Make the tool a part of the build instead.

Test: make checkbuild
Bug: http://b/35673791
Change-Id: I2f5c1aeae239ac4ab6616eb5c71360e3055f86d5
2017-02-22 14:52:52 -08:00
Treehugger Robot
fd96d2421a Merge "Improve signal handling in soong_ui" 2017-02-22 20:29:53 +00:00
Dan Willemsen
9af5fb9ac8 Improve signal handling in soong_ui
Bug: 35214134
Test: ctrl-C during build
Test: add for{} to hang soong_ui in multiple places, ensure it exits
Change-Id: Ic71eedd4b1814ab2f3c441ae61a97570eda4fe16
2017-02-22 10:44:19 -08:00
Dan Willemsen
29f88279ba Filter kati output to collapse verbose messages
1. Collapses the "including .../Android.mk ..." lines like ninja does,
so that we overwrite the last line if there wasn't anything else to
print.
2. Strips ansi control codes so that log files don't include unreadable
characters.

Test: m -j
Test: m -j | tee output.log   (with colored output)
Change-Id: Ib18437f6f9d37084360097a9d586800c833072c5
2017-02-21 19:40:49 -08:00
Treehugger Robot
5e07dc57c4 Merge "increase javac_filter line length limit to 2MB" 2017-02-20 06:56:15 +00:00
Colin Cross
8b82b7ea32 increase javac_filter line length limit to 2MB
Some javac wrappers output the entire list of java files being
compiled on a single line, which can be very large, set the maximum
buffer size to 2MB.

Test: pipe the grok build output through soong_javac_wrapper
Change-Id: Ib208461dca02ced4959433b7695ec760dc134468
2017-02-19 19:56:29 -08:00
Dan Willemsen
f29bcfc24b Merge "Add device blueprint files to root build." 2017-02-18 01:19:34 +00:00
Dan Willemsen
6c1ae37599 Merge "Export cc_library_headers as BUILD_HEADER_LIBRARY" 2017-02-17 23:50:41 +00:00
Treehugger Robot
f729700729 Merge "Fix Zip64 behavior in zip2zip" 2017-02-17 22:20:25 +00:00
Dan Willemsen
a1354b325d Fix Zip64 behavior in zip2zip
This was blindly copying the zip64 extra fields from the central
directory of the original zip file to the new one. The zip64 extra
fields depend on the contents of the header it's attached toa, and in
this case we were copying the zip64 file header offset from the central
directory entry into the destination local file header, which makes no
sense, especially since the offset changed in the new file.

So strip all zip64 extra entries, and we'll create them as necessary
when writing ou the new file.

Bug: 34704111
Test: zip2zip on the original target-files -> img that was broken
Test: m -j blueprint_tools (new android_test.go)
Change-Id: Ie3c0540b13d3afcf42f3d47fff319065952b126f
2017-02-17 13:21:03 -08:00
Fabien Sanglard
fcc426d394 Merge "Add Documentation for clion project generator" 2017-02-16 22:00:48 +00:00
Dan Willemsen
d5781347e0 Export cc_library_headers as BUILD_HEADER_LIBRARY
And support the reverse translation in androidmk.

Test: Use a cc_library_headers using LOCAL_HEADER_LIBRARIES in make
Test: androidmk with LOCAL_HEADER_LIBRARIES
Test: androidmk with soong's Android-*.mk file for BUILD_HEADER_LIBRARIES
Change-Id: I17adedb62151f62e67e2168b09ad87f1d5648df6
2017-02-16 10:58:26 -08:00
Fabien Sanglard
52d7a66671 Add Documentation for clion project generator
Change-Id: If59d4b7255fcb2718b1ff4b97246b94b4c09a8c7
2017-02-16 09:57:46 -08:00
Colin Cross
449887957c Merge "Export header libraries to make as static libraries" 2017-02-16 16:05:20 +00:00
Colin Cross
4ac44809af Export header libraries to make as static libraries
Header libraries were building an empty .a file but setting
LOCAL_MODULE_CLASS := SHARED_LIBRARIES.  Make the static and shared
checks in libraryDecorator.AndroidMk explicit.

Bug: 35228396
Test: builds, examine out/soong/Android-${TARGET_PRODUCT}.mk
Change-Id: I5653ae92bb41d440d8c3ff4b6d509be188feb961
2017-02-15 23:26:15 +00:00
Treehugger Robot
367a7da041 Merge "Blacklist code for CFI." 2017-02-15 22:52:46 +00:00
Michael Wright
7cac38429b Add device blueprint files to root build.
Test: built with a blueprint file in device/google/marlin
Change-Id: Ia820e6dd3d46b8f6f718b6fddedaa3f548b371fa
2017-02-15 21:43:36 +00:00
Treehugger Robot
31160bef1e Merge "Ban --coverage now that we have native coverage" 2017-02-15 20:58:49 +00:00
Vishwath Mohan
f3918d37fb Blacklist code for CFI.
Adds the -fsanitize-blacklist option for CFI, using the built in
blacklist at external/compiler-rt/lib/cfi/cfi_blacklist.txt.

Also refactors the CFI cflags and ldflags into cc/makevars.go to
ensure they're consistent across Soong and make projects.

Bug: 30227045
Test: ENABLE_CFI=true m -j40 builds and boots.
Test: The blacklist prevents runtime errors that otherwise occur.
Change-Id: I91c5420478e7290061d89338a86abdef69c67fe2
2017-02-15 12:46:52 -08:00