Commit graph

4760 commits

Author SHA1 Message Date
Colin Cross
face4e4563 Import AAPT-related product variables from make
Test: m checkbuild
Change-Id: I22113c17d240ff26652cea7df801a183343faebd
2017-10-30 17:36:41 -07:00
Stephen Hines
bc7ab77eb9 Switch to clang-4393122.
am: 0ed7d24f7a

Change-Id: I9792f96d02044430629ea08e23b5d1cc3e5938f8
2017-10-30 19:46:15 +00:00
Stephen Hines
0ed7d24f7a Switch to clang-4393122.
Bug: http://b/62580008
Bug: http://b/68236239
Bug: http://b/68236396
Test: https://goto.google.com/clang-4393122-testing
Change-Id: Ib6bcf93e356172aad2a762b730a6f93916a5d845
2017-10-30 16:00:44 +00:00
Vishwath Mohan
d4b484b070 Build system changes for CFI (Soong)
This CL makes multiples changes in preparation for platform-wide CFI.

(a) Adds a second -version-script=... to the command line
when building components that use a version script. This ensures that
__cfi_check is also exported, and allows CFI to be enabled for these
components.

(b) Adds both topdown and bottom up mutators for CFI to help propagate
dependencies correctly for components that may need CFI disabled.

(c) Fixes an issue with the mutators to correctly apply settings to
both generated variants

(d) Fixes issues when components have more than a single visibility
flag.

Bug: 30227045
Test: SANITIZE_TARGET=cfi m -j40 # dependencies are correctly built
                                 # with/without CFI

Change-Id: I44793cc03bcbcdaa957cc49c7240b87d7c9db327
2017-10-30 01:42:31 -07:00
Alex Light
901abbc79d Merge "Allow java_host_binary to be used with genrule."
am: 047a24ac5c

Change-Id: I461dffdb266403547a1b60204790215461478daa
2017-10-28 00:13:41 +00:00
Treehugger Robot
047a24ac5c Merge "Allow java_host_binary to be used with genrule." 2017-10-28 00:01:53 +00:00
Steven Moreland
4c9efd2ab2 Merge "ModuleFactoryAdapter -> ModuleFactoryAdaptor"
am: 7e768301b9

Change-Id: If5a4d17136ba5eedb0ada903acb285c3d9e4814f
2017-10-27 23:27:46 +00:00
Treehugger Robot
7e768301b9 Merge "ModuleFactoryAdapter -> ModuleFactoryAdaptor" 2017-10-27 23:20:31 +00:00
Alex Light
2423717a0f Allow java_host_binary to be used with genrule.
This is done by implementing the HostToolPath interface for java
Binary objects.

Currently, in order for a java_binary_host to be used in this way the
java_host_binary must include:
    compile_multilib: "first"

Otherwise the genrule is unable to find the correct variant.

Test: ./build_test.bash
Test: Manual

Bug: 68397812

Change-Id: I6849488dc13fa8c383df69d00f62ad815ec17876
2017-10-27 22:07:48 +00:00
Steven Moreland
b1448e4e0b ModuleFactoryAdapter -> ModuleFactoryAdaptor
Fixes type

Test: none
Change-Id: If1a85537243390a0e0d65b8911767288e00538c2
2017-10-27 14:46:47 -07:00
Alan Leung
f863d380c9 Merge "Use D8 by default"
am: 5bab222432

Change-Id: Ic1fb8159ac74c40ba468d7208b11c80cc32b351a
2017-10-27 21:34:37 +00:00
Alan Leung
5bab222432 Merge "Use D8 by default" 2017-10-27 21:15:48 +00:00
Jayant Chowdhary
4b26316680 Merge "Make clang libTooling tools ignore all lto flags."
am: bdb04acd57

Change-Id: I9d8305df2d155965ecae8ca62ba9cb344523d9f4
2017-10-27 20:51:35 +00:00
Treehugger Robot
bdb04acd57 Merge "Make clang libTooling tools ignore all lto flags." 2017-10-27 20:42:19 +00:00
Alan Leung
899f3742b8 Use D8 by default
The min-sdk-version issue is solved.

Same goes for the ART layout gtests failure found on the art host bots.

Bug: 67569208
Test: m checkbuild / tests
Change-Id: I88c7f5e9ea5c5c5d1b13404ba5db1479f9f7f2f7
2017-10-27 11:51:01 -07:00
Jayant Chowdhary
20f5d137ed Make clang libTooling tools ignore all lto flags.
LLVM r275480 does not recognize flto flags, suppress the option in clang
libTooling tools for now.

Bug: 62839002

Test: mma

Change-Id: Ia9d80b46320e551a93dbff780405d8ff8ad73f35
2017-10-27 11:29:52 -07:00
Dan Albert
33196e13c3 Merge "Add support for packaging static libs in the NDK."
am: 3ae6d30804

Change-Id: If09a5caeaaa1c34c21949f2f016ff392c23685ed
2017-10-27 18:28:55 +00:00
Treehugger Robot
3ae6d30804 Merge "Add support for packaging static libs in the NDK." 2017-10-27 18:20:31 +00:00
Dan Albert
f563d25578 Add support for packaging static libs in the NDK.
Adding `static_ndk_lib: true` to a module installs the static library
to the NDK sysroot.

Test: Set property for libc.a, make ndk
Test: Set property for libc.a, scripts/build-ndk-prebuilts.sh
Bug: https://github.com/android-ndk/ndk/issues/272
Change-Id: Ib368a25705f2adb7129dac207c1b727d4ccc1eb2
2017-10-26 12:19:29 -07:00
Colin Cross
6255422ccf Fix kotlin -classpath argument
am: 715d7110f7

Change-Id: Ie82cc059fca023a89ec5de994a8243fefabeef28
2017-10-26 14:53:41 +00:00
Colin Cross
715d7110f7 Fix kotlin -classpath argument
kotlinc expects -classpath, not --classpath.

Also add a test that uses only .kt files to exercise the code when
there are no java sources.

Test: java_test.go
Change-Id: Ifa5a007b460b40ea2188d0907570fbdca6c48da7
2017-10-26 14:47:40 +00:00
Dan Willemsen
4f487cdd96 Merge "Switch instruction_set to *string"
am: b563989f97

Change-Id: Ide1e22b8e574c4ab5a54f33180a9041ca2a42657
2017-10-26 07:01:47 +00:00
Treehugger Robot
b563989f97 Merge "Switch instruction_set to *string" 2017-10-26 06:56:35 +00:00
Colin Cross
a55c967ac5 Fix source jars
am: 8eadbf0aaf

Change-Id: If9a22699adf39954c6716ccf0ffe39a9a69df75a
2017-10-26 01:07:17 +00:00
Colin Cross
8eadbf0aaf Fix source jars
Source jars were not working as designed because javac will only
compile files from the -sourcepath if there are references to them
starting from files on the command line.  Switch to extracting
the source jars into a directory and passing a list of the files
to javac.

Test: m checkbuild
Change-Id: I9f7d824f8538d081b2f5ad64ae3cbfd0e96213af
2017-10-26 01:00:46 +00:00
Nan Zhang
b17b4758f9 Use prebuilt turbine jar for unbundled javac builds.
am: 9a36418089

Change-Id: I30a3fb0960f2775a6bc0cf6742a2c5d27b0f03cd
2017-10-25 22:45:05 +00:00
Dan Willemsen
5922f3cb6e Switch instruction_set to *string
So that the contents gets replaced when prepended/appended instead of
merged.

Test: Set instruction_set in a cc_defaults, and in a module.
Change-Id: I0f2c789231d89efa1ab053f9dc118cd19f11b0e6
2017-10-25 15:20:50 -07:00
Nan Zhang
9a36418089 Use prebuilt turbine jar for unbundled javac builds.
Test: m -j
Change-Id: If2ab85f8591fe7ab275a1d4fefdd80d871f2c36d
2017-10-25 11:11:37 -07:00
Colin Cross
8598fa6671 Merge changes If6d512ff,I3171f921
am: 49a7feb189

Change-Id: I7bee7d40f1d49dfc196ea99407b169429ac7ffc7
2017-10-25 17:38:29 +00:00
Colin Cross
49a7feb189 Merge changes If6d512ff,I3171f921
* changes:
  Add convenience phony targets for system modules
  Don't panic in turbine with no classes
2017-10-25 17:28:25 +00:00
Jiyong Park
939658c4a8 LLNDK can re-export headers
am: 2a45412445

Change-Id: I15dbe8697786ce257f6ff177ea6d4aa2ca2c262c
2017-10-25 03:07:04 +00:00
Jiyong Park
2a45412445 LLNDK can re-export headers
Added export_llndk_headers properties to llndk_library module. And a new
module type llndk_headers is added. This is to enable an LLNDK library
to reexport other LLNDK headers.

Bug: 65395259
Test: do the following
// frameworks/native/libs/arect/Android.bp
llndk_headers {
    name: "libarect_vendor_headers",
    export_include_dirs: ["include"],
}

// frameworks/native/libs/nativewindow/Android.bp
llndk_library {
    name: "libnativewindow",
    ....
    export_llndk_headers: ["libarect_vendor_headers"],
}

check that
-Iframeworks/native/libs/arect/include is in LOCAL_EXPORT_CFLAGS of
libnativewindow.vendor in out/soong/Android-<product>.mk

Change-Id: If1650414b2967f2042f4ebe2b593ed3f3ea45d3a
2017-10-25 10:30:05 +09:00
Colin Cross
88c37d3c5f Add convenience phony targets for system modules
OpenJDK9 system modules are not build modules, which means they
can't be built with m core-system-modules.  Add a phony target.

Test: m core-system-modules
Change-Id: If6d512ff7a009b49743fb25cbb566935ec1c0153
2017-10-24 16:02:53 -07:00
Colin Cross
5c6ecc179f Don't panic in turbine with no classes
ALLOW_MISSING_DEPENDENCIES=true can cause missing dependencies to be
hidden from GenerateAndroidBuildActions, which is triggering the
len(jars) == 0 check in compileJavaHeader.  For the
ALLOW_MISSING_DEPENDENCIES=true case the check is unnecessary, as the
build rules will be replaced with runtime errors.  On the off chance
the check would have been hit in a real build, allow merge_zips to
create an empty zip file if it is asked to.

Test: m ALLOW_MISSING_DEPENDENCIES=true
Change-Id: I3171f921d51229ddf38a1a647d32566658c673fa
2017-10-24 16:01:44 -07:00
Colin Cross
70898c5f45 Merge changes Id806633d,I05e945f3,Ieac84040,I18eb8cc0,If11c298e
am: 17ae970a92

Change-Id: I41deccdfac6f35a477e044de1244424540b42da9
2017-10-24 21:30:59 +00:00
Treehugger Robot
17ae970a92 Merge changes Id806633d,I05e945f3,Ieac84040,I18eb8cc0,If11c298e
* changes:
  Fix missing source module with ALLOW_MISSING_DEPENDENCIES=true
  Convert Visit*Deps from blueprint.Module to android.Module
  Move first/last unique elements utility functions to android package
  Move ModuleContext.ModuleBuild to ModuleContext.Build
  Make android.ModuleContext not include blueprint.ModuleContext
2017-10-24 21:16:43 +00:00
Colin Cross
9e4d063484 Merge "Use prebuilt dx for PDK builds"
am: 3615dcb30c

Change-Id: I5b55ad84cdac0e28331e1ca3919c56a675d0090c
2017-10-24 20:21:38 +00:00
Colin Cross
0617bb85c6 Fix missing source module with ALLOW_MISSING_DEPENDENCIES=true
A module referenced with srcs: ":module" was not honoring
ALLOW_MISSING_DEPENDENCIES=true.  Don't fail if the module
doesn't exist, an error will already have been produced by
ExtractSourcesDeps.

Bug: 68183622
Test: m ALLOW_MISSING_DEPENDENCIES=true
Change-Id: Id806633d12ab2ecd78b532e1922e59824e5c20a8
2017-10-24 13:05:06 -07:00
Colin Cross
d11fcda940 Convert Visit*Deps from blueprint.Module to android.Module
Also adds checks that the dependencies are android.Modules and
are not disabled.

Test: m checkbuild
Change-Id: I05e945f38915d49cd3c0ab72a86576949bc7eff2
2017-10-24 13:01:03 -07:00
Treehugger Robot
3615dcb30c Merge "Use prebuilt dx for PDK builds" 2017-10-24 19:17:49 +00:00
Colin Cross
b671544973 Move first/last unique elements utility functions to android package
Move firstUniqueElements to android.FirstUniqueStrings,
lastUniqueElements to android.LastUniqueStrings, and lastUniquePaths
to android.LastUniquePaths.

Test: m checkbuild
Change-Id: Ieac840405126c7f8f98afb4a4ef35c01a18fe7fb
2017-10-24 12:12:32 -07:00
Colin Cross
ae88703df5 Move ModuleContext.ModuleBuild to ModuleContext.Build
Now that android.ModuleContext does not include blueprint.ModuleContext
we can rename android.ModuleContext.ModuleBuild to
android.ModuleContext.Build without colliding with
blueprint.ModuleContext.Build.  Leave ModuleBuild as a wrapper around
Build for now to avoid having to update all the users outside
build/soong simultaneously.

Test: m checkbuild
Change-Id: I18eb8cc04faf002049a11d9aac97e9732ff5d638
2017-10-24 10:59:00 -07:00
Colin Cross
3f68a1362b Make android.ModuleContext not include blueprint.ModuleContext
android.ModuleContext should replace the blueprint.ModuleContext
methods with ones that take android.Module parameters instead of
blueprint.Module parameters.  As a first step, don't include
blueprint.ModuleContext in android.ModuleContext and manually
specify the methods from blueprint.ModuleContext that we need.
Future patches will replace these methods with ones that take
android.* types.  Also do the same for TopDownMutatorContext.

Test: m checkbuild
Change-Id: If11c298eed98bc65712b4942d0283cafa058726c
2017-10-24 10:58:59 -07:00
Colin Cross
0d3f8c0db6 Use prebuilt dx for PDK builds
The source for dx may not be available in PDK builds, use the
prebuilt one from prebuilts/build-tools instead.

Bug: 67663308
Test: m TARGET_BUILD_PDK=true
Change-Id: I9090b5190539f901fc05264a472133c12d4ea2a1
2017-10-24 10:52:26 -07:00
Colin Cross
d602bc1cda Fail when a module depends on a disabled module
am: 1e45cb77a0

Change-Id: I454b353606584838764ebc4d83d6568286b65bcc
2017-10-24 01:28:59 +00:00
Colin Cross
1e45cb77a0 Fail when a module depends on a disabled module
Copy the logic from cc.go to fail when a module depends on a disabled
module.  A future change will refactor this to remove the duplication
and cover all other module types.

Test: m TARGET_BUILD_PDK=true doesn't panic
Bug: 67663308
Change-Id: Iab2b142cebdbd74df934e4733f0de83bd3334d86
2017-10-23 16:43:47 -07:00
Colin Cross
0c503f1e80 Merge changes from topic "soong_prebuilts_misc_common"
am: 254aaec328

Change-Id: I68c26fd073e1621a428e09c108dce5bd0a5f08ec
2017-10-23 21:16:59 +00:00
Colin Cross
d85ff2fa7a Support multiple outputs in genrules with depfile: true
am: 15e86d938b

Change-Id: If3c3ed7927ca8343077b9e053359a8f122cf7b86
2017-10-23 21:16:46 +00:00
Colin Cross
56ee7b6c44 Support installable prebuilt jars
am: 535e2cf4e1

Change-Id: Ibfe43dd69f27abc6a7a945f822f5f39a4638bf10
2017-10-23 21:16:33 +00:00
Treehugger Robot
254aaec328 Merge changes from topic "soong_prebuilts_misc_common"
* changes:
  Fix finding src directory for aidl
  Support multiple outputs in genrules with depfile: true
  Support installable prebuilt jars
2017-10-23 21:12:13 +00:00