Commit graph

692 commits

Author SHA1 Message Date
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
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
Colin Cross
395f2cfa89 Move Ndk_abis from soong.config to soong.variables
soong.config is not cleared between builds, which can cause
problems when switching between an ndk build and a platform build.

Bug: 118398924
Test: OUT_DIR=out_ndk DIST_DIR=dist build/soong/scripts/build-ndk-prebuilts.sh
Change-Id: Ifc03a0c25f46625375cdda5723e4a09d7d8050d5
2018-10-24 23:20:10 +00:00
Dan Willemsen
9ff34c0ca8 Update linux_bionic configuration
Add a missing toolchain method, don't require modules to opt in to
linux_bionic.

Bug: 31559095
Test: attempt to build host bionic
Change-Id: Ia5c8e2f127b88f56191b7abc389d5329cfdb0720
2018-10-22 15:46:03 -07:00
Dan Willemsen
0ef639bb59 Allow generating modules once per OS instead of once per Class
When building with two OSes of the same class (Host, etc) enabled,
independently produce variants of each module for each OS, instead of
making `compile_multilib: "first"` select just one of the OSes.

My use case this is for Linux + LinuxBionic, which are both considered
Host class, but this would also applied if we wanted to generate rules
for Linux+Darwin, or some combination of firmware bits (either in
addition to Android in the Device Class, or multiple firmwares in a new
Class)

Bug: 31559095
Test: enable host bionic, see a linux(_glibc) and linux_bionic
      definition for binaries
Change-Id: I55e7f046758b3dc2a31da2c4b20274ec68ece0a0
2018-10-22 15:46:03 -07:00
Dan Willemsen
fa2aee1ca4 Remove USE_CLANG_LLD[=false]
This should always be true now. It will be a change for side branches
(build_tools, etc) that weren't setting UseClangLld in the
soong.variables file.

Test: treehugger
Change-Id: I9fd6157fda630bf8bb939677dbcb026f02685f19
2018-10-21 19:54:12 -07:00
Dan Willemsen
2d31a44b8a Stop using DIST_DIR in Soong
We're only using it to distribute files in case of failure, which isn't
well supported currently, but can be handled for now by using the
DIST_DIR environment variable during the command execution.

This was at least one cause that we'd be re-running Soong during every
build server build, as the DIST_DIR values are unique.

Test: m dist
Change-Id: Ibd5e6b6c46695350de80b745bfb6a6aa685033a0
2018-10-20 21:33:41 -07:00
Haibo Huang
a31e2bda89 Add support for cortex-a76 in soong
Bug: 117125298
Test: Change a device to be A76 and build
Change-Id: Iae0773d54e57b247c818d44f8044180d5a3f95a8
2018-10-12 23:55:38 +00:00