Commit Graph

4655 Commits

Author SHA1 Message Date
Nicolas Geoffray 5c3c768187 Revert "Make some common properties overridden when used in defaults modules"
Bug: 68337468

Breaks HOST_PREFER_32BIT=true

This reverts commit 617016a6f2.

Change-Id: Ifb20f41cdf93dbfd73a3aac5b055e595e334350b
2017-11-01 09:32:53 +00:00
Colin Cross 617016a6f2 Make some common properties overridden when used in defaults modules
Switch commonProperties to *string and *bool so that defining them
in a module correctly overrides instead of appends to values set
in defaults modules.

Bug: 68337468
Test: m checkbuild
Change-Id: I70e45caa92f65dc6a3bc81ae33a5a8f34ad11890
2017-11-01 05:28:36 +00:00
Treehugger Robot 76530ec6f7 Merge "Import AAPT-related product variables from make" 2017-10-31 23:39:24 +00:00
Orion Hodson 33c252c2f1 Revert "Build system changes for CFI (Soong)"
This reverts commit d4b484b070.

Rationale: second in group of commits that left aosp_x86_64 not
building. (See https://android-build.googleplex.com/builds/
submitted/4426589/aosp_x86_64-eng/latest/logs/build_error.log)

Bug: 30227045
Test: builds
Change-Id: I38ab5284c614d6ee68e7359219bd75c7d50131be
2017-10-31 21:01:00 +00:00
Orion Hodson da11d7422f Revert "Hide mutated variant in non-make builds."
This reverts commit 6147c6972a.

Rationale: first in group of commits that left aosp_x86_64 not
building. (See https://android-build.googleplex.com/builds/
submitted/4426589/aosp_x86_64-eng/latest/logs/build_error.log)

Bug: 30227045
Test: builds
Change-Id: I632869d13d09b43e2040da187d7ced4f05c332de
2017-10-31 20:47:44 +00:00
Treehugger Robot a6253ea0bd Merge "Make $(depfile) work with sbox" 2017-10-31 20:03:37 +00:00
Vishwath Mohan 6147c6972a Hide mutated variant in non-make builds.
This CL hides (using Module.Properties.PreventInstall) either the
sanitized or stock variant for non-make embedded builds (based on
whether a sanitizer is enabled or not) so we don't have duplicate
rules for installing the same target.

Bug: 30227045
Test: OUT_DIR=out build/soong/scripts/build-ndk-prebuilts.sh # no
longer generates a duplicate build error.

Change-Id: I0b2dbb0afd5d426b32da67f951e2a4f9fbb3f3b9
2017-10-30 20:33:41 -07:00
Vishwath Mohan 9ee01976fe Merge "Build system changes for CFI (Soong)" 2017-10-31 01:42:16 +00:00
Jeff Gaston 02a684b8b2 Make $(depfile) work with sbox
Most notably, the sandbox depfile path should be passed into the tool.

Bug: 68336760
Test: m -j checkbuild

Change-Id: I22f944a3f57d613fda26de0ea777a915cafcd020
2017-10-30 17:49:29 -07:00
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 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
Treehugger Robot 047a24ac5c Merge "Allow java_host_binary to be used with genrule." 2017-10-28 00:01:53 +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 5bab222432 Merge "Use D8 by default" 2017-10-27 21:15:48 +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
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 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
Treehugger Robot b563989f97 Merge "Switch instruction_set to *string" 2017-10-26 06:56:35 +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
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 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 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
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 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
Jiyong Park f14986b8a6 Merge "Allow macro definition with space"
am: d8cc795f86

Change-Id: I7b95bcee363fcacccb090bb57e529709c8b7934f
2017-10-22 07:41:29 +00:00
Treehugger Robot d8cc795f86 Merge "Allow macro definition with space" 2017-10-22 07:38:51 +00:00
Colin Cross e243c231da Fix finding src directory for aidl
aidlFlags was always looking for a src directory at the top level
instead of in the module's source directory.

Test: m checkbuild
Change-Id: Ie31baa21c8632c2bd9a6ebc42e6291417b1f31cd
2017-10-21 15:19:43 -07:00
Colin Cross 24d1ed50ac Add $ORIGIN to rpath for host tests
am: bd75e1d0bd

Change-Id: I017e2a833c830eb3c57831fc4bf45a7aca09f88c
2017-10-21 17:51:06 +00:00
Colin Cross bd75e1d0bd Add $ORIGIN to rpath for host tests
Allow loading test libraries installed into the test directory.

Test: builds
Change-Id: I15a462ebd41b99e9eb76b5be889ed3bd013732e0
2017-10-21 16:04:14 +00:00