Commit graph

1508 commits

Author SHA1 Message Date
Chris Wailes
ffebc5b71f Revert^8 "Upgrade to clang-r522817"
This reverts commit 8c27af2136.

Reason for revert: Re-land the Rust 1.78.0 and Clang r522817 updates

Change-Id: Id1fe3790c9688f2c204ca26b5638e1a245cc65f4
2024-06-10 18:06:52 +00:00
Dmitrii Ishcheikin
8c27af2136 Revert^7 "Upgrade to clang-r522817"
36c6af6bd2

Change-Id: Id3320a7862f1ebbfe49bfa4caa36e7ccfd515524
2024-06-07 13:06:19 +00:00
Chris Wailes
86cbd9e46d Merge "Revert^6 "Upgrade to clang-r522817"" into main 2024-06-07 03:31:39 +00:00
Yi Kong
36c6af6bd2 Revert^6 "Upgrade to clang-r522817"
This reverts commit 55d4abde48.

Reland after fixes

Change-Id: Ic22c58cd4735c737849379de86097605fccc2036
2024-06-04 16:54:06 +00:00
Liana Kazanova
f820c3beda Merge "Revert "Enable -Wfortify-source"" into main 2024-05-29 00:26:24 +00:00
Liana Kazanova
885f2eec3c Revert "Enable -Wfortify-source"
This reverts commit 5735ef6777.

Reason for revert: DroidMonitor: Potential culprit for b/343287447 - 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: I1aeeddc251db760e2ab01c734733d351514ec5b0
2024-05-28 23:33:24 +00:00
Aditya Kumar
3775725af2 Merge "Enable -Wfortify-source" into main 2024-05-28 22:58:46 +00:00
Aditya Kumar
5735ef6777 Enable -Wfortify-source
Workaround for the post-submit failures
in b/341339765 has been merged.

Test: woodchipper and presubmit
Fixes: 315245071
Change-Id: I840f545cc0892cfdf9c896fd45761ba5308ff1ca
2024-05-24 04:43:18 +00:00
Kiyoung Kim
22152f6cda Remove VndkUseCoreVariant related code from build
VndkUseCoreVariant feature is deprecated along with VNDK. This change
removes related code from Soong.

Bug: 330100430
Test: AOSP CF build succeeded
Change-Id: Ie182c9e4dc9cf0a4fe9d5fddf5b36754ddb53d18
2024-05-24 10:45:28 +09:00
Kiyoung Kim
0d8908c2e4 Move sanitizer.libraries.txt logic into Soong
Currently sanitizer.libraries.txt module is defined from Makefile, while
all logics to create the list of modules is implmented within the Soong.
This change moves sanitizer.libraries.txt module definition into Soong,
so it can be generated without sharing list of modules over Make
variable.

Bug: 339131599
Test: AOSP CF build succeeded, with same list of modules in
/system/etc/sanitizer.libraries.txt

Change-Id: I987684877aa8dae221a03227d784f2a8ca4f5cc4
2024-05-23 17:50:46 +09:00
Yi Kong
9b9d29b845 Turn off relaxed-template-template-args as a workaround
ToT switched on "relaxed-template-template-args" by default. This does
not work with our outdated libc++. Turn it off until we have the new
libc++.

Test: build with Kokoro ToT Clang (build 2417)
Bug: 341084395
Bug: 332594828
Change-Id: I994c476c1f7b4abd81e5ae0bde4e1f9afd1aa920
2024-05-20 02:48:42 +09:00
Priyanka Advani
89ed157a2f Revert "Enable -Wfortify-source"
This reverts commit 4412723f63.

Reason for revert: Droidmonitor triggered revert due to build breakage in b/341339765. 

Change-Id: Id2880f6c0e38504f1adace5e4dab3fd7f6b9b792
2024-05-17 19:42:55 +00:00
Priyanka Advani
55d4abde48 Revert^5 "Upgrade to clang-r522817"
This reverts commit 0135499554.

Reason for revert: Droidmonitor triggered revert due to b/341148479 and b/341138217. Will be verifying through ABTD before submission.

Change-Id: I22e069178dfda0b1791bd77c908afff8cb87bf26
2024-05-16 22:00:02 +00:00
Aditya Kumar
4412723f63 Enable -Wfortify-source
This reverts commit 9b7e07c7aa.
Workaround for the post-submit failure in b/339523786 has been merged.

Fixes: 315245071
Change-Id: I517f13334ad169429daaa68bda7d5f600f653977
2024-05-16 17:00:53 +00:00
Sam Chiu
9b7e07c7aa Revert "Enable -Wfortify-source"
This reverts commit a6e022c835.

Reason for revert: To verify the broken build b/339553761

Change-Id: Ib5546879effc283464a9ef66a20378960f9a56bf
2024-05-09 06:52:15 +00:00
AdityaK
a6e022c835 Enable -Wfortify-source
Fixes: 315245071
Change-Id: Ic8ca6a1c0dafea62f2bca3d20f5c86b3e3225ea0
2024-05-08 16:35:51 +00:00
Yi Kong
0135499554 Revert^4 "Upgrade to clang-r522817"
This reverts commit 33fb507271.

Change-Id: Ib29f98c8540b3cda04ae99743d34e9a81dc0e6ad
2024-05-07 04:50:16 +00:00
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
Treehugger Robot
9a7898d800 Merge "Allow override of -Wno-error=format" into main 2024-04-12 23:43:06 +00:00
Juan Yescas
fc5cdcbdf5 Include __BIONIC_NO_PAGE_SIZE_MACRO flag to avoid breaking libraries
The __BIONIC_NO_PAGE_SIZE_MACRO flag has to be passed to
the build system because there are C/C++ libraries using
__BIONIC_NO_PAGE_SIZE_MACRO to decide whether to use getpagesize()
or PAGE_SIZE macro.

Bug: 333973679
Test: Build manually
Change-Id: Ie5d71f4b2b256ab8f429ed4724b8d249b364d5da
2024-04-12 07:06:12 +00: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
Steven Moreland
8d1b2db53f Merge "Use __BIONIC_DEPRECATED_PAGE_SIZE_MACRO." into main 2024-04-10 20:57:45 +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
Steven Moreland
2a481368b8 Use __BIONIC_DEPRECATED_PAGE_SIZE_MACRO.
The default compilation behavior is set to be the future direction,
and a flag is set for backwards compatibility.

Bug: 312546062
Test: build/boot
Change-Id: Ibf87cbb2ab5da8640bcf7eb5f8cd643bf500e2e5
2024-04-08 18:59:10 +00:00
Pirama Arumuga Nainar
950e8c97fe [cc:riscv64] Do not pass -mno-strict-align while linking
Bug: http://b/327307773

Newer clang rejects this flag as unsupported.  It is not necessary while linking because the flag is passed as an IR feature.

Change-Id: I781afd913be7c07612196e736c3ae58773791071
2024-03-20 17:25:20 +00:00
Elliott Hughes
b48fb83936 Defer to clang for --hash-style.
We fixed the clang driver to "do the right thing" based on target api level years ago, but these manual workarounds predate that (or were copy & pasted from places that predated that). We don't need them any more.

See https://github.com/android/ndk/issues/2005 for more detail.

Change-Id: I995741b8606e389e8de8272f1cc532624516245a
2024-03-20 14:50:26 +00:00
Pirama Arumuga Nainar
0593537f58 [cc:riscv64] change -munaligned-access to -mno-strict-align
Bug: http://b/327307773

cd071253c7 removed -munaligned-access

Change-Id: I7a102fa1cdc49564cb0b724e6f177d33b3636f55
Test: presubmit
2024-03-19 16:28:31 +00:00
Elliott Hughes
c2600464c7 Fully document all the riscv64 flags.
In particular, make it clearer when/how we can remove each of them.

Change-Id: Ic3156e53ea56479324781fea737390588bc086b5
2024-03-18 19:37:13 +00:00
Kalesh Singh
fa1ebf5943 soong: ldflags: Add separate-loadable-segments
To suport >4KB page sizes, the loader may extend LOAD segment mappings
to be contiguous in the virtual address space. This is done in order to
reduce the use of unreclaimable kernel slab memory for the otherwise
necessary gap VMAs (when the runtime-page-size < ELF-segment-p_align).

Such mappings may beyond the end of the backing file when extended;
which breaks the common userspace assumption that file memory maps are
entirely backed by the underlying file.

Existing apps (not yet updated for larger page size support) may
encounter breakages if they parse /proc/self/[s]maps and use the
[start, end] addresses to operate on system libraries that have
crt_pad_segment optimization (VMA extension) [1].

In order to avoid breaking exisiting apps, update the build system to
ensure the platform ELFs' segments are entirely backed by the file
even when the VMA is extended to be contiguous with the subsequent
segment's. This is achieved using the linker flag
-z separate-loadable-segments, which inserts enough padding (zeros)
to also align each segment's offset on file by it's p_align
(max-page-size).

Although laying out the ELF segments on disk to respect the p_align
causes an increase in the file's apparent size (i_size), on Android the
actual disk usage increase is not significant due to most of the padding
being zero blocks which don't get alloacted in the read-only partitions.

The following results were obtained on an ARM64 device on a recent
git_main build:

 No Separate     Separate     Delta         Delta %   Partition
   Loadable      Loadable
   Segments      Segments

   4208.90MB    4214.6MB       5.70MB       0.14%     All RO Partitions

Note: The overhead of -z separate-loadable-segments is minimized by the
fact that ARM64 android already builds with -z separate-code. [2]

[1] https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/arch-common/bionic/crt_pad_segment.S
[2] 733198152d:build/soong/cc/config/arm64_device.go;l=53

Bug: 328797737
Test: Manually test previously crashing application
Change-Id: Icb14ad10b5c9282855d54c7945b065b7b4184163
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2024-03-12 17:04:50 -07:00
AdityaK
2c90a92d77 Update unaligned-vector-mem to -munaligned-access
Latest compiler has merged both unaligned access flags into one.

TODO:  This is needed until we change clang driver to enable -munaligned access by default.for Android b/327307773

Bug: 326790418
Change-Id: Ia8c29dc56104d2cffb8ac41aae6eeacccae68e61
2024-02-28 06:14:57 +00: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
Treehugger Robot
c7c666a354 Merge "Remove macros that the Linux host no longer needs." into main 2024-02-09 19:39:06 +00:00
Elliott Hughes
49e8f25966 Remove macros that the Linux host no longer needs.
We patched our ancient glibc to match current glibc (and bionic/musl).

Test: treehugger
Change-Id: I6377b5dfb94d3a0e2209d4c2f0661ef81d362fc3
2024-02-09 16:43:34 +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
Aditya Kumar
d18128fa12 Merge "Add Wno-ambiguous-reversed-operator to get around the operator== lookup issue in clang" into main 2024-02-08 12:17:05 +00: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
Elliott Hughes
5897fd6a5e Merge "Remove __STDC_FORMAT_MACROS." into main 2024-02-07 23:50:37 +00:00
Elliott Hughes
1c80585cd6 Remove __STDC_FORMAT_MACROS.
Our mingw doesn't use this. (It does however still use
__STDC_CONSTANT_MACROS and __STDC_LIMIT_MACROS.)

Test: treehugger
Change-Id: I415017093b9ccffd21fd41f17a2f4387839a0f53
2024-02-07 20:45:25 +00:00
Elliott Hughes
ac43c55656 Remove macros that Darwin never used.
Test: treehugger
Change-Id: I4b31c1f40142c0346ac2d2c9e9b831954c4d9468
2024-02-07 18:30:22 +00:00
Aditya Kumar
b2a56627a2 Merge "Revert^2 "Update clang version to clang-r510928"" into main 2024-02-03 12:54:13 +00:00
Treehugger Robot
fe423e39fb Merge "Reduce warning spam from "unused-" flags in //external, //vendor, //hardware" into main 2024-02-03 03:25:58 +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
Kalesh Singh
f4ffe0a026 soong: Add crt_pad_segment to .so's
crt_pad_segment adds a NOTE to the ELF which is used by the binoic
loader to determine whether it should pad segments when mapping them
into the virtual address space, such that there are no gaps between
mappings of consecutive segments. This avoids an increase in
unreclaimable kernel slab memory usage for VMAs on devices where the
runtime-page-size > elf-segment-p_align.

Since -fandroid-pad-segment [1] respects -nostdlib used in android
platform builds, soong must link in crt_pad_segment to platform shared
libraries.

For simplicity, link crt_pad_segment everywhere that crtend_so is
applicable, ignoring nocrt property, as there is no other reason
to track these separately.

Example:

❯ readelf -WS /system/lib64/libc++.so [Output simplified]

...
Section Headers:
  [Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
...
  [ 2] .note.android.pad_segment NOTE            0000000000000288 000288 000018 00   A  0   0  4
...

[1] https://github.com/llvm/llvm-project/pull/77244

Bug: 316403210
Test: readelf -WS <lib>.so
Change-Id: Icc06611376cfd5ee4de7281b4134f9f8ffe7ca60
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2024-01-31 19:42:31 -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