* 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
* 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
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
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
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
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
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
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
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
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
* changes:
Fix crtend for musl static binaries
Support static_executable: true for musl builds
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
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
This reverts commit ea28f4cae7.
Reason for revert: Postsubmit failure was unrelated, and was fixed by this revert CL aosp/1802327
Change-Id: I2693b17c2261cfc3dce0ed69baeb2d1f45f784f8
This reverts commit 73de70264a.
Reason for revert: Broken build 7651218 on aosp-master on aosp_x86_64-userdebug -- b/197190129
Change-Id: I18387e5d2765fecb292127d09e3bbe7cf19b5efd
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
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
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
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
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
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
Because it's commonly useful and not cc/ specific
Also export GenerateBazelBuildActions and update uses
Test: Existing tests pass
Change-Id: Ibc6858bb1129afba181a7686dda432defe33b00d
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
- 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
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
The musl allocator works now, remove libjemalloc5 from the default
libraries.
Bug: 190084016
Test: prebuilts/build-tools/build-prebuilts.sh --musl
Change-Id: I12ef8112af99f90e10e8a247ddc2eddfd4cd98a0
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
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
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
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
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
Some libraries were missing in aosp/1777786.
Bug: 161456198
Bug: 194743866
Test: m on full-eng
Merged-In: I7c7aa1025a876e45fc4779378825d91098164e84
Change-Id: I3cb4dfcf490ddb6b4bd3915232399cebf5e467d5
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)
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)
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
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
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
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
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