Commit graph

4746 commits

Author SHA1 Message Date
Colin Cross
d243091381 Remove partial javastream proto support
javastream proto is rarely used and tricky to support directly
in java because it depends on an extra host tool.  It can be
supported with a genrule, so just remove the partial built-in
support.

Test: m checkbuild
Change-Id: Iffe75e7040cb889ca17fdd85ef3e8e64fc3aa9e9
2017-11-17 11:22:08 -08:00
Colin Cross
af05017b75 Add support for .srcjar files from genrules and srcs
Allow srcs to contain .srcjar files, which will be extracted just
before javac.  Also allow genrules and generated sources to directly
return .srcjar files.

Test: m checkbuild
Change-Id: Ie4cf60ecb9d2ec63a4c2275221544203b1383597
2017-11-17 11:22:08 -08:00
Colin Cross
ebe1a51c81 Fix java AIDL properties to match C/C++
The C/C++ aidl properties use:
aidl: {
    local_include_dirs: [],
    include_dirs: [],
}

But the Android.bp file was expecting:
aidl_include_dirs: [],
export_aidl_include_dirs: [],

Update java AIDL support to match the C support, which is
also what the androidmk conversion tool is creating.

Test: m checkbuild
Change-Id: I3df763d0b203b1b6556798a21b0553e7d35ad7d5
2017-11-17 11:22:08 -08:00
Colin Cross
d5dbfb78a0 Fix proto flags in java
Compute the common proto flags and pass them to the protoc invocation
when generating java files.

Test: m checkbuild
Change-Id: I0d4c23ad001d01eab03b404545383f009214106d
2017-11-17 11:22:08 -08:00
Colin Cross
f18e11074d Fix using aidl files from filegroups
Compute sources including from filegroup and genrule dependencies
before determining if any sources will cause flags to be added.

Test: gen_test.go
Change-Id: I0434b003bbda07a58bb2ce1a0a72997918c8fae2
2017-11-17 11:22:08 -08:00
Colin Cross
ad59e75a56 Add cc_library tests
Add tests around reusing objects between static and shared
libraries.

Test: library_test.go
Change-Id: I1a1a01c5ea9f9edfbcaa5b29c39c281630e04f70
2017-11-17 11:22:04 -08:00
Colin Cross
20823f95e6 Set -fomit-frame-pointer for all devices
-fomit-frame-pointer was only being set for arm and mips.  Since
we always use unwind tables and not frame pointers to unwind, and
since ART generated code does not use frame pointers, just turn
off frame pointers everywhere to gain an extra register.

Bug: 68951394
Test: m checkbuild
Change-Id: I9237d486a0c0215cdafd96d66712082df0eba785
2017-11-15 18:52:42 +00:00
Treehugger Robot
d03553cf13 Merge changes Iae2bda98,I68e64888,I75af16e7
* changes:
  Remove gcc-specific optimizations
  Move some flags to affect all devices
  Move -fvisibility-inlines-hidden to global device cppflags
2017-11-15 01:34:46 +00:00
Treehugger Robot
31c3239038 Merge "Make cc.NewLLndkStubLibrary as public" 2017-11-15 00:56:46 +00:00
Colin Cross
fff8ad2f35 Merge changes I5059a1e3,I5a06a893
* changes:
  Add --write_if_changed argument to soong_zip
  Add searchable android.DirectorySortedPaths
2017-11-14 23:44:25 +00:00
Treehugger Robot
90377447c8 Merge "Update default configuration" 2017-11-14 22:27:48 +00:00
Colin Cross
b37620f870 Remove gcc-specific optimizations
These flags were added for gcc, but are always stripped out when
compiling for clang.  Since gcc is barely used, removed them.

Bug: 68855788
Bug: 68947919
Test: m checkbuild
Change-Id: Iae2bda9808dd9499848ce145ccdf71c4c490b80e
2017-11-14 17:43:33 +00:00
Colin Cross
ea3141d06d Move some flags to affect all devices
Move -fdata-sections and -fno-short-enums to global device flags.
-fdata-sections was not previously set on x86[_64], -fno-short-enums
was not previously set on mips[64].

Bug: 68855788
Test: m checkbuild
Change-Id: I68e64888d5414fc022366eb2b6c5cd92c28a5542
2017-11-14 17:43:24 +00:00
Jiyong Park
64ca4b722a Make cc.NewLLndkStubLibrary as public
We need to extend llndk_library to automatically set symbol_file for the
llndk version of libclang_rt.asan* libraries.

Bug: 67011251
Test: build

Change-Id: Ib6964817759f9228456e4fb2a27fce3bc09423a9
2017-11-14 20:53:13 +09:00
Colin Cross
c7d1254119 Merge "Revert "Test for dangling rules in make checkbuild"" 2017-11-13 23:41:24 +00:00
Colin Cross
fb941913a3 Revert "Test for dangling rules in make checkbuild"
This reverts commit 7709a05770.

Reason for revert: Broke mac checkbuilds

Change-Id: If71ec9198ca8943d90ce9d5e3a277faf239e38a5
2017-11-13 23:38:57 +00:00
Colin Cross
26f14509d1 Move -fvisibility-inlines-hidden to global device cppflags
It was previously set on arm[64] and mips[64], this will cause it
to be set for x86[_64] too.

Bug: 68855788
Test: m checkbuild
Change-Id: I75af16e7d259963ad633cc664929144332bb435d
2017-11-13 15:18:19 -08:00
Colin Cross
f83c150269 Add --write_if_changed argument to soong_zip
Simplify making restat rules by adding a --write_if_changed argument
to soong_zip that generates the output file into memory and then
compares it to the version on disk before writing it out.

Test: builds
Change-Id: I5059a1e3a11e79b0ca538b3b829bc7479c126ce6
2017-11-13 15:11:08 -08:00
Colin Cross
5e6cfbead9 Add searchable android.DirectorySortedPaths
Add an android.DirectorySortedPaths that stores paths sorted such
that all paths in a directory including subdirectories are in a
contiguous subslice.  This will allow efficient O(log(N)) finding
of all paths in a directory using a binary search on the directory
prefix.

Test: TestDirectorySortedPaths in paths_test.go
Change-Id: I5a06a89351ae06e88c06526be54a6b79075361b7
2017-11-13 15:11:08 -08:00
Dan Willemsen
cbf9e827a7 Update default configuration
This isn't often used, but the values were quite old. So update them to
something closer to aosp_arm64 from today.

Bug: 68803744
Test: m clean; m --skip-make libc
Change-Id: Id5c60b62e7c7a91635dea9669fc604d63d299778
2017-11-13 14:46:44 -08:00
Treehugger Robot
df93350ccd Merge "Test for dangling rules in make checkbuild" 2017-11-13 22:43:30 +00:00
Colin Cross
7709a05770 Test for dangling rules in make checkbuild
Get a list of leaf nodes in the dependency graph
from ninja, and make sure none of them are in the
output directory.  This ensures that there are no
rules that depend on a file in the output directory
that doesn't have rule to generate it.  The check
will catch a common set of build failures where
a rule to generate a file is deleted (either by
deleting a module in an Android.mk file, or by
modifying the build system incorrectly).  These
failures are often not caught by a local incremental
build because the previously built files are still
present in the output directory.

Bug: 36843214
Bug: 68062417
Test: manual
Change-Id: I4933187e8b72f2ef0c32d18ffea756e2c6fa417c
2017-11-13 12:47:42 -08:00
Treehugger Robot
bafc47aea6 Merge "Change remaining properties to *string, *bool in Soong." 2017-11-13 19:04:56 +00:00
Treehugger Robot
08bb51cdc5 Merge "Send soong output to std.log in multiproduct_kati" 2017-11-12 01:33:47 +00:00
Dan Willemsen
f196396a1c Send soong output to std.log in multiproduct_kati
Instead of throwing it away (though it would also be in soong.log along
with the verbose messages).

Test: build/soong/build_test.bash with ctx.Println added
Change-Id: I64f8b11ab6752a6be8a5934fb41e30439238e331
2017-11-11 15:44:51 -08:00
Treehugger Robot
cc178b3e78 Merge "Re-enable -Wunknown-warning-option" 2017-11-11 13:29:23 +00:00
Colin Cross
62255a7687 Merge "Add presingletons" 2017-11-11 00:53:53 +00:00
Treehugger Robot
dbe8b78a5d Merge "pom2mk: Allow setting LOCAL_SDK_VERSION" 2017-11-10 23:53:44 +00:00
Colin Cross
a0059915d1 Merge "Add OncePer.Get()" 2017-11-10 22:48:38 +00:00
Dan Willemsen
15a8e793f3 pom2mk: Allow setting LOCAL_SDK_VERSION
For unbundled builds, LOCAL_SDK_VERSION needs to be set, otherwise we'll
try to use frameworks-res, which isn't available.

Bug: 64723465
Test: Use with prebuilts/sdk/update_current.py
Change-Id: If5e1233b4bcb09b3d0e2251e8dd1a8ecfc87eb19
2017-11-10 14:03:48 -08:00
Pirama Arumuga Nainar
4c0e1bf4e0 Re-enable -Wunknown-warning-option
Bug: http://b/68236396

This warning only needs to be enabled for frameworks/base/core/jni.

Test: Build the topic
Change-Id: I9f6aab2045f135d691696f9fd461c895a5aadb38
2017-11-10 13:54:47 -08:00
Nan Zhang
a5e7cb4eab Change remaining properties to *string, *bool in Soong.
Test: m -j checkbuild
Bug: b/68853585
Change-Id: I0fd10ff31e90c1941e80cfbf25e40e9988f1e202
2017-11-09 22:42:32 -08:00
Nan Zhang
ea568a4a24 Change bool, and string properties to *bool, and *string for java,
python, and genrule.

Test: m -j checkbuild
Bug: b/68853585
Change-Id: Ic9a8083818e920dc399a4b00841e2aa496f70faa
2017-11-08 21:25:40 -08:00
Jeff Gaston
99a5635733 Merge "Pass results of Finder into Blueprint" 2017-11-09 03:07:36 +00:00
Vishwath Mohan
1fa3ac552d CFI include/exclude path support (Soong)
This CL adds the ability to centrally enable or disable CFI for
components using either an environment or product config
variable. This is a better, nore manageable option that enabling CFI
across each component individually.

Bug: 67507323
Test: CFI_INCLUDE_PATHS= system/nfc m -j40
Test: CFI_EXCLUDE_PATHS = frameworks/av m -j40

Change-Id: I38b77946759121aec99ab25f31aaee2e5d993f73
2017-11-08 18:56:10 -08:00
Jeff Gaston
06643be323 Merge changes I73abb992,Ifcd42073
* changes:
  Have sbox remove its output directory before running
  Consolidate gensrcs implementation into one task each
2017-11-09 00:23:37 +00:00
Jeff Gaston
d3e141de80 Pass results of Finder into Blueprint
Bug: 64363847
Test: m -j

Change-Id: I79db8c524af6e77c35a0199ec1876e5eb94e8971
2017-11-08 23:48:44 +00:00
Jeff Gaston
94cc5662c4 Merge "Have genrule use $genDir as sbox's --output-root" 2017-11-08 23:18:25 +00:00
Jeff Gaston
8a88db5a35 Have sbox remove its output directory before running
Bug: 38205169
Test: m -j
Change-Id: I73abb9921596c96fa056449bdf8250c2928bceda
2017-11-08 13:44:03 -08:00
Dan Willemsen
02c4c1d3f0 Fix mac build
Test: `m nothing` on mac
Change-Id: Ibc377134dbcc5d40263697ef1e79fc31b16e0d1d
2017-11-08 12:50:38 -08:00
Jeff Gaston
437d23c3ad Consolidate gensrcs implementation into one task each
in preparation for each task to delete its output dir
before running.

Bug: 38205169
Test: rm out -rf && m -j

Change-Id: Ifcd42073d4fb74f532adc0c095555b4a542feb99
2017-11-08 12:38:00 -08:00
Jeff Gaston
5acec2b0e0 Have genrule use $genDir as sbox's --output-root
rather than passing buildDir .
This will make it reasonable for sbox to delete its --output-root

Bug: 38205169
Test: m -j
Change-Id: Ic3a82a8df040117870c251c068a88545143257cf
2017-11-08 12:37:14 -08:00
Dan Willemsen
b760f5d638 Merge "Setup java paths in soong_ui" 2017-11-08 20:31:30 +00:00
Treehugger Robot
c7b8e72c91 Merge "Change bool, and string properties to *bool, and *string for cc" 2017-11-08 18:41:33 +00:00
Treehugger Robot
f20e48a9e5 Merge "Add support for test_suites for python_binary_host and python_test_host" 2017-11-08 18:23:16 +00:00
Dan Willemsen
d9e8f0a95a Setup java paths in soong_ui
This way config.mk no longer needs to check which java is in PATH and
fix it. It'll be consistent for all build steps under soong_ui.

Also unify handling of ANDROID_JAVA_HOME / JAVA_HOME with
OVERRIDE_ANDROID_JAVA_HOME / EXPERIMENTAL_USE_OPENJDK9.

Test: m nothing
Test: build/soong/soong_ui.bash --make-mode nothing (w/o envsetup.sh)
Test: aosp_arm ninja files are the same before/after
Test: before/after ninja files match with OVERRIDE_ANDROID_JAVA_HOME
Test: before/after ninja files match with EXPERIMENTAL_USE_OPENJDK9
Change-Id: Icdb65093d9c346524074de239a4f895e4230a24d
2017-11-08 00:44:47 -08:00
Isaac Chen
2bce8edf34 Generic 32-bit armv8 built as generic armv7 fix
When the following lines are specified in the BoardConfig.mk

TARGET_2ND_ARCH_VARIANT := armv8-a
TARGET_2ND_CPU_VARIANT := generic

The resulted binaries won't be built using 32-bit armv8-a integer
division instructions. Instead, division routines are used because
the build system will set a compiler option "-march=armv7-a", and
hence overwiting the previous "-march=armv8-a", when
TARGET_2ND_CPU_VARIANT is set to generic (or unset).

Bug: 67446726
Test: lunch aosp_arm64; make -j; emulator # boot to home screen
      Also verify -march=armv7-a is not specified in the compiler
      command line and the resulted binary actually uses integer
      division instructions.

Change-Id: I430687aa5a658d2ec9f325a66d849b4c8898c7d5
2017-11-08 04:17:35 +00:00
Nan Zhang
0007d810e2 Change bool, and string properties to *bool, and *string for cc
there's no use case for prepending/appending to bool, and string
properties within module struct. Declearing "*bool" and "*string" almost
cover everything user need.

I did see one case that user specify relative_install_path as
path prefix in cc_defaults, and concatenate with the one in real module
to get the final relative install path in Android.bp <bionic/tests/libs>.

Test: m -j checkbuild
Bug: b/68853585
Change-Id: If3a7a2689c3fc307aae136af6bc9c57f27a1e1a0
2017-11-07 15:57:16 -08:00
Colin Cross
d293e65c82 Merge "Let LoadHooks call CreateModule" 2017-11-07 22:49:47 +00:00
Dan Willemsen
4eeb44b83f Merge "Change storage behavior of multiproduct_kati" 2017-11-07 22:25:24 +00:00