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
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
So far, the installation of required modules were handled by Make. This
prevents us from implementing the module installation and packaging
entirely in Soong.
This CL is the first step towards that goal. Soong now correctly tracks
the dependencies and they are correctly returned by
TransitivePackagingSpecs(), which is used by packaging modules like
android_system_image.
Bug: 321626681
Test: build
Change-Id: I9192b5333ceaa0b7d1c5c4abeec2af62febcd976
Change genrule Out to `android:"arch_variant"` for supporting
multilib variants.
Bug: 323295272
Test: go test -run TestMultilibGenruleOut
Change-Id: I102d64b45a5a2a5193f813001fc32da0d1fe9d36
We want LLNDK symbols to be explicitly marked with llndk tag to
handle LLNDK freezing which happens before SDK freezing. If symbols
need to be frozen as LLNDK, those symbols must be marked explicitly with
correct vFRC version.
In the following example,
LIBFOO { # introduced=35
foo;
bar;
bar; # llndk=202404
baz; # llndk=202404
qux; # llndk=202505
};
NDK libfoo will have foo and bar while LLNDK libfoo stub will have bar
and baz for 202404.
Bug: 329012338
Test: test_ndkstubgen test_symbolfile
Change-Id: I384f589b240fa047e8871964bf9550f426024dfc
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>
So far we created {"", "current"} stubs for LLNDK modules. But we don't
need "current" because "" itself is a stub.
This change only removes unused LLNDK stub modules with "current"
version, which aren't used at all.
Bug: 329183083
Test: m blueprint_tests
Change-Id: Ib8e880b6d88952b489657ea1ac557a48afe562a4
Header ABI checker dumps the ABI from core variants and filters it by
version scripts. Ideally it should load different version scripts for
LLNDK, NDK, APEX, etc, but the build rules have not been completed. The
current solution is to load core variants' version scripts. It works
for every existing library because a library's variants share one
version script.
Test: make
Bug: 329078703
Change-Id: I4e26275e24daf93c7d3bb7e70b542a1197ae2129
We set the default optimization mode to --lto-O0 for LTO enabled
projects, in order to save build time. This is missing some performance
optimizations, esp. related to vectorization. Now that we suggest eng
build for developers, we can enable full optimization by default.
When we introduced --lto-O0, we achieved a 4.2% saving in
system-processes-memory-direct. Enabling full LTO optimization will
trade some of the memory / binary size savings for better code
performance. For system-processes-memory-direct, it is 2.0% increase
compared to --lto-O0, or a net 2.2% saving compared to baseline.
Test: presubmit
Bug: 328163089
Change-Id: Ia4d0f74e668ed057d6d9d6fc6c60196c2e355fb9
Some libraries like `libnativehelper_compat_libc++` only exist as shared
library in module sdk. When prebuilt of this library is selected using
apex_contritbutions, only shared linkages should be redirected to the
prebuilt version. The static linkage should come from source.
Test: Added a unit test
Bug: 322175508
Change-Id: Ic65d376b2354b4a42c7b9ea3ed1cd80c37e2840f
This relands aosp/2978137 with acknowledgement of soong namespaces.
If multiple versions of the prebuilt module sdk share the same soong
config namespace, then PrebuiltPostDepsMutator rewrites rdeps to one of
those prebuilts in a non-deterministic way.
This CL uses apex_contributions to make this deterministic. Multiple
prebuilts will not be allowed to have their prefer evaluate to true. If
this happens, one of the prebuilts must be explicitly declared in
apex_contributions.
This CL also fixes the special-casing of the top-level
java_sdk_library_import in ReplaceDirectDependencies. For
framework-foo.v2, it will use BaseModuleName framework-foo instead of
SdkLibraryName framework-foo.v2 to determine if the source module has
been selected.
Test: ran the previously failing cmd of b/327552112
Test: Added a unit test
Test: aninja -t query
out/soong/.intermediates/packages/modules/Permission/SafetyCenter/Config/safety-center-config/android_common/javac/safety-center-config.jar
| grep module_sdk is empty (should not cause a regression for
323454855)
Change-Id: Id484a41192085c50b7e34ad415c6e195edb0d006
If multiple versions of the prebuilt module sdk share the same soong
config namespace, then PrebuiltPostDepsMutator rewrites rdeps to one of
those prebuilts in a non-deterministic way.
This CL uses apex_contributions to make this deterministic. Multiple
prebuilts will not be allowed to have their prefer evaluate to true. If
this happens, one of the prebuilts must be explicitly declared in
apex_contributions.
This CL also fixes the special-casing of the top-level
java_sdk_library_import in ReplaceDirectDependencies. For
framework-foo.v2, it will use BaseModuleName framework-foo instead of
SdkLibraryName framework-foo.v2 to determine if the source module has
been selected.
Test: Added a unit test
Test: aninja -t query
out/soong/.intermediates/packages/modules/Permission/SafetyCenter/Config/safety-center-config/android_common/javac/safety-center-config.jar
| grep module_sdk is empty (should not cause a regression for
323454855)
Bug: TODO
Change-Id: I7191200c330c5bcb9d5532006d3c573a60db61cc
The new libc++ prebuilt has HWASan and non-HWASan variants for arm64.
Bug: 175635923
Test: checkout use-prebuilt-libcxx topic, build libc++demangle, verify
that libc++demangle-install is not a valid build target
Change-Id: I34385c48aa7ad1401e2547d65d30a14fa342e304
libc++[abi] always check whether one of these macros is defined, not
the value the macro is defined to. With the new libc++, there is a
Windows __config_site header that automatically defines
_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS and _LIBCPP_HAS_THREAD_API_WIN32
to nothing, so these definitions need to match to avoid a redefinition
error.
Bug: 175635923
Test: treehugger
Test: m adb
Change-Id: I1e48947c3b45e59804cdacd48776c7f3bd9a18c6
Since BaseModuleName of the dep becomes its LOCAL_MODULE name in the
generated mk file, we should also use BaseModuleName of dep for populating
properties such as LOCAL_SHARED_LIBS of rdeps
Test: m nothing --no-skip-soong-tests
Bug: 322175508
Change-Id: I6b47112faa63f85d19b5b71e0e102cea0ab68e3b
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
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
Add the dependency on the fdo_profile module in afdoTransitionMutator
and read the provider in GenerateAndroidBuildActions.
This relands Ied8fd7b52d5694a3691652318e87b8fe14dda126 with a fix
to use the correct LTO ldflag when an afdo variant doesn't have a
profile.
Bug: 319288033
Bug: 324141705
Test: afdo_test.go
Change-Id: I024ca316cfb565b5fb0251793f05a54ce16cc1cb
LTO does not set the -import-instr-limit flag when building for
darwin, don't test it on darwin host modules.
Test: afdo_test.go
Change-Id: I83f77006a875f8b0a6af9ae11eb3bad88b0681b1