Also, prefer
-Wl,--execute-only
rather than
-Wl,-execute-only
Bug: 139945549
Bug: 146144180
Test: m
Change-Id: I4a07978c7a84a0a7e841b9e059305b0f443d0e95
Suggested-by: Ryan Prichard <rprichard@google.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
See the Changes.md addition for more details.
Test: treehugger (build_test on downstream branches)
Change-Id: I6ad6b454a6fccf93772fda26cfc7dd6bbfc07c40
Exclude vendor/ and hardware/ from the manually written binder interface
whitelist.
Bug: 136279235
Test: interfaces in excluded directories are not checked against whitelist.
Change-Id: I71152995466a25e92b6d0b153538ebfc1b252f5b
No device in our tree use this obsolete thing now.
OEM devices with libhealthd should define health HAL
2.1 instead.
Test: builds
Fixes: 127677771
Change-Id: I1861452a3f7fc97ee20615c8f9f25422f9f507e2
To remove '../' and other strangeness from compiler arguments, which run
into problems with remote execution:
Android.mk: LOCAL_C_INCLUDES := $(LOCAL_PATH)/include/bar/..
foo.c: #include "foo.h"
include/foo.h
In this case, we'll send foo.c and include/foo.h, but include/bar may be
empty, and not exist on the remote server. So while the file is there,
you may not be able to access it.
There's also a byproduct of removing extra '/' and './' components,
which should be harmless.
Fixes: 144109314
Test: diff build-aosp_arm.ninja before/after; scan diffs
Test: treehugger
Change-Id: Id2eceba76fbf9b1524487e82cb5c8903c815e45f
Use of -Weverything blocks build system changes and toolchain updates
on new warnings. Forbid it in the build system. Developers can
experiment with -Weverything on their module by adding it to their
Android.mk file and building with
m ANDROID_TEMPORARILY_ALLOW_WEVERYTHING=true
Fixes: 143713277
Test: manual
Change-Id: Ifca9ad45301b0d51f18b5ae85cfb9e5b89fbef3f
Use .KATI_NINJA_POOL := none to mark rules that can run in RBE or
goma when they are enabled, which along with passing
--default_pool=local_pool will allow moving remoteable jobs into
the remote pool without relying on hacks in kati.
Fixes: 143938974
Test: inspect pools in build-${TARGET-PRODUCT}.ninja for m USE_RBE=true
Test: inspect pools in build-${TARGET-PRODUCT}.ninja for m USE_GOMA=true
Change-Id: I08615ae1f2eaef9ff0ba253b8aa3d83ab57ebb27
The NDK is built like this. Having it for app builds within the Android
build system allows us to distinguish platform code from app code.
This is specifically to distinguish AIDL interfaces using libbinder_ndk.
'myBinder-ndk_platform' libs will use additional functionality that
'myBinder-ndk' libs won't use (in the future, these may be separate
variants with the same name, see b/121157555).
Bug: 136027762
Test: using this to distinuish code in NDK vs platform code
Change-Id: I27471b9184e8d67fc51c8eace317f92b3f0f3539
Now that ONE_SHOT_MAKEFILE no longer exists, we don't have to rely on
the filesystem to store this informtion.
This removes ~16.7k files from our build graph
(aosp-master/aosp_arm64-eng), though only about 600 of them were being
used in a normal build.
Test: treehugger
Change-Id: I3ac12f5ea7f11d25064109a0599bc5be1976fba5
Bug: http://b/119086751https://android-review.googlesource.com/c/837025 disabled lld relocation
packing globally and enabled it for soong modules targeting pie and
above. Turn it on for Android.mk modules as well.
Test: grep for -Wl,pack-dyn-relocs=android in
out/build-aosp_<device>.ninja
Change-Id: I81b8625073aa6b364219b8cf3122b69c95ec7589
Clang derives the value of __ANDROID_API__ from the triple these days. In a
future version of clang I plan to start making the behaviour of the HWASAN pass
dependent on the API level in the triple, so it's going to need to be accurate.
Test: walleye-userdebug boots
Change-Id: I23f570bd8ee4fb3167729a75a5e859efe1883a46
libprofile-extras has a wrapper to getenv() that appends the effective
userid (euid) of the current process to GCOV_PREFIX. This avoids
conflicts and permissions issues when multiple processes try to
create/access the same directories and files under /data/misc/trace.
This library needs to be added and the -Wl,--wrap,getenv flag needs to
be passed to all link steps. Since Android.mk does not propagate flags
and libraries across dependencies, this change just adds the library and
flag to all non-static-library Android.mk modules. As a consequence,
*ALL* binaries created via Android.mk will have the signal handler and
property watcher thread in libprofile-extras but they are no-ops in
non-coverage-enabled binaries.
The dependency is added early enough in core/binary.mk so that the
LOCAL_SOONG_LINK_TYPE resolutions occur correctly.
Test: Verify that coverage files are written to
/data/misc/trace/<euid>/proc/... instead of /data/misc/trace/proc/...
Change-Id: I4d5f849c15e9a278253f2148185ddf3ab2878e2f
Historically, we've relied on the path to the clang compiler changing in
order to trigger rebuilds instead of direct dependencies on the compiler
itself. That's somewhat more reliable, since the actual $(CLANG) file is
often a script that doesn't actually change during every update.
In Soong, we've added the dependency anyway, so do it here as well. This
makes it easier for my RBE experiments to identify when we intend to use
clang and to send the entire compiler.
Test: treehugger
Test: build a system image with RBE, find that every command that needed
the compiler gets it.
Change-Id: I3838b5d77884394a8c0f7a1ba133142102602084
Looks like the reason for it existing has been fixed. It should probably
just be removed.
Bug: None
Test: WITH_TIDY=1 m
Change-Id: Ic001393da7211cd6ef2bbd5af6ef13c7fe8e00e7
When TARGET_VNDK_USE_CORE_VARIANT is set to true, the vendor variant of
VNDK libraries are by default not installed. Instead, the core variant
will be used by vendor binaries at runtime.
To ensure the core variant of VNDK libraries are installed, we also add
a flag LOCAL_VNDK_DEPEND_ON_CORE_VARIANT to indicate that the vendor
variant module depends on the core variant module. This flag should be
set by Soong for all VNDK libraries without the vendor variant
installed. When the flag is set, the vendor variant binary is also
compared against the core variant binary to ensure they are
functionally identical.
As we are merging the two variants for some libraries, we need a new
link type to denote a module is usable as both native:vndk and
native:platform. We add native:platform_vndk for this.
Bug: 119423884
Test: With the corresponding Soong change, build with
TARGET_VNDK_USE_CORE_VARIANT set to true.
Test: Add a dummy VNDK library and a dummy vendor binary that depends
on it. Build with no-vendor-variant VNDK and check the core
variant is installed.
Test: Add conditional compilation based on __ANDROID_VNDK__ in the
dummy VNDK library and check build fails.
Change-Id: I40000f2728e8193212113c1ee950e9d697f2d40d
There never were too many users of this, and I've just converted the
last ones to Soong.
Test: diff build-aosp_arm.ninja
Test: treehugger
Change-Id: Ida6d486a62d0b521c1cd67f5f18c0ad0dbe957e3
Add 32BIT and 16BIT compile time flag for nanopb library to support
16BIT or 32BIT size, default is 8BIT. User need to use the corresponding
library when define the PB_FIELD_* flag during compilation.
Change-Id: I0d25bcdf62d6b47733e1ad4bddbd4dfce2192b5d
Test: None
Bug: 122292884
These now must be defined in Android.bp files.
Bug: 122618577
Test: compare build-aosp_arm.ninja before/after
Test: codesearch for LOCAL_MODULE_HOST_OS.*windows
Change-Id: I14451c7753299692940e026f85687b4c3331bb07
This enables execute-only memory (XOM) layouts to be used by default in
the build system. As of now, there's only support for ARM64 devices, so
this only affects those. Since userland XOM requires kernel support,
devices without the necessary support will continue to allow pages
marked execute-only to be read and they should be unaffected by this.
Bug: 77958880
Test: Device with and without kernel support boot.
Test: Binary throws segfault when reading from XOM on supported device.
Test: Debugger works and stack traces are still generated correctly.
Test: Teamfooding, stable during regular usage.
Change-Id: I8db4235c8e60eea6d701bdf3c43b79a06d6b01cd
This fixes the WITH_TIDY flakes that we've been seeing, as we've been
relying on a particular order of target-specific variable inheritance.
Change-Id: I68c8a56620c29a41e45f26e5ea81a5313490c1cf
Fixes: 122637600
Test: WITH_TIDY=true m libhellojni_jni
I'll be adding more intermediate targets in this file, so move all of
the uses closer to the end.
Bug: 122637600
Test: build-aosp_arm64.ninja is the same before and after
Change-Id: Ib8a588e570cb2a61bab75118db6e480d6afceaa8
vtsc just ignores the -d argument and apparently can't write a depfile.
So for now, just stop assuming it produces one.
Bug: 121058584
Bug: 120496070
Test: NINJA_ARGS="-w missingdepfile=err" m libvts_interfacespecification
Change-Id: Ie1483fbeead9f710d8a6636df07ce44bbc4a6e2d
Bug: http://b/116873221
The coverage runtime (libclang_rt.profile) needs stderr, which is
exported by bionic only after API level 23.
Test: Build with coverage on globally
Change-Id: I1bdfbbf248d1743d529e9f40f0b52da92bb20ef7
AArch64 execute-only memory is only supported when using lld as the
linker. There's still a few modules which don't use lld, so in those
cases we need to disable this option.
Bug: 77958880
Test: Module with LOCAL_USE_CLANG_LLD false builds without XOM
Test: Module without LOCAL_USE_CLANG_LLD defined builds with XOM
Change-Id: I5dfe3cd1e1cac2b3ead13912af9f7fe896d507e9
Adds build system support for generating AArch64 binaries with
execute-only memory layouts via a new LOCAL_XOM property. Also adds
support for an ENABLE_XOM build flag for global builds.
Bug: 77958880
Test: make -j ENABLE_XOM=true
Change-Id: I6af9e3615d0a9fdff802eae50e6ad94311ec8046
This fixes a bug where cross host OS notice dependecies were incorrectly
added and caused missing file errors.
Bug: 36073965
Test: Manual build + inspection
Change-Id: I3983ad6158acf939842f836fe3f44cecf9187087