Commit graph

446 commits

Author SHA1 Message Date
Yi Kong
33fb507271 Revert^3 "Upgrade to clang-r522817"
This reverts commit 7a4012586b.

Still more build breakages...

Change-Id: I2081d68e37bf260da78c651bb8fb9ae0d05b4c37
2024-04-22 23:04:07 +00:00
Yi Kong
7a4012586b Revert^2 "Upgrade to clang-r522817"
This reverts commit 321dd23b34.

Breakage is fixed by https://r.android.com/3051002.

Change-Id: I70925c7aa01fb78ec701971ee97192993aef0edd
Test: abtd
Bug: 322868540
2024-04-22 07:22:02 +00:00
Phenix Chen
321dd23b34 Revert "Upgrade to clang-r522817"
This reverts commit dccbef36a4.

Reason for revert: Potential culprit for b/335755564

Change-Id: I3fd02f2b08ad94a4e022cbebcd96afc2fab2e1d8
2024-04-19 05:30:10 +00:00
Yi Kong
dccbef36a4 Upgrade to clang-r522817
Bug: 322868540
Change-Id: Ia75c1e71574b0c0dfc11d5d4e9d06cf855f28c36
2024-04-18 14:11:37 +09:00
David Duarte
eefabc8a67 Allow override of -Wno-error=format
Move -Wno-error=format from noOverrideGlobalCflags to
commonGlobalCflags so that projects can re-enable it with
"-Werror=format"

Bug: 315250603
Test: Add -Werror=format to bluetooth_cflags
Change-Id: I677cee5373c670c1a3b0eceeea1b7c35d28a17c2
2024-04-10 23:15:08 +00:00
Cole Faust
8982b1c49e Remove "exported" ninja variables
There was infrastructure to export ninja variables to bazel. Now that
the bazel migration is cancelled, we don't need it anymore.

Bug: 315353489
Test: m nothing
Change-Id: I298cc2ac7ebd004557be3b30d75f7357cab0b7a0
2024-04-09 09:42:37 -07:00
AdityaK
a0ad736b91 Remove wtautological warnings added during toolchain update
Bug: b/301328082

Change-Id: I0bf10e4a9456dff1b3a521ca13cb5170e738f80a
2024-02-16 19:44:26 +00:00
Pirama Arumuga Nainar
7493929ff2 Enable -Wambiguous-reversed-operator
Bug: http://b/323152930
Bug: http://b/324323434

The ambiguity in frameworks/av/media/codec2 is resolved.

Test: build partner branch, and presubmit
Change-Id: Ie1aa0b6c965b1a9076333d7d25fd9f9664467a31
2024-02-09 22:45:58 +00:00
AdityaK
12f239fd37 Move Wno-ambiguous-reversed-operator to noOverrideGlobalCflags
Some builds were still failing when it was in noOverrideExternalGlobalCflags

Bug: b/324323434
Change-Id: Ibaaa611f085d94e7defac7f2a6aa70b9eef08552
2024-02-08 16:28:20 -08:00
AdityaK
94688b5a4f s/Wno-error=unused-variable/Wno-unused-variable
http://b/315246135

Change-Id: I2086c644afc9a371732ccbe18d09fa078286ece0
2024-02-08 16:25:01 -08:00
AdityaK
839eda517e Add Wno-ambiguous-reversed-operator to get around the operator== lookup issue in clang
Bug: b/323152930
Change-Id: Iee1bc4dd9db9a0fe38d7cf871c34abb638abc092
2024-02-07 20:30:55 -08:00
Aditya Kumar
b2a56627a2 Merge "Revert^2 "Update clang version to clang-r510928"" into main 2024-02-03 12:54:13 +00:00
Aditya Kumar
ef7c121a6b Revert^2 "Update clang version to clang-r510928"
22686bab04

Change-Id: I1117546bb71548e1146c6ae43419b6aef772f812
2024-02-02 14:32:47 -08:00
Pirama Arumuga Nainar
22686bab04 Revert "Update clang version to clang-r510928"
Revert submission 2804373-clang_r510928

Bug: http://b/301328082

Reason for revert: Broke aosp-main/aosp_x86-next-userdebug

Reverted changes: /q/submissionid:2804373-clang_r510928

Change-Id: I6802b329e8dbd9dce5a75aab76c43960765a8594
2024-01-31 06:51:49 +00:00
AdityaK
0790ce2e56 Update clang version to clang-r510928
Bug: b/301328082
Test: N/A
Change-Id: Ied250c42c33d9e2d8bd9b9161b9028874540addb
2024-01-30 15:09:29 -08:00
Prashanth Swaminathan
13b063730a Reduce warning spam from "unused-" flags in //external, //vendor, //hardware
Some clang unused-* warnings are not covered by "-Wno-unused". Add them
explicitly to avoid noise from these warnings, given that they don't
generally get fixed.

Test: Local clean builds.
Change-Id: I13f5089fd68f1a67a11be14fa41807688d803ba3
2024-01-30 20:31:25 +00:00
Elliott Hughes
2ced4b5c66 Greatly reduce build warning spam.
No-one ever fixes unused-* or deprecated-* warnings in external/ (nor should they!).

-Wno-deprecated-enum-enum-conversion should probably have been added
next to -Wno-deprecated-anon-enum-enum-conversion when it was added,
since it's a major spam contributor, and equally unlikely that anyone
will clean them up.

-Wno-deprecated-dynamic-exception-spec is a weird special case because
it should be irrelevant after our next libc++ update, but in the
meantime -- because libc++ is used everywhere -- this is a massive spam
contributor that no-one on Android cares about because we don't use
exceptions (and the people seeing this can't fix libc++ anyway).

Test: local clean builds
Change-Id: I098202337e9e5026c4c5215dbf5a2abf1fbbdca8
2024-01-22 18:34:10 -08:00
Colin Cross
bcf53701b7 Fix race CommonGlobalCflags when running tests in parallel.
Clone the commonGlobalCflags global variable when modifying it so that
it gets a unique object per context.

Test: go test -race ./...
Change-Id: Ia4b91c40939d4b4d338bd11e4d4f523521874548
2024-01-17 11:11:03 -08:00
Colin Cross
8ff105860d Remove ConvertWithBp2build implementations
Remove the ConvertWithBp2build implementations from all the module
types, along with the related code.

Bug: 315353489
Test: m blueprint_tests
Change-Id: I212672286686a318893bc7348ddd5a5ec51e77a7
2023-12-08 13:51:05 -08:00
Tomasz Wasilczyk
e14961626c Bump default experimental from gnu++2a to gnu++2b.
Bug: 311052584
Test: treehugger
Test: m checkbuild
Change-Id: I5e9d479dd4c14e21fe7d29ea6894f1149fd15e50
2023-11-15 11:46:26 -08:00
Elliott Hughes
c79d9e3053 Bump the default from gnu++17 to gnu++20.
We should update gnu++2a to gnu++2b too, but not in this CL.

Bug: 311052584
Test: treehugger
Test: m checkbuild
Change-Id: I3637444d74868b3a29b425fd749ecbbe1a45fbf7
2023-11-15 11:46:03 -08:00
Yi Kong
0fa503da2e Only enable MLGO for ARM64 ThinLTO targets
The MLGO model we embed in the Android Clang is trained on ARM64
ThinLTO artefacts. Applying the model across architectures does not
necessarily translate to performance improvement. Therefore only enable
the optimisation on ARM64 ThinLTO for now.

Test: presubmit
Bug: 293827654
Change-Id: Ie64a65c11191cf700a463637a0746c8470d3aa3c
2023-11-07 14:12:51 +09:00
Aditya Kumar
e19a173a48 Merge "Discard IllegalFlags when testing a new compiler" into main 2023-10-29 00:50:33 +00:00
AdityaK
e7b606717a Discard IllegalFlags when testing a new compiler
Also add -Wno-everything as suggested by Pirama

Bug: b/308179696

Follow up: https://b.corp.google.com/issues/308179380

Change-Id: Iaa73f2b52363562b2391346d8b2e5dc73bab4f2d
2023-10-27 18:54:58 +00:00
Krzysztof Kosiński
14e25a504c Merge "Revert "Revert "Enable -Werror=incompatible-function-pointer-types""" into main 2023-10-26 21:46:35 +00:00
Krzysztof Kosiński
83199b5e4d Revert "Revert "Enable -Werror=incompatible-function-pointer-types""
This reverts commit 5e75975e04.

Reason for revert: breakages fixed

Change-Id: Id54499eabaca649bee5ea6452a3a4134d8773e2d
2023-10-26 07:16:29 +00:00
Treehugger Robot
c70be4b986 Merge "Globally disable -Wreorder-init-list." into main 2023-10-22 09:49:55 +00:00
Krzysztof Kosiński
8f8cc1668e Globally disable -Wreorder-init-list.
This warning is triggered even when initializers don't have any
side effects, so it very rarely surfaces actual bugs/mistakes.
99% of the time it complains about a purely cosmetic issue.
Disable it by default in commonGlobalCFlags, which still allows
individual modules to opt into it.

Bug: 145210666
Test: presubmit
Change-Id: I671b5c457ee3d92b9cc37f020ba54e01e1a04f59
2023-10-22 05:09:40 +00:00
Eric Rahm
1952471c56 Reapply "Use zstd to compress debug info in cc libraries"
This reverts commit d0500f10ef.

Test: m
Bug: 305277519
Change-Id: I126395d32cfc0048b6403c831613d9b4a178af4d
2023-10-20 16:01:14 +00:00
Eric Rahm
5571ab8599 Reapply "Compress debug info in clang builds with zstd"
This reverts commit 6d089b7de0.

Test: m
Bug: 305277519
Change-Id: Iaa27fa0aae8ef624b403e905bfb04df15e380baf
2023-10-20 16:01:14 +00:00
Matías Hernández
6d089b7de0 Revert "Compress debug info in clang builds with zstd"
Revert submission 2788316

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.corp.google.com/builds/quarterdeck?branch=git_main&target=panther-next-userdebug&lkgb=10981485&lkbb=10981536&fkbb=10981536, bug b/306625613

Reverted changes: /q/submissionid:2788316

Change-Id: I7a49b82d26454fe34f8200622a38cdabc0f446cf
BUG: 306625613
2023-10-20 13:07:14 +00:00
Matías Hernández
d0500f10ef Revert "Use zstd to compress debug info in cc libraries"
Revert submission 2788316

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.corp.google.com/builds/quarterdeck?branch=git_main&target=panther-next-userdebug&lkgb=10981485&lkbb=10981536&fkbb=10981536, bug b/306625613

Reverted changes: /q/submissionid:2788316

Change-Id: Ice939d57214879416da06d7134c6a8b56eaf00e6
BUG: 306625613
2023-10-20 13:07:14 +00:00
Eric Rahm
f52906f194 Use zstd to compress debug info in cc libraries
We can save a significant amount of disk space by compressing
debug info in `lld` cc builds. This change configures a build
flag to instruct lld to compress debug info when building cc
libraries. Rather than adding a global config we add this to
each target individually to avoid linker failures on windows
cross build targets.

Test: m
Bug: 305277519

Change-Id: I4ab3d47fb0de7e31a39fb671cccde1acee3a2018
2023-10-19 22:47:44 +00:00
Eric Rahm
fa0dff576b Compress debug info in clang builds with zstd
We can save a significant amount of disk space by compressing
debug info in `clang` builds. This change configures a build
flag to instruct clang to compress debug info.

Test: m
Bug: 305277519
Change-Id: Ieeaa655452d847e83ebc6bec0864e47c46f4c6fb
2023-10-19 22:24:58 +00:00
Aditya Kumar
b36eaa663b Revert "Enable hot cold split"
This reverts commit 4e28d0eda2.

Reason for revert: Reverting now that we should have sufficient data from Crystalball https://b.corp.google.com/issues/306023954

Change-Id: I9f92c203eda309956ec192432ba0063eb11f59e2
2023-10-17 21:31:45 +00:00
AdityaK
4e28d0eda2 Enable hot cold split
Change-Id: I6752ee000bc72c488ab197f6671514c9e5faa2bd
2023-10-13 15:35:26 +00:00
Ramya Subramanian
5e75975e04 Revert "Enable -Werror=incompatible-function-pointer-types"
This reverts commit 07c362bf7f.

Reason for revert: DroidMonitor: Potential culprit for Bug 304839693 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.”.

Change-Id: Iafb894510c48af2dd8b015d7264a031ff9348884
2023-10-11 23:00:33 +00:00
Krzysztof Kosiński
07c362bf7f Enable -Werror=incompatible-function-pointer-types
Bug: 296321145
Test: presubmit
Change-Id: I9c056285263061e17e53c4924dcd32bf5310ed91
2023-10-06 20:06:47 +00:00
Treehugger Robot
2eff89a8ce Merge "Remove -Wsign-promo." into main 2023-10-02 23:14:26 +00:00
Krzysztof Kosiński
29c60f34fb Remove -Wsign-promo.
This flag has no effect in Clang:
https://clang.llvm.org/docs/DiagnosticsReference.html#wsign-promo

Bug: 296606895
Test: presubmit
Change-Id: I59c1e6b6cf541529b9f4741accdf26822572426f
2023-09-30 06:15:22 +00:00
Krzysztof Kosiński
1a4572ec9c More documentation for C++ global config.
Bug: 296606895
Test: presubmit
Change-Id: I19a4fa327bf1eac192067caf6d064a740124caf6
2023-09-30 05:49:09 +00:00
zijunzhao
5bcebba331 Handle Clang's change of defaults from -fcommon to -fno-common
Remove fcommon and make fno-common by default.

Bug: b/151457797
Test: make checkbuild
Change-Id: Ieb4c1e1bfff05fd0db894e8eab263fb31b376da9
2023-09-13 05:09:11 +00:00
Treehugger Robot
ca22dfb5d1 Merge "Enable -Wmultichar." into main 2023-09-05 21:17:21 +00:00
Yi Kong
798f5d2e7e Merge "Enable MLGO for register allocation" into main 2023-09-03 05:38:34 +00:00
Yi Kong
67a2dee8c5 Enable MLGO for register allocation
This enables Machine Learning Guided Optimizations (MLGO) for register
allocation. App launch performance on oriole-userdebug is improved by
0.53%, and binary size is very slightly reduced (e.g. 64 bytes for
libart.so).

https://dashboards.corp.google.com/_0e1b06dd_a79e_4433_b625_b62e5cac004b?p=BootImageProfileId:36265

Test: presubmit
Bug: 229056536
Change-Id: I0e5d40bb90a1555a1343f114ebffffca281f20b2
2023-09-03 05:38:14 +00:00
Krzysztof Kosiński
769f5030d4 Enable -Wmultichar.
-Wmultichar is enabled by default, so we don't need to explicitly
enable it.

Bug: 298703966
Test: presubmit
Change-Id: Iae820145e6412365024a97ab3a34d760563785fa
2023-09-02 03:33:00 +00:00
Treehugger Robot
08e1792144 Merge "Enable -Wsizeof-array-div for 3P code." into main 2023-09-01 17:35:53 +00:00
Krzysztof Kosiński
24686c5e22 Enable -Wsizeof-array-div for 3P code.
This warning usually indicates an incorrect size being computed,
which can cause severe bugs.

Bug: 296422292
Test: presubmit
Change-Id: I381dea70a6a408883ec772ccc006746ad66b835f
2023-08-31 01:29:59 +00:00
Yi Kong
ed7c73edfe Update clang version to clang-r498229b
Now built with MLGO. This reduces the total Clang invocation time for
building AOSP by 0.7%.

    TOOLCHAIN_RUSAGE_OUTPUT=/tmp/rusage.txt m -j32
    PGO + LTO + BOLT          83839.78s
    MLGO + PGO + LTO + BOLT   82949.30s

Test: presubmit
Bug: 293616148
Change-Id: I5364c341520172e8e1acafb4aa3330922805ac0e
2023-08-25 15:21:52 +09:00
Krzysztof Kosiński
4353fab901 Enable -Wgnu-designator
Bug: 296606895
Test: presubmit
Change-Id: I2ef67807fef8376ea08f65f60439b7c3b6f73e83
2023-08-21 23:55:44 +00:00