Bug: http://b/63768402
Bug: http://b/65598278
Add support for the 'pgo' property to specify how a module is processed
under PGO. A sample property is below:
pgo: {
instrumentation: true, // could be "sampling: true" when supported
profile_file: "pgo_simple.profdata",
benchmarks: ["pgo_simple"],
}
1. Runtime profiles can be gathered using "sampling" or
"instrumentation". Sampling is not supported initially.
2. If 'toolchain/pgo-profiles' project is found,
'toolchain/pgo-profiles/${profile_file}' is passed to the compiler and
linker when building this module.
3. If ANDROID_PGO_INSTRUMENT environment variable is set, and includes a
benchmark in the 'benchmarks' list, appropriate flags (for e.g.
-fprofile-generate for instrumentation) are passed to the compiler and
linker when building this module.
Test: Add example modules that specify the pgo property and verify
appropriate flags and dependencies in the Ninja file. Some
tests/examples are in https://android-review.googlesource.com/474805
Change-Id: I6242e0c904497a115e367dea6927ba1c4b906355
The linux kernel requires that the ELF interpreter (runtime linker)
that's referenced by PT_INTERP be either an absolute path, or a relative
path from the current working directory. We'd prefer a relative path
from the binary, similarly to how we handle looking up shared libraries,
but that's not supported.
Instead, extract the load sections from the runtime linker ELF binary
and embed them into each host bionic binary, omitting the PT_INTERP
declaration. The kernel will treat it as a static binary, and we'll use
a special entry point (linker_wrapper) to fix up the arguments passed by
the kernel before jumping to the embedded linker. From the linker's
point of view, it looks like the kernel loaded the linker like normal.
Bug: 31559095
Test: Enable host bionic,
out/soong/host/linux_bionic-x86/nativetest64/libdemangle_test/libdemangle_test
Change-Id: I8d0aea9790b5e86fcc3ea6e2d00cfa33907e2853
Move these flags from the normal flags to the toolchain flags, since we
want them to always apply.
Test: Add #ifdef __ANDROID__ to crtbegin.c, check to see if it's set for host bionic
Change-Id: I382dd229e3e4a889bc916f6f8e1248c7debb8fad
It doesn't need one, and doesn't handle it well either (it tries
allocating memory before the memory allocators are initialized).
Test: out/soong/host/linux_bionic-x86/bin/linker64
Change-Id: Ic4f75e8914093f13f28d53cf771f518f2b4e5d2e
cc_genrule is the same as a normal genrule, but can depend on other cc
modules (like cc_object).
Test: mmma external/minijail
Change-Id: I8df87665c7bdc76ce89c92755c054f967a818e57
Bionic headers aren't implicit when building with the VNDK, they're
exported from libc. So add libc to the shared libraries of a cc_object
if it wants the standard flags.
Removes a duplicate No_default_compiler_flags
Test: Add cc_object with vendor_available, build on aosp_arm64_ab (VNDK-enabled)
Change-Id: I9bfcd1e1a65de4edc597bd348b79d625ecae4f5e
In most cases, we don't care about arm vs x86 when selecting whether a
module is in a test suite or not, but we do care about whether we need
to add the host or device module(s) to the suite. So enable the arch
mutator.
Test: Add android-specific test_suites property, look in out/soong/Android.mk
Change-Id: I1e258d6e97e18c8d20297568cd8ee8d4161d5023
So that we don't get confused when using :<module> in srcs to depend on
a module that could also be a HostBinTool.
Test: m -j
Change-Id: Ia3b1c26826e70f84c6dc5ff78c95dd11d76901b6
Currently, abi is dumped for platform variants of system libraries.
Dump them for vendor variants since they are the ones which need to be abi
stable on security updates. This also ties abi dumping to BOARD_VNDK_VERSION.
Test: For libfoo:
1) Added a source file with a dummy function for the core
variant.
2) Excluded the source file from the vendor variant.
3) BOARD_VNDK_VERSION=current mm -j64 produces libfoo.so.lsdump with no
dummy_function since the source file was not included in the vendor
variant.
Test: Inspected build.ninja and confirmed that all of a library's abi
dump dependencies (.sdump files are dependencies of the final .lsdump files) are
from vendor variants.
Change-Id: Ie0bf91fcd81606c131845d9872261166b5db72aa
We've only got one user of this currently, but since it needs the
location of the toolchain, and different flags based on 32 vs 64-bit,
it's easier just to add support than to get this into a genrule.
Test: Convert external/mdnsresponder to Soong, build
Change-Id: I6c19a82bc14f6ab556f6cc5f37164862ba5f9083
Instead of requiring every host module to specify -ldl -lrt -lpthread
and then break the mac build because -lrt doesn't exist, make them
implicit to match the behavior of modules built for the device.
Test: m -j checkbuild
Change-Id: I63c26adef71e71d314b9c9caa31c1aeb1d8f6651
launcher.
For Python2, we bundle embedded launcher as bootstrapper within every
.par file. This feature is only enabled for linux_x86_64 for now. We
provide a user flag: hermetic_enabled within bp file. By default, Pyhon2
still use classic bootstrapping way to construct .par file and relys on
host interpreter. Once embedded_launcher is enabled, launcher will be
used to bootstrap .par file and execute user program.
For Python3, the launcher will be ready soon, and for now it still relys
on classic bootstrapping.
Test: Real example is used to test.
Bug: b/63018041
Change-Id: I28deba413d8ad3af407595e46f77d663e79a3705
ThinLTO achieves comparable performance to full LTO while taking much
less time for compilation.
Test: Build hwui with "thin" and "full" LTO
Change-Id: If3400b82af0d5e0226410c8b740999cdad746a59
Split InstallFileName into InstallExecutable that does chmod +x
after copying the file. Also remove InstallFile and rename
InstallFileName to InstallFile.
Test: m -j checkbuild
Change-Id: Id41ad4eafe521f6cd5d8cc250b7747ecb3da8dfc
All the stats below are for a hikey960-eng build on AOSP master.
Number of order-only inputs in out/soong/build.ninja:
Before: 2847162
After: 606508
Size of: Before After
out/soong/build.ninja 572MB 233MB -59%
out/soong/Android-hikey960.mk 15MB 9MB -40%
out/build-hikey960.ninja 367MB 358MB -2%
Ninja time in `m nothing`:
Before: 6.9s
After: 5.0s
Soong generation time:
Before: 11.6s
After: 6.6s
Test: m nothing
Test: wrote script that counted inputs, only duplicates were removed
Test: treehugger
Change-Id: I6b7c5ef5b1395014b7bf5fd0b8112d42bee127bf
header-abi-diff has switched to recursive diffing of types and can
diff more accurately if types included in re-exported shared library
headers are included as well.
Bug: 62060883
Test: make -j64, android.hardware.light@2.0.so.lsdump contains structs
from libcutils as well (libcutils' headers are re-exported by
android.hardware.light@2.0)
Change-Id: I814819e4f7258b4b380350fe8ad0ccf8dbd5ce5c
This reverts commit 80b27e4e20.
Fixed CTS build issue by adding -march=armv7-a in cts/tests/tests/os/jni/Android.mk since the library built here needs/uses instruction (swp) obsolete in ARMv8.
Bug: 64964151
Test: lunch aosp_arm64-userdebug; make -j cts
lunch aosp_x86-userdebug; make -j cts
lunch aosp_sailfish-userdebug; make -j cts
lunch aosp_bullhead-userdebug; make -j cts
Change-Id: I6ccafce043e101c769ad370a81ffa0eb62719b5e
Make sure that libdl is always after libc on the command line.
Simplifies the logic to always support system_shared_libs for
sdk and vndk builds.
For backwards compatibility without updating lots of Android.bp
files, allow libdl to be listed in shared_libs as long as it
is also in system_shared_libs or libc is not in system_shared_libs.
Remove all the places that libdl is added as a dependency, since
it will always be present unless explicitly removed now.
Bug: 62815515
Test: m -j checkbuild
Change-Id: I0233178ffea87a2f0b82190746022476304a68e2
Add armv8-a as a valid/supported 32-bit arm architecture variant. If
some known armv8-a core, like cortex-a53, cortex-a73, etc. is specified
as TARGET(_2ND)_CPU_VARIANT, the associated TARGET(_2ND)_ARCH_VARIANT
will be treated as if armv8-a is specified.
Bug: 62895439
Test: "bionic-unit-tests-static --gtest_filter=*strlen*" on Nexus 4
(armv7-krait), emulator (armv7), and sailfish (armv8-kryo).
The test binary for the first 2 is built with armv7-a as its
TARGET_ARCH_VARIANT; The test binary for the last is built with
armv8-a as its TARGET_2ND_ARCH_VARIANT.
TARGET(_2ND)_CPU_VARIANTs of both binaries are set to "generic".
Change-Id: I53bee2974346cf485b2da54cf7aad010b0425910
Right now this is hard coded in two places (here and in
core/binary.mk). Keep it in one place so it's easier to change.
Test: make checkbuild
Bug: None
Change-Id: I2a2c784d4c667b326f871e6144db92753c16c85f
soong_build was writing a different make_vars-*.mk on every run
because the lists of vndk libraries were not sorted, causing
kati to regenerate the ninja file.
Test: m -j nothing && rm out/soong/build.ninja && m -j nothing
Change-Id: If1ef51bad602d61a337ee6f62d4758d4123cb00d
In LTO mode the backend constructs a target exclusively from command line flags,
without opportunity to accept code gen arguments from Clang. Clang does not
currently pass the -emulated-tls parameter for Android, even though it defaults
to emulated TLS for Android in non-LTO builds. Until this is fixed upstream, we
can explicitly specify that the LTO output for Android should use emulated TLS.
Test: build libandroid with LTO, verified that it uses __emutls_get_address
rather than __tls_get_addr.
Change-Id: I18acac41aac885fc6635fbd55f96ba7c845eb5e7
Enabling the lto property for a module builds that module and all static
dependencies with LTO.
LTO (link-time optimization) allows the compiler to optimize and
generate code for the entire module at link time, rather than
per-compilation unit. LTO is required for Clang CFI and other
whole-program optimization techniques. LTO also allows cross-compilation
unit optimizations that should result in faster and smaller code, at the
expense of additional compilation time.
Test: make -j12 libc with lto: true for libc
Change-Id: Ib8baefedf60e02701d44673a7c473e0845730101
Gold recognizes a different set of emulation strings to specify targets
than the bfd linker accepts. Clang only passes bfd emulations to the
linker, so we need to override these with the versions accepted by gold
when using gold.
Gold normally picks up the correct target from the first ELF input file
if it cannot parse the emulation parameter. However when using LTO, all
objects may be bitcode files, which causes gold to rely on the passed
--oformat or -m parameter to determine the proper target. If gold cannot
parse the emulation string passed by clang, it fails to link.
Test: build LTO version of libc
Change-Id: I38e78bb912fd3cc5fb7b4a762284f50ddd4f3998
cflags that are only applied when building the vendor variant of a lib
is now supported. This will be particularily useful when existing macro
should be turned off for the vendor variant:
cflags: ["-DENABLE_FEATURE_X"],
target: {
vendor: {
cflags: ["-UENABLE_FEATURE_X"],
},
},
Without this, the library author has to undef the macro inside the
source code using __ANDROID_VNDK__, which is not desired especially for
external projects.
Bug: 64514237
Test: BOARD_VNDK_VERSION=current m -j libsqlite libsqlite.vendor
Merged-In: Ib484b5b12e14ab776276a30ed2763dffadc9d642
Change-Id: Ib484b5b12e14ab776276a30ed2763dffadc9d642
(cherry picked from commit 1e7495d973)
Since a lib in exclude_shared_libs are not used for the vendor variant,
it should also be removed from the export_shared_lib_headers.
Bug: 62471389
Test: BOARD_VNDK_VERSION=current m -j libxml2.vendor successful
(libxml2 has libicuuc in both exported_shared_lib_headers and
exclude_shared_libs for the vendor variant)
Merged-In: Ic9ddbd7be3c76df563e428ba2409a03bd2e1e113
Change-Id: Ic9ddbd7be3c76df563e428ba2409a03bd2e1e113
* changes:
Allow AndroidMkData.Custom handlers to extend normal values
Remove error from AndroidMkDataProvider.AndroidMk
Remove error from AndroidMkData.Custom
Remove error from AndroidMkData.Extra
Bring java support closer to current version of make
Rename java_prebuilt_library to java_import
Pass accumulated AndroidMkData to AndroidMkData.Custom handlers
and expose WriteAndroidMkData so that Custom handlers can write
out the normal make variables and then add their own.
Test: No change to out/soong/Android-aosp_sailfish.mk
Change-Id: Id9717132bbd6c5cf3af8596f3eaa9bbb05d98e40
It's never anything except nil, and it unnecessarily complicates
the implementations.
Test: m -j checkbuild
Change-Id: I3e3b7251f32ffa84dbdfd0448faf248c306ca808
It's never anything except nil, and it unnecessarily complicates
the implementations.
Test: m -j checkbuild
Change-Id: I021c7971ede3e11bbe08cf1601f4690ed4d1a036
It's never anything except nil, and it unnecessarily complicates
the implementations.
Test: m -j checkbuild
Change-Id: I8a117a86aa39aeb07d9d8d0686ef869c52784f19
And make it work like bazel's java_import, using a "jars" property
instead of "srcs", and allowing multiple jars to be listed.
Test: soong tests
Change-Id: Ida2ace6412bd77b4feb423646000a1401004e0ea
Old devices don't support gnu hashes, use --hash-style=both when
the sdk_version property is set.
Test: m -j checkbuild
Bug: 64608507
Change-Id: Iec5229a08fc192f1c8872466ee4bf866adf50443