Commit graph

7833 commits

Author SHA1 Message Date
Sam Delmerico
5fb794ae37 clean up CL for androidmk variables
Change-Id: If14d1925bea78f467740f8395f1d529db00b618c
2023-01-27 16:01:37 -05:00
Sam Delmerico
4e115cc90d add androidmk cc-related variables to androidmk
The adbd_test androidmk definition is missing some cc-related variables
for cc_test in mixed builds. These variables should be populated from
information from Bazel.

Bug: 265758350
Change-Id: I59d017e2eb2f139188ba3383c457cc0055372b61
2023-01-25 15:14:03 -05:00
Vinh Tran
ba46e76622 Merge "Delete __ANDROID_APEX_MIN_SDK_VERSION__ from Soong" 2023-01-25 19:09:27 +00:00
Treehugger Robot
d5ac8fe723 Merge "Add noOverride64GlobalCflags support to Soong" 2023-01-25 19:07:48 +00:00
Treehugger Robot
8153bc40bb Merge "Add additional adbd related tests to mixed staging" 2023-01-25 13:21:07 +00:00
zijunzhao
933e38093d Add noOverride64GlobalCflags support to Soong
Bug: b/261642850
Test: Build and check warnings. Add two xfail tests in bionic and see the
results locally.

Change-Id: I68fca0084787c329b6c49ce4dff6fd132f820735
2023-01-25 04:02:29 +00:00
Trevor Radcliffe
6f0aef34e8 Merge "Export sanitizer vars for use in Bazel" 2023-01-24 17:29:47 +00:00
Liz Kammer
9c667416de Add additional adbd related tests to mixed staging
Test: CI
Change-Id: I724e854dbbc67a1a37109e19935b28627066acc8
2023-01-24 10:47:18 -05:00
Trevor Radcliffe
4f95ee96b8 Export sanitizer vars for use in Bazel
Bug: 265154269
Test: Unit tests
Change-Id: I46584159264476d76079e396c6ec294fb394acff
2023-01-23 20:28:06 +00:00
Spandan Das
d623192eea Merge "Export system headers for SdkVariants as well" 2023-01-20 23:54:08 +00:00
Spandan Das
baef7ff6df Merge "Add documentation about the purpose of #apex and #symbols in map.txt" 2023-01-20 18:20:13 +00:00
Vinh Tran
f9754735f2 Delete __ANDROID_APEX_MIN_SDK_VERSION__ from Soong
Currently, Bazel sets __ANDROID_APEX_MIN_SDK_VERSION__ based on the cc library's min_sdk_version while Soong does based on apex's min_sdk_version. This causes a diff in the clang commands.

Digging further, we realized __ANDROID_APEX_MIN_SDK_VERSION__ isn't used anywhere so we might just delete it altogether instead of fixing it.

Bug: 265134933
Test: presubmit
Change-Id: I08e89dc8f6ef86669248ea5c47de6603e9d2ffbb
2023-01-20 00:14:48 -05:00
Spandan Das
934c97da5e Add documentation about the purpose of #apex and #symbols in map.txt
Currently we document the semantics of these two symbols. I would like
to add some documentation about why this granularity is necessary. The
majority of the details are contained in b/191371676

Test: N/A (documentation change)
Bug: 265485106
Change-Id: I752c921eabceff94f92f24a46c9a16dc28a2af19
2023-01-19 18:56:06 +00:00
Trevor Radcliffe
3a79caa3b9 Merge "Add musl defaults in bp2build" 2023-01-19 16:01:04 +00:00
Spandan Das
98c000ae43 Export system headers for SdkVariants as well
This code block exists for LLDNK code path (m.UseVndk()...), but was
missing from NDK code path (m.IsSdkVariant())

Test: TH
Change-Id: Ib156d14a6f013c88499a0641dbb547c632357362
2023-01-18 19:50:53 +00:00
Cole Faust
a905aba595 Remove cflag_artifacts.go
The artifacts it produces are no longer used.

Bug: 262629589
Test: m nothing
Change-Id: Ie9a23310bd6468cfc0b692424f43bf5c16577aee
2023-01-17 15:35:42 -08:00
Cole Faust
57f70c03cd Merge "Use WriteFileRule in cflag_artifacts" 2023-01-17 23:28:21 +00:00
Cole Faust
baa24a2077 Use WriteFileRule in cflag_artifacts
Most of the complexity in cflag_artifacts can be avoided
by using WriteFileRule.

Bug: 262629589
Test: m out/soong/cflags/module_cflags-Wall.txt
Change-Id: I5b0a678c24609f7b187c9fb8e5fcae7f89adf59c
2023-01-13 15:16:19 -08:00
Yi Kong
df456b5f33 Suppress misc-use-anonymous-namespace clang-tidy warning
This is a new warning introduced in clang-r484482.

Test: presubmit
Bug: 265438407
Change-Id: Ic31e0dac5aee3214e21bad41f2e6e3505daabe2c
2023-01-13 18:07:37 +00:00
Treehugger Robot
002254731f Merge "Make LLVM_NEXT extra cflags no override" 2023-01-13 01:00:17 +00:00
Colin Cross
4a25e78f52 Merge "Use the same rpaths for tests and binaries and cc and rust" 2023-01-12 23:14:46 +00:00
Yi Kong
60a2010415 Make LLVM_NEXT extra cflags no override
Test: m nothing
Change-Id: I2cf7ab1dcc9cb23298c45b6bf38f8ecc2a9d951e
2023-01-13 04:40:18 +09:00
Sasha Smundak
39a301c963 Clean up mixed builds module names filtering
* Remove `Bp2buildCcLibraryStaticOnlyList` it is never set
* Remove the rest of the sutff related to it
* Streamline MixedBuildsEnabled
* Rename BazelContext.BazelAllowlisted to BazelContext.NameFilter
  to reflect its action
* Rename bazelContext to mixedBuildBazelContext
* Fix minor warnings from Go static analyzer

Test: treehugger
Change-Id: Ie245c992f94bbfd5c7c23dd06917026200a28263
2023-01-12 00:32:45 +00:00
Colin Cross
225a37a7f0 Use the same rpaths for tests and binaries and cc and rust
Rust and cc binaries currently use $ORIGIN/lib64:$ORIGIN/../lib64 as the
rpath, and cc tests add $ORIGIN/../../lib64:$ORIGIN/../../../$ORIGIN:$ORIGIN.
This causes problems when a binary is included as test data in
out/host/linux-x86/testcases/<test dir>/<CPU>/<test>, as the
binaries can't find the libraries in out/host/linux-x86/lib64.

Use the same rpath for test and binaries, and for cc and rust.

Bug: 264604160
Test: m USE_HOST_MUSL=true out/host/linux-x86/testcases/acpi_tables_test_src_lib/x86_64/acpi_tables_test_src_lib && out/host/linux-x86/testcases/acpi_tables_test_src_lib/x86_64/acpi_tables_test_src_lib
Test: m USE_HOST_MUSL=true out/host/linux-x86/testcases/gen_sdk_test/x86_64/gen_sdk_test && out/host/linux-x86/testcases/gen_sdk_test/x86_64/toybox
Change-Id: I10fe5dc0de01d1f3c6aea8dbabbf60edab5989c3
2023-01-11 16:04:19 -08:00
Trevor Radcliffe
0d1b4029b8 Add musl defaults in bp2build
Bug: 261657184
Test: Unit Tests
Test: Manual Inspection of generated files
Change-Id: I69864abb410fddecd530fc75f2531aff33b33c97
2023-01-11 18:43:20 +00:00
Vinh Tran
57b1e4064b Merge "Remove apex_available tag in cc_library_static generated from stubs-providing lib" 2023-01-10 15:30:11 +00:00
Zi Wang
709c59b2df Merge "Add variant_prepend support for all the properties in bp2build" 2023-01-10 05:54:29 +00:00
Treehugger Robot
4520481c6a Merge changes I07db8afc,Ia89e0239
* changes:
  Stop module types being SdkAware
  Replace usages of SdkAware in sdk module with Module
2023-01-07 14:46:22 +00:00
Hsin-Yi Chen
8a5d4126a2 Merge "Add header_abi_checker properties for vendor, product, and platform" 2023-01-07 07:35:49 +00:00
Paul Duffin
e76fa00998 Merge "Remove IsModuleInVersionedSdk" 2023-01-06 22:37:59 +00:00
Paul Duffin
5366821635 Merge "Dedup checks for module being in versioned sdk snapshot" 2023-01-06 22:37:15 +00:00
Zi Wang
9f609db46a Add variant_prepend support for all the properties in bp2build
This is a follow up of aosp/2336916. All the properties that have
variant_prepend tag are supported in bp2build.

Bug: 261644490
Test: TH and modified tests with updated expected behaviors
Change-Id: I13bb5d4d8fcd38bf153fa9083c9c945aec2dfa19
2023-01-04 11:19:50 -08:00
Vinh Tran
55225e343d Remove apex_available tag in cc_library_static generated from stubs-providing lib
When a cc library has stubs, its static variant shouldn't be included in an apex to ensure the library with stubs isn't statically linked. See https://cs.android.com/android/platform/superproject/+/master:build/soong/apex/apex.go;l=2804;drc=89b01aeaa9e19377ff547baab791277719b8aaf3

This CL modifies bp2build so that it excludes apex_available tag from the static target if the library has stubs. This way, we can ensure that no apex can depend on the static target which results to static linking.

Test: go test
Bug: 255589949
Change-Id: Iedf248994b808436f2440570b094fd06d6284ae9
2023-01-03 21:44:07 +00:00
Cole Faust
216805457c Allow adding extra tradefed options in the Android.bp file
Some tests need to add custom tradefed options, but still want to
keep most of the soong autogenerated tradefed xml file.

Expose a test_options: { tradefed_options: [...] } property that
will allow tests to add more options to the autogenerated xml file.

Fixes: 184895128
Test: go test, and verified that the ninja files did not change for aosp_arm64
Change-Id: I50d4ad139322e9e207202f1e1a50f5bbb424aa6f
2023-01-03 12:47:11 -08:00
Trevor Radcliffe
db7e0263f4 bp2build conversion for Sanitize.Integer_overflow
and Sanitize.Misc_undefined.

This is a redo of aosp/2277186 with changes to account for issues
in mixed builds. Specifically, for now we're disabling mixed builds
for modules that use ubsan. This bug tracks enabling it:
b/261058727.

Bug: 253428057
Test: Unit tests
Change-Id: Ia1277a7fa9a82f40998d7f3d2c40ea90f38201e7
2022-12-29 21:21:23 +00:00
Hsin-Yi Chen
8feb41392a Add header_abi_checker properties for vendor, product, and platform
The developers can apply different configurations to vendor, product,
and platform libraries. In LSDUMP_PATHS_FILE, the vendor and product
variants are tagged with VENDOR and PRODUCT. Their ABI dumps will not be
generated in the directories under prebuilts/abi-dumps.

Test: make libutils.vendor libutils
Bug: 227282691
Change-Id: I747ceb174a070a67d592c5a47fcc848a6129661d
2022-12-28 18:50:38 +08:00
Jooyung Han
f7562aee8b Merge changes from topic "dup-check-in-apex"
* changes:
  apex_vndk doen't need stub variants
  Check for duplicate bundled files from different modules.
2022-12-28 01:45:27 +00:00
Yi Kong
a8b0bfbeab Do not report warnings when testing with the top of trunk LLVM
also clean up flags for Clang r475365.

Test: LLVM_NEXT=true m
Change-Id: I6ebbedc6b3e3adb50c156b852eb113a1c64ffc2a
2022-12-26 16:03:54 +09:00
Yu Liu
5482a833d1 Merge "Support env based compiler flags." 2022-12-22 19:51:02 +00:00
Treehugger Robot
9f8599549d Merge changes Ib4fe4def,I6fdecefa
* changes:
  Disable sanitizer for vendor_snapshot_object modules
  VSDK: capture hwasan static libs for vsdk snapshot build
2022-12-22 03:52:47 +00:00
Yu Liu
19ea53de84 Support env based compiler flags.
Bug: 187086342
Test: Manual and unit tests.
Change-Id: Ic8e5f09dd6552e1121174bb00f0aae647661cf7b
2022-12-21 12:39:30 -08:00
Vinh Tran
72e1d65f05 Merge "Remove creation of has_stubs in cc_library_shared by bp2build" 2022-12-21 03:16:08 +00:00
Jooyung Han
1724d58a91 apex_vndk doen't need stub variants
This was revealed by the new check added in
Ib3c6efd16bdf13b59f79be66d4f9dba49100f6cc.

This was okay since the old implementation relied on the fact that impl
variant comes before stub variants.

To make the new check happy and keep the intention explicit, stub
variants are not added to VNDK apex.

Bug: 191770320
Test: m (apex_test)
Change-Id: I455f2c9b6bc471c579379286c0198f36d325adf6
2022-12-21 10:17:44 +09:00
Yu Liu
295cdfc79c Merge "Enable code coverage for cc shared library" 2022-12-20 20:20:12 +00:00
Treehugger Robot
463c15de15 Merge "Make more cc tests parallel" 2022-12-20 19:38:58 +00:00
Jigar Thakkar
1d174b185f Merge "Revert "Allow adding extra tradefed options in the Android.bp file"" 2022-12-20 16:24:20 +00:00
Treehugger Robot
597894279d Merge "mixed builds: add cc_test bazel handler, and add adbd_test to staging allowlist." 2022-12-20 03:12:53 +00:00
Vinh Tran
83f88cdc8b Remove creation of has_stubs in cc_library_shared by bp2build
Because when stubs_symbol_file is defined on cc_library_shared, has_stubs is already implied to be true.

Bug: 260771171
Test: go test
Change-Id: I3b9a2cfb9000411d1b5f22da87dc339267775799
2022-12-19 13:56:11 -05:00
Tahsin Loqman
77dc7d0839 Revert "Allow adding extra tradefed options in the Android.bp file"
This reverts commit 8ec823cba1.

Reason for revert: DroidMonitor: Potential culprit for Bug b/262965953 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: I236cc36981d8b30527ca286632727f8ca267e969
2022-12-19 16:27:25 +00:00
Justin Yun
08270c6c2d Disable sanitizer for vendor_snapshot_object modules
vendor_snapshot_object modules do not provide sanitizers.
Avoid sanitizer mutation for these modules.

Bug: 234772527
Test: build against the vsdk with SANITIZE_TARGET=hwaddress
Change-Id: Ib4fe4def673aa77a4321f47c09393adcb2fa2964
2022-12-19 23:04:08 +09:00