Commit Graph

310 Commits

Author SHA1 Message Date
Colin Cross 979f9f9b18 Disable standalone relocation packer
We only support relocation packing inside lld now, remove calls to
the standalone relocation packer.  Any shared library built with
LOCAL_USE_CLANG_LLD := false will no longer have relocation packing.

This will also prevent relocation packing on prebuilt shared
libraries.

Also enables relocation packing on Darwin since lld will work on
Darwin.

Bug: 110715614
Test: m checkbuild
Change-Id: Ib4d4bc86f164d05dd78455c8e7605d4b4f5a2a77
2018-06-26 00:35:46 +00:00
Tom Cherry fc97764dd5 Reland: Verify init scripts for correctness during build
Relanding with change to not run on the darwin build since host init
verifier is not possible there.

Bug: 36970783
Bug: 110477913
Test: builds pass without failures
Test: builds fail with failures in init files used via LOCAL_INIT_RC,
      PRODUCT_COPY_FILES, or TARGET_PREBUILT

Change-Id: Iae93705a9320159ed97328e615eaa3bc150e6442
2018-06-21 11:16:25 -07:00
Colin Cross 375d9618f6 Merge "Merge LOCAL_STATIC_ANDROID_LIBRARIES manifests" 2018-06-20 23:24:52 +00:00
Yifan Hong 560890b29f Merge "Revert "Verify init scripts for correctness during build"" 2018-06-20 22:56:39 +00:00
Tom Cherry d15e50022f Revert "Verify init scripts for correctness during build"
This reverts commit 03303f97be.

Reason for revert: Mac build

Change-Id: Iadd76491307534fde81d3d917876c603a0658fb9
2018-06-20 22:45:14 +00:00
Tom Cherry 8075746865 Merge "Verify init scripts for correctness during build" 2018-06-20 17:06:11 +00:00
Jiyong Park 1cf8ee619b Export SDK library names
A java module exports SDK library names that it is using directly or
indirectly via its dependencies. Manifest fixer uses the SDK lib names
to automatically add <uses-library> tags for the apk.

The SDK library names are exported via exported-sdk-libs file in make.
From Soong, they are exported via LOCAL_EXPORT_SDK_LIBRARIES flag.

Bug: 77575606
Test: m -j

Change-Id: I4e7a9bdc5bf845af85168abf55f8063900bacc72
2018-06-20 11:50:06 +09:00
Colin Cross 16f1dbc43c Merge LOCAL_STATIC_ANDROID_LIBRARIES manifests
Pass LOCAL_STATIC_ANDROID_LIBRARIES to ManifestMerger, and copy
manifests for prebuilts AARs and static android libraries to
$(intermediates.COMMON)/manifest/AndroidManifest.xml.

Bug: 78447299
Test: m java
Change-Id: I02ac29d3445fcd591101ff0ce215e60dd0997224
Merged-In: I02ac29d3445fcd591101ff0ce215e60dd0997224
Merged-In: Ib20aa4849978283f1da1ce601b28199fc0183e05
2018-06-16 07:55:41 -07:00
Tom Cherry 03303f97be Verify init scripts for correctness during build
Bug: 36970783
Test: builds pass without failures
Test: builds fail with failures in init files used via LOCAL_INIT_RC,
      PRODUCT_COPY_FILES, or TARGET_PREBUILT

Change-Id: Ia98793776b365733ca8f0174dc228326a6edf041
2018-06-14 14:21:06 -07:00
Colin Cross 5c1a27f30f Use implicit output for prebuilt aar manifests
Remove my_full_libs_manifest_deps by making AndroidManifest.xml an
implicit output of the prebuilt aar unzipping rule.

Bug: 78447299
Test: m checkbuild
Change-Id: I26934d16fd646d45bf57c9527dbb191112cb627b
Merged-In: I26934d16fd646d45bf57c9527dbb191112cb627b
(cherry picked from commit 2b5829e1a6)
2018-06-13 12:34:51 -07:00
Colin Cross 2029903b64 Allow forcing AAPT2 on
Building with FORCE_AAPT2=true will turn on AAPT2 for all modules
unless they set LOCAL_USE_AAPT2 := false.  The build system will
attempt to rewrite common AAPT patterns into AAPT2 patterns,
including removing --extra-packages for support library packages,
removing LOCAL_RESOURCE_DIR point to support library resources,
adding a default empty manifest file if it doesn't exist, and
converting LOCAL_STATIC_JAVA_AAR_LIBRARIES to
LOCAL_STATIC_ANDROID_LIBRARIES.

Bug: 79481102
Test: m checkbuild
Change-Id: I8d9d55fe4d5d5c965c64b0407efe74e0afc35c3a
2018-05-11 02:23:20 +00:00
Anton Hansson 66d47b884e Update make rules to use new android.jar location.
This file has been copied into a 'public' subdir. Use that, so that
the old file can be deleted. Also introduce a new macro to avoid
duplicating this path in a bunch of places.

Bug: 77525052
Test: m checkbuild
Change-Id: Ifcf59c6fb357769b2765e417c8dd56d2ad9b97aa
2018-04-27 16:39:44 +01:00
Chih-Hung Hsieh d1caff4b2b Fix typo.
Bug: 73768157
Test: make checkbuild
Change-Id: Icf3a142500aa3f9849250ae0a895a61797b95376
2018-04-13 13:15:46 -07:00
Chih-Hung Hsieh 32427d6903 Add USE_CLANG_LLD and LOCAL_USE_CLANG_LLD
* Current default is not using lld.
* When USE_CLANG_LLD or LOCAL_USE_CLANG_LLD is true or 1,
  * Use *GLOBAL_LLDFLAGS instead of *GLOBAL_LDFLAGS.
    GLOBAL_LLDFLAGS should call lld and with correct lld flags.
  * set my_pack_module_relocations to false.

Bug: 73768157
Test: make checkbuild
Change-Id: I3e63cf8ae0865d01d2bc1f36e9304f4a5d092cb8
2018-04-12 11:00:06 -07:00
Colin Cross 6e136922f3 Remove framework_res_package_export_deps
framework_res_package_export is now always either the prebuilt
android.jar from an SDK or a package-export.apk generated by
Soong, so the dependency on R.stamp is never useful.  Remove
all assignments to framework_res_package_export_deps, and replace
usages with frameworks_res_package_export.

Test: m checkbuild
Change-Id: If484e9eb08061cb0ed0697755f13db71d741aaab
2018-03-07 09:47:41 -08:00
Dan Willemsen 926ee44603 Revert "Revert "Better error for missing LOCAL_SRC_FILES in prebuilts""
This reverts commit f78069865b.

Reason for revert: fixed mips

Bug: 73904572
Test: lunch aosp_mips-eng; m nothing
Change-Id: I4f51f91210f1d78ec97e450ac6e0509797c62bb9
2018-02-27 23:32:49 +00:00
Dan Willemsen f78069865b Revert "Better error for missing LOCAL_SRC_FILES in prebuilts"
This reverts commit 8d5dc6be57.

Reason for revert: broke mips targets

Change-Id: Ib8cb21e6d480b0745911efeba1f23932ddc7c2f8
2018-02-27 23:16:12 +00:00
Dan Willemsen 8d5dc6be57 Better error for missing LOCAL_SRC_FILES in prebuilts
If there's a prebuilt with LOCAL_MULTILIB := true, but only a single
LOCAL_SRC_FILES entry, we end up with a weird build error where `cp`
is trying to copy the local directory. Exit early with an error in this
case.

Bug: 73904572
Test: build-aosp_marlin.ninja is identical
Change-Id: Ie2821817c237087a96e87fb9602e430e0f86584a
2018-02-26 21:01:45 -08:00
Jiyong Park 5ebca30d21 Support LOCAL_SDK_VERSION := core_current
core_current is a pseudo SDK version which is a core Java API subset of
the Android API. It is expected to be mainly used for external Java
projects which are agnostic to Android; such as junit, guava, etc.

A module built with this SDK version can only link to java modules of
the same kind. It can't depend on modules built with LOCAL_SDK_VERSION
:= current or without LOCAL_SDK_VERSION.

Bug: 72206056
Test: m -j
Change-Id: I34a9696393aa6704fd6684a40ea5b05d3fb46b23
2018-02-01 17:14:55 +09:00
Nicolas Geoffray e3e19f0dfa For prebuilts, use the built_module for nostripping dexpreopt.
Earlier, we would use the prebuilt directly, which doesn't go through
build optimizations like uncompressing the dex files.

bug: 63920015
Test: m -j32 && verify priv-apps prebuilt's vdex don't contain
      the dex code.

Change-Id: I1a69d3b6832e3a940616f71a95c13091a4220b4b
2018-01-24 15:20:33 +00:00
Nicolas Geoffray 3972a47e9f Tighter control of stripping in dex_preopt_odex_install.
- Move logic to uncompress dexs in an APK in dex_preopt_odex_install.mk
  and definitions.mk.
- Explicitly mark nostripping cases where dexpreopt will not embed the dex
  file in the APK.

bug: 63920015
Test: m
Test: verify priv-apps dexs are uncompressed and unstripped
Test: Verify a non priv-app APK with uncompressed dex doesn't get stripped.

Change-Id: I624a03e3d965cebc0cae43fd6f7a6260178e6b8a
2018-01-18 22:42:46 +00:00
Dan Albert 4297c39e75 Also restrict NDK linking by static/shared STL.
Test: make checkbuild
Bug: None
Change-Id: I0eb29ec483c069d1c12f444fd2e94cc6eb320f93
2018-01-05 11:49:43 -08:00
Dan Albert 975e303ad2 Restrict NDK link type to matching STLs.
Test: make native
Bug: None
Change-Id: Ie9d9107fe0eeb425843ae2db197e1c60d14a59ca
2018-01-04 12:51:34 -08:00
Dan Willemsen 1d64623105 Export proguard flags from static android libraries and aar prebuilts
Test: m Contacts, classes-proguard.jar has same contents
Test: rm -rf out; tapas Contacts; m
Change-Id: Id7a92fb2c44913bccbfcbeae127355b4de588e4d
Merged-In: Id7a92fb2c44913bccbfcbeae127355b4de588e4d
(cherry picked from commit 1417c177ac)
2017-12-28 17:22:19 +00:00
Sundong Ahn f3e8302088 Add LOCAL_SDK_VERSION := system_$(VER)
am: 5a44d1f069

Change-Id: Ief08f78484b654502d356c07d61063a16aad0572
2017-12-01 04:26:10 +00:00
Sundong Ahn 5a44d1f069 Add LOCAL_SDK_VERSION := system_$(VER)
The system_$(VER) can be set in LOCAL_SDK_VERSION, and the apk will use
android_system.jar at build time.
If LOCAL_SDK_VERSION is not defined and this module is installed in
vendor.img, LOCAL_SDK_VERSION is set to system_current.

Bug: 67724799
Test: 1. build && run on taimen
2. LOCAL_SDK_VERSION:=system_27 in ims.apk && build ims.apk && check
the vsdk_v27_intermediates.

Merged-In: I5b11c78b8fcd4a2f2a5e3b141527cd34dbe80018
Change-Id: I5b11c78b8fcd4a2f2a5e3b141527cd34dbe80018
(cherry picked from commit ef212cbe8d)
2017-12-01 00:39:07 +00:00
Dan Willemsen b2cff60b8a Merge "Switch gcnodir name from basename to just removing .so"
am: c1d7537d99

Change-Id: Iebfc8f3b18d37f04ea92baf52b373ed3eea935c1
2017-11-20 23:14:16 +00:00
Dan Willemsen ba9badf8ec Switch gcnodir name from basename to just removing .so
$(basename) was catching all of the hidl services that have versions
like "1.0" in their name, marking the .0-service portion as a suffix to
be removed.

Instead just remove ".so" and assume that everything else isn't actually
a suffix.

Bug: 69271974
Test: NATIVE_COVERAGE=true COVERAGE_PATHS=hardware/interfaces m; compare
      ninja files
Change-Id: I76e27d9ab1f9d4862cc2607c5f2ed9c121879421
2017-11-20 13:03:25 -08:00
Dan Willemsen 9b0a730b14 Merge "Add LOCAL_AAPT2_ONLY"
am: da5fbe3c38

Change-Id: I0105575b63e8dca60fad8661443089d168cc0c0e
2017-11-18 02:23:30 +00:00
Dan Willemsen bb6393c5a4 Add LOCAL_AAPT2_ONLY
This allows modules to specify that they may only be used from modules
using aapt2. Using aapt2 removes absolute path references to modules, so
this can be useful if a module is preparing to move its sources, or
replace itself with a prebuilt aar.

Test: m
Test: Label frameworks/support/design; m
Test: Label frameworks/support/v4; m
Test: build/soong/build_test.bash
Change-Id: Icfb3d4b19a6a0e3a3bb00091d2a97a4d88c0c761
2017-11-17 15:54:15 -08:00
Xin Li 44dd4881de Merge commit '66b8b530187b129934a685bf0c4349eef00e4b0c' from
oc-mr1-dev-plus-aosp-without-vendor into stage-aosp-master.

Change-Id: I7594bb72dd7e847292eb502edd918e41318aac29
Merged-In: Ide82473d358719f7e01cd2a4a85db954f3722f14
2017-11-14 11:36:22 -08:00
Nicolas Geoffray 21a3aef7d7 Merge "Add a product variable for priv-apps dependencies." 2017-11-01 13:40:20 +00:00
Mathieu Chartier 55eabd5511 Add product property for preopting extracted APKs
The property is PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK. If specified,
this preopts the APK with the default compile filter (quicken).

This will be used to quicken preopt of gmscore dynamite modules when
preopting is disabled. This fixes a possible RAM regression caused
by running out of the APK.

Bug: 65601274
Test: make and flash

(cherry picked from commit 0fbb836cf6)

Merged-In: Ibf0fa73ee7fafd9735e587baf19c4950a7da817a
Change-Id: Ibf0fa73ee7fafd9735e587baf19c4950a7da817a
2017-10-17 15:57:45 -07:00
Jiyong Park 2416dc8cd1 Merge "Prevent vendor libs from depending on private VNDK libraries" am: 492f67c0ac am: 327a511925
am: b1d7b3a44f

Change-Id: Iac7cf30fa20da671b9a12d61b4a5768e024e996c
2017-10-11 02:00:49 +00:00
Treehugger Robot 492f67c0ac Merge "Prevent vendor libs from depending on private VNDK libraries" 2017-10-11 01:45:36 +00:00
Jiyong Park a3fb1588f4 Prevent vendor libs from depending on private VNDK libraries
For module installed to /vendor partition, direct linking to the libs
marked as `vendor_available: false` is not allowed. The

Bug: 64730695
Test: Add vendor_available: false to libft2 and
libcompiler_rt. Add the two libs into LOCAL_SHARED_LIBRARIES of a vendor
lib (e.g. libdrm). Build fails with the link_type check error message.

Change-Id: Iaf23574ceddb0c087111e1d95997e9ddd60cdf87
2017-10-10 19:38:06 +09:00
Colin Cross 4442e1180f Merge changes I06b8efa8,Id2fa2d18 am: 4d44c2dc12 am: 6fff4ee8de
am: a88ca0936f

Change-Id: I0e21e38f2135bb4fbb17ae3a44d84a769e685cbf
2017-10-06 23:38:07 +00:00
Colin Cross ea1629e788 Refactor removing classes.dex for dexpreopt
Combining $(call dexpreopt-remove-classes.dex) into a
$(call copy-one-file) rule is hacky and error prone.  Make a helper
dexpreopt-copy-jar function that takes LOCAL_DEX_PREOPT and copies
the jar, removing the dex files if necessary.

Test: only description message changes to out/build-${TARGET_PRODUCT}.ninja
Change-Id: Id2fa2d18571ca01bc81302c912b8de25f3dde7a1
2017-10-06 14:26:25 -07:00
Nicolas Geoffray a95fbd1ed5 Add a product variable for priv-apps dependencies.
Those dependencies are jars/apks on which we want to
uncompress their dexs.

bug: 30972906
bug: 63920015

Test: sailfish build

Change-Id: Ic96ffe9dbe39abc1c28e7de134892d689207c9ca
2017-10-06 11:14:08 +01:00
Dan Willemsen 1d4993cdee Merge "Always pass --auto-add-overlay to aapt2 for aar prebuilts" am: 4ec7972785 am: 62263d99ef
am: 8e025e030f

Change-Id: I1f83f8477f353d0c5f0a6fb2e329d50835b377a9
2017-10-06 00:14:35 +00:00
Dan Willemsen e3c99016f9 Always pass --auto-add-overlay to aapt2 for aar prebuilts
Bug: 64723465
Test: Build all aar prebuilts in our internal tree
Change-Id: I82ef8d59d4f710b755226b2801dc65c2ccffe40c
2017-10-05 14:55:11 -07:00
Colin Cross 69ced5de5e Delete jack support am: a6bc3a8a4c
am: 37bf2b1250

Change-Id: I19133aedbfe91f7cd49588b33f517dc4bb17b91c
2017-10-02 20:00:16 +00:00
Colin Cross e673deb280 Delete jack support
Remove all support for running jack.

Bug: 65302138
Test: m -j checkbuild
Change-Id: I1ef87c88af3f2689f8b0dcf1a01c958b16159631
Merged-In: I1ef87c88af3f2689f8b0dcf1a01c958b16159631
(cherry picked from commit 5db5d31d73)
2017-10-02 11:15:19 -07:00
Colin Cross a6bc3a8a4c Delete jack support
Remove all support for running jack.

Bug: 65302138
Test: m -j checkbuild
Change-Id: I1ef87c88af3f2689f8b0dcf1a01c958b16159631
Merged-In: I1ef87c88af3f2689f8b0dcf1a01c958b16159631
(cherry picked from commit 5db5d31d73)
2017-10-02 18:06:56 +00:00
Colin Cross ec346cf1fd Merge changes I06179fca,Ie48746c8,Ia47ebc95 am: b182ea7bcb am: 2c717745b2
am: 1e7f83bf49

Change-Id: I538de57657bfc334dc6d3d24b22baccb01d9b0d5
2017-09-27 02:48:39 +00:00
Colin Cross 7dc9043546 Allow disabling turbine
m -j TURBINE_ENABLED=false will build without turbine.  This is
primarily useful for A/B comparisions of turbine builds, but will
also be used to temporarily disable turbine for unbundled builds
until we have turbine prebuilts.

Bug: 64308460
Test: m -j TURBINE_ENABLED=false java
Test: m -j java
Change-Id: Ie48746c8bfc60c361be9634cb1805ca1c09aa1fe
2017-09-26 16:23:00 -07:00
Nicolas Geoffray 95032843ba Merge "Revert "Revert "Make privileged apps always keep uncompressed dex files.""" am: 121fe5a80a am: 279df08f3b
am: 3c36897dbc

Change-Id: I2fe569b2d0f861a724f5a99139350c4d02e280ef
2017-09-20 08:59:35 +00:00
Nicolas Geoffray b06c30b480 Revert "Revert "Make privileged apps always keep uncompressed dex files.""
bug: 30972906
bug: 63920015

Test: doing zipinfo on the produced apks after build.
Test: fugu build

This reverts commit f69441b76b.

Change-Id: I6b029f2044385f3e3fa332091a9244cec79d2474
2017-09-19 13:09:27 +01:00
Mathieu Chartier cd32d9aea1 Merge "Add product property for preopting extracted APKs" into oc-mr1-dev
am: 9e2fd26a29

Change-Id: If492791db41c08b23191f1f58fd08ed85dc161ca
2017-09-18 22:55:46 +00:00
Mathieu Chartier 0fbb836cf6 Add product property for preopting extracted APKs
The property is PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK. If specified,
this preopts the APK with the default compile filter (quicken).

This will be used to quicken preopt of gmscore dynamite modules when
preopting is disabled. This fixes a possible RAM regression caused
by running out of the APK.

Bug: 65601274
Test: make and flash

Change-Id: Ibf0fa73ee7fafd9735e587baf19c4950a7da817a
2017-09-18 12:43:49 -07:00