This CL blocks modules intended for the host from having the bottom up
sanitizer mutator applied. We only maintain a single copy of host
binaries, so generating variants doesn't make sense
anyway. Additionally, the existing logic was causing an error with
builds not embedded in make (eg: aosp-build-tools which uses
soong_ui.bash) where the wrong variant was installed on the host. This
change should fix that.
Bug: 64536751
Test: m -j40 && SANITIZE_TARGET="address" m -j40
Test: aosp-build-tools build breakage is fixed.
Change-Id: Ia79b4661f69ce26a7be17c4339c18ca0f397d760
LL-NDK, VNDK-core, VNDK-SP libraries are exported to make as
SOONG_LLNDK_LIBRARIES, SOONG_VNDK_CORE_LIBRARIES, and
SOONG_VNDK_SAMEPROCESS_LIBRARIES. This can be used to auto-generate
ld.config.txt from a template.
Bug: 64013660
Test: BOARD_VNDK_VERSION=current m -j successful
Test: check out/soong/make_vars*.mk and look for SOONG_*_LIBRARIES
Merged-In: I0f4c5d05d9cd28c3fc9fdcca6ce0e6eaeaacbe8d
Change-Id: I0f4c5d05d9cd28c3fc9fdcca6ce0e6eaeaacbe8d
This CL fixes a bug in the ASAN top down mutator which was incorrectly
checking (and setting) SanitizeDep to true only for the parent module
and not for the visited child modules.
Fixing this also requires some changes to the variant creation logic
to ensure that the correct variant is passed to make for
installation. This will eventually be replaced by logic that appends
an appropriate suffix to sanitized libraries (eg: libc++.asan), which
will allow both variants to be passed to make.
Bug: 64536751
Test: m -j40 && SANITIZE_TARGET="address" m -j40
Change-Id: Id5e5a5946192adf07418dd433bca503047177007
The final name of the prebuilt binary is going to match the basename
of the return value of link(), so copy the binary to the intermediates
directory to a file name that honors the name and stem properties of
the module.
Test: manual
Change-Id: Ieed4df79b11382924ca0be8e940d3279b45f748a
As a part of the fix for bug 38304436, the condition for dumping abi for
a source file was reduced to : if the source file belongs to a library
belonging the vndk or the llndk, dump the abi. This needs to be changed back to:
if the source file comes through a dependency of a vndk library (static,
whole static or source), whether or not the dependency may be vndk-enabled, dump
the abi.
Test: mm -j64 in external/libcxx.
Without the change, libc++ does not produce any abi dump, since it
depends on whole static libraries not marked vndk enabled. After the
change, libc++ has an abi dump combining abi exposed by whole static,
static and source dependencies.
Bug: 38304436
Change-Id: Ida3dceeca11342756191f316bee74ea08bcdd984
Don't preserve the confusing names from make. Rename AllCodenames to
ActiveCodenames, add FutureCodenames, and add CombinedCodenames to
fetch the *real* AllCodenames.
To allow `introduced=P` in NDK library definitions, we need to know
that P exists. Use the combined list of current and future API
codenames generating stubs.
Test: make ndk
Test: check out/soong/api_levels.json
Bug: None
Change-Id: I435f9ce7446236edc268a84e33474044a55a6302
When the lib is vendor-only, then .vendor suffix is not added.
Furthermore, this change correctly adds .vendor suffix even to the names
listed in LOCAL_SHARED_LIBRARIES so that we don't need to add the suffix
in the make world.
This also allows us to use the original name (without the .vendor
suffix) of the vendor-only modules in make (e.g. in PRODUCT_PACKAGES or
as a make target).
Bug: 37480243
Test: BOARD_VNDK_VERSION=current m -j <name> is successful, where <name>
is one of the vendor-only libraries in Soong. (i.e.
android.hardware.renderscript@1.0-impl)
Test: m -j does not break anything
Change-Id: I203e546ff941878a40c5e7cfbb9f70b617df272d
C++17 is basically done, but not rubber stamped yet. Rewrite c++17 and
gnu++17 to their 1z equivalents until this happens, and we get a
version of clang that allows it.
Test: mma in a project with cpp_std c++17
Change-Id: I1626c366c3a9b47c997cc27dc9c5205201ebbdf5
'vndk' tag must be parsed in cc_defaults as well.
Test: build with a module that has 'vndk' tag in cc_defaults.
Change-Id: I21a5a831dbf8cae00be98c00f4bb98504da53c8d
sAbiDumper uses one year old clang which does not support
recent mcpu options like exynos-m2.
So, we set mcpu=cortex-a53 for ToolingCFlags.
Change-Id: I294ca692181fd2cbc6ba5efb1e4e2d2d605b7a85
Signed-off-by: Junmo Park <junmoz.park@samsung.com>
Ubsan is currently support ARM/ARM64,
so It's OK to enable the build Flag
Test: build test module with flags in Android.bp:
sanitize: {
all_undefined: true,
diag: {
undefined: true,
},
},
BUG:38250996
Change-Id: I37a01b4610132f58315e68335b3c3cdfb148357d
InitDefaultsModule and InitDefaultableModule were requiring the
module to be passed in as an argument twice, once as a
android.Module and once as an android.DefaultableMOdule. Use
a type assertion instead.
Test: builds
Change-Id: I57d721e68a4f016e02c17a678af5f2ba25a9a430
These compiler flags weren't being properly added to ToolingCFlags,
which was causing clang-tidy to complain a lot about incompatible
redeclarations of library functions. Moving them to compilerFlags()
causes them to be added to ToolingCFlags.
Bug: None
Test: mma in bionic/. clang-tidy now shows 7,142 fewer high-severity
warnings.
Change-Id: If5148858d9db143a3dd9b0ce6c970258ec4ff9cb
Also export the corresponding variable to make.
libnativehelper's include_deprecated contains all of the
headers that are currently used by libraries without
the "nativehelper/" prefix.
The current count of this is this:
2 ScopedLocalFrame.h
4 JniInvocation.h
4 ScopedBytes.h
5 AsynchronousCloseMonitor.h
6 toStringArray.h
7 ScopedStringChars.h
38 JniConstants.h
41 ScopedPrimitiveArray.h
79 ScopedUtfChars.h
80 UniquePtr.h
100 ScopedLocalRef.h
467 JNIHelp.h
Now we can remove each file from the global header include
on a file by file basis.
Bug: 63762847
Test: libs find their headers
Change-Id: Iffc0c1ceb55cc59dc4a70c75d7c0b9ce8397b2cf
Add support for excluding paths from having integer_overflow applied to
them when using SANITIZE_TARGET=integer_overflow via an
INTEGER_OVERFLOW_EXCLUDE_PATHS make variable. This covers the soong side
of the change.
Bug: 30969751
Test: Build with SANITIZE_TARGET=integer_overflow
SANITIZE_TARGET_DIAG=integer_overflow
INTEGER_OVERFLOW_EXCLUDE_PATHS=<path> and confirmed this was no
longer being applied to binaries in that path.
Change-Id: I298b772f5425da28dff1cf007825be19558db3a8
If BOARD_VNDK_VERSION is set, and a module is set to
`vendor_available: true` it is installed in /system and /vendor.
However, if the module is a VNDK library, it must be
installed at `/system/${LIB}/vndk` instead of /vendor/${LIB}.
For those modules, need following to set.
vendor_available: true,
vndk: {
enabled: true,
support_system_process: true,
},
`support_system_process` is optional to define.
If it is defined to true, the module is regarded as vndk-sp.
link-type check for VNDK modules is added to make sure that VNDK
modules only link to other VNDK shared libraries or LL-NDKs.
move the ABI checks to VNDK from all of vendor_available.
Bug: 38304436
Test: attempt to compile with BOARD_VNDK_VERSION:=current
Test: Use `vendor_available_vndk: true` for VNDK modules and compile
with BOARD_VNDK_VERSION:=current
Change-Id: I409268e0b7f05a9d01697bf9f9f4726b5aac631f
Fix mutator registration for tests to allow different tests
in the same package to register different mutators.
Allow tests to track the resulting ModuleBuildParams objects
to use in assertions, and provide helpers for getting them.
For example:
config := android.TestConfig(buildDir)
ctx := android.NewTestContext()
ctx.RegisterModuleType(...)
ctx.MockFileSystem(...)
ctx.ParseBlueprintsFile("Android.bp")
ctx.PrepareBuildActions(config)
ctx.Register()
// Get the Inputs value passed to the javac rule for the foo module
inputs := ctx.ModuleForTests("foo".Rule("javac").Inputs
Test: java_test.go
Change-Id: I10c82967f5f3586d2c176f169906b571ed82fc73
This was breaking SANITIZE_TARGET (and likely others)
Test: SANITIZE_TARGET=address m -j nothing
Test: out/soong/build.ninja is identical before/after
Test: out/soong/Android-aosp_arm64.mk is identical before/after
Change-Id: Ic0d6774025761ec9ae9240c109895ab8032e4784
device_kernel_headers is a built-in heder-only lib that provides device-specific
kernel headers. The header path is configured via a new product variable
SystemIncludeDirs, which is currently the mirror of
TARGET_PROJECT_SYSTEM_INCLUDES in the make world.
Note: generic kernel headers (bionic/libc/kernel) have been added to the
include path by default. "device_kernel_headers" module is for device-specific
kernel headers such as /device/*/*/kernel-headers.
Note 2: this is opt-in for Android.bp modules (i.e. header_libs :
["device_kernel_headers"] required.) while it is always provided to
Android.mk modules.
Bug: 62939405
Test: choosecombo to aosp_sailfish (or any other Pixel/Nexus targets)
BOARD_VNDK_VERSION=current m -j gralloc.msm8996 (or any other vendor
libs using vendor-specific kernel headers)
Change-Id: I81c60abc13942c89fff723d1544b27a81b300db0
Adds the SANITIZE_TARGET=integer_overflow build option to apply signed and
unsigned integer overflow sanitization globally. This implements the
Soong side of the build option.
An additional build option is provided to control whether or not to run
in diagnostics mode, controlled by SANITIZE_TARGET_DIAG. This works the
same way that SANITIZE_TARGET does and currently only supports
'integer_overflow' as an option.
A default sanitizer blacklist is added to avoid applying sanitization
to functions that are likely to exhibit benign overflows.
Bug: 30969751
Test: Building with and without the new flags, device boot-up, tested
various permutations of controlling the new flags from build files.
Change-Id: Ibc8a8615d3132f1a23faaf1cb4861f24c5ef734a
If a vendor (or vendor_available) lib has a dependency to a llndk
library, the name of the llndk library is modified to <name>.llndk.
There was a bug that this name modification is done only for shared_libs
property, but not for export_shared_lib_headers property. As a result,
the headers of the llndk was not re-exported. Fix the bug by modifying
export_shared_lib_headers property as well.
Bug: 63178444
Test: build
Test: look into out/soong/Android-<target>.mk. libutils.vendor has
system/core/liblog/include_vndk in its LOCAL_EXPORT_CFLAGS.
Change-Id: I6fcb1036cdb81ba167ead815b436a5cada283ede
Change module factories from returning a blueprint.Module and a list
of property structs to returning an android.Module, which holds the
list of property structs.
Test: build.ninja identical except for Factory: comment lines
Change-Id: Ica1d823f009db812c518f271a386fbff39c9766f
Update the coverage sanitizer flags in soong to use the new
flavor of coverage sanitization.
Bug: 63108942
Test: Fuzzer runs with coverage guards.
Change-Id: I2e817a5282cf7dab49aee6985743defd4fb74628
With the latest Clang we do not have issue with beqc instruction,
so allow generation of compact branches for mips.
This reverts commit 3d6a38d601.
Change-Id: I6dbb5d1fce08bd714cc9a0318d50de5765cff038
Note that libdl is already (always) implicitly loaded
because libc.so has a dependency on it.
This change also makes sure that libc.so always goes before
libdl.so in DT_NEEDED list.
Bug: http://b/62815515
Test: make
Change-Id: Idb231f8a8443ee859828bac6462236a1b7199d05
Whenever a symbol file is not available, header-abi-linker can look at
the symbols with STV_DEFAULT or STV_PROTECTED visibility for further abi
filtering.
Bug: 62463617
Bug: 62307940
Test: make -j64
Change-Id: I5dc618be104a49d47375d37cf78c4490b1529987
Adding a mechanism to conditionally exclude some shared library
dependencies when a lib is built for vendors.
Without this, some libraries cannot be earily marked as vendor_available
if they are depending on shared libs can shouldn't be marked as
vendor_available.
By using exclude_shared_libs with exclude_srcs (or __ANDROID_VNDK__
macro), we can eliminate the unnecessary dependency for vendors.
Bug: 62471389
Test: build
Change-Id: If94277b45c3769223cea371d0028e75277640356
Add a list of flags which are not understood by clang LibTooling tools
and filter them out of the Cflags the tools are invoked with.
Test: In frameworks/av, make libmedia vendor_available (this invokes
header-abi-dumper on this module), mm -j64.
Bug: 62447349
Change-Id: I46f017212b89f4331145c999103d0ed44da0abaf
Setting Sanitize.Diag.Undefined to true does not enable diagnostics for
all possible UBSan sanitizers that might be declared in Sanitize.Misc_undefined
(specifically unsigned-integer-overflow and nullability-*). This adds an
equivalent Sanitize.Diag.Misc_undefined string array to allow diagnostics to
be enabled in these sanitizers.
Bug: 62546512
Test: make works and device boots.
Test: Tested an Android.bp generated binary with the new field enabling
unsigned-integer-overflow diagnostics.
Change-Id: I9aa7cb2555ab4f94ae1aa290715a617718d936ff
We're making an NDK API Council +1 a requirment for changes to these
files, so we need to know that all symbol files will match a given
file pattern.
Test: Changed a symbol file to foo.txt, `make ndk` failed
Test: make ndk
Bug: http://b/35870541
Change-Id: I29690fb97746ad682e57845fea3f1114cfd77598
Also filter out -Wl,--no-undefined for all host sanitizers, not just ASan.
UBSan on host defaults to no-trap (i.e. diagnostic mode), and that requires
the runtime library and runs into the same problem with undefined symbols as ASan.
Bug: 34719251
Test: Misc_undefined: ["integer"] on a soong target
Change-Id: I1fb4781f663a11f5f427d50c0bf9beb8e181cd5e
Merged-In: I1fb4781f663a11f5f427d50c0bf9beb8e181cd5e
(cherry picked from commit fe9bc1dccb)
We now add export_static_lib_headers, export_generated_headers to the
filters while dumping the abi of a library using header-abi-dumper
(through -I<dir> additions to the invocation of header-abi-dumper and
header-abi-linker)
Also add support for zipped reference source based abi dumps.
Test: mm -j64 in hardware/interfaces/nfc/default/1.0 produces
android.hardware.nfc@1.0.so.lsdump with abi filtered out using generated
headers.
Test: Copied the linked abi dumps produced by mm -j64 in bionic/libc to
prebuilts/abi-dumps/ndk and gzipped them. Ran mm -j64 again in
bionic/libc and verified header-abi-diff getting invoked.
Bug: 32750600
Change-Id: I26210af908c87a6143e39fa25f50307acb68a387
This fixes some warnings on internal master where the compatibility
suite logic didn't look at EXECUTABLES (it was checking for
LOCAL_MODULE_CLASS == NATIVE_BENCHMARK, which doesn't exist).
Test: Compare out/soong/Android-aosp_arm64.mk
Test: Compare out/build-aosp_arm64.ninja
Change-Id: Ibe3c40e81e26f4c4cb9fd5bea1619b94181764fb
Soong command lines have gotten very long due to hidl modules
reexporting lots of libraries. Dedup the include dir flags.
Test: m -j checkbuild
Change-Id: I6ada1251012da42344e2c00ae66001a649023d2c
* Cortex-A15 supports VFPv4 instructions
Test: make otapackage
Test: Built angler with 32 bit variant set to cortex-a15.
Test: Boot this version of the angler, ran bionic unit tests.
Change-Id: I94f00c9486ece201aa2c230308b9f90b0209dc4a
This reverts commit 4068a5db6c.
Now the Mac xcode-select and xcrun goes through Config.HostSystemTool,
which will grab $PATH through Config.Getenv
Test: m -j (on mac)
Change-Id: I2632c4fdb2ec961e59944cf02ff165e0fd3c869d
Also, update flags for cortex-a53.
Bug: 37647380
Test: Built target with cortex-a73 for both 32 bit/64 bit.
Test: Built target with cortex-a53.cortex-a57 for both 32 bit/64 bit.
Test: Ran bionic unit tests, ran art target tests.
(cherry picked from commit 1d9aa26d44)
Change-Id: I3325f60add7f424f8cca53c22919fc481ef5e787
Descriptions currently look like:
[ 0% 4/29328] cc out-soong/.intermediates/external/clang/lib/Sema/libclangSema/android_arm_armv7-a-neon_denver_static_core/obj/external/clang/lib/Sema/SemaCodeComplete.o
This is not very helpful - most of the characters are used to show the
output path, which contains useful information like target architecture,
but also contains most of the path to the source files twice, and less
useful information like the exact variant name used by soong.
Make the descriptions look like:
[ 0% 3/29329] //external/clang/lib/Sema:libclangSema clang++ SemaTemplateInstantiate.cpp
This is //path/to/module:modulename tool relative/path/to/source/file
Test: builds, looks pretty
Change-Id: I3087aa7d4eb1860ef6239d77407b8b35445616d7
Add Sanitize.Order cflags after the general sanitizer options, so
it can override the global -fno-sanitize-recover=all.
Bug: 38128476
Test: m SANITIZE_HOST=address
Test: manual test
Change-Id: Ied5600507b66bd25d9d2a8bba428162ed4eb01e4
Moving the last users of a sanitizer runtime library to soong was
causing the runtime library to stop getting installed. Declare
the dependency so make keeps installing it.
Test: builds
Change-Id: Ieeb9ad5c04ac8df0d1a74239da393dac5cab2b03
C++ sources generated from .rs files need includes in
frameworks/rs and frameworks/rs/cpp. Add them automatically
instead of requiring modules to add them manually.
Test: builds
Change-Id: I7270fef0b36c1956475d6d83ab8aa2e3c362e688
Remove -Wa,-mmxu option because clang doesn't support it.
Test: successful build of mips32r2-fp-xburst arch variant
Change-Id: I0c3da5dee0bb3acb44e75991b4763b061acc86e1
When linux_bionic is turned on, there are two host modules for the
preprocessed ndk headers, but only one is enabled. So exit early for the
disabled one.
Bug: 31559095
Test: Diff out/soong/build.ninja before/after, no change.
Test: Turn on linux_bionic, no longer see a panic.
Change-Id: I204a884a83ccf21c96088e97c19a0cffe029ec99
Hides:
In file included from frameworks/rs/cpu_ref/rsCpuExecutable.cpp:4:
In file included from prebuilts/ndk/current/sources/cxx-stl/llvm-libc++/include/fstream:169:
In file included from prebuilts/ndk/current/sources/cxx-stl/llvm-libc++/include/ostream:138:
In file included from prebuilts/ndk/current/sources/cxx-stl/llvm-libc++/include/ios:216:
In file included from prebuilts/ndk/current/sources/cxx-stl/llvm-libc++/include/__locale:21:
prebuilts/ndk/current/sources/android/support/include/locale.h:97:9: error: 'LC_GLOBAL_LOCALE' macro redefined [-Werror,-Wmacro-redefined]
^
out-soong/ndk/sysroot/usr/include/locale.h:115:9: note: previous definition is here
^
Test: builds
Change-Id: I766e8645db33e6e71f44a131aa0b1649d83e8c51
We have code that acts slightly differently when the static analyzer is
running, so that it can produce more accurate diagnostics (e.g. less
false positives). It uses __clang_analyzer__ to detect the static
analyzer.
When the static analyzer is run via clang-tidy, __clang_analyzer__
doesn't get defined.
Bug: None
Test: WITH_TIDY=1 m. clang-tidy now acts as expected in code made for
the static analyzer
Change-Id: I460ff410640524633c0a60b71d34927d17e1ed98
Remove the last -isystem for global include directory (besides
bionic).
Bug: 31751828
Test: builds
Change-Id: I8f38332de8f0cffd5c56b9b5ebeacbaaf3a4faea
Merged-In: I8f38332de8f0cffd5c56b9b5ebeacbaaf3a4faea
(cherry picked from commit d13a457a45)
The deps have to be exported alongside the headers to make sure
the headers are in place when a module that depends on the shared
library builds.
Bug: 37555583
Test: use protos in a cc_library
Change-Id: I8f5b8d7937868458c1cf02b990a348aa395634da
hasSrcExt is used to determine extra flags and dependencies when
generated files are used. If the generated files are being handled
in a static library whose objects are reused in a shared library,
the flags and dependencies still need to apply. Instead of clearing
the source files in the shared library, move them to an OriginalSrcs
property, and check that in hasSrcExt along with the Srcs property.
Also pass extra exported include directories from the static
library to the shared library.
Bug: 37555583
Test: use protos in a cc_library
Change-Id: I709779ec03b66b220b7bd58a1f6f0b9b5067d955
Allow properties to be overriden by arch variants.
Add include_dirs and local_include_dirs properties.
Pass -I . to fix:
frameworks/base/proto/src/metrics_constants.proto: File does not
reside within any path specified using --proto_path (or -I). You
must specify a --proto_path which encompasses this file. Note that
the proto_path must be an exact prefix of the .proto file names --
protoc is too dumb to figure out when two paths (e.g. absolute and
relative) are equivalent (it's harder than you think).
Test: m -j libplatformprotos
Change-Id: I3e02621ca25bfa7ca0a0e3b83377d70dd352668f
References to an MSA architecture feature were added in
I3cadc29434dbd5fdb3aa780198414e90f9572ec5, but never added
to the build system.
Test: builds
Change-Id: I178813824a21475e013f7e8209d9473466ab821c
Generating released API levels and android-current is not sufficient
in a trunk-stable world. One branch will have the stable APIs and
possibly multiple unreleased API levels. We need to generate stubs
for each unreleased API level up to our current target.
I still need to add support for things like `# introduced=O` before
this is really done.
Whether or not we still need something like "current" that would map
to the absolute latest even it hasn't been assigned a code name yet
is uncertain.
Test: make ndk
Bug: None
Change-Id: I282be1347ab39c56fa887d4d71c03bb12c300dc5