Commit Graph

4671 Commits

Author SHA1 Message Date
Martin Stjernholm
caa47d7eed Disable all host OS variants except those explicitly included.
Necessary to avoid problems with implicitly enabled host OS'es, e.g.
linux_glibc getting enabled when we only supply a linux_bionic linker
in runtime-module-host-exports. That will then cause a non-functional
prebuilt to take precedence over source if the prebuilt is preferred.

We don't do this for device since we so far only support a single
device OS (android).

This introduces the notion that SDK member types can be host OS
dependent or not. That way java members with host prebuilts don't get
restricted to a specific host OS.

Test: m nothing
Test: build/soong/scripts/build-aml-prebuilts.sh runtime-module-host-exports
  Check that the generated Android.bp correctly disables the bionic
  linker prebuilt for linux_glibc.
Test: art/build/apex/runtests.sh
  on master-art with an updated runtime SDK snapshot
Test: art/tools/buildbot-build.sh {--host,--target}
  on master-art with an updated runtime SDK snapshot
Bug: 160349757
Change-Id: Idad7ef138cdbcbd209d390bf6c10ca8365d4619f
2020-08-03 21:06:50 +01:00
Treehugger Robot
5a7d5a2667 Merge "Skip llndk_library and llndk_headers for vendor snapshot" am: f856693344 am: 8022defd7a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1379876

Change-Id: I27d4768c8327dd9c02ad0b32686bb8058c7a70ae
2020-08-01 00:43:28 +00:00
Treehugger Robot
f856693344 Merge "Skip llndk_library and llndk_headers for vendor snapshot" 2020-08-01 00:01:49 +00:00
Paul Duffin
0f460aa9db Fix prebuilt mutator ordering in tests am: 021f4e525f am: 8537c9cb30
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1380179

Change-Id: I77be0b785a95bdb943c8ead613f8e2d7b1d32776
2020-07-31 17:45:54 +00:00
Paul Duffin
021f4e525f Fix prebuilt mutator ordering in tests
Previously, the prebuilt mutators were added by the
cc.RegisterRequiredBuildComponentsForTest() function as a convenience
but unfortunately it lead to some of the mutators being in a different
order in the tests than in the normal build.

This change:
* Extracts the RegisterPrebuiltMutators() call from
  cc.RegisterRequiredBuildComponentsForTest()
* Makes sure that the prebuilt mutators are registered before the
  visibility gatherer and enforcer mutators.

Bug: 162505935
Test: m nothing
Change-Id: I7d959b558200b502f0a5e4653c41ea01414e142a
2020-07-31 16:12:01 +01:00
Pirama Arumuga Nainar
c02c98b8f5 [cc/sanitize] Deprecate blacklist sub-property of sanitize
All uses of this property have been migrated to 'blocklist' instead.

Update language to comply with Android’s inclusive language guidance

See https://source.android.com/setup/contribute/respectful-code for
reference

Bug: 161896447
Bug: 162245450

Test: TH
Change-Id: I4b83b41ad5a4b2caf1166b1acece9537f545aaad
2020-07-30 22:17:22 -07:00
Justin Yun
f2664c6b4a Skip llndk_library and llndk_headers for vendor snapshot
llndk_library and llndk_headers are backward compatible. We may use
the source code instead of snapshot for those modules.

Bug: 161565086
Test: build with vendor snapshot
Change-Id: If3da3f9b31f7180d8d0835f8dbd7ba938a60d967
2020-07-30 18:57:54 +09:00
Colin Cross
f0913fb0a0 Follow all shared library dependencies when collecting JNI libraries
The implementation before libraryDependencyTag was added failed to
include some JNI libraries into apps because it did not handle
sharedExportDepTag, earlySharedDepTag or lateSharedDepTag.

Also fix a bug in cc.*Module.IsNdk that was comparing "liblog.ndk"
against "liblog" and incorrectly returning false that would have
caused NDK libraries that now pass the check above to incorrectly be
packaged into the APK.

Bug: 162437057
Test: m checkbuild
Change-Id: I02fb745abb5cace2b4e5bfff2f35cef6d2e0a4ff
2020-07-29 13:22:33 -07:00
Colin Cross
aac3222cdf Fix DepsInSameApex for some dependencies of static libraries
The implementation before libraryDependencyTag was added failed to
treat shared library dependencies with reexported headers on a
static library as crossing the apex boundary because the dependency
tag was overwritten from SharedFromStaticDepTag to sharedExportDepTag,
causing FromStatic to be false.

Bug: 162437057
Test: m checkbuild
Change-Id: I514b90aeb0f1477045e92b46d17336d4fb2fb62c
2020-07-29 13:22:33 -07:00
Colin Cross
4fbb5e0234 Handle static unwinder in ltoDepsMutator
The implementation before libraryDependencyTag was added failed to
treat the libgcc_unwind dependency as a static library when traversing
dependencies for LTO because it didn't handle staticUnwinderDepTag.

Bug: 162437057
Test: m checkbuild
Change-Id: Iccc96c0daa0379f51eb975c51fd5e8c507a0daba
2020-07-29 13:22:33 -07:00
Colin Cross
370173e0af Expose all shared and header libraries to Make
The implementation before libraryDependencyTag was added failed to
expose some shared or header libraries because it didn't handle the
headerExportDepTag or SharedFromStaticDepTag tags.

Bug: 162437057
Test: m checkbuild
Change-Id: Ie477de70faa31cca8afaa753ea1c0c39586858c7
2020-07-29 13:22:33 -07:00
Colin Cross
6e511a9a9f Add libraryDependencyTag to track dependencies on static and shared libraries
dependencyTag uses a set of predefined tags to identify different types
of dependencies.  There are already multiple bits of metadata stored
in the dependency tag (Library, Shared, ReexportFlags), and supporting
them all requires a combinatorial explosion of predefined tags and
causes issues when using equality comparisons if a new bit of metadata
is added.

Add a new libraryDependencyTag type that will contain the metadata
bits, and replace the quality comparisons with checks on the metadata
bits.

There are 5 TODOs where modifying the checks identified problems with
the existing checks.  These were left in place to produce identical
build output and will be fixed separately.

Bug: 162437057
Test: no change to build.ninja or {Android,make_vars,late}-${TARGET_PRODUCT}.mk
Change-Id: I72d4207dcf381c07c92e00e5a03968ebb5ed8d30
2020-07-29 13:22:30 -07:00
Jasraj Bedi
bb4511df94 Added write only sanitizer for ASAN and HWASAN
Bug: 162024969
Test: Successfully builds targets for both host and device

"writeonly" flag in SANITIZE_(HOST|TARGET) enables it with "address"
and "hwaddress"

Change-Id: Ia89d43230deef15a67dee09ed015fea14f0717ff
2020-07-29 20:13:53 +00:00
Treehugger Robot
51dba16ce7 Merge "Inclusive fix: Replace sanity with validation in cc.go." am: afb7c1b7e9 am: b04b2e0ca4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1374703

Change-Id: I8f2a5ff3578cf625b7615a7957701573185853f9
2020-07-29 14:01:28 +00:00
Treehugger Robot
afb7c1b7e9 Merge "Inclusive fix: Replace sanity with validation in cc.go." 2020-07-29 13:24:15 +00:00
Treehugger Robot
41033816b2 Merge "Update language to comply with Android's inclusive language guidance" am: 0fbbc904b8 am: 3c8b1a91ae
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1374756

Change-Id: Icb90cc103d96654ff3ffa62960ceb368a94b53ad
2020-07-29 08:48:41 +00:00
Treehugger Robot
0fbbc904b8 Merge "Update language to comply with Android's inclusive language guidance" 2020-07-29 08:10:52 +00:00
Treehugger Robot
312390eab6 Merge "Update language to comply with Android's inclusive language guidance" am: c92a48ffa7 am: 8c785bcb64
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1373518

Change-Id: Ie99eb89b902d2dea975fa23fe083550cfdf4232d
2020-07-29 01:45:52 +00:00
Treehugger Robot
c92a48ffa7 Merge "Update language to comply with Android's inclusive language guidance" 2020-07-29 01:12:36 +00:00
Patrice Arruda
807cfd2a99 Inclusive fix: Replace sanity with validation in cc.go.
Bug: b/161896447
Test: "lunch 1" and "m nothing"
Change-Id: Ibaba96149763a55a0ff20c338bb98b6f9a2a12b6
2020-07-28 18:35:53 +00:00
Pirama Arumuga Nainar
296ae444b1 Merge "[cc/sanitize] Add Blocklist property" am: eda8499a3c am: bb77ffc496
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1373516

Change-Id: I73bf9a823b80a58690ddb1ede93dbee7e4635f77
2020-07-28 17:55:46 +00:00
Pirama Arumuga Nainar
eda8499a3c Merge "[cc/sanitize] Add Blocklist property" 2020-07-28 17:21:59 +00:00
Yo Chiang
08fac0c25f Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for
reference

Bug: 161896447
Test: TH
Change-Id: I9bb7178518c3f9dec0fe0a6dbd8d1a8e19a6b495
2020-07-29 01:10:11 +08:00
Treehugger Robot
8eff6a65bc Merge "Rename CFI blocklist files." am: 75117fcdd0 am: 204ffe38e3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1373377

Change-Id: I8233fc5410b4ac5376230764298e388a7b331729
2020-07-28 16:20:34 +00:00
Treehugger Robot
75117fcdd0 Merge "Rename CFI blocklist files." 2020-07-28 15:59:47 +00:00
Colin Cross
9ff5a66f03 Merge changes from topic "revert-1366377-prebuilt_build_tool_make-RMDAHCHNNX" am: 96d4f4550a am: db21367de5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1371195

Change-Id: Ia74d51c6399693526bfe4dd192962698c97810d6
2020-07-28 02:21:15 +00:00
Colin Cross
96d4f4550a Merge changes from topic "revert-1366377-prebuilt_build_tool_make-RMDAHCHNNX"
* changes:
  Revert "Add prebuilt_build_tool to allow genrules to use prebuil..."
  Revert "Switch cc's use of bison and flex to prebuilt_build_tool"
  Revert "Fix builds with absolute OUT_DIR"
2020-07-28 01:52:25 +00:00
Kiyoung Kim
019c1a9034 Merge "Deprecate VNDK-Lite" am: 1b478e57a0 am: b0c5e33791
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1351464

Change-Id: I496f158aaa05ad72bbf6f22985a90a76d7d68bf0
2020-07-28 00:59:00 +00:00
Kiyoung Kim
1b478e57a0 Merge "Deprecate VNDK-Lite" 2020-07-28 00:36:11 +00:00
Pirama Arumuga Nainar
6c4ccca7b7 [cc/sanitize] Add Blocklist property
This will eventually replace the Blacklist property.

Update language to comply with Android’s inclusive language guidance

See https://source.android.com/setup/contribute/respectful-code for
reference

Bug: 161896447
Bug: 162245450
Test: build topic
Change-Id: I3c2609c791c27b8ba3bcb55f79304b78bce1f518
2020-07-27 13:37:05 -07:00
Dan Albert
f740ed01ff Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 161896447
Test: None
Change-Id: I05f296357c7993088190ef45e49fb8e3a02559d6
2020-07-27 13:21:10 -07:00
Pirama Arumuga Nainar
eb8d403273 Rename CFI blocklist files.
Update language to comply with Android’s inclusive language guidance

See https://source.android.com/setup/contribute/respectful-code for
reference

Bug: 161896447
Test: build
Change-Id: I3de274e58135660e102c276a9822a2ef2cd7cba8
2020-07-27 18:37:48 +00:00
David Su
dd18efd95d Revert "Switch cc's use of bison and flex to prebuilt_build_tool"
Revert submission 1366377-prebuilt_build_tool_make

Reason for revert: breaks build
Reverted Changes:
I20bf062bb:Export prebuilt tools to Make
I4bb526492:Move some prebuilt build tool configs to Soong
I195b68813:Support per-module MakeVars
Ibcb257e7b:Fix dependency loop with flex
I6150f0f39:Switch cc's use of bison and flex to prebuilt_buil...
I6939451b8:Reland "Use genrules to build a consistent awk."
Idee60640f:Add prebuilt_build_tool modules for genrule use
I00893172b:Rename bison to bison_bin
I82c26be1c:Add prebuilt_build_tool to allow genrules to use p...

Change-Id: I1ca553ffe4b09250a441b9bc477c3ba98c6f6549
2020-07-24 21:25:00 +00:00
Jooyung Han
fc22012fac Merge "Fix __ANDROID_SDK_VERSION__=0" am: 3992b7c486 am: b96c02671f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1371677

Change-Id: I97d37b0ace05c038a7f6eee6be672f10ce11ffe4
2020-07-24 02:27:35 +00:00
Jooyung Han
3992b7c486 Merge "Fix __ANDROID_SDK_VERSION__=0" 2020-07-24 02:07:03 +00:00
Dan Willemsen
18e6e2d47e Merge "Revert "Support per-module MakeVars"" am: 1a4ab20c1a am: 1ab5fe458a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1371260

Change-Id: Ia6acfc8e5471ab858049ee9becbba5e3fbe094e2
2020-07-23 22:40:18 +00:00
Dan Willemsen
62462de650 Merge changes from topics "prebuilt_build_tool", "prebuilt_build_tool_make" am: 4ec839a251 am: bef2696b56
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1366377

Change-Id: If49014ca1b19a7522f0d679be77e39fbf1f0a622
2020-07-23 22:39:41 +00:00
Dan Willemsen
03c46e7523 Switch cc's use of bison and flex to prebuilt_build_tool am: d2e291ae5c am: d97bee1578
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1366376

Change-Id: Icaa21d4d240b00368d1acfd9becb367ace4eae82
2020-07-23 22:39:36 +00:00
Dan Willemsen
1a4ab20c1a Merge "Revert "Support per-module MakeVars"" 2020-07-23 21:43:04 +00:00
Dan Willemsen
613564eed4 Revert "Support per-module MakeVars"
This reverts commit 2019658b86.

Reason for revert: broke builds where makefiles were using M4 without depending upon it

Change-Id: I18304246e7a8a8f8c2620dd2c65ed77acd256be2
2020-07-23 21:37:35 +00:00
Dan Willemsen
d97bee1578 Switch cc's use of bison and flex to prebuilt_build_tool am: d2e291ae5c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1366376

Change-Id: I8f28910f1578f3e315ea82c804cdefec6a59d971
2020-07-23 21:25:14 +00:00
Dan Willemsen
4ec839a251 Merge changes from topics "prebuilt_build_tool", "prebuilt_build_tool_make"
* changes:
  Support per-module MakeVars
  Switch cc's use of bison and flex to prebuilt_build_tool
  Add prebuilt_build_tool to allow genrules to use prebuilt tools
2020-07-23 21:10:04 +00:00
Jooyung Han
de34d2375f Fix __ANDROID_SDK_VERSION__=0
__ANDROID_SDK_VERSION__ for a cc module means API level of which the
module should work with.

For APEX variants, it should be apex.min_sdk_version and tracked by the
variable cc.Module.apexSdkVersion.

The variable was set in the wrong place and used uninitialized
sometimes, which results __ANDROID_SDK_VERSION__=0.

Bug: n/a
Test: m
Test: checked build.ninja manually
      => no __ANDROID_SDK_VERSION__=0
Change-Id: Iba532b2c62773983414a061f5291a73363322487
2020-07-23 05:01:56 +00:00
Christopher Parsons
f6540ff785 Merge "Create 'cc_prebuilt_test_library_shared' module type" am: 6b3d9c3fe8 am: a8106ebbfb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1341895

Change-Id: I8507c61067bae8b3fa3d6059a10801c1a582984d
2020-07-22 18:10:29 +00:00
Christopher Parsons
6b3d9c3fe8 Merge "Create 'cc_prebuilt_test_library_shared' module type" 2020-07-22 17:35:34 +00:00
Chris Parsons
1f6d90f4c7 Create 'cc_prebuilt_test_library_shared' module type
This new module type allows cc_test modules to depend on prebuilt
shared libraries and have them included as data dependencies alongside
the test binary.

Test: Manually verified to facilitate mk-to-bp migration of
bionic-unit-test prebuilt dependencies (aosp/1339035)

Change-Id: Idbac0854f1f9e2e01bbfa63591de458b61733e17
2020-07-22 16:06:37 +00:00
Yi Kong
60cf02515e Merge changes I90df9c04,I70bb8dc2 am: f9a78248b0 am: a7fcd17a0f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1368617

Change-Id: I2add0c4c151ccd684f0930aad0ce5819920ec127
2020-07-22 01:25:38 +00:00
Yi Kong
f9a78248b0 Merge changes I90df9c04,I70bb8dc2
* changes:
  [pgo] Allow profile gather and use flags to coexist for sampling PGO
  [pgo] Sampling PGO does not require benchmark property
2020-07-22 00:46:42 +00:00
Christopher Parsons
39e1f73131 Merge "Install data_libs using relative_install_path property" am: fef9d4b601 am: 4a016f49a9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1359742

Change-Id: I29f194fa1649a4f36f81f62d0c47c595e07994f5
2020-07-21 18:11:31 +00:00
Yi Kong
a575ff38a8 [pgo] Allow profile gather and use flags to coexist for sampling PGO
Bug: 79161490
Test: presubmit
Change-Id: I90df9c04dbe2a423c06e9a966fe9bcaed0a84a65
2020-07-22 02:01:49 +08:00