Move the last clang-specific list into the common global list. This
affects the command line flag ordering due to the the -fdebug-prefix-map=
flag that is added by an init() function, which will force every native
rule to recompile.
Bug: 68947919
Test: m checkbuild
Change-Id: Ic2509e61e9555e9483b92a18d7e8d9913b7125cc
Squash the contents of some clang-specific ninja variables into
the main ninja variables.
Bug: 68947919
Test: no change to command lines used to build mmma bionic
Change-Id: I29bf144b03307a7893376e68d82f12f5c40e8e95
Remove cflags that are not handled by clang from the global defaults,
and remove calls to ClangFilterUnknownCflags.
Squash lists of clang-specific default flags into the main default
flags lists.
Rename Toolchain.Clang*flags to Toolchain.*flags.
Rename Go variables with Clang in the name that have no non-Clang
equivalent.
Remove unused ninja variables.
Bug: 68947919
Test: no change to build.ninja for aosp_cf_x86_64_phone-userdebug or aosp_crosshatch-userdebug
Change-Id: Id287945315d53e5eaef197adbbb4f1302f2e3680
This CL exports common/global/device/host clang/ld/ldd flags
from their Ninja variable initialization locations in
cc/config/global.go and cc/config/clang.go to make Bazel's cc_toolchain
and Soong's cc actions more consistent with each other.
This does not handle env-dependent or arch-specific toolchain flags
yet (logic in compiler.go and linker.go).
Test: TH
Bug: 187086342
Bug: 187084737
Bug: 186628704
Bug: 187857770
Change-Id: Ie403d7cd23f35160897b9dd902c799cbf1bd7f0c
New clang compiler issue too many such warnings.
Bug: 179065588
Bug: 179309338
Bug: 179278370
Test: make, presubmit
Change-Id: I9948a4b34ec75a01aa24c2fd753722b072ae5202
This change turns -Wunguarded-availability option which enforces calls
to APIs which are introduced after the min_sdk_version of the
compliation unit to be guarded with __builtin_available check. For
example, let's assume that we have foo() which was introduced with API
level 30.
void foo() __INTRODUCED_IN(30);
Then if foo() is called for a module whose min_sdk_version is less than
30, say 26, it should be called as below:
if (__builtin_available(android 30, *)) {
foo();
} else {
// fallback impl
}
For modules whose min_sdk_version is >=30, the guard is not required.
Bug: 150860940
Bug: 134795810
Test: m
Change-Id: I084148b9a051350626a37cb394daa4398b7332d5
Also suppress a clang-tidy warning and a ubsan check to pass compilation.
Bug: 171348143
Test: build.
Change-Id: Ie5162c15df172cefd7cff9776e54531fd620bc23
* Rename `vndk_deps` mutator to `sabi_deps` to better reflect its
purpose.
* Eliminate duplication of ABI dump generation logic. sabiDepsMutator
should call libraryDecorator.shouldCreateSourceAbiDump() to determine
if a module needs to be marked with CreateSAbiDumps.
* Non-VNDK libraries that are opt-in to ABI check would have their
dependencies correctly marked with CreateSAbiDumps.
* Refactor some lines to idiomatic syntax.
* Add comment strings.
Bug: 145608479
Bug: 173492236
Test: TH presubmit
Change-Id: I99e97787bdf2a4f0c970809161b64aa668ff3d1a
Also suppress some warnings/flags globally to pass compilation.
Bug: 149839606
Test: build aosp_arm64-userdebug.
Change-Id: I0ed740e51b6b39c58842a58eabcf3cdf404e73fa
Allow new clang compiler warnings until they are
fixed or suppressed in all branches.
Bug: 145916209
Test: make checkbuild
Change-Id: Ic873b8d705dacd0d92f9031b3960e01283090363
This reverts commit 862eb4648a.
Re-upgrades the compiler to clang-r370808, after first dealing with
regressions in ndk_translate and execute only pages.
Bug: 139945549
Bug: 145807809
Bug: 145827049
Bug: 145825270
Test: atest \
CtsSelinuxTargetSdk27TestCases:android.security.SELinuxTargetSdkTest#testNoExecuteOnly
Test: m ndk_translation_host_unit_tests && \
./out/host/linux-x86/nativetest/ndk_translation_host_unit_tests/ndk_translation_host_unit_tests
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Change-Id: I714b582faffa8c92384818a7b12338d621968548
-Wc99-designators warns for the use of nested and array initializers in
C++20 code. Many internal projects have pushed back against this
warning.
Disables:
- -Wimplicit-int-float-conversion
- -Wpointer-compare
- -Wxor-used-as-pow
- -Wfinal-dtor-non-final-class
- -Wreorder-init-list
For projects under external/, vendor/, etc, but only if they use
Android.bp (not Android.mk) and -Wreorder-init-list may be re-enabled by
-Wall if set locally.
-Wno-incomplete-setjmp-declaration is needed for NDK stubs that get
generated (functions without full definitions of their parameters).
Sets
- -Wno-error=implicit-int-float-conversion
- -Wno-error=reorder-init-list
for all projects in order to unblock landing the compiler upgrade due to
internal projects not being able to disable or fix these before the
upgrade.
Bug: 139945549
Test: build (aosp_crosshatch, crosshatch, aosp_x86_64-eng,
walleye), boot internal devices, bionic + RS atests, kernel builds.
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Change-Id: I18e3c0eb657fd59824526f36c6dd57bdcf0526ba
Some of the warnings are too common to fix/opt-out for non-Google
projects.
Also in the change, minor clean up of duplicated code.
Test: presubmit
Bug: 139945549
Change-Id: Ic176ef1f17133405851a79592b6bef5ccb403bd9
-Wthread-safety-negative was disabled because it requires locks to
support an operator!(), and std::mutex in libc++ does not. Disabling
it everywhere was preventing it being used for modules that want to
opt in to using it and provide their own lock that supports
operator!(). Modules that use -Weverything should either stop using
-Weverything (preferred), or add -Wno-thread-safety-negative.
Bug: 143713277
Test: m native
Change-Id: I0b84679a806a21b16cabe7f739fde61c3efe2cbe
The compiler upgrade to r370808 can now check C code for implicit
fallthrough. This is triggering a massive number of warnings throughout
external/ and the rest of the platform.
Revisit enabling this for C another day.
Bug: 139945549
Test: m
Change-Id: I8dfaedab78c6230b46e8a45a9e65106dec363380
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
hidl/aidl actually does concern about this warning. After fixing their
codebase, this flag is no longer needed.
Test: presubmit
Change-Id: Id88abea88137be0f873c21db76644fe78b9045c8
Clang is smarter at producing this new warning now, producing far
fewer false positives. Re-enable the diagnostic for Android.
Test: build
Bug: 72331526
Change-Id: Ide827791c51587bceb977ae4116894a8cd620eb1
Clang is smarter at producing this new warning now, producing far
fewer false positives. Re-enable the diagnostic for Android.
Test: build
Bug: 72331526
Change-Id: I2020b887fbeb3cd833462e50df835a6cd104920d
For walleye, the overall binary size is decreased by ~1.1%.
For Googlers, http://go/android-llvm-newpm
Test: build
Bug: 131855431
Change-Id: I6726cd3de0d528b773fb23eae1a7c5c360e29807
So that projects can override the flag through cflag (CPPFlags are
appended after CFlags).
Test: m checkbuild
Change-Id: Ib72f4ed4731f41982a0eb8a90c782c09810aa8c9
Emit address-significance table which allows linker to perform safe ICF.
Clang does not emit the table by default on Android since NDK still uses
GNU binutils.
With the flag, binary size is decreased. For Marlin:
-fno-addrsig -faddrsig diff
/system/bin 28012K 27108K -3.33%
/system/lib 88220K 86964K -1.44%
/system/lib64 151936K 148108K -2.58%
Test: m checkbuild
Bug: 128940110
Change-Id: I99511f038a6d4b88b5c849a0f8943c24731ab6ea
Merged-In: I99511f038a6d4b88b5c849a0f8943c24731ab6ea
(cherry picked from commit a32b5e6a6b)
Emit address-significance table which allows linker to perform safe ICF.
Clang does not emit the table by default on Android since NDK still uses
GNU binutils.
With the flag, binary size is decreased. For Marlin:
-fno-addrsig -faddrsig diff
/system/bin 28012K 27108K -3.33%
/system/lib 88220K 86964K -1.44%
/system/lib64 151936K 148108K -2.58%
Test: m checkbuild
Bug: 128940110
Change-Id: I99511f038a6d4b88b5c849a0f8943c24731ab6ea
(cherry picked from commit a32b5e6a6b)
All instances for the warning are fixed/suppressed, turn the warning
back on.
Test: m checkbuild
Bug: 128878287
Change-Id: Ifd5f9a64cb7ff1ce47f498ed38436056b493ee92
Emit address-significance table which allows linker to perform safe ICF.
Clang does not emit the table by default on Android since NDK still uses
GNU binutils.
With the flag, binary size is decreased. For Marlin:
-fno-addrsig -faddrsig diff
/system/bin 28012K 27108K -3.33%
/system/lib 88220K 86964K -1.44%
/system/lib64 151936K 148108K -2.58%
Test: m checkbuild
Bug: 128940110
Change-Id: I99511f038a6d4b88b5c849a0f8943c24731ab6ea