Add barebones riscv64-linux-android support. This should be enough
to add riscv64-specific entries to Android.bp files, but can't
actually compile anything until there are riscv64 toolchains.
Test: arch_test.go
Change-Id: I0dcc7e797d9352dd38243be908a7f19004ff3db1
This makes mixed builds resilient to a recent backward-incompatbile
Bazel feature which explicitly adds the main repository (`@`) prefix to
all labels which are stringified by `str(target.label)` in Starlark.
This implementation is compatible with both current Bazel and
Bazel@HEAD.
After a new Bazel release to AOSP, we can clean up this code a little to
only support Bazel with this feature active (and that we need not hedge
on either Bazel behavior).
Bug: 248106697
Test: `m --bazel-mode nothing` with both current Bazel and a new Bazel
Change-Id: Id53c8505bb9080d5073c844de7f1ee57ceceae46
Previous commit: commit fcc53f992b.
Test: 1. use `TARGET_BUILD_VARIANT=userdebug TARGET_PRODUCT=aosp_arm64 build/bazel/ci/mixed_droid.sh` to verify no error occurred.
2. revise the test cases under request_type_test. 3. pass the test cases
Bug: 242587802
Change-Id: I7f70e62f7b6f42fa5f211772888040a0d07a710b
also using a generic json_encode as an approximation for `json.encode`
Test: 1. use m --bazel-mode-dev nothing to verify no error occured. 2.
revise the test cases under request_type_test. 3. pass the test cases
Bug:242587802
Change-Id: I1288ecca1afd3e32f6473bcabae4ee2cb5838007
Fix: 232544453
Test: go tests
Test: b build //frameworks/av/media/module/foundation:libstagefright_foundation
Test: b build //frameworks/av/media/module/foundation:libstagefright_foundation (with in-apex hardcoded to True, non-apex hardcoded to False)
Change-Id: I7b5f356ff6ed31f89a9d9153396bc851d991c487
also using a generic json_encode as an approximation for `json.encode`
Test: USE_BAZEL_ANALYSIS=1 m libc
Bug: b/242587802
Change-Id: Ib83aeda3f99cc3966548b0cd47e72669422ed72d
* changes:
add bp2build unit tests for aidl_interface
AIDL source generation accounts for Bazel paths
convert .aidl srcs for java_library
add Partition method to LabelListAttribute
Bug: 231322789
Test: with this CL on internal master,
1) b build --verbose_failures //vendor/google/modules/AdbdGoogle:com.google.android.adbd --config=android_x86_64
2) adb install bazel-bin/vendor/google/modules/AdbdGoogle/com.google.android.adbd.apex, and adbd is activated successfully on cuttlefish device.
3) m mts && mts-tradefed run mts-adbd, and there is no failure with cuttlefish device
4) packages/modules/adb/test_device.py, and there is no failure with cuttlefish device.
Change-Id: I81b6f5336cacf35c68957ae2dac65f985b6eafb9
It can be tedious to split a LabelListAttribute on all of the
configuration axes, so LabelListAttribute.Partition can be used to do
this based on a predicate function.
Test: go test ./bazel
Change-Id: I78ff8c24ce9c86bab5896290d8afe979d56545b6
Use of the native CcSharedLibraryInfo results in using a superfluous
symlink for shared libraries in mixed builds. The new provider
propagates an unwrapped output file (real file, not a symlink).
Test: With related rules changes, manually verified that installed
mixed-build libc was not a symlink. (cf_x86_64, inspected system.img
with `m droid`)
Change-Id: I2a59b348fbfc2a381c229d66c0098e87674a9ddc
Instead of a StringListAttribute of length 1,
introduce a more appropriately reduced StringAttribute
so that e.g. `select`s work properly
Test: new cases in TestGenerateBazelTargetModules
Change-Id: I0ae0e4a51e39f85caf55b0d00459222ede6de79c
bp2buildTestCase
attrNameToString
runBp2BuildTestCase
makeBazelTargetNoRestrictions
The testing framework defined in the bp2build package can only be used
from within the package because many common testing functions are
private to the package. This prevents modules defined in Soong
plugins (e.g. system/tools/aidl/build) from testing bp2build conversions.
Test: go test ./bp2build
Change-Id: Ia867081327c5181d04687b13c4550e68e6a11f86
* Add ApexCqueryInfo to obtain apex artifacts used by the makefile
generator and downstream modules
* Refactor code common to GenerateAndroidBuildActions and ProcessBazelQueryResponse
* Implement android.MixedBuildBuildable for modules
* Enable mixed build for apex modules with payload_type:"image"
The first take 6a2b7c40b was setting compressed APEX suffix incorrectly, and
was reverted in 8a3c91494.
Fixes: 239925080 239695521 232085015
Test: treehugger
Change-Id: I1720f8db3c7cc773183d25a815d9b7eeaf7c73ad
* Add ApexCqueryInfo to obtain apex artifacts used by the makefile
generator and downstream modules
* Refactor code common to GenerateAndroidBuildActions and ProcessBazelQueryResponse
* Implement android.MixedBuildBuildable for modules
* Enable mixed build for apex modules with payload_type:"image"
Bug: 232085015
Test: treehugger
Change-Id: I9f1e03e5e7a5b5dde35a5db10c253069543ac973
Add toolchains to support cross compiling to aarch64-linux-musl and
arm-linux-musleabihf.
Bug: 236052820
Test: build arm and arm64 musl sysroots
Change-Id: I47a9322929baff2492c6e8db989ece01fcbeb133
By default, most module types are only enabled for device. Converting
this behavior and host_supported/device_supported properties allows us
to skip building incompatible targets.
Test: soong tests
Test: bp2build.sh
Change-Id: If1da523b4cc8c4cbf2bb26da063d9923b662cc32
Note go.mod file changes go version to 1.18 (for generics)
You might need to refresh/reload your IDE (e.g. IntelliJ)
Bug: N/A
Test: manually verified (e.g. ran `m nothing` successfully)
Change-Id: I2a6dadd673fd170961d1fd1e1756f7581e9a1091
Bug: 196084681
Test: b run //build/bazel/examples/python/protobuf:build_bazel_examples_python_protobuf_main --config=linux_x86_64
Change-Id: I4d806902d262351231f64686a5d24513a25d9749
This change will cause bp2build to generate genlex targets any
time a .l or .ll file is present in the srcs for a cc target and
add those genlex targets to the srcs attribute of the original
target.
Bug: 207408632
Test: unit tests
Change-Id: I1bce82c9d3c3d458eae1cef547ffae3d6e975134
This change constitutes a number of fixes which cause mixed builds to
have deterministic ninja file output:
1. Depsets are identified based on a hash of their contents instead of
an arbitrary ID integer from Bazel
2. Depset definitions in the ninja file are sorted by the above hashes
3. BuildStatements (action information from Bazel's aquery) are sorted
by their contents
Test: Ran `USE_BAZEL_ANALYSIS=1 m nothing` three times and verified the
md5sum of out/soong/build.ninja was identical all three runs.
Test: mixed_droid
Change-Id: Iffdf6cc62c31d76fbbfa78726827497516171f4f
Each depset now corresponds to a phony rule which depends on other
depsets or on full paths; thus, bazel's depset structure is preserved in
the form of phony rules of name bazel_depset_{id}.
Previously, flattening and recopying large lists of file path strings
was quite inefficient. This was particularly evident as we enumerated
hundreds of clang headers for each cc compile action.
This reduces soong_build analysis time by about 30% for mixed builds.
It also reduces ninja file size by ~750MB.
Fixes: 229405615
Test: Unit tests, manually verified metrics, mixed_droid CI
Change-Id: I78df152ac1488ae0c6807afdde4b4ad5e6d26287
To make testing easier, refactor existing module-global variables into a
struct that can be mocked.
Test: build/bazel/bp2build.go
Change-Id: I9d177677644ea743641a745b1839a3a8b29f902a
Most of the variable export code for cc modules can be re-used for
exporting variables for java modules. Refactor this code into a more
composable structure for reuse.
Test: build/bazel/bp2build.sh
Test: manual comparison of
out/soong/soong_injection/cc_toolchain/constants.bzl
with previous output
Change-Id: Ie5a6fee08cc888b7dc69c3e324e5c3f8aa269a8f
In Soong, java_library can specify static_deps which are dependencies
that get aggregated into the final jar (akin to static linking). This is
useful because it allows dependencies higher up in the chain to compile
against the APIs exported by transitive dependencies. Bazel does not
support this functionality directly, but it can be emulated via the
exports attribute which makes any targets listed in the attribute public
to targets further up the chain.
Bug: 217236083
Bug: 219908977
Test: b build //external/error_prone:error_prone_core
Test: b build //external/bouncycastle:bouncycastle-host
Test: b build --platforms=//build/bazel/platforms:linux_x86
//prebuilts/sdk/tools/jetifier/jetifier-standalone:jetifier
Change-Id: I2867e3f816de720a6f4bd9ff7a847d1b0c2da2d6
Make go stop complaining about format string:
"Errorf format %s has arg ba of wrong type"
Test: go test soong/...
Change-Id: I4615f5ff77e1c2c41b84fd227462cdb3564d4369
If a system shared lib is specified in shared_libs, this results in
duplicate values appearing, causing a failure in Bazel. This change
removes any system shared libraries that appear in shared libraries from
bionic OS axes where system_shared_libraries takes the default value.
Test: go soong tests
Test: temporarily allowlist directory with this issue, no longer hits
duplicate library failure.
Change-Id: I9dce570b73c24973f695b815bce8d50f7259798d
Also fix some bugs pertaining to configurable attribute handling of bool
attributes and label sttributes, so that they may support values across
multiple different axes at the same time.
Test: unit tests for bp2build
Test: mixed_droid
Change-Id: I411efcfddf02d55dbc0775962068a11348a8bb2c
Also remove the need to use bp2build_available on
soong_config_module_types as we want to convert every single of them
into the tree for a complete soong_injection soong_config_variables.bzl
file.
The variables are split into their bool, value and string types
respectively, as they all need to be handled differently on the Bazel
product_platform side, as well as for generating constraint values and
settings. For example, value variables need to integrate with
TemplateVariableInfo, and string variables need to include the string
value itself into the select key/constraint value.
Sample soong_config_variables.bzl file: https://gist.github.com/jin/cef700bfb20c8656a931306dd71d47e1
Test: CI
Bug: 198556411
Change-Id: I8665dd1269a507edb37de62407ed3641564bea5c
variable usage.
There's bug a in the current soong_config_variable handling
implementation where a soong_config_variable sets conditions_default
value for an attr, and a non-conditions_default value for another attr.
This results in the former attr not properly setting the zero value for
the non-conditions_default select key, resulting in the pretty printer
omitting the attribute totally.
The current implementation in this CL ensures that the zero value is set
whenever this happens at the module level. This is seen in
library_linking_strategy_cc_defaults (see comments in code, and the new
tests)
Test: CI
Bug: 198556411
Change-Id: Ibaeb94508c51a7429fb7a08df610cbb5470f76d2
Bazel run shell actions begin `bin/bash -c <command>`, without escaping,
the command can be treated as an argument to `bin/bash`.
Test: build/bazel/mixed_droid.sh
Change-Id: I423cb393da2e6ac97448ec77b2596f12670dfd31
hardlinks are incompatible with sandboxing
relative links are incopatible with Soong's use of `cp -d`
Test: build/bazel/ci/mixed_libc.sh
Change-Id: I8c776cda6a27c680c51466d9a7af1b499f2f566d
Previously, excludes computation for the default condition in label list
selects was clobbering pre-existing values. This CL fixes it by
performing a union of the new values with existing ones instead.
Test: properties_test.go
Bug: 198556411
Change-Id: Id11f4fb14e359201304afde0d8ba856851d41395
This just sets up the toolchain and allows Darwin+Arm64 to be specified
as a HostCross target. These variants will not be exported to Make, or
be installed on a Soong-only build. A future CL will add support for
universal binaries using these variants.
This config is a bit stranger than the regular 64/32 multilib, as it's
two primary 64-bit configs. And on a Darwin/X86 machine, the Arm64
versions are HostCross (doesn't work on the current machines), while a
Darwin/Arm64 machine, either version works (if Rosetta is installed).
Bug: 203607969
Change-Id: Iacaed77d267773672da027cd74917e33fb1c1e94
Also refactor target.bionic to be handled not as its own configuration
axis, but instead to be grouped into os selects handling.
This allows us to remove libbase and its dependencies from the bp2build
denylist.
Test: mixed_droid.sh CI
Change-Id: I92f30074d286306207653fe37589835ae3db16c4
To support protos (and other srcs that generate sources), we need to
partition further. Separate out into a separate common function.
Bug: 200601772
Test: build/bazel/ci/bp2build.sh
Change-Id: I7bf4cd96fd9a9fca4ccb3c96f21a04303201f891
This prevents use of CcInfo to obtain object information, as doing so
would mean propagating linker inputs transitively up the graph (not a
feature that Soong supports)
Test: mixed_libc.sh
Change-Id: I5e5cbfb607b866bb57491dbc0693f79b71707492
To reflect what's provided in SharedLibraryInfoProvider
Move the logic for identifying the toc file into Starlark
instead of the Soong Go code.
Adapt TestGetCcInfoParseResults to expect the toc as well.
Test: build/bazel/cquery/request_type_test.go:TestGetCcInfoParseResults
Test: cc/library_test.go:TestCcLibrarySharedWithBazel
Test: build/bazel/ci/mixed_{libc,droid}.sh
Change-Id: I40ad47158cb98b14ca03c21e351988818cb01770
The specification of exporting includes vs system includes has an impact
on inclusion sort order. Conflating the two caused some symbols to not
be resolved correctly.
Bug: 198403271
Test: build/bazel/ci/bp2build.sh
Test: USE_BAZEL_ANALYSIS=1 m libbacktrace_no_dex succeeds with libc++_*
modules removed from mixed build denylist (would fail otherwise)
Change-Id: I08aff253d8962dc678ed10214b1c171330e0fe19
Add a new request type with its own StarLark function
Hook it up via GetPythonBinary
Add to MockBazelContext a LabelToPythonBinary
Add a test for the new request type
Test: request_type_test.go:TestGetPythonBinaryParseResults
Change-Id: I05f6506adfbbdac8b3f40475509ed02ab8e844e5
- 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
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
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
Soong supports some hand-crafted target.<type> that match multiple os or
arch types to simplify configuring for similar targets. target.bionic is
used to match on both android and linux_bionic OSes for cases where they
should be handled the same way.
Test: build/bazel/ci/bp2build.sh
Change-Id: I47b6aaf3279e4d242c4fd0e12f24117eb98e0665
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
This CL adds support to bp2build/Soong to dump a BUILD file under
out/soong/soong_injection/targets containing alias targets to their real
targets for every converted Soong module, regardless of whether they are
handcrafted or generated.
Test: TH
Change-Id: Ic1816fda5d019c395301618134fac68b3057d752
This allows it to be used for other modules types and other properties
(e.g. static_libs & exclude_static_libs).
Test: go test soong tests
Bug: 188497994
Change-Id: I40ab16e3b540ece0a6684558b32f7e8e25df6f24
This is to simplify the process of resolving label + exclude labels
across the various configuration axes we have and across the various
properties/modules that use this behavior.
Test: ci/bp2build.sh && ci/mixed_droid.sh
Change-Id: I8efae3e75ddb365384f5caaf5bb504a5206618d3
This CL adds support for cc_library to correctly split c, as and cpp
srcs in shared/static nested props, as well as splitting
the *filegroup* deps in those props, where each filegroup is expanded
into its own c, cpp and as srcs filegroups. This ensures that the
correct sources go into cc_library_static's underlying cc_libraries for
c, cpp and as sources respectively.
See the bp2build conversion test for a better visualization.
Bug: 183064430
Test: TH
Change-Id: I29add5140672d042adff65527d8b65f4a5f0a05b
LabelListAttribute support was already added, but LabelAttribute support is needed for cc_import rules.
Test: Added unit test for version_script, which is the only supported LabelAttribute so far.
Change-Id: I4e86e7391586e0780623d06b794e7399f0ccd50e
Test: Added new unit test and updated existing tests.
Test: bazel build //bionic/... //external/... //frameworks/... //system/...
Test: ./build/bazel/scripts/run_presubmits.sh
Change-Id: I250d1964f5cf42b92ddb929379d35d8c844423f7
This fixes a test and rolls forward I28cf7437ee96cdf2fdbcb1eda2303691cff08ba4
Test: m nothing
Test: See I28cf7437ee96cdf2fdbcb1eda2303691cff08ba4
Change-Id: I0e450c28e70087e406e7b562d7e772785f177379
Revert submission 1714835-roboleaf-asm-c
Reason for revert: TestCcLibraryStaticProductVariableSelects fails everywhere
Reverted Changes:
I28cf7437e:Split asm and c flags and srcs in bp2build output
I2b47e6b55:Split libraries by language in cc_library_static
Change-Id: I85d39a462f0a5b3f5ff3d685906813fab9f01358
This allows removal of almost all current items from the mixed build
denylist, which were previously broken due to being unable to separately
control flags for compilations of different languages within the same
target.
Note that this does not appropriately implement asm/c srcs and flags for
either the shared variant or the static variant. This will require a
followup.
Test: bp2build.sh and mixed_libc.sh CI scripts
Test: Updated b2build tests
Change-Id: I28cf7437ee96cdf2fdbcb1eda2303691cff08ba4
This allows support of generated hdrs / srcs in mixed builds.
Test: Manually verified that libc_bionic_ndk passes compilation (failed
previously due to missing generated heaer)
Test: bp2build and mixed_libc CI scripts
Test: New aquery test
Change-Id: I88e359a4bd9eba383c207d5cf812272725ff0a3d
There are two pieces to make this work:
1. Local include paths must include $(BINDIR)-relative paths, to support
generated headers in those directories.
2. The srcs that bp2build outputs for BUILD targets must include labels
for targets given in generated_hdrs and generated_srcs.
Support for exported_generated_hdrs intentionally deferred.
This allows us to remove several targets from the bp2build denylist.
Some are moved to the mixed build denylist, because genreated headers are
still unsupported in mixed builds.
Test: bp2build.sh CI script
Change-Id: Ib4f9dac20f6445487b8dad53b91eac01f437a590
Then plumb them to LabelAttribute.
This refactoring is required because the previous implementation did not
handle properties in shards other than the first one (e.g.
version_script) well. In addition, it also makes the code paths between
bp2build and analysis more similar.
Bug: 186650430
Test: Presubmits.
Change-Id: Ic4393e8ae47f4e88816bf45c89399efd61494d22
Doesn't work when depends on arch/target/etc., but good enough for
libdl_android.
Bug: 186650430
Test: Presubmits.
Change-Id: Ib0facb41a89454717c74663e5e078aedd33d1b9c
OS-specific exclude_srcs and srcs will be done in a follow-up, due to
complexities from merging multiple select statements together.
Test: TH
Bug: 186153868
Change-Id: I01b881e9a5a7cd41b4a507f8be7e9e65eab37bdc
Not needed anymore for bp2build-incremental since https://android-review.googlesource.com/q/topic:no-include-check.
Not needed for mixed builds either, since cc compile actions aren't sandboxed.
Fixes: 186488830
Test: treehugger and go tests
Change-Id: Ib5d4908dcce6bf910a653c457bb251d726e717d4
Test: go soong tests
Test: bp2build generate & sync; mixed build libc; mixed build su (su is
an Android.mk target that relies on converted a cc_library_headers)
Bug: 181552740
Change-Id: I9efd587970551fd41f642a208f0aa0a80e8694e0
This CL refactors the cc* bp2build converters to use the common
attribute extractors in cc/bp2build.go.
This also adds include_build_directory to be handled by the compiler
attr extractor to generate recursive headers as inputs.
This also turns include_dirs and local_include_dirs into the
execroot-relative -I flags.
e.g. if a module in bionic/libc has "private" in local_include_dirs,
the "-Ibionic/libc/private" copt is generated for it.
Fixes: 185139955
Test: TH
Test: Forrest for mixed_clean-droid
Change-Id: Ib67056482227e62068fbbea0455035bdf5d56319
OriginalModuleName is a clearer name for what the field represents.
Also document it.
Follow-up from aosp/1675466.
Test: TH
Change-Id: Ie1152b5ae63f388164582be70e193a91ef96c89c
There is little overlap at this point, but we expect these to converge
more over time, to handle exported includes, libs, etc., this will allow
those changes to be handled in one place and allow more consolidation of
code.
Test: bp2build generate & sync; mixed build libc
Change-Id: I51685dad9f4fc11a634965a3c9e84f4a0e279ecb
This CL contains the converter for libdl_android, a cc_library that
expands into a cc_shared_library and a regular cc_library.
Test: TH
Test: bp2build; bazel test //build/bazel/tests/...
Change-Id: If70641a538211b0d6b2aac0e4d0d06912318304d
Test: Added unit test
Test: bp2build-sync.py write; bazel build //bionic/... works for more cc_library_static targets (in a parent CL)
Change-Id: Ib487216a4bcbc52958ff948722dae347b0d8b606
go idiom is to define the interface where it is used rather than where
it is defined. This makes it obvious that ParseResult is not a used part
of the interface, removing the need to return an interface{} and cast
results.
Test: go test soong tests
Test: generate & sync bp2build; mixed build libc
Change-Id: I0d8d99c1d8d0125588522cc86502286b83c91bf7
Required fixes:
- Set MakeLinkType for libraries, even in mixed build mode.
- Set snapshot header information to empty list, which passes
validation logic for depending modules
Fixing these libraries also requires a Starlark change to
cc_library_static.bzl, which will be submitted separately.
Additionally, this adds better error messaging in the event that
output files are missing from a mixed-build library.
Test: USE_BAZEL_ANALYSIS=1 m libc
Test: USE_BAZEL_ANALYSIS=1 m runtime-module-sdk
Change-Id: Iad2c4d46359986fb0a43263292a15ed45fabbac7
Starting with copts for cc_object, with an extracted function that can
be shared with other cc_* module types.
Test: TH
Change-Id: I9025232e83a3dcd0ca243387486fafbdbd3e2d9b
This CL is pretty large, so I recommend starting with reading the newly
added tests for the expected behavior.
This change works in conjunction with the linked CLs in the Gerrit topic.
Those CLs add support for new platform() definitions for OS targets
specified in Soong's arch.go, which are configurable through
Android.bp's `target {}` property. It works similary to previous CLs
adding support for the `arch {}` property.
These configurable props are keyed by the OS: android, linux_bionic,
windows, and so on. They map to `select` statements in label list
attributes, which this CL enables for cc_library_headers' header_libs
and export_header_lib_headers props.
This enables //bionic/libc:libc_headers to be generated correctly, from:
cc_library_headers {
name: "libc_headers",
target: {
android: {
header_libs: ["libc_headers_arch"],
export_header_lib_headers: ["libc_headers_arch"],
},
linux_bionic: {
header_libs: ["libc_headers_arch"],
export_header_lib_headers: ["libc_headers_arch"],
},
},
// omitted props
}
to:
cc_library_headers(
name = "libc_headers",
deps = [] + select({
"//build/bazel/platforms/os:android": [
":libc_headers_arch",
],
"//build/bazel/platforms/os:linux_bionic": [
":libc_headers_arch",
],
"//conditions:default": [],
}),
)
Test: TH
Test: Verify generated //bionic/libc:libc_headers
Fixes: 183597786
Change-Id: I01016cc2cc9a71449f02300d747f01decebf3f6e
cc_object crtbrand sets product_variable.platform_sdk_version.asflag
and will not compile correctly within mixed builds without it.
Only handles product_variables that expand product variables.
Bug: 181794963
Test: ~/aosp/build/bazel/scripts/milestone-2/demo.sh full
Change-Id: I293fcb18032aa51f63bb7b3de94abd6d1ec38180