Commit graph

698 commits

Author SHA1 Message Date
Colin Cross
1f367bfe8b Add a flag to allow unbundled builds to build SDKs from source
Mainline modules are tightly coupled to the platform, and should
build against the current SDK from source and not prebuilts. Add
a flag UNBUNDLED_BUILD_SDKS_FROM_SOURCE to specify that a
TARGET_BUILD_APPS build should build the current SDK instead of
using the prebuilts.

Bug: 121194841
Bug: 121231426
Test: no change to out/build-aosp_sailfish.ninja
Test: forrest unbundled build
Test: forrest master apps build
Test: forrest mainline modules build
Change-Id: I45a40a335483dae2fe192721df9b31bdbab97ee5
2018-12-18 22:46:24 -08:00
Colin Cross
539f409d78 Merge "Dexpreopt soong modules inside soong" 2018-12-18 01:54:32 +00:00
Colin Cross
43f08db29e Dexpreopt soong modules inside soong
Port the dexpreopt logic from Make to the dexpreopt package in Soong,
and use it to dexpreopt Soong modules.  The same package is also
compiled into the dexpreopt_gen binary to generate dexpreopt scripts
for Make modules.

This relands Ib67e2febf9ed921f06e8a86b9ec945c80dff35eb and
I462182638bd57b1367b5bfb0718e975c11ae66f7, along with multiple fixes
to depsfile generation in dexpreopt_gen that caused .odex files for
modules in defined make to be missing dependencies on boot.art, and
a fix to not dexpreopt and strip tests.

Bug: 119412419
Bug: 120273280
Test: no differences to dexpreopt outputs on aosp_sailfish system/,
      only expected changes to dexpreopt outputs on system_other
      (.vdex files for privileged Soong modules no longer incorrectly
      contain .dex contents).
Test: OUT_DIR=$PWD/out m
Test: NINJA_ARGS="-t deps out/target/product/sailfish/obj/APPS/Contacts_intermediates/dexpreopt.zip" m
Change-Id: I6bb2c971cee65d2338839753aa0d84939f335b1b
2018-12-15 19:07:54 -08:00
Colin Cross
4ff85ebeb7 Revert "Dexpreopt soong modules inside soong"
This reverts commit 29ff88741e.

Test: none
Bug: 119412419
2018-12-14 11:49:58 -08:00
Colin Cross
359e6436be Revert "Fix MaybeRel when OUT is absolute"
This reverts commit fee2bff77c.

Test: none
Bug: 119412419
2018-12-14 11:49:58 -08:00
Colin Cross
fee2bff77c Fix MaybeRel when OUT is absolute
MaybeRel was failing with an error when comparing an absolute out
path to a relative source path.  Make it return false instead, and
add tests.

Bug: 119412419
Test: paths_test.go
Change-Id: I462182638bd57b1367b5bfb0718e975c11ae66f7
2018-12-13 21:05:18 +00:00
Colin Cross
29ff88741e Dexpreopt soong modules inside soong
Port the dexpreopt logic from Make to the dexpreopt package in Soong,
and use it to dexpreopt Soong modules.  The same package is also
compiled into the dexpreopt_gen binary to generate dexpreopt scripts
for Make modules.

Bug: 119412419
Bug: 120273280
Test: no differences to dexpreopt outputs on aosp_sailfish system/,
      only expected changes to dexpreopt outputs on system_other
      (.vdex files for privileged Soong modules no longer incorrectly
      contain .dex contents).
Change-Id: Ib67e2febf9ed921f06e8a86b9ec945c80dff35eb
2018-12-13 15:53:54 +00:00
Jiyong Park
0ddfcd1188 Don't create unnecessary APEX variations
This change fixes a problem that APEX variations are created for the
modules that actually shouldn't built for any APEX. For example,
consider this case.

apex { name: "myapex", native_shared_libs: ["mylib"],}

cc_library { name: "mylib", shared_libs: ["libfoo#10"],}
cc_library { name: "libfoo",
             shared_libs: ["libbar"],
             stubs: { versions: ["10"], }, }
cc_library { name: "libbar", ...}

Before this change, both the stubs and non-stubs variations of libfoo
were mutated with apexMuator, which is incorrect for the non-stubs
varia; there is no dependency chain from the apex "myapex" to the
non-stubs variation, but to the stubs variation due to the #10 syntax.

This was happening becauses we used the name of the module to determine
whether it should be built for APEX or not. Both stubs and non-stubs
variations have the same module name "libfoo".

Fixing this issue by recording the list of APEX variations required
directly on the module. So, the stubs variation of libfoo has myapex in
its apex variations list, but the non-stubs variation doesn't, and thus
apexMutator does not pick up the non-stubs variation.

Test: m (apex_test updated and passing)
Test: cherry-pick ag/5747464 and m
Change-Id: I31e618626809a828a55fff513ef5f81f79637afa
2018-12-13 10:48:15 +09:00
Jiyong Park
de866cbe50 Stubs dependency is not installed
When the stubs variant of a library is dependend by a platform component
and the library is included in one or more APEX, the library is not
installed to the platform, because it is provided by APEX.

Bug: 120266448
Test: m
Test: add stubs: { versions: ["1"], }, to libnetd_resolv
then build netd. libnetd_resolv.so does not exist under /system.

Change-Id: I09b78e38df285033ef6e9c85f7ea4b0274e85070
2018-12-13 10:48:15 +09:00
Haibo Huang
47c9d4c8a3 Remove denver from soong
Test: build
Change-Id: If740c2aaa321dee01f5d99c37171390e15f62c62
2018-12-04 19:39:48 -08:00
Haibo Huang
f46b1cb06e Remove denver64 from soong
Test: build
Bug: 73545680
Change-Id: I6b213a1d83275c566fd6142a07550094240528c4
2018-12-04 21:01:50 +00:00
Jiyong Park
25fc6a9cc9 Stubs variant is used when building for APEX
When a native module is built for an APEX and is depending on a native
library having stubs (i.e. stubs.versions property is set), the stubs
variant is used unless the dependent lib is directly included in the
same APEX with the depending module.

Example:

apex {
    name: "myapex",
    native_shared_libs: ["libX", "libY"],
}

cc_library {
    name: "libX",
    shared_libs: ["libY", "libZ"],
}

cc_library {
    name: "libY",
    stubs: { versions: ["1", "2"], },
}

cc_library {
    name: "libZ",
    stubs: { versions: ["1", "2"], },
}

In this case, libX is linking to the impl variant of libY (that provides
private APIs) while libY is linking to the version 2 stubs of libZ. This is
because libY is directly included in the same apex via
native_shared_libs property, but libZ isn't.

Bug: 112672359
Test: apex_test added
Change-Id: If9871b70dc74a06bd828dd4cd1aeebd2e68b837c
2018-12-04 17:46:22 +09:00
Jaewoong Jung
1d6eb68731 Use debug mode when running R8 for eng builds.
Bug: 119601874
Test: Built for different variants.
Change-Id: I2250587eb3e457ca15265eb9f8359872e9b08363
2018-11-30 15:23:16 +00:00
Anton Hansson
7dbfd82346 Remove obsolete flag
Last use removed in Ibefde5feaeaec8fb68cbc6ea1c019bf8b5e608bb

Test: make
Change-Id: Icd4273b2ab472758ce0fbc237c294960ee16685d
2018-11-29 10:08:14 +00:00
Stephen Hines
c027b309f1 Merge "Support Qualcomm Kryo 385 CPU variant." 2018-11-29 07:23:40 +00:00
Treehugger Robot
abe477a33a Merge "Allow NDK APIs to be marked as drafts." 2018-11-28 23:11:06 +00:00
Jaewoong Jung
5edacb2635 Merge "Add filegroup support to notice property." 2018-11-28 21:22:38 +00:00
Dan Albert
23d37e09e9 Allow NDK APIs to be marked as drafts.
Draft APIs are available to the platform and to CTS to allow
developers to iterate on an API, but hidden from the NDK artifacts to
avoid releasing the API until it is ready.

Test: Mark binder_ndk headers and library as drafts, make checkbuild,
      build-ndk-prebuilts.sh, verify missing from NDK artifact.
Bug: http://b/120091134
Change-Id: I8685e92bdaaea581e17fe98e7a2bfb9388f9f132
2018-11-28 09:52:12 -08:00
Dan Albert
a3b83662b8 Up the NDK's minimum supported API level.
r18 doesn't support ICS.

Test: m checkbuild
Bug: http://b/119587551
Change-Id: I39ffa21c428bcdd7e970476bedc7d6dffb7b3c43
2018-11-27 13:58:18 -08:00
Jaewoong Jung
62707f79ab Add filegroup support to notice property.
Also, replace all notice file references with the parent directory
pattern(../) with filegroups. This new version has
ALLOW_MISSING_DEPENDENCIES support, so shouldn't break branches that
don't contain the libwinpthread project.

Bug: 118899640
Test: Manual build + forrest runs on previously failed branches.
Change-Id: I13e70e8dab547f82c1c8f15eccc7ae116e480ad5
2018-11-27 09:45:18 -08:00
Ivan Lozano
074ec480ef Add support for AArch64 XOM binaries.
Adds build system support for generating AArch64 binaries with
execute-only memory layouts via a new xom module property. Also adds
support for an ENABLE_XOM build flag for global builds.

Bug: 77958880
Test: make -j ENABLE_XOM=true
Change-Id: Ia2ea981498dd12941aaf5ca807648ae37527e3ee
2018-11-21 08:59:37 -08:00
Artem Serov
d3072b0c7c Support Qualcomm Kryo 385 CPU variant.
Support Kryo 385 cpu variant which should be used for
Qualcomm Snapdragon 845.

Motivation:
  kryo385 CPU *IS NOT* an Arm Cortex-A75.

Particular problem:
  Cortex-A75 CPU must support optional ARMv8.2 dot product
  feature; kryo385 CPU (Qualcomm Snapdragon 845) doesn't
  support it.

Test: Builds when kryo385 is used as cpu variant.
Test: Pixel 3 boots to GUI with kryo385 as CPU variant
      with this patch on AOSP 9.0.0 r16.

Bug: 119564566

Change-Id: I62ffb46b1977b48446c6c1ca1400b1b39f7a8457
2018-11-21 10:15:07 +00:00
Dan Willemsen
377a12b4c3 Add product_variables.product_is_iot variables
These are enough to compile bootanimation with Soong.

Test: build bootanimation on internal branch
Change-Id: I8474b54ea196ab71ce178c517eb261bdc22b2e01
2018-11-19 23:36:38 -08:00
Dan Willemsen
569edc5f66 Add dist support to Soong
When dist'ing a library or binary that has use_version_lib set, always
distribute the stamped version, even for the device.

Test: m test_build_version_test dist
Change-Id: I2995ec516b1d182ce18f099aeaa4d186ffbcf01f
2018-11-19 15:26:14 -08:00
Jaewoong Jung
dd13272151 Merge "Revert "Add filegroup support to notice property."" 2018-11-19 17:29:59 +00:00
Jaewoong Jung
491fe5ffd8 Revert "Add filegroup support to notice property."
This reverts commit ff7a1a47d9.

Reason for revert: Broke ART buildbot

Change-Id: I005ccfcc2c36bbcb274cb2a069fc701168faacd2
2018-11-19 16:18:54 +00:00
Jaewoong Jung
ac083c8cd7 Merge "Add filegroup support to notice property." 2018-11-19 15:47:23 +00:00
Dan Willemsen
60e62f0c44 Add nanopb-c support
Test: cd hardware/ril; mma
Change-Id: Id1481940d15a2a3f6eb29af54ee30080ff2286cb
2018-11-17 15:28:25 -08:00
Jaewoong Jung
ff7a1a47d9 Add filegroup support to notice property.
Also, replace all notice file references with the parent directory
pattern(../) with filegroups.

Bug: 118899640
Test: Manual build
Change-Id: I841345d747f41a3bb5beea66ad87a979734c39a4
2018-11-16 13:26:43 -08:00
Jaewoong Jung
16c7d3d263 Revert "Revert "Revert "Revert "Export static libraries.""""
This reverts commit 555c114283.

Reason for revert: The namespace issue in the pi-dev-plus-aosp-without-vendor branch is now fixed.

Change-Id: I26ed591447797a8ee505f43bdd209162418b6c5e
2018-11-16 01:20:05 +00:00
Jiyong Park
8fd6192480 APEX can be flattened
When TARGET_FLATTEN_APEX is set to true, APEXes are flattened, which
means files in an APEX is not packaged into the mini file system image,
but instead directly copied to the system partition.

This option is for devices where kernel does not support loopback
devices or the maximum number of loopback devices is too small (though
the threshold is TBD as of now).

This CL also fixes a bug that jars having bytecode are installed instead
of those having dex.

Bug: 118485880
Test: TARGET_FLATTEN_APEX=true m apex.test; tree
out/target/product/.../system/apex/apex.test shows list of files in it.

Test; m apex.test, then a file out/target/product/.../system/apex/apex
.test.apex exists.

Change-Id: I5a3d62d392d05f2779c4925388afe4f6e460059b
2018-11-14 13:41:54 +09:00
Jiyong Park
1a7cf08ebb Add filename_from_src property to prebuilt_etc
Base name of the output file of a prebuilt_etc is by default the module
name. This default behavior can be customized by either via the
'filename' property or the new 'filename_from_src' property. The former
explicitly sets the base name while the latter makes the file name to be
that of the source file.

Test: m (prebuilt_etc_test added)
Change-Id: Ic2900417bda62993f6de2612d993234b82b74479
2018-11-13 12:43:34 +09:00
Colin Cross
c17727d06b Shard arch property structs
Arch property struct types are created at runtime.  Go has a limit
of 2**16 bytes for the name of a type, and the type of a struct
created at runtime is a string containing all the names and types
of its fields.  To avoid going over the limit, split the runtime
created structs into multiple shards.

Also undo MoreBaseLinkerProperties now that it is no longer
required.

Bug: 80437643
Test: m checkbuild
Test: no change to out/soong/build.ninja
Change-Id: I035b20332ec63f3d4b1696855c5b0b0a810597b7
2018-11-12 19:04:13 +00:00
Colin Cross
4e81d709ab Document host_supported and device_supported
Test: none
Change-Id: I151fa044a61a0fc993ce4ea672fda762c15025cc
2018-11-11 02:37:48 +00:00
Jaewoong Jung
555c114283 Revert "Revert "Revert "Export static libraries."""
This reverts commit eb05c2a633.

Reason for revert: Yet another broken build.

Change-Id: I4198f2dd5c7848365d71d03f6dbd598998fb9bd8
2018-11-09 22:25:37 +00:00
Jaewoong Jung
eb05c2a633 Revert "Revert "Export static libraries.""
This reverts commit 3affc07ca0.

Reason for revert: The notice dependency bug is now fixed.

Change-Id: I5424ade9d742fbe190651097c04914a29db6dfa0
2018-11-09 16:02:34 +00:00
Colin Cross
37a07b1784 Revert "Use protoc-gen-javalite for java lite protos"
This reverts commit 5a5aca0568.

Change-Id: Iadbc2ec7fbc45d888383e0e6f569cbfc5ef6a996
2018-11-04 17:23:48 -08:00
Colin Cross
87dc8b7138 Merge "Use protoc-gen-javalite for java lite protos" 2018-11-05 01:13:14 +00:00
Jiyong Park
d8acc14bd2 Merge "Prebuilt_etc can be uninstallable" 2018-11-03 06:34:23 +00:00
Colin Cross
5a5aca0568 Use protoc-gen-javalite for java lite protos
Protobuf 3.5.2 does not natively support lite protos, instead they
are generated by the protoc-gen-javalite plugin compiled from
external/protobuf-javalite.

Bug: 117607748
Test: m checkbuild
Change-Id: I95c2d873f19d4c00e9dc312d7fdbe98cae250a8b
2018-11-03 00:05:58 +00:00
Jaewoong Jung
3e6b1fbcfb Revert "Export static libraries."
This reverts commit 5d19e1de88.

Reason for revert: Broke aosp-build-tools/darwin_mac

Change-Id: I1af36848fb5a00849aec69941ddef33769b1b536
2018-11-02 22:56:30 +00:00
Jaewoong Jung
5d19e1de88 Export static libraries.
Export static libraries through LOCAL_STATIC_LIBRARIES and
LOCAL_WHOLE_STATIC_LIBRARIES. This enables dependency-based NOTICE file
generation. Also, add a notice property in the libwinpthread module.

Bug: 36073965
Test: cc_test.go
Change-Id: Ic63ca523b40acac82bbe876f7aa40ecd495907c5
2018-11-01 22:45:59 +00:00
Colin Cross
b551a7775b Merge "Add sanitize.address to product_variables.eng" 2018-10-31 17:45:53 +00:00
Jiyong Park
ad9ce044fb Prebuilt_etc can be uninstallable
For APEXs, we need different prebuilt_etc modules having the same
'filename' properties, because we expect them to have same local path
inside APEXs. For example, we will have ./etc/ld.config.txt file for
APEXs having an executable.

However, this can cause duplicated targets in the make world, because
the prebuilt_etc modules will all be installed to the same path under
/system.

In order to avoid this, adding 'installable' property to prebuilt_etc
module type to optionally make a module to be non-installable, but only
to APEXs.

Test: build/soong/build_test.bash --dist

Change-Id: Iadb564e07d0483934548ca63f5f524a2c8515a81
2018-10-31 22:59:48 +09:00
Treehugger Robot
d471374fd6 Merge changes from topic "apex_multilib"
* changes:
  Add filename property to prebuilt_etc
  binaries and native_shared_libraires are multilib-aware props
2018-10-30 00:56:49 +00:00
Colin Cross
3273cc27f7 Add sanitize.address to product_variables.eng
statsd enables ASAN in eng builds.

Test: m checkbuild
Change-Id: Ie25e1be55e14043a866d881b378cdd8d38ad356e
2018-10-26 23:59:52 -07:00
Jiyong Park
139a2e6935 Add filename property to prebuilt_etc
filename property is an optional property that specifies the name of the
installed file which is by default name of the module.

This will be used to APEXs to have ./etc/ld.config.txt files for their
own.

Test: m (prebuilt_etc_test.go added)
Change-Id: Ic8d0c0044c5bc2c6c33117fe2c19ef6ad75451a8
2018-10-26 22:14:59 +09:00
Neil Fuller
bcf97f5afd Merge "Add soong build restrictions for libcore targets" 2018-10-26 09:31:59 +00:00
Colin Cross
5a0dcd5acf Store dex files uncompressed and unstripped in privileged APKs
Privileged APKs need to store their dex files uncompressed so they
can be verified and mapped directly out of the APK.

Also track whether the module will be dexpreopted or not in order
to determine if the dex file should be stripped before signing.

Test: SystemUI.apk contains an uncompressed dex file
Change-Id: I4dca86c7f8778595882405b34adcf2a7bae03c67
2018-10-25 17:47:12 +00:00
Neil Fuller
df5f356c86 Add soong build restrictions for libcore targets
Add soong build restrictions for libcore targets to stop
other targets depending on internals.

Test: cd build/soong/; ./build_test.bash --products aosp_arm
Bug: 113148576
Change-Id: I2c15924fbecaf0c2076d08de65814a6dcb790e73
2018-10-25 18:10:57 +01:00