Commit Graph

5773 Commits

Author SHA1 Message Date
Colin Cross f58e5e8f24 Merge "Don't propagate ASAN through shared library dependencies" into sc-dev 2021-06-01 17:24:09 +00:00
Colin Cross 58b783b460 Remove unused cc.copyDirectlyInAnyApexDependencyTag
Bug: 183759446
Test: go test ./build/soong/cc
Change-Id: I967f5c42cbf7722843a6455cbc2867a8912033cb
Merged-In: I967f5c42cbf7722843a6455cbc2867a8912033cb
(cherry picked from commit 243f3c250e46ec48640c7f1e71ab1f16372e055c)
2021-05-27 13:13:17 -07:00
Jiyong Park 59fa1e4b7f Merge "Update VndkMustUseVendorVariantList after aidl-freeze-api" into sc-dev 2021-05-25 22:43:41 +00:00
Justin Yun acd459728a Do not filter LLNDK lib from llndk.libraries.txt
llndk.libraries.txt is used to list the LLNDKs for the linkerconfig.
This is also required to define the VNDK snapshot modules of LLNDK
stub libraries.
The list had a filter for hwasan libraries, but the filter must be
used only for the LLNDK_LIBRARIES make variable, but not for the
llndk.libraries.txt file.

Bug: 189070366
Bug: 188716508
Test: m nothing
Test: LLNDK_LIBRARIES in make_vars-*.mk does not include hwasan.
Change-Id: I820dd1161892dc76700aa1d696ea2643764d2052
Merged-In: I820dd1161892dc76700aa1d696ea2643764d2052
(cherry picked from commit 611e886ca73cdab96aaff32b5ff1f86222951dff)
2021-05-25 13:29:48 +09:00
Jiyong Park c110a43b92 Update VndkMustUseVendorVariantList after aidl-freeze-api
Bug: 188713899
Test: m
Change-Id: Ib1287208a1c6cfc40e4c01617b64ce05c6c88f6e
2021-05-24 23:51:19 +09:00
TreeHugger Robot 5ff8e3f567 Merge changes from topic "far-dep-exists" into sc-dev
* changes:
  Check for product variant in addition to core variant.
  Plumb through OtherModuleFarDependencyVariantExists from blueprint.
2021-05-22 12:54:47 +00:00
Pirama Arumuga Nainar dcabea581c [cc/coverage] Define a macro during coverage builds
Bug: http://b/186576313

During a coverage build, pass the __ANDROID_CLANG_COVERAGE__ macro to
native compilations.  This allows tools like dalvikvm and dex2oat, which
would otherwise call _exit(), to write profiles on coverage builds by
calling exit() instead.

Test: `m CLANG_COVERAGE=true NATIVE_COVERAGE_PATHS="art" nothing`
          and check compiler flags in out/soong/build.ninja.
Change-Id: I18315b89170abdd650e4c6c55577688348c42225
(cherry picked from commit 551b06d9e69066baf1b621b20d4b838ac2f28902)
2021-05-21 13:48:41 -07:00
Martin Stjernholm f7a62e6c73 Merge changes I4e7a7ac5,I0c73361b into sc-dev
* changes:
  Record the actual APEXes that a module is part of.
  Rename InApexes -> InApexVariants
2021-05-21 19:22:15 +00:00
Bill Peckham 8f37844151 Check for product variant in addition to core variant.
It's possible that a module will have a product variant
but not a core variant. In that case, we still need to
apply the vendor suffix to the androidmk module name.

Bug: 188720375
Bug: 187963715
Test: Build vendor image using vendor snapshot.

Change-Id: I190fdd707ca23357d1c324c1b1f3318457625f03
Merged-In: I190fdd707ca23357d1c324c1b1f3318457625f03
(cherry picked from commit 4016d7b53e70bdf53dfdc93c8a7969f70fe2eb05)
2021-05-21 11:44:45 +09:00
Justin Yun a42f005bd1 VNDK snapshot may provide LLNDK stub libraries
VNDK snapshots newer than v30 have LLNDK stub libraries. In that
case, the vendor variant for the BOARD_VNDK_VERSION must not be
generated from the LLNDK modules. They are already provided by the
VNDK snapshots.
Generate the vendor variant of the BOARD_VNDK_VERSION only if
BOARD_VNDK_VERSION has an integer value less than or equal to 30.

Bug: 187963715
Bug: 181815415
Test: m nothing
Change-Id: I31e90f4d7e7678c45558f6bf987f5582a4c34f78
Merged-In: I31e90f4d7e7678c45558f6bf987f5582a4c34f78
(cherry picked from commit dee806fd094c81515aa9ec88efd0f594a057afb0)
2021-05-21 08:30:07 +09:00
Jiyong Park 712e8b5b1b Rename InApexes -> InApexVariants
.. in preparation for the upcoming change. This change doesn't alter any
behavior.

InApexes is a misleading name. People expects that it has the list of
soong module names of the APEXes that a module is part of. So, for
example, `core-oj` is a part of both `com.android.art` and
`com.google.android.art`. However, in reality, that's not true. The
field has `com.android.art` only. This is because the two APEXes
(android and Google) have the same apex name which is `com.android.art`.
That apex name is used in various places like the `apex_available` and
allows us to keep using the same name regardless of whether the APEX is
overridden or not.

However, this is causing problems in some cases where the exact list of
soong module names is required. The upcoming change will add a new field
to handle the case and the new field actually will get the name
'InApexes'. So, the existing field is renamed to a less misleading name
`InApexVariants`.

Cherry-picked from https://r.android.com/1710528.

Bug: 180325915
Test: m nothing

Change-Id: I0c73361b452eddb812acd5ebef5dcedaab382436
Merged-In: I0c73361b452eddb812acd5ebef5dcedaab382436
2021-05-20 17:36:22 +01:00
Luke Huang 0573b316d3 Fix the apex compatible issue on the platform Q
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1710971

Bug: 187907243
Change-Id: If81c03e8d828cb9e421e48d887b06d5e7ab37d5f
(cherry picked from commit 0c96eb74e228c80881bc2ccbcf2a9d2df9643bc5)
Merged-In: I9aceb7ba33baa23d193a6d554e7892a5d5f0effa
2021-05-20 12:53:22 +00:00
Colin Cross 3aec9423fe Don't propagate ASAN through shared library dependencies
Propagating enabling ASAN through shared library dependencies
doesn't make much sense, because only the non-ASAN variant is exposed
to Make, leading to an non-installed dependency.

Bug: 186487510
Test: TestAsan
Change-Id: I7d3f20f2d10beac09c66c6b6dcb7a34a513ff3b8
Merged-In: I7d3f20f2d10beac09c66c6b6dcb7a34a513ff3b8
(cherry picked from commit af98f58242c043b2f96dd6f415b18354af06b473)
2021-05-18 12:27:25 -07:00
TreeHugger Robot 2ca5b08593 Merge "Define vsr_min_shipping_api_level to cc_test" into sc-dev 2021-05-18 00:42:08 +00:00
Elliott Hughes 0e9cdb04df cc/linker.go: check min_sdk_version.
Checking sdk_version broke mainline code that compiles against a current
API level but needs to be able to run on an older API level.

Bug: http://b/187907243
Test: treehugger
Change-Id: If1192ef2809e39b043f0a384775b6c9e3a8bd619
2021-05-17 17:52:26 +00:00
Justin Yun 9876ffa7b3 Define vsr_min_shipping_api_level to cc_test
test_options in cc_test can have vsr_min_shipping_api_level to define
the minimum shipping api level that checks vendor api level in
addition to the device shipping api level. It can be used for the
tests that have dependency on the vendor api level.
vsr stands for the vendor software requirements.

Bug: 181284704
Test: manual test
Change-Id: I7f2cecd2818d35d86f7c08cb220e0c9db71fe0a8
Merged-In: I7f2cecd2818d35d86f7c08cb220e0c9db71fe0a8
(cherry picked from commit a364cfb69d3c5a3660bc4b19e40b4cd916496682)
2021-05-17 09:30:10 +09:00
Bill Peckham a7eec840cc Merge "Fix missing headers for vndk snapshotted libc" am: 054619d198 am: a1ae5530cb am: 94f308c04a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1708168

Change-Id: I7aa49e3be1ca027ef6a16c8cd3c1b378eb512575
2021-05-14 18:21:23 +00:00
Colin Cross 25c60df217 Merge "Add order-only dependency on shared libraries" am: 9debc21ca3 am: 78894a5ab0 am: 690de6069b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1707986

Change-Id: Id03071cc3809d0c4212839f6be3fec547ae3a61c
2021-05-14 18:19:52 +00:00
Bill Peckham 054619d198 Merge "Fix missing headers for vndk snapshotted libc" 2021-05-14 16:52:11 +00:00
Colin Cross 9debc21ca3 Merge "Add order-only dependency on shared libraries" 2021-05-14 16:48:57 +00:00
Inseob Kim cc12d90753 Fix missing headers for vndk snapshotted libc
VNDK snapshot depends on addExportedGeneratedHeaders to grab generated
headers. This change adds a missing addExportedGeneratedHeaders call to
make libc's headers captured correctly.

Bug: 181326838
Test: VNDK_SNAPSHOT_BUILD_ARTIFACTS=true m dist vndk && unzip -l
out/dist/*.zip

Change-Id: Iaa89b5255c836761a26c77bb27f35f768f49039e
2021-05-14 20:15:55 +09:00
Colin Cross 58dd6a92e5 Add order-only dependency on shared libraries
Improve the dependency accuracy by adding an order-only dependency
on the shared library alongside the existing depenency on the
table of contents file.  The dependency won't cause the module
to be rebuilt when the the shared library changes, but will allow
anything using the ninja graph for sandboxing to know the dependency
exists.

Test: manual
Change-Id: I3accbcabee62fa0ad3eb3d1aaedc5a4bffe27308
2021-05-13 18:01:24 -07:00
Treehugger Robot 0290f6e772 Merge "Soong: check if lndk is needed for apex build" am: ef0439d969 am: 2a4deaaf6d am: 7a89365bc1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1705069

Change-Id: Iaf8d854ab9548591698c1e8240a26124d904a268
2021-05-13 23:23:58 +00:00
Zhijun He ec2858799b Soong: check if lndk is needed for apex build
This is to fix the unnecessary dependencies inclusion
when building apex modules.

Test: Build
Bug: 186306595
Change-Id: I1f3bbdb0a1f97a8338b45ca29c92acf9b20eadd3
2021-05-13 14:04:45 -07:00
Jingwen Chen 8e27e6c226 Merge "bp2build: build //external/scudo/..." am: ccfd7fc939 am: 58344f0391 am: 1c7591cfb9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1704771

Change-Id: I3665975d656141f7919cce5d80eff25ea7edc9d4
2021-05-13 13:23:04 +00:00
Jingwen Chen ccfd7fc939 Merge "bp2build: build //external/scudo/..." 2021-05-13 12:19:43 +00:00
Jingwen Chen d17bb43fe1 Merge "bp2build: export some cc toolchain flags into Starlark." am: 1d35a87072 am: 138b60595c am: a7e79646d3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1698426

Change-Id: Iac3a24bb6a528b1281465ed4a354c95ea01e4a59
2021-05-13 11:29:09 +00:00
Jingwen Chen 1d35a87072 Merge "bp2build: export some cc toolchain flags into Starlark." 2021-05-13 10:31:54 +00:00
Paul Duffin b964b24a51 Merge "Allow module types to force creation of a default APEX variant" am: 9896b3424b am: 05ca6f6919 am: 5c45498964
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1705263

Change-Id: I4365d9d1dfbfcd8bf9aa3f6381ec9470b7ff9921
2021-05-13 09:06:26 +00:00
Paul Duffin 9896b3424b Merge "Allow module types to force creation of a default APEX variant" 2021-05-13 08:07:19 +00:00
Jingwen Chen 75be1cae8f bp2build: build //external/scudo/...
Test: TH
Fixes: 187158841
Change-Id: I73c1d8fe075d2534c2389973b9381405d9389044
2021-05-13 06:25:49 +00:00
Jingwen Chen bf61afb7f7 bp2build: export some cc toolchain flags into Starlark.
This CL exports common/global/device/host clang/ld/ldd flags
from their Ninja variable initialization locations in
cc/config/global.go and cc/config/clang.go to make Bazel's cc_toolchain
and Soong's cc actions more consistent with each other.

This does not handle env-dependent or arch-specific toolchain flags
yet (logic in compiler.go and linker.go).

Test: TH
Bug: 187086342
Bug: 187084737
Bug: 186628704
Bug: 187857770
Change-Id: Ie403d7cd23f35160897b9dd902c799cbf1bd7f0c
2021-05-13 06:25:47 +00:00
Ivan Lozano a072c5ae56 Merge "Refactor vendor snapshot to use LinkableInterface." am: 7ce2dee09e am: 61c475060a am: 001c11e93a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1680606

Change-Id: Ifff15886dba6bda0754d086456a1db3b7524e4ed
2021-05-12 21:13:41 +00:00
Ivan Lozano d7586b6526 Refactor vendor snapshot to use LinkableInterface.
Refactors the vendor snapshot support to use the LinkableInterface
so that support can be extended to Rust. This CL does not add
vendor snapshot support for Rust; that is left for a follow-on CL.

Bug: 184042776
Test: m nothing
Change-Id: Id0c4970ca00053484a52677d182153cbc454c301
2021-05-12 14:01:10 -04:00
Paul Duffin b5769c15a3 Allow module types to force creation of a default APEX variant
Bug: 187910671
Test: m droid
Change-Id: I797d4ab60d15b526744fe6e4df1b55c8b75b0310
2021-05-12 16:16:51 +01:00
Jingwen Chen 0bf1dcc16a bp2build: remove libc_tzcode from denylist. am: 3950cd6ed4 am: 2700ace254 am: 19c563ed78
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1704770

Change-Id: I2c0f87fb73c124d54db0e4a36c9c8e7b8841ee88
2021-05-12 13:18:56 +00:00
Jingwen Chen 3950cd6ed4 bp2build: remove libc_tzcode from denylist.
This now works with --features no_copts_tokenization. With tokenization,
the escaped empty string '\"\"' became an actual empty string '' on the
command line, setting -DWILDABBR to the wrong value.

However, no_copts_tokenization unveiled other problems with Android.bp
flags, such as spaces in existing cflags like
https://cs.android.com/android/platform/superproject/+/master:bionic/libc/Android.bp;l=288;drc=a0a4a6c2967b5b3c02c951ea1145f32ed5564ab9
- this trips up Bazel's copts when generated literally, so the
fix (other than splitting on space and making Soong accept strings that
don't start with dashes as cflags) is to make bp2build split cflags on
spaces before generating them as copts.

Test: bp2build, build bionic/...
Fixes: 186822591
Change-Id: Icf10bd20f6fb81db0b719ca0555fc70c75b91a79
2021-05-12 10:46:15 +00:00
Elliott Hughes 113f08a93f Merge "Use SHT_RELR relocations where possible." am: 4dac3874f1 am: 41f7037e90 am: 52fc6ab060
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1673945

Change-Id: Ia5331b1ec1ebff548a6acc97e8b5c86643c0f336
2021-05-11 22:33:50 +00:00
Elliott Hughes 4dac3874f1 Merge "Use SHT_RELR relocations where possible." 2021-05-11 17:29:39 +00:00
Lukács T. Berki dea80a9701 Merge "Fix typo caused by incorrect git merge." am: 9c9a069ae6 am: 3baab77119 am: e5d18cae1e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1701987

Change-Id: Icaee6dee420654185bef5bb96099a3b4b3555bf7
2021-05-11 07:00:09 +00:00
Lukács T. Berki 9c9a069ae6 Merge "Fix typo caused by incorrect git merge." 2021-05-11 06:01:30 +00:00
Chris Parsons c701d7af75 Handle cc_library shared/static only properties am: 0864831019 am: 6dfc0bbe94 am: ef3ec1f018
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699029

Change-Id: Ic2b4bec306d57a4348e86574bcb34795305b7589
2021-05-10 23:38:40 +00:00
Rupert Shuttleworth 3b413d35a4 Fix typo caused by incorrect git merge.
Test: bazel build //bionic/...
Test: cd cc; go test
Test: cd bp2build; go test
Change-Id: I334e02609203f332384256e990f2c40a016fc9e5
2021-05-10 18:41:51 -04:00
Chris Parsons 0864831019 Handle cc_library shared/static only properties
Also handle whole_static_libs via a different attribute
(whole_archive_deps), separating these dependencies from regular static
deps.

Test: Build //bionic/libdl with bazel in conjunction with bzl
changes

Change-Id: I45019b6127a0d2731592ec35537ca15e77001cc2
2021-05-10 14:06:47 -04:00
Rupert Shuttleworth 9fe8434127 Merge "Add temporary workaround for pack_relocations linker flag conversion for bp2build." am: e8f13bbb04 am: b68f7c11d3 am: 7f8a21cf3e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1700745

Change-Id: Iacaeb308f21318eb085ff1e110fcd8d727bfe928
2021-05-10 11:34:05 +00:00
Rupert Shuttleworth 7d46a4455a Add support for shared_libs in cc_library targets. am: c50fa8dd05 am: b28a33ceca am: 91200c1649
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697794

Change-Id: I800f7fdd859a36b01d458e979e563defc6022d87
2021-05-10 09:55:07 +00:00
Rupert Shuttleworth 143be94016 Add temporary workaround for pack_relocations linker flag conversion for bp2build.
Test: added unit test
Test: bazel build //bionic/...
Change-Id: I28217026f5846820ea2cc32cf8790948a54a9365
2021-05-10 05:17:42 -04:00
Rupert Shuttleworth c50fa8dd05 Add support for shared_libs in cc_library targets.
Test: cd bp2build; go test

Test: bazel build //bionic/...

Test: ./build/bazel/scripts/run_presubmits.sh

Change-Id: I71e279470a0d69b243dd0a2b53ce31842fd36ee4
2021-05-10 03:35:32 -04:00
Elliott Hughes 98004216d9 Merge "Remove most of the remaining references to gccCmd." am: aa4c712989 am: a09ee94843 am: 2aa090f638
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1696319

Change-Id: Ia79aab6e3900694a02e896ddf543e4b194f46027
2021-05-07 19:13:45 +00:00
Elliott Hughes 7d52df4f87 Merge "Remove unused parts of the strip implementation." am: 2e0436c7af am: e21f8f645c am: 9fb4c1bbac
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697656

Change-Id: I893a9e2c01e7f96e5f3712b0611aa69760e58af0
2021-05-07 19:13:35 +00:00