Commit graph

6369 commits

Author SHA1 Message Date
Chih-Hung Hsieh
d0f82fee44 Add tidy-soong, tidy-dir-path, module-tidy targets
* When WITH_TIDY=1, these targets allow quick check of C/C++
  source code with clang-tidy, without building C/C++ binaries.
* For each module with tidy rules, add a module-tidy target, e.g.,
  libart-tidy, libartd-tidy, bionic-benchmarks-tidy, libnativehelper-tidy, etc.
* Add a tidy-soong phony target that depends on all module-tidy targets.
* For each directory X/Y add a tidy-X-Y phony target that depends
  on all *-tidy targets in X/Y and tidy-X-Y-Z for all X/Y/Z directories,
  e.g., tidy-bionic, tidy-bionic-benchmarks, tidy-libnativehelper, etc.
* Only soong modules are collected for now.
  Tidy rules in .mk files will be collected later.
* Some comment lines reformatted by gofmt.

Test: WITH_TIDY=1 make <some_module>-tidy tidy-<some_directory>
Test: WITH_TIDY=1 make tidy-soong
Bug: 199169329
Change-Id: I45aef3875f70288a8e070761e5f083dbbdfa6e94
2021-09-07 14:56:44 -07:00
Chih-hung Hsieh
1b0a86b751 Merge "Add config/tidy.go to per-file owners." am: 63d1a0ab94
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1819238

Change-Id: I1d05b0704a79e02df04a7706d77ccfde19609942
2021-09-07 20:38:42 +00:00
Chih-hung Hsieh
63d1a0ab94 Merge "Add config/tidy.go to per-file owners." 2021-09-07 20:18:05 +00:00
Linzhao Ye
d11722bb82 Merge "Add android.hardware.wifi.hostapd-V1-ndk_platform to VNDK list." am: a0dc31d4a2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1796168

Change-Id: I3676b21992a9c54e8286c970d639c1e31ce748eb
2021-09-07 17:35:53 +00:00
Chih-Hung Hsieh
f92c7154cd Use tidyExternalVendor for external/googletest
* Do not run expensive clang-analyzer-* checks with googletest/*,
  which should be checked upstream.

Test: make WITH_TIDY=1 CLANG_ANALYZER_CHECKS=1
Bug: 198098397
Change-Id: Ic801ffa802b42d4d55ae89553073c926f9eaa351
2021-09-07 10:22:56 -07:00
Chih-Hung Hsieh
04a5dabf9a Add config/tidy.go to per-file owners.
Test: make
Change-Id: I01b7bcd2cb5a766baf7ea8015996b4a782395875
2021-09-07 10:20:49 -07:00
Liz Kammer
7cbf7738f2 Cleanup unused code for bp2build conversion.
This code to support bp2build-specific modules is no longer necessary as
we do not create bp2build modules after https://r.android.com/1792714

Test: build/bazel/ci/bp2build.sh
Change-Id: I20d3c42f7e3516554cfb537fef05ba40d222dbeb
2021-09-07 13:19:21 -04:00
Linzhao Ye
a0dc31d4a2 Merge "Add android.hardware.wifi.hostapd-V1-ndk_platform to VNDK list." 2021-09-07 17:15:33 +00:00
Lukács T. Berki
69b9caf11a Merge "Do not modules in files called "Blueprints"." am: 399dbe0699
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1817961

Change-Id: I754c8b72284ac8a22851f58ad1d03c8e2a90ec3d
2021-09-03 18:38:54 +00:00
Lukács T. Berki
399dbe0699 Merge "Do not modules in files called "Blueprints"." 2021-09-03 18:20:39 +00:00
Matthias Maennich
276f996713 ndk_library: separate abidw and abitidy into separate rules am: c2346f1c21
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1818334

Change-Id: Iee14342d6f062b7ed84305e038505c025fbbc849
2021-09-03 13:03:42 +00:00
Matthias Maennich
c2346f1c21 ndk_library: separate abidw and abitidy into separate rules
Both processes might consume a large amount of memory when analyzing
library ABIs. By chaining them via a pipe we keep the same
representation twice in memory. That can introduce a problematic peak
memory consumption. Hence, split them apart into separate rules that
depend on each other.

Bug: 191235788
Test: m out/soong/abi-dumps/ndk/28/x86_64/libc/abi.xml
Signed-off-by: Matthias Maennich <maennich@google.com>
Change-Id: Ia0264a5ede5b2c2a3c2e3fbe968c11d36acf33c2
2021-09-02 21:04:15 +01:00
Lukacs T. Berki
b838b0a147 Do not modules in files called "Blueprints".
The only case for this was Blueprint itself at build/blueprint, but with
that being a part of Soong, this special case is not necessary anymore.

Test: Presubmits.
Change-Id: Icc51cd80bd43f936a97018061cfbf76fc385e4c3
2021-09-02 11:46:24 +02:00
Chris Ye
50ef6e204a Add android.hardware.wifi.hostapd-V1-ndk_platform to VNDK list.
Bug: 194806512
Test: Boot up.
Change-Id: I50518b0291dd40dc051c340faa2641c4cf5952d4
2021-09-01 15:34:12 -07:00
Chih-hung Hsieh
e1d5c9fdd0 Merge "RBE should not copy source file back to local" am: 7686708a43
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1814116

Change-Id: Id774c8148eb900217d42d41258d6f2407395f24b
2021-09-01 20:55:02 +00:00
Chih-hung Hsieh
7686708a43 Merge "RBE should not copy source file back to local" 2021-09-01 20:43:00 +00:00
Treehugger Robot
05ac706e6f Merge "Refactor SdkMemberType.AddDependencies()" am: a36ffdead5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1808897

Change-Id: I0535c811329b9101059bf9a8953ee203335d2cb4
2021-08-31 19:08:38 +00:00
Treehugger Robot
a36ffdead5 Merge "Refactor SdkMemberType.AddDependencies()" 2021-08-31 18:53:59 +00:00
Treehugger Robot
e3e7ca657b Merge "Deprecate group_static_libs property" am: add0b0880e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1814113

Change-Id: Ia5711d638317dcda58628e76b1ba3919f2314cb4
2021-08-31 16:47:56 +00:00
Treehugger Robot
add0b0880e Merge "Deprecate group_static_libs property" 2021-08-31 16:35:18 +00:00
Paul Duffin
296701e35b Refactor SdkMemberType.AddDependencies()
Replaces the BottomUpMutatorContext parameter with a new
SdkDependencyContext type that extends BottomUpMutatorContext. This is
to allow the sdk to pass additional information to the implementations
of that method to allow the behavior to be more finely tuned.

Bug: 195754365
Test: m nothing
Change-Id: I69c6d2c523934eb67d7a7e6c55c241e9b8a81773
2021-08-31 17:07:07 +01:00
Treehugger Robot
2ae5bdd01c Merge "No clang-analyzer-* checks by default for generated files" am: 09d1c71abd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1814102

Change-Id: Ief60efc7a45ff1cf7ab67b92b6cd2ef61d87fea7
2021-08-31 00:03:43 +00:00
Treehugger Robot
09d1c71abd Merge "No clang-analyzer-* checks by default for generated files" 2021-08-30 23:50:36 +00:00
Treehugger Robot
c149ae2622 Merge "include vendor linked-libraries in fuzz target bundles" am: c2ac3ee294
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1811239

Change-Id: Ib3eb68bff8e89b1d910a09d114a57a173bde3ce4
2021-08-30 23:24:55 +00:00
LaMont Jones
5569d6eb47 Deprecate group_static_libs property
We now default to lld for platform builds, removing all need for this
property.  For more details, see "Effecient archive file handling" in
https://lld.llvm.org/NewLLD.html#key-concepts

Bug: 189475744
Test: Manual build succeeds
Change-Id: If1104d68b13de8c7afab35c1741a68f64394b448
2021-08-30 23:13:03 +00:00
Treehugger Robot
c2ac3ee294 Merge "include vendor linked-libraries in fuzz target bundles" 2021-08-30 23:11:45 +00:00
Chih-Hung Hsieh
062e934a9e No clang-analyzer-* checks by default for generated files
Test: make with WITH_TIDY=1 CLANG_ANALYZER_CHECKS=1

Bug: 198098397
Change-Id: I386be0b4ee0fcc1785b2eeb8d1eb26ced68246d7
2021-08-30 15:08:24 -07:00
Chih-Hung Hsieh
fde8e6d387 RBE should not copy source file back to local
Test: make with default RBE variables plus:
WITH_TIDY=1 CLANG_ANALYZER_CHECKS=1
RBE_CLANG_TIDY=true
RBE_CLANG_TIDY_EXEC_STRATEGY=remote_local_fallback

Bug: b/157147559
Change-Id: I1c0106312910919cfda99b816cc8d0f9731b8bd1
2021-08-30 12:49:39 -07:00
Pirama Arumuga Nainar
a5bc4aaabd [cc] Switch to -fsanitize-ignorelist am: 582fc2d1dd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1811240

Change-Id: I67be5ca57a384a19b5425288f01af73ab65deda3
2021-08-30 04:54:30 +00:00
Pirama Arumuga Nainar
582fc2d1dd [cc] Switch to -fsanitize-ignorelist
Upstream added this flag to replace -fsanitize-blacklist.

Test: presubmit
Change-Id: Iad6a1ac47b3a5693ed2107f491cbb36ac9f630ff
2021-08-27 15:12:56 -07:00
Kris Alder
756ec8d8f1 include vendor linked-libraries in fuzz target bundles
Without this, any libraries with vendor: true set won't be included.

Bug: 197917632
Test: make haiku, run several fuzz targets on a device
Change-Id: Icab8d3f17d1f07f49940ee0ea52d9312a925affa
2021-08-27 22:08:29 +00:00
Nicolas Geoffray
9e1902daca Merge "Add exclude_runtime_libs to more targets." am: 7e4c05fcc8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1810756

Change-Id: I170171b9b1edc4551e2c89452c49ed1274b0267f
2021-08-27 11:43:58 +00:00
Martin Stjernholm
3aa9544ec1 Add exclude_runtime_libs to more targets.
Test: `m droid` with https://r.android.com/1810717
Bug: 197856821
Change-Id: I4c93ae4b1f686796827a9635ba4ed50db00e6a8c
2021-08-26 17:29:49 +01:00
Jiyong Park
b4adefa58e Merge changes I15328e0b,I731227c2 am: 19312d4224
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1808218

Change-Id: I58224f0fc056f174567241a13d9eb54dbaef5d12
2021-08-25 22:48:34 +00:00
Jiyong Park
19312d4224 Merge changes I15328e0b,I731227c2
* changes:
  crt objects for APEX and vendor variants have correct target API levels
  crt modules produces cc rules for testing
2021-08-25 22:30:40 +00:00
Florian Mayer
f38f955bdb Merge "Use new pass manager for HWASan builds." am: 35fc86c9cf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1802330

Change-Id: Ieaef02fc55baa0fd76c79659192a29fde5876d73
2021-08-25 10:57:59 +00:00
Florian Mayer
35fc86c9cf Merge "Use new pass manager for HWASan builds." 2021-08-25 10:39:37 +00:00
Jiyong Park
5df7bd33f7 crt objects for APEX and vendor variants have correct target API levels
Previously, crt objects for APEX and vendor variants targetted API level
16 regardless of their context. For example, even if BOARD_VNDK_VERSION
is set to 29, or an APEX has `min_sdk_version: "29"`, the target API
level was from `min_sdk_version` property of the crt object which is set
to 16.

The meaning of min_sdk_version is quite different when it comes to crt
objects. It means the lowest API level that it CAN target for. It does
NOT mean the API level it SHOULD always target.

This has caused some other problems like TLS segment underalignment for
vendor libraries because the vendor libraries were all built with TLS
layout from API level 16.

This change fixes the problem by correctly implementing the different
semantic of min_sdk_version for crt objects.

Bug: N/A
Test: m nothing

Change-Id: I15328e0b6cbabbe151dd65c7469c6355e167b78a
2021-08-25 16:26:47 +09:00
Jiyong Park
7549d460f0 crt modules produces cc rules for testing
Previously, crt modules didn't produce cc rules because they didn't have
any input src files set. This prevented us from having a test which
checks the cflags of the crt modules.

Fixing that by adding source file to the crt modules. crtbrand is also
added as an 'objs' dep, because otherwise partialLd rules won't be
generated.

Bug: N/A
Test: m nothing
Change-Id: I731227c20c662c876c40f0c41e1769a271e2c643
2021-08-25 16:16:03 +09:00
Sophie Zheng
5e640b6b45 Merge "Also generate api lists based on symbol files for cc_library rule during build time." am: d9287b6c35
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1797135

Change-Id: Ie272b922a62dbb655535fef3a4c1888d4019cedb
2021-08-25 04:29:18 +00:00
Sophie Zheng
d9287b6c35 Merge "Also generate api lists based on symbol files for cc_library rule during build time." 2021-08-25 04:16:34 +00:00
Treehugger Robot
c07549c715 Merge changes from topic "ninja_static" am: c5e452b2c5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1801111

Change-Id: Ia8cacb28044eb4496c1d713dcf5ffada6b68c907
2021-08-25 02:41:54 +00:00
Treehugger Robot
c5e452b2c5 Merge changes from topic "ninja_static"
* changes:
  Fix crtend for musl static binaries
  Support static_executable: true for musl builds
  Use SystemSharedLibs as StaticLibs for static executables
2021-08-25 02:28:07 +00:00
sophiez
4c4f80326d Also generate api lists based on symbol files for cc_library rule during build time.
Test: build/soong/soong_ui.bash --make-mode SKIP_ABI_CHECKS=true TARGET_PRODUCT=aosp_cf_x86_phone TARGET_BUILD_VARIANT=userdebug droid dist DIST_DIR=/usr/local/google/home/sophiez/my_dist_dir EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true CLANG_COVERAGE=true SKIP_BOOT_JARS_CHECK=true

Change-Id: Ic857c14c5c258b8f4d150cc71ce9eabce33d7d54
2021-08-24 17:39:45 -07:00
Colin Cross
f26b466cad Fix crtend for musl static binaries
Bug: 190084016
Test: aosp-build-tools linux_musl build
Change-Id: Ia78884cd24f5b7d8aa8207268539cfb453666699
2021-08-24 13:39:02 -07:00
Colin Cross
a793db33a2 Support static_executable: true for musl builds
Bug: 190084016
Test: aosp-build-tools linux_musl build
Change-Id: I630c54033c44ddd6b54388ed36642629cf2e4e5b
2021-08-24 13:39:02 -07:00
Colin Cross
450744e718 Use SystemSharedLibs as StaticLibs for static executables
Shared libraries are ignored for static executables, treat
SystemSharedLibs as StaticLibs to avoid every static executable
having to list libc as a static dependency.

Test: m checkbuild
Change-Id: I02442a1a2a8d4164ec3dd389a16da2346e2d8751
2021-08-24 13:39:02 -07:00
Treehugger Robot
a41f24c545 Merge "Apply pylint to build/soong/cc/ndk_api_coverage_parser" am: 373e71c5d4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1797008

Change-Id: I4bfd96c5da8cba12fb1db0059db6f85e2aede684
2021-08-23 22:57:13 +00:00
Treehugger Robot
373e71c5d4 Merge "Apply pylint to build/soong/cc/ndk_api_coverage_parser" 2021-08-23 22:42:05 +00:00
Colin Cross
a07b7cde23 Merge "Set ANDROID_HOST_MUSL for musl builds" am: b3c68004af
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1797128

Change-Id: I507b8c13036a6fcd639846641274bffb1f545446
2021-08-23 19:03:04 +00:00
Colin Cross
b3c68004af Merge "Set ANDROID_HOST_MUSL for musl builds" 2021-08-23 18:47:40 +00:00
Florian Mayer
7c02c0883a Use new pass manager for HWASan builds.
Now that we have rolled to a sufficiently new clang, HWASan also works
with the new pass manager.

Bug: 135298400
Test: introduce memory safety bug and verify HWASan gets triggered.
Change-Id: I497ca6542971569cbcad949780e4c7df5b0bfb44
2021-08-20 10:07:20 +01:00
Treehugger Robot
bc3bbf81bc Merge "Revert "Revert "Apply pylint to cc/symbolfile""" am: 99d5a0f5c9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1802996

Change-Id: Iadfdedc4664a3e8717d29ddaa143acf8c71c18e6
2021-08-19 21:07:14 +00:00
Treehugger Robot
99d5a0f5c9 Merge "Revert "Revert "Apply pylint to cc/symbolfile""" 2021-08-19 20:51:40 +00:00
Spandan Das
3f5659f268 Revert "Revert "Apply pylint to cc/symbolfile""
This reverts commit ea28f4cae7.

Reason for revert: Postsubmit failure was unrelated, and was fixed by this revert CL aosp/1802327

Change-Id: I2693b17c2261cfc3dce0ed69baeb2d1f45f784f8
2021-08-19 19:31:54 +00:00
Treehugger Robot
242d45b1fa Merge "Revert "Apply pylint to cc/symbolfile"" am: 9ab1e685ee
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1801789

Change-Id: I5d42a63f1af53a7c08691fd8361cb171b32d5ad9
2021-08-19 11:54:58 +00:00
Treehugger Robot
9ab1e685ee Merge "Revert "Apply pylint to cc/symbolfile"" 2021-08-19 11:43:17 +00:00
Junwei Wang
ea28f4cae7 Revert "Apply pylint to cc/symbolfile"
This reverts commit 73de70264a.

Reason for revert: Broken build 7651218 on aosp-master on aosp_x86_64-userdebug -- b/197190129

Change-Id: I18387e5d2765fecb292127d09e3bbe7cf19b5efd
2021-08-19 08:10:05 +00:00
Treehugger Robot
f82cdf018f Merge "Collect info on non-cc sources in a cc module." am: 4132ef45bb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1798371

Change-Id: I5195d3f4e0af043048f7570b69d9000d8775f947
2021-08-19 06:07:29 +00:00
Treehugger Robot
4132ef45bb Merge "Collect info on non-cc sources in a cc module." 2021-08-19 05:55:43 +00:00
Matthew Maurer
1678ccaeaa Merge changes I9682b978,I35465715,I9c5aa5f3,I1c76e620 am: a8b1ab0370
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1774010

Change-Id: I7d46bcfc463f859f6c44d6fae95abf6792aba15c
2021-08-19 03:13:16 +00:00
Matthew Maurer
a8b1ab0370 Merge changes I9682b978,I35465715,I9c5aa5f3,I1c76e620
* changes:
  Support Rust in Ramdisk
  Support Rust in native-bridge
  Support Rust in Product
  Support Rust in Recovery
2021-08-19 02:55:46 +00:00
Liz Kammer
680bd2dd0a Merge "Don't create a new module for bp2build conversion." am: 380dbb9327
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1792714

Change-Id: Ie7d6d5908d06f14121691f7aa0f57c7c7303e67a
2021-08-18 19:44:01 +00:00
Liz Kammer
380dbb9327 Merge "Don't create a new module for bp2build conversion." 2021-08-18 19:28:20 +00:00
Spandan Das
30eefd8b84 Apply pylint to build/soong/cc/ndk_api_coverage_parser
1. Run black --line-length 80 -S build/soong/cc/ndk_api_coverage_parser to
fix formatting
2. Annotate # pylint: disable=line-too-long for multi line strings in
test_ndk_api_coverage_parser.py

Test: pytest
build/soong/cc/ndk_api_coverage_parser/test_ndk_api_coverage_parser.py
Test: pylint --rcfile tools/repohooks/tools/pylintrc
build/soong/cc/ndk_api_coverage_parser
Bug: 195738175

Change-Id: Ifb6d4cd67399eb3fa201185c5d1ebc2544fa316f
2021-08-18 17:17:47 +00:00
Liz Kammer
ba85722ffa Merge "Handle arch-specific/not properties the same." am: 5641096e7f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1792708

Change-Id: Id7960374816f1c7198e3c4b1dbb919ad66a7ff45
2021-08-18 16:16:29 +00:00
Liz Kammer
5641096e7f Merge "Handle arch-specific/not properties the same." 2021-08-18 15:59:49 +00:00
Jay Patel
761bbc16da Merge "Allow PRODUCT_CFI_INCLUDE_PATHS to work with blueprints also" am: eaf5e1b3ec
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1746893

Change-Id: I8995c7a7004b904c9b944bcc384550a76c406702
2021-08-18 15:32:39 +00:00
Jay Patel
eaf5e1b3ec Merge "Allow PRODUCT_CFI_INCLUDE_PATHS to work with blueprints also" 2021-08-18 15:18:41 +00:00
Treehugger Robot
d44adf7ff7 Merge "Apply pylint to cc/symbolfile" am: 68a240badb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1797009

Change-Id: I99f9dc6de576e7c966e6096033e8f232ebe3fa21
2021-08-17 23:04:18 +00:00
Treehugger Robot
68a240badb Merge "Apply pylint to cc/symbolfile" 2021-08-17 22:44:37 +00:00
Matthew Maurer
c6868383f4 Support Rust in Ramdisk
Bug: 178565008
Bug: 165791368
Test: Build and link a Rust library into a ramdisk binary
Change-Id: I9682b978936624133e5a62e94caace0e8958fd0f
2021-08-17 15:08:49 -07:00
Matthew Maurer
a61e31f66a Support Rust in native-bridge
Bug: 178565008
Bug: 165791368
Test: Build and link a Rust library into a native-bridge binary
Change-Id: I3546571530529203d9dbfd62777f20de18c6bd51
2021-08-17 15:08:49 -07:00
Matthew Maurer
52af5b052b Support Rust in Product
Bug: 178565008
Bug: 165791368
Test: Build and link a Rust library into a product binary
Change-Id: I9c5aa5f3a1f323af9aa2aee804635045f1b91bd4
2021-08-17 15:08:49 -07:00
Matthew Maurer
460ee9429e Support Rust in Recovery
Bug: 178565008
Bug: 165791368
Test: Build and link a Rust library into a recovery binary
Change-Id: I1c76e6204019443c567082730a4cf680f4a2a74a
2021-08-17 15:08:49 -07:00
Liz Kammer
74ec1686aa Collect info on non-cc sources in a cc module.
Cc modules in Soong can contain non-cc srcs, collect information on
whether they exist in a module. This is not entirely precise as globs
are not evaluated and srcs from other modules (e.g. filegroups,
generated sources) are not handled; however, it should give a decent
lower bound on how often each type occurs.

Bug: 194938896
Test: SOONG_DUMP_JSON_MODULE_GRAPH=/tmp/json_srcs m nothing and verify
      outputs
Change-Id: I7ad52e863727cf5fa4e8d41cf04d27c86e395c6d
2021-08-17 17:29:51 -04:00
Liz Kammer
2ada09a546 Don't create a new module for bp2build conversion.
A performance improvement for bp2build as Blueprint/Soong no longer have
the overhead of additional modules. The creation of these modules
results in:
* traversal of additional modules for each subsequent mutator
* synchronization over a go channel to collect newly created modules:
https://cs.android.com/android/platform/superproject/+/master:build/blueprint/context.go;l=2594,2600;drc=1602226f23181b8c3fbfcaf3358f0297e839d7d3

We avoid both of these by storing the information directly in the
underlying module.

Also as a fringe benefit, removes some necessary boilerplate for
conversion.

For benchmarks, reduces runtime ~1% for 1% converted, ~24% for 100%
converted. See more: go/benchmarks-for-https:-r.android.com-1792714

Test: ran benchmarks/tests in bp2build
Test: build/bazel/ci/bp2build.sh
Change-Id: Ie9273b8cbab5bc6edac1728067ce184382feb211
2021-08-17 15:57:09 -04:00
Xin Li
8ded89b1bf Merge "Merge sc-dev-plus-aosp-without-vendor@7634622" into stage-aosp-master 2021-08-17 18:14:22 +00:00
Liz Kammer
135bf55281 Handle arch-specific/not properties the same.
Refactor arch-handling code to return a "no-config" axis which allows
handling non-arch configed properties the same way as arch-configed
properties.

Test: build/bazel/ci/bp2build.sh
Change-Id: I485b35fd91c28501fe2055234dc9b278488bf4b5
2021-08-17 13:06:54 -04:00
Colin Cross
7e7b028b88 Set ANDROID_HOST_MUSL for musl builds
Unlike glibc, musl does not #define __MUSL__ on the assumption that
building against musl will be done using a configure script that should
be testing for individual features rather than assuming them based on
using musl.  We don't use configure-based builds, so add a local
ANDROID_HOST_MUSL macro that will be defined for all host musl builds.

Bug: 190084016
Test: m USE_HOST_MUSL=true adb
Change-Id: I44e3ffd1d727fd0ea8b69c3b074fef7e92e2be41
2021-08-16 14:42:53 -07:00
Spandan Das
73de70264a Apply pylint to cc/symbolfile
PEP8 recommends using the not operator over comparision to empty string

Test: pytest build/soong/cc/symbolfile/test_symbolfile.py
Test: pylint --rcfile tools/repohooks/tools/pylintrc
build/soong/cc/symbolfile
Bug: 195738175

Change-Id: I4ed2bc0680beccc19a63d8b3f383983d4dff1baf
2021-08-16 18:59:57 +00:00
Xin Li
3eaa6bcecf Merge sc-dev-plus-aosp-without-vendor@7634622
Merged-In: I10ff6a5df76852f0a22fe3ac22df764528f07423
Change-Id: I71f2397f425a46d346e49ac422d256d7e049c7a2
2021-08-14 06:30:56 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
a38e518eb9 Expose Soong's default clang versions to Bazel
As `CLANG_DEFAULT_*VERSION` static strings

Bug: 192058388
Test: Existing tests pass
Change-Id: I047bc3ad9626bf67c12a0b0ac76943c79fb1b4b0
2021-08-13 17:44:07 +00:00
hamzeh
c0a671fc80 Moving common fuzzing code to fuzz package
Test: make haiku and make haiku-rust
Change-Id: Ife80cc10672f51bd6afbae7061cc9373a2a15e7d
2021-08-11 23:54:15 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
3079d96120 Merge "Lift BazelHandler interface into android/" am: ccb6a01324 am: 4e088148d3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1793169

Change-Id: I4ed98cbd30139e5c2d91164c3447ef295970ae17
2021-08-11 21:36:03 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
0d99045b69 Lift BazelHandler interface into android/
Because it's commonly useful and not cc/ specific
Also export GenerateBazelBuildActions and update uses

Test: Existing tests pass
Change-Id: Ibc6858bb1129afba181a7686dda432defe33b00d
2021-08-11 18:19:40 +00:00
Colin Cross
874af37b5c Merge "Remove libjemalloc5 from default musl libraries" am: 88c5391dbe am: 35cff6ebd9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1784829

Change-Id: Icb3b186b1530211286e3ef75a89d05ab121628c0
2021-08-11 14:43:24 +00:00
Colin Cross
88c5391dbe Merge "Remove libjemalloc5 from default musl libraries" 2021-08-11 14:14:48 +00:00
Christopher Parsons
69dcdd1024 Merge "Support rtti in bp2build" am: 9f7c388337 am: 13923bc3d6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1792107

Change-Id: I8747084d228958c31d532b360a44077845c67495
2021-08-10 21:09:06 +00:00
Christopher Parsons
9f7c388337 Merge "Support rtti in bp2build" 2021-08-10 20:05:44 +00:00
Yabin Cui
c51eaf9d7c Merge "Revert^2 "Switch to clang r428724 13.0.1."" am: 39ff202748 am: 3ce0f54b9e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1792067

Change-Id: Id28c7d9899700adc52687b6f51fae6c0291c3056
2021-08-10 19:54:04 +00:00
Yabin Cui
39ff202748 Merge "Revert^2 "Switch to clang r428724 13.0.1."" 2021-08-10 19:22:15 +00:00
Treehugger Robot
550ed75031 Merge "Support exporting device arch toolchain info" am: 6fd3047115 am: 97cc383f00
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1784827

Change-Id: Ia6e381669455b567356acf0d7350521c5cb42a01
2021-08-10 16:45:25 +00:00
Treehugger Robot
6fd3047115 Merge "Support exporting device arch toolchain info" 2021-08-10 16:11:52 +00:00
Chris Parsons
2c7883941e Support rtti in bp2build
Rtti was already handled by bazel macros, so this change simply
propagates the rtti bit to these macros.

Test: Run bp2build, build //external/libcxxabi:all
Change-Id: I63296db2db868202874c8bd0b1de6310f7bb85c7
2021-08-10 11:58:07 -04:00
Yabin Cui
10bf3b8c00 Revert^2 "Switch to clang r428724 13.0.1."
786c1d41ef

Change-Id: Ic143d1b3375c8258e0e4274339524380de391676
2021-08-10 15:42:10 +00:00
Christopher Parsons
6787777e06 Merge "bp2build: handle system_shared_libs" am: 67d6ccecfc am: 430c7d2c53
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1783210

Change-Id: I7406a36873b6dc626cf89ceab6aa15d4aa05368c
2021-08-09 19:41:50 +00:00
Christopher Parsons
67d6ccecfc Merge "bp2build: handle system_shared_libs" 2021-08-09 19:11:00 +00:00
Chris Parsons
51f8c39261 bp2build: handle system_shared_libs
- If no system_shared_libs is specified, bp2build writes no attribute
value. In this case, the bazel library macros determine the correct
default behavior.
- If any system_shared_libs is specified for any variant, then bp2build
writes the value verbatim. This includes if an empty list is specified,
as this should override defaulting behavior.

Note this defaulting behavior is incomplete and will be incorrect in
corner cases. For example, if, in an Android.bp, system_shared_libs is
specified for os.linux_bionic but not for os.android, then the bazel
default for os.android will be incorrect. However, there are no current
modules in AOSP which fit this case.

As a related fix, supports static struct for cc_library_static.

Also, removes some elements from the bp2build denylist.

Test: mixed_droid CI
Change-Id: Iee5feeaaf05e8e7209c7a90c913173832ad7bf91
2021-08-09 11:41:09 -04:00
Yabin Cui
5659921cbb Merge "Revert "Switch to clang r428724 13.0.1."" am: 01cad0cddc am: 04d221ad04
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1789927

Change-Id: Iaa0bbd11a3ab4b60e0de49a814f55c7dd6570793
2021-08-08 21:31:34 +00:00
Yabin Cui
01cad0cddc Merge "Revert "Switch to clang r428724 13.0.1."" 2021-08-08 21:02:29 +00:00
Yabin Cui
786c1d41ef Revert "Switch to clang r428724 13.0.1."
Revert submission 1743633-switch-to-clang-r428724

Reason for revert: fix build
Reverted Changes:
I824f3bc1c:Update bazel's clang version to clang-r428724
I6c4c26267:Adjust test for compiler update.
I94ab1f2dc:Switch to clang r428724 13.0.1.

Change-Id: I846e904b6e868d4e2be1bd8260ed59fc5464ef68
2021-08-08 20:59:59 +00:00
Yabin Cui
1d0eb600b3 Merge "Switch to clang r428724 13.0.1." am: baeca672c1 am: dd91217745
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1743633

Change-Id: I136abfa3ae1a7de5e8d83819234753891df2ddca
2021-08-08 18:43:11 +00:00
Yabin Cui
baeca672c1 Merge "Switch to clang r428724 13.0.1." 2021-08-08 18:20:22 +00:00
Yabin Cui
e87329c4c5 Switch to clang r428724 13.0.1.
Bug: http://b/190099451
Test: build and boot devices

Change-Id: I94ab1f2dc194ffcec5681708b558af26ced30aae
2021-08-06 18:28:08 +00:00
Stephen Hines
f325197225 Merge "Revert "Make DWARF v5 the default debug information format."" am: fe3bab726d am: 463011ccf9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1788771

Change-Id: I0ec309672bc2c7ed8971791e0b942e6b7c564083
2021-08-06 17:46:31 +00:00
Stephen Hines
fe3bab726d Merge "Revert "Make DWARF v5 the default debug information format."" 2021-08-06 17:04:41 +00:00
Stephen Hines
bb1a17aecb Revert "Make DWARF v5 the default debug information format."
This reverts commit 5e13f86fc8.

libabigail isn't quite ready for DWARF v5 yet, so let's revert this
temporarily.

Bug: http://b/182004844
Bug: http://b/195152239
Bug: http://b/195698910
Test: Builds
Change-Id: I4b1dd8f9e64d19f37c90b8a2433cbb302c7d5105
2021-08-05 17:05:01 -07:00
Elvis Chien
9c99354465 Allow PRODUCT_CFI_INCLUDE_PATHS to work with blueprints also
but disable it for host modules like how it's done for Android.mk

Bug:
179233410

Test:
m -j32

Change-Id: I246cd9163e06997a2b50cd25688370690c8929af
2021-08-04 18:07:51 +08:00
Christian Wailes
8e11a903a9 Merge "Conditionally apply rustdoc flags to third party crates" am: 99bc67a548 am: d793c89474
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1783747

Change-Id: Id56a4a5dd2d8259d6a0d666e403238759885d570
2021-08-03 20:18:47 +00:00
Liz Kammer
003e20e7f8 Merge "Correct isThirdParty check" am: 0f77bb4304 am: 72a3729ced
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1769705

Change-Id: I978766d9e515004b2b39c608793d557d9b876506
2021-08-03 15:34:26 +00:00
Colin Cross
90a8b3abd5 Remove libjemalloc5 from default musl libraries
The musl allocator works now, remove libjemalloc5 from the default
libraries.

Bug: 190084016
Test: prebuilts/build-tools/build-prebuilts.sh --musl
Change-Id: I12ef8112af99f90e10e8a247ddc2eddfd4cd98a0
2021-08-02 13:17:13 -07:00
Liz Kammer
82ad8ccca2 Support exporting device arch toolchain info
Test: bp2build.sh
Bug: 187084665
Change-Id: I49e75f603accab519784dbaf25d85db0010587a3
2021-08-02 14:54:10 -04:00
Chris Wailes
b2703adce4 Conditionally apply rustdoc flags to third party crates
This CL changes the logic in rust/builder.go so that some rustdoc flags
are only applied to external crates.  This will allow us to since
warnings and deal with soft-failures in external crates while allowing
us to be more strict with our internal Rust code.

Bug: 195136952
Test: m rustdoc
Change-Id: Icdde304bbbb323cae9657e8f842f58ae79e811ce
2021-08-02 11:50:34 -07:00
Liz Kammer
067b889762 Correct isThirdParty check
Previously, isThirdParty check was over-selecting for third-party-ness,
the only non-third-party paths were those explicitly excluded from
typically third party directories, results in ~all code being considered
third party.

Updated test to ensure bionic is not considered third party, which fails
without this change.

Test: go soong tests
Change-Id: Id371aaad2ceef2b3163384fa84712397877cbe90
2021-08-02 11:50:34 -07:00
Yuntao Xu
ac11e71333 Merge "remove target from every intermediate depFile" am: 1b05df5fd4 am: eb5bcf21ec
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1782649

Change-Id: I31f83639c6278e82f926e6fabf151966e43ba49a
2021-08-02 16:59:08 +00:00
Yuntao Xu
1b05df5fd4 Merge "remove target from every intermediate depFile" 2021-08-02 16:28:27 +00:00
Dan Willemsen
2cb2b2319b Merge "Bump minimum MacOS version to 10.13" am: db45fb250d am: d7cacef34a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1780977

Change-Id: Ida12392b4751b64261ecdacd2edf1102e16672df
2021-07-30 18:35:48 +00:00
Justin Yun
df032badd8 Rewrite snapshot dependencies for vndk-ext am: 27b9572433 am: 1a45180fe7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1779758

Change-Id: I6413423b86eccb8d28cbfa1213806eb8c7147f7d
2021-07-30 18:35:34 +00:00
Yi-Yo Chiang
e2027b2526 Merge changes from topic "variational-required" am: d7b95f94a1 am: e3c9611b24
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1739833

Change-Id: I00420ba0a1409254125935e8c1a4c3610fa44536
2021-07-30 18:35:25 +00:00
Dan Willemsen
db45fb250d Merge "Bump minimum MacOS version to 10.13" 2021-07-30 17:22:56 +00:00
Yuntao Xu
56cc658b93 remove target from every intermediate depFile
1. The current logic in the rsCppCmdLine only removes the target from the
first intermediated depFile, which is different from the logic in Make, see
https://source.corp.google.com/android/build/make/core/definitions.mk;l=1078
2. The expected logic, as that in Make, is to remove the target from every
intermediate depFile, if there are many, before the concatenation;
3. This bug would cause dependency cycle error, please check the bug number
below for more details;
4. The fix is to make sure the logic here is the same as that in Make.

Bug: 195036632
Test: m CtsRsCppTestCases with the converted Android.bp file (run more than
once to make sure no error occurs)
Test: manually checked the gen/rs/rs.stamp.d file to make sure there
is only one target on the top (the same as that built with the former
Android.mk file)
Test: TreeHugger

Change-Id: If79e3e5e7bc18a6fddcf56c0168daea93726afc6
2021-07-30 09:47:07 -07:00
Justin Yun
27b9572433 Rewrite snapshot dependencies for vndk-ext
VNDK-ext libraries have dependency on VNDK libraries. When building
against snapshots, the dependency must be rewritten with the
snapshots.

Bug: 194864314
Test: m nothing
Change-Id: I1244c6a6590e89b344ab39514bb5142d36b04268
2021-07-30 10:49:02 +00:00
Yi-Yo Chiang
d7b95f94a1 Merge changes from topic "variational-required"
* changes:
  cc/cc.go: Support per-image-variation "required"
  android/androidmk.go: Calls *RequiredModuleNames() to get required modules
2021-07-30 10:09:40 +00:00
Dan Willemsen
3dc4326ce7 Bump minimum MacOS version to 10.13
We've removed all of our buildbots running 10.10, and Android Studio
requires 10.14+, so our oldest users are now the 10.13 buildbots.

Bug: 191879468
Change-Id: Ie9fdb59f12bb672c5f2448cb558f54a2e10039fb
2021-07-29 12:18:29 -07:00
Yi Kong
d6504afaa7 Merge "Fix build on older Macs with universal binary Clang" am: c14f088a5f am: 4d6cdf5ac6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1775267

Change-Id: Ic473c5405a6eb670aa949a3331be2a8fe8a6c658
2021-07-28 11:31:56 +00:00
Yi Kong
c14f088a5f Merge "Fix build on older Macs with universal binary Clang" 2021-07-28 11:05:00 +00:00
Jiyong Park
6ede93608b Add more *-ndk libraries to VndkMustUseVendorVariantList
Some libraries were missing in aosp/1777786.

Bug: 161456198
Bug: 194743866
Test: m on full-eng

Merged-In: I7c7aa1025a876e45fc4779378825d91098164e84
Change-Id: I3cb4dfcf490ddb6b4bd3915232399cebf5e467d5
2021-07-27 02:56:43 +00:00
Jiyong Park
021c24fcff Merge "Fix build" into sc-dev-plus-aosp 2021-07-26 05:38:40 +00:00
Jiyong Park
44a13ac401 *-ndk.so libraries are added to VndkMustUseVendorVariantList
We will replace the ndk_platform backend with the ndk backend. The
former hasn't been deleted yet because there already are references to
it. When the existing references are all replaced with the ndk backend,
we will remove the ndk_platform backend and the corresponding libraries
will be removed from this list.

Bug: 161456198
Test: m

Merged-In: I7c7aa1025a876e45fc4779378825d91098164e84
Change-Id: I7c7aa1025a876e45fc4779378825d91098164e84
(cherry picked from commit b58719c156)
2021-07-26 13:22:49 +09:00
Jiyong Park
b7e666f587 Fix build
android.system.suspend-V1-ndk has added recently.

Bug: 194632673
Test: m
Change-Id: I003f8405e015df396d8c231046edb31c09ddc305
2021-07-26 03:34:59 +00:00
Jiyong Park
a592b6f8e0 Reland: Add more target-specific properties
Following properties are added:

* vendor.header_libs
* platform.cflags
* platform.header_libs
* platform.exclude_shared_libs

These are used in the *-ndk libraries generated from the aidl_interface
modules, so that we can build the platform variants of the libraries
just like the *-ndk_platform libraries. Eventually, we will remove the
*-ndk_platform libraries.

Bug: 161456198
Test: m
Merged-In: I126e272cd29eb1e03662c54bfa8bd64e704adc74
Change-Id: I126e272cd29eb1e03662c54bfa8bd64e704adc74
(cherry picked from commit bb14481408)
2021-07-26 11:19:35 +09:00
TreeHugger Robot
5c4d5ca6cf Merge changes from topic "remove_ndk_platform" into sc-dev-plus-aosp
* changes:
  *-ndk.so libraries are added to VndkMustUseVendorVariantList
  Reland: Add more target-specific properties
2021-07-26 02:00:46 +00:00
Yi-Yo Chiang
c7e044f531 cc/cc.go: Support per-image-variation "required"
Support "core" and "recovery" variants for now. Might add more image
types if needed.

Bug: 191369319
Test: Presubmit
Test: Inspect out/soong/Android-*.mk
Change-Id: Iebab29ed5d6d8fe9c66b6d6e56e00246d10c36b3
2021-07-24 22:44:36 +08:00
Colin Cross
e9a7d0f732 Merge "Reland "Split the x86 host toolchain into glibc and musl variants"" am: dcbc76134d am: 632d3cf202
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1777148

Change-Id: Icca632d52e633a77b26e960bf11cb448d05bbf64
2021-07-24 03:09:27 +00:00
Colin Cross
e4e1d6a9bc Merge "Revert "Split the x86 host toolchain into glibc and musl variants"" am: c5647ca16e am: a199295f7a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1777147

Change-Id: Ie502ec0d1e461c7809175d8a27078e92bb9b7e00
2021-07-23 23:00:47 +00:00
Colin Cross
a45cf21495 Merge changes Idbeb4819,Ifc02f9e5 am: 7628e933b6 am: 038ac4c9bc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1775369

Change-Id: Icb2f36d978b0aee2e883a510029a410d406d1ff3
2021-07-23 23:00:37 +00:00
Colin Cross
528d67e523 Reland "Split the x86 host toolchain into glibc and musl variants"
Split the x86 host toolchain into glibc and musl variants

Create new musl toolchains that are based on the existing glibc
toolchains, and add the necessary flags for musl compiles.

This relands Ifc02f9e5afa61ff758be98b0c962f3a4b53d0546 with changes
for I46672e3a096b6ea94ff4c10e1c31e8fd010a163c.

Bug: 190084016
Change-Id: Iaa9f7a50ff601155ecd73acc5701a2c226be66dc
Test: TestArchMutator
2021-07-23 22:25:36 +00:00
Colin Cross
c5647ca16e Merge "Revert "Split the x86 host toolchain into glibc and musl variants"" 2021-07-23 22:22:11 +00:00
Colin Cross
5d6904e1cf Revert "Split the x86 host toolchain into glibc and musl variants"
This reverts commit 4fb4ef2242.

Reason for revert: crossed with aosp/1775072

Change-Id: Ied922850b810d82627ba4f9ee42f672cfe286c91
2021-07-23 22:20:29 +00:00
Colin Cross
7628e933b6 Merge changes Idbeb4819,Ifc02f9e5
* changes:
  Add dynamic_list property
  Split the x86 host toolchain into glibc and musl variants
2021-07-23 22:08:19 +00:00
Treehugger Robot
fba8644b97 Merge "Remove default_shared_libs" am: 2231f8a21c am: 0cddfa441d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1775072

Change-Id: Id3f0baada1ba1fdb209fdd24569ecbbf3fe99722
2021-07-23 21:28:09 +00:00
Kalesh Singh
9c8a488a5d Merge "Update VndkMustUseVendorVariantList" am: 295ae69b04 am: 63f2974d3f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1774327

Change-Id: Icc603ae51b805371b1332b66b2ae7007c200767f
2021-07-23 21:25:41 +00:00
Treehugger Robot
2231f8a21c Merge "Remove default_shared_libs" 2021-07-23 21:18:51 +00:00
Kalesh Singh
295ae69b04 Merge "Update VndkMustUseVendorVariantList" 2021-07-23 17:16:28 +00:00
Colin Cross
5942238966 Add dynamic_list property
Add a dynamic_list property that is similar to version_script but uses
a -Wl,--dynamic-list flag instead of -Wl,--version-script.

Bug: 190084016
Test: TestLibraryDynamicList
Change-Id: Idbeb4819ce4d92e50c4e9b27ec8f150d566d380a
2021-07-23 10:15:13 -07:00
Colin Cross
4fb4ef2242 Split the x86 host toolchain into glibc and musl variants
Create new musl toolchains that are based on the existing glibc
toolchains, and add the necessary flags for musl compiles.

Bug: 190084016
Test: TestArchMutator
Change-Id: Ifc02f9e5afa61ff758be98b0c962f3a4b53d0546
2021-07-23 08:57:17 -07:00
Christopher Parsons
b46b416998 Merge "Remove bp2build deps mutator" am: 2f1102fe58 am: ba5164965a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1774225

Change-Id: Ief47750896b9ffca5ac375e841288e1b7da8cca0
2021-07-23 15:22:52 +00:00
Colin Cross
1dd4b94aa3 Merge "Remove Fuchsia support from Soong" am: b8d69871a8 am: be588a31d1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1774379

Change-Id: I9e0151ef36eb011f8c942469ca50eff0b781faf6
2021-07-23 15:22:42 +00:00
Christopher Parsons
2f1102fe58 Merge "Remove bp2build deps mutator" 2021-07-23 14:55:40 +00:00
Colin Cross
b8d69871a8 Merge "Remove Fuchsia support from Soong" 2021-07-23 14:54:49 +00:00
Yi Kong
f8e53703f0 Fix build on older Macs with universal binary Clang
Our Clang is not built to handle old linkers by default, so if we do not
configure this explicitly it may attempt to use flags that are not
supported by the version of the Darwin linker installed on the build
machine.

Bug: 191276541
Test: build rs on 10.13
Change-Id: Ia40170b6aeba11fb6997021ec3f73e911e0b057c
2021-07-23 07:54:01 +00:00
Jiyong Park
5b48d9a01b *-ndk.so libraries are added to VndkMustUseVendorVariantList
We will replace the ndk_platform backend with the ndk backend. The
former hasn't been deleted yet because there already are references to
it. When the existing references are all replaced with the ndk backend,
we will remove the ndk_platform backend and the corresponding libraries
will be removed from this list.

Bug: 161456198
Test: m

Merged-In: I7c7aa1025a876e45fc4779378825d91098164e84
Change-Id: I7c7aa1025a876e45fc4779378825d91098164e84
(cherry picked from commit b58719c156)
2021-07-23 12:56:50 +09:00
Jiyong Park
9259a7ee61 Reland: Add more target-specific properties
Following properties are added:

* vendor.header_libs
* platform.cflags
* platform.header_libs
* platform.exclude_shared_libs

These are used in the *-ndk libraries generated from the aidl_interface
modules, so that we can build the platform variants of the libraries
just like the *-ndk_platform libraries. Eventually, we will remove the
*-ndk_platform libraries.

Bug: 161456198
Test: m
Merged-In: I126e272cd29eb1e03662c54bfa8bd64e704adc74
Change-Id: I126e272cd29eb1e03662c54bfa8bd64e704adc74
(cherry picked from commit bb14481408)
2021-07-23 12:55:51 +09:00
Colin Cross
acf474e9bb Merge "Replace android.BuildOs with Config.BuildOS" am: 78fd15f7d6 am: bf2f93f8e8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1773108

Change-Id: Ib6e5eea644f359c59e597943222d3f1f51b564d0
2021-07-23 00:39:59 +00:00
Colin Cross
78fd15f7d6 Merge "Replace android.BuildOs with Config.BuildOS" 2021-07-23 00:07:01 +00:00
Chris Parsons
5a34ffb350 Remove bp2build deps mutator
Refactor bp2build to retrieve modules directly by name, instead of via
DirectDeps. This functions properly as bp2build has no need for variant
information of the blueprint graph.

Test: USE_BAZEL_ANALYSIS=1 m fmtlib
Change-Id: Ief4b67bc56f24929871af772f3a742f07085bf8c
2021-07-22 18:09:34 -04:00
Colin Cross
6b8f4253eb Remove default_shared_libs
system_shared_libs has been modified to have the same behavior as
the newly added default_shared_libs, remove default_shared_libs in
favor of system_shared_libs.

This reverts Ia2349d84c70e503916f90a5d2702e135248f73df and renames
the default_shared_libs property in cc_object (which never had
system_shared_libs) to system_shared_libs.

Bug: 193559105
Test: m checkbuild
Change-Id: I46672e3a096b6ea94ff4c10e1c31e8fd010a163c
2021-07-22 12:10:11 -07:00
Treehugger Robot
9b95e0bc13 Merge "Apply system_shared_libs to all variants" am: 2e4c0eb90e am: 75c2ca900e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1765126

Change-Id: Ie18e6bb3aa92e5ac73301d06cf4426564c19a95a
2021-07-22 19:00:12 +00:00
Treehugger Robot
2e4c0eb90e Merge "Apply system_shared_libs to all variants" 2021-07-22 17:44:32 +00:00
Kalesh Singh
ada357aeb4 Update VndkMustUseVendorVariantList
Add android.system.suspend-V1-ndk_platform

Bug: 170260236
Test: m
Change-Id: I93b84112e0fcdd3593ca196308338945376acc1a
2021-07-22 06:34:13 +00:00
Colin Cross
cb0ac95bde Remove Fuchsia support from Soong
Bug: 194215932
Test: m checkbuild
Change-Id: Id7d3964d9417f8b0938af9b168bb4c00cebe9390
2021-07-21 20:37:46 -07:00
Kiyoung Kim
52b6b4a768 Merge changes I3574d2a1,Ifb69fb3d am: 5d96f64d04 am: 6a7257a450
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1771025

Change-Id: I39bdfdbd3ffe8e9471b54480f557206ec93a3e26
2021-07-22 01:30:55 +00:00
Kiyoung Kim
5d96f64d04 Merge changes I3574d2a1,Ifb69fb3d
* changes:
  Update prebuilt_etc available for snapshot
  Separate snapshot definition
2021-07-22 00:57:39 +00:00
Liz Kammer
5a084f028d Add deps for system_shared_libs for all axes am: 561923e10d am: 9919c2ea1a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1774005

Change-Id: I8bb43e96a011495d530ef8cbee7cd5f868729600
2021-07-21 17:56:05 +00:00
Liz Kammer
561923e10d Add deps for system_shared_libs for all axes
This is the same hack we have currently, but applying it to the various
axes to unblock a Soong/bionic refactoring CL.

Test: bp2build.sh
Change-Id: Ie068461201bb3c18b9f385026e96cca2c7fe6b97
2021-07-21 10:15:56 -04:00
Hsin-Yi Chen
9ce14e7d03 Merge "Specify working directory and OUT_DIR to ABI tools" am: 1f019f945d am: 28bca125df
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1760699

Change-Id: I526b9a95e11e4e36ff80a9d9387240f979a0e3b3
2021-07-21 07:45:55 +00:00
Hsin-Yi Chen
1f019f945d Merge "Specify working directory and OUT_DIR to ABI tools" 2021-07-21 07:19:13 +00:00
Colin Cross
0c66bc615b Replace android.BuildOs with Config.BuildOS
Replace the android.BuildOs constant with Config.BuildOS so that it
can vary based on the product config.

Bug: 190084016
Test: all Soong tests
Change-Id: Ia67f872d8b2ab788747a22e3a9659dc21c9775cd
2021-07-20 12:46:48 -07:00
Kiyoung Kim
ae11c233b5 Update prebuilt_etc available for snapshot
Make prebuilt_etc module available for the snapshot. This change
includes implementing snapshot interface for the prebuilt_etc module so
it can be added to the snapshot from the fake snapshot, or when the
module is specified in the list.

Bug: 192430376
Test: m nothing passed
Test: Checked if the module is included in the snapshot properly
Change-Id: I3574d2a1b8f8f4e5f083f3913e8768f5088d0c46
2021-07-20 11:24:03 +09:00
Colin Cross
9e7c62b79a Merge "Remove clang indirection, affects command line ordering" am: ae86338676 am: eeec86e85e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1767414

Change-Id: I9f209242598bb46a2f73cea6acd2fee88bf8cfc8
2021-07-19 22:16:15 +00:00
Colin Cross
ae86338676 Merge "Remove clang indirection, affects command line ordering" 2021-07-19 21:46:52 +00:00
Treehugger Robot
266d97fa2a Merge "Refactoring fuzz packaging code" am: 0b45f0b90f am: c62f2deb45
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1758711

Change-Id: Ib7b2a903e1f5a8a52c38272704c67b9e92cfef94
2021-07-19 20:34:57 +00:00
Hsin-Yi Chen
79781a94f0 Specify working directory and OUT_DIR to ABI tools
This commit adds `--root-dir . --root-dir $OUT_DIR:out` to the commands
of ABI tools. If the user sets non-default $OUT_DIR, the tools write
"out" instead of the actual $OUT_DIR to the ABI dumps.

Test: export OUT_DIR=~/aosp_out ; \
      make libstagefright_bufferqueue_helper.vendor
Bug: 192157880
Change-Id: I4e2d1b252273106fb6a3ecfa1727d5c91ba03444
2021-07-19 03:46:31 +00:00
Kiyoung Kim
48f3778cb4 Separate snapshot definition
Current snapshot definition is located in the CC module, so it is
difficult to capture non-CC module (such as prebuilt_etc) to the
snapshot. Separate general snapshot definition from cc so other modules
can also define its own snapshot.

Bug: 192430376
Test: m nothing passed
Change-Id: Ifb69fb3d2ec555b629aa31ec03e7ce5831fd3063
2021-07-19 11:42:32 +09:00
hamzeh
41ad881e16 Refactoring fuzz packaging code
Rust and cc fuzz packaging have common. This change is to put this
common methods and fields into fuzz_common.

Test: make haiku and make haiku-rust ran locally and verify corpus,
dict and config are packaged along with the executable.

Change-Id: I04bf535cd2597ed8b2bd3d8e6ea8c28f38bdc18b
2021-07-16 17:43:33 -07:00
Colin Cross
0369572907 Merge "Rename ninja variables with Clang in the name" am: 51736b82fc am: ac5a348ce9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1767413

Change-Id: Ib314260932248c5f2d0ca0f2e567fa61eb91c1e2
2021-07-16 01:06:04 +00:00
Colin Cross
7a19faf969 Merge changes I29bf144b,Id2879453 am: 908fbe200e am: a103247992
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1767412

Change-Id: Ib40d4dae318eb81f1bd04cd061af664cd4994238
2021-07-16 00:30:14 +00:00
Colin Cross
51736b82fc Merge "Rename ninja variables with Clang in the name" 2021-07-16 00:28:13 +00:00
Colin Cross
908fbe200e Merge changes I29bf144b,Id2879453
* changes:
  Remove more clang indirection without affecting command lines
  Remove clang indirection without affecting build.ninja
2021-07-16 00:00:22 +00:00
Colin Cross
9cc59c1cbd Remove clang indirection, affects command line ordering
Move the last clang-specific list into the common global list.  This
affects the command line flag ordering due to the the -fdebug-prefix-map=
flag that is added by an init() function, which will force every native
rule to recompile.

Bug: 68947919
Test: m checkbuild
Change-Id: Ic2509e61e9555e9483b92a18d7e8d9913b7125cc
2021-07-14 20:55:25 -07:00
Colin Cross
0523ba2675 Rename ninja variables with Clang in the name
Rename the ninja variables that have an extraneous Clang in the name,
since there are no longer any non-Clang variables.

Bug: 68947919
Test: no change to command lines used to build mmma bionic
Change-Id: I081d5e1d423a66d55faece6cb1d265cd5e504d5f
2021-07-14 20:55:23 -07:00
Colin Cross
c8bed31f56 Remove more clang indirection without affecting command lines
Squash the contents of some clang-specific ninja variables into
the main ninja variables.

Bug: 68947919
Test: no change to command lines used to build mmma bionic
Change-Id: I29bf144b03307a7893376e68d82f12f5c40e8e95
2021-07-14 20:55:02 -07:00
Colin Cross
33bac24bb9 Remove clang indirection without affecting build.ninja
Remove cflags that are not handled by clang from the global defaults,
and remove calls to ClangFilterUnknownCflags.

Squash lists of clang-specific default flags into the main default
flags lists.

Rename Toolchain.Clang*flags to Toolchain.*flags.

Rename Go variables with Clang in the name that have no non-Clang
equivalent.

Remove unused ninja variables.

Bug: 68947919
Test: no change to build.ninja for aosp_cf_x86_64_phone-userdebug or aosp_crosshatch-userdebug
Change-Id: Id287945315d53e5eaef197adbbb4f1302f2e3680
2021-07-14 20:54:22 -07:00
Treehugger Robot
cb656bb1ca Merge "Export paths for the snapshot modules" am: 5445c84f4d am: e7154ca8e7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1762847

Change-Id: I878703ad9b1f6f2fb36909603023110f9e88cf3a
2021-07-14 00:36:06 +00:00
Treehugger Robot
5445c84f4d Merge "Export paths for the snapshot modules" 2021-07-14 00:08:12 +00:00
Colin Cross
72bf8e1310 Apply system_shared_libs to all variants
Remove the odd semantics of system_shared_libs that ignore the property
for non-bionic variants by always honoring it.  For the common case
of system_shared_libs: [] this is generally correct, a non-bionic
variant of a module that doesn't compile against bionic libc probably
also doesn't want some other libc.  For modules that use something
like system_shard_libs: ["libc"] to link against libc but not libdl
and libm this may cause problems, as it will cause a host varaint to
try to link against the non-existent host "libc" module, but there
aren't very many of those and they can be fixed to use a target.bionic
clause.

Bug: 193559105
Test: m checkbuild
Change-Id: I94454a71144e3e68c7148b8d0bf2d974d2ad2bc6
2021-07-13 16:23:23 -07:00
Christopher Parsons
76da607830 Merge "Seperate asflags and cflags" am: ace3b7f0a2 am: 7e8be02166
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1764626

Change-Id: I2edbc9c29d57af80df67f5bc90bc45b29df5de77
2021-07-13 21:36:06 +00:00
Chris Parsons
69fa9f9e5e Seperate asflags and cflags
This fixes a bug which was a misunderstanding of soong properties:
Soong's cflags pertain only to C and C++ language, whereas bazel's copts
pertain to all three languages. This change ensures that asflags are
added as specifically asflags, and the 'copts' for the static library
macro pertains only to C and C++ languages.

This requires a somewhat hacky workaround for asflags, however: Since
assembly sources also need includepath-related flags, this duplicates
these flags between copts and asflags. To reduce verbosity of
bp2build-generated targets, this also ensures that asflags are omitted
in cases where there are no assembly sources.

Test: Mixed build droid CI
Change-Id: Ic0babed1f90d6dc82e5788638681ce5b995043f8
2021-07-13 14:06:14 -04:00
Treehugger Robot
90fd09de6b Merge changes from topic "vendor_snapshot-192647618" am: da70df7277 am: 4ba5a02a4d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1755250

Change-Id: Iee6ae2a99d36117e9099a6c926b0c0c46ec42436
2021-07-13 09:24:26 +00:00
Treehugger Robot
da70df7277 Merge changes from topic "vendor_snapshot-192647618"
* changes:
  cc/cc.go: Harden GetSnapshot() against nil pointer panic
  cc/cc.go: Add Device() method to LinkableInterface
2021-07-13 08:54:11 +00:00
Justin Yun
d9e05750ba Export paths for the snapshot modules
Some makefiles require the paths to the snapshot to use the snapshot
resources. Export SOONG_{IMAGE}_{VERSION}_SNAPSHOT_DIR to make.

Bug: 187222756
Test: check ninja depedency with and without snasphots.
Change-Id: Ie817285d43db094335e4c81ebb6eca7007c5f37d
2021-07-13 11:36:24 +09:00
Treehugger Robot
322af7d65a Merge "Share EffectiveLicenseFiles for snapshot modules" am: b9386b703e am: 56ff4c5c08
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1751244

Change-Id: Ia7eea45d703289ad943f1e818c88e736265bfb67
2021-07-12 22:38:31 +00:00
Treehugger Robot
b9386b703e Merge "Share EffectiveLicenseFiles for snapshot modules" 2021-07-12 22:06:59 +00:00
Liz Kammer
7b6484325b Merge changes If89b7d0b,I630c06f0,Id861a62b,If71bb468 am: 1a0e2d20b3 am: 60cd3b9609
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1749407

Change-Id: I4346f2ae9432e2cd375bdbacb4a422105d73f3c5
2021-07-09 21:12:19 +00:00
Liz Kammer
75db931843 Iterate over sanitizers
Test: go test soong tests
Change-Id: If89b7d0b04cad79b42a08504d4fcff36e914b7a4
2021-07-08 11:19:15 -04:00
Liz Kammer
7b920b4057 Update memtag code behavior to match comment.
Test: go test soong tests
Change-Id: I630c06f01c90256b1990c37b9236e8967a5fa316
2021-07-08 11:19:15 -04:00
Liz Kammer
d56ddb5482 Reorganize memtag tests for clarity.
Test: go test soong tests
Change-Id: Id861a62bd0ff2b6a5a4354fbda939e9ebb13a2a5
2021-07-08 11:19:15 -04:00
Liz Kammer
75b9b40a56 Add comments to sanitizer properties.
Test: n/a
Change-Id: If71bb4683a4ae969670235c51b3f1b3af2073f91
2021-07-08 11:19:12 -04:00
Liz Kammer
acd1fb16d5 Merge changes I770f5ce7,I32d4417d am: 4aa48b03ea am: 1d9b80262e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1749405

Change-Id: I21460aae0a59264de829322d6f1408c6322934ad
2021-07-08 13:39:51 +00:00