In the future, target.linux will apply to all targets running a linux kernel
(android, linux_glibc, linux_bionic). So move all current users to the specific
linux_glibc.
There will be another cleanup pass later that will move some instances back to
target.linux if the properties should be shared with target.android and
target.linux_bionic, but target.linux needs to be removed first.
Test: out/soong/build.ninja identical before/after
Change-Id: I04e4f984781e60feb355de7adf80c54300e0d1f5
Add a no_framework_libs property similar to no_standard_libs.
The new property will allow modules to continue to link against
the standard bootclasspath libraries that contain java.*, but
not against the framework libraries. This avoids having to
specify the bootclasspath libraries explicitly.
Test: m -j checkbuild
Change-Id: I0be13a45cadca9b90a0fd1797885cd18c5b462e3
The apps build depends modules that have empty sdk_version. Let the
behavior match make for now.
Test: m -j TARGET_BUILD_APPS=Gallery2
Change-Id: Ie5545d2cd6b1268b0b3392dc0af2e4eb3d38a588
The file header returned by jar.ManifestFileContents had unset
date and mode fields. The unset date field resulted in the
"Last Mod Time" field in the zip file being set to 0, which
OpenJDK 9's jar implementation treats as an error:
java.time.DateTimeException: Invalid value for MonthOfYear (valid values 1 - 12): 0
Bug: 67095392
Test: zipdetails out/host/linux-x86/framework/tradefed.jar
Change-Id: I0a818d57420f5e5de57e8ff57791951c1b538443
Add a properties to allow including files as resources, including
support for filegroups. Also add a flag that causes module sources
to be included in the final jar.
Test: java_test.go TestResources
Change-Id: Ida8ee59b28df9fe66952170f46470d3a09fd5d65
Follow the make change in I87aee34940937dbde33a977f55d1faf2c8054561
to use classes before desugar in the classpath.
Test: java_test.go
Change-Id: I1054f4aea1eb349b6f687e1af0adb92a944fd8c5
Don't waste time running dx on libraries that will never end up
on the device.
Test: m -j checkbuild
Change-Id: Iad1750823d3261cd6ad6eb6aa00c74d45b9737a3
It's not doing anything anymore, and the next patch will need more
complex jar arguments. Just remove it.
Test: m -j checkbuild
Change-Id: I96d15995e86263ec04fd5c13ab0fd54d8b85c788
The resources jar and the combined jar are not always used, so
add the errorprone dependency to the compiled jar.
Test: m -j checkbuild
Change-Id: Iaa10a04347758c676bb704969b86f9442e6c3175
For consistency with make, rename java resources to
java_resource_dirs and android resources to resource_dirs.
Test: m -j checkbuild
Change-Id: Ie9aac50fef40f6a9093b4b98759e79cd086bb797
target.linux_glibc will apply to host builds with glibc, which is
identical to the current target.linux. In a future change, target.linux
will change to affect all targets using the Linux kernel (android,
linux_bionic, and linux_glibc).
target.bionic will apply to all OS variants using Bionic.
Bug: 31559095
Test: Add target.linux_glibc, target.bionic sections to an Android.bp, build
Test: m host
Change-Id: I677a67c22fba148fec264132311e355283f9d88d
libm is a default library for device builds, so default it for host
builds as well.
Also removes duplicate additions of -ldl, -lpthread, -lm and -lrt.
Test: m host
Change-Id: I8f7e799d48a1f427e48dcfb1d0ccba93c5f9780b
We want to start using some Soong Android.bp in tradefed so
enabling our project to be seen too.
Test: build a Android.bp target in tradefed
Bug: 66908811
Change-Id: Ia4543fc27d124442912e3a05d7bd3fd2f9850a1f
Ubuntu has both aliases, but Mac only declares python2.7, not python2.
Test: `m sepolicy_tests` on internal master
Change-Id: Ia2b5d2d95195f307befbc1893a465752f14b8a7b
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
Hostdex support isn't working yet, and we are accidentally producing
a dex jar for host modules, which confuses soong_java_prebuilt.mk.
Test: m -j checkbuild
Change-Id: Ie2c331fa697f49dab23c380a5c6e0490d67c9f74
* changes:
Extract the linker and embed it into host bionic binaries
Add prefix_symbols support to cc_object
Fix ToolchainClangCflags for host bionic
Don't add a rpath to the linker
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
Forcing sdk modules to be declared explicitly is unnecessary, just
add the required dependencies on the jar and aidl files.
Test: java_test.go
Change-Id: Ib28bdc1051c5825e7c0efb6adff1f9282675560e
Fix the java module sdk tests, and expand them to cover testing
all classpaths including for the host.
Test: java_test.go
Change-Id: I71be13cc5545f5c4d5b377c4c8de3dccbb09abf9
Java tests will need to test code inside if ctx.Device() blocks,
switch to using TestArchConfig and NewTestArchContext.
Disable TestSdk for now, just registering modules that depend
on the SDK triggers panics because of previously untested code
that is now executed.
Test: java_test.go
Change-Id: Iff2c814af56cc830327db8d951c4350034c00361
Add TestArchConfig and NewTestArchContext to create a test context
that will run the arch mutator, which is necessary to test any code
that is inside a ctx.Device() block or similar.
Test: next patch
Change-Id: Ieb1a0326bc27fc18ba88b8d37655a7e0c6870d6c
First pass at java support for the device. Adds desugar before
dx, and passes javalib.jar to make.
Test: m -j checkbuild
Change-Id: I3138d943bc4867a52c3fce8fbdb597773793988d
Jar always puts default MANIFEST.MF files in if none was specified.
Copying that behavior in soong_zip causes problems with merge_zips,
because it ends up taking the default manifest from the classes.jar
instead of the user's manifest from res.jar. We don't want the
user's manifest in the classes.jar, otherwise a change to the
manifest will cause all the class files to rebuild. Instead,
move the manifest insertion to the final merge_zips stage.
Test: m -j checkbuild
Change-Id: Id6376961dbaf743c2fb92843f9bdf2e44b963be0
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
The extended-timestap extra block changes between Local File Header and
Central Directory. We have to strip it out to avoid mis-filling during
zip2zip.
Bug: b/65455145
Test: add unit-test.
Change-Id: I17e3f6c10fd6a068019620b4426f6042f6fac317
In some cases, we need delete META-INF dir to void mis-using some
classes files in the Java runtime.
For now, when we delete META-INF, we need keep Manifest file in the jar
since merge_zips doesn't have ability to add a default one.
Bug: b/65455145
Test: m clean && m -j
Change-Id: Iea44b1a98d348cd8df1fa7374907733b1add6935
Turbine leaves out bridges which can cause javac to unnecessarily insert
them into subclasses. Setting this flag causes our custom javac to
assume that the missing bridges will exist at runtime and not recreate
them in subclasses. If a different javac is used the flag will be
ignored and extra bridges will be inserted, which should be harmless.
The flag is implemented by https://android-review.googlesource.com/c/486427
Test: m -j checkbuild
Test: check core-libart for extra methods
Bug: 65645120
Change-Id: I6e2babe4a5a24cda4903845ae895c369343ec55b