Commit Graph

6117 Commits

Author SHA1 Message Date
Colin Cross 5aff065626 Revert "soong_zip: set local header crc for symlinks"
This reverts commit b88c4dfb87.

This made it worse, now that the local header crc matches the global
header, unzip will attempt to unzip the symlink.  However, the local
header size is still incorrect, so it produces an empty file instead
of a symlink.

Bug: 110716403
Change-Id: Ifd9aabc04d180b7ead4aec8566c151206b6b7c57
2018-06-23 06:14:01 +00:00
Colin Cross b88c4dfb87 soong_zip: set local header crc for symlinks
Getting a crc into the local header requires setting it before writing
the payload, or using a streaming data header after the payload with
the crc.  Stored (uncompressed) entries are not allowed to use a
streaming data header.

Symlinks are always stored uncompressed, so set the crc in the file
header before writing the payload.

Test: m checkbuild
Test: zipdetails on zip with symlink created with soong_zip has same
      crc in local header and central header.
Bug: 110716403
Change-Id: I66c5d41f0a5b23b828d6a03a3790afedc5a97625
2018-06-23 03:23:19 +00:00
Colin Cross 5c733856bd Merge "Always use OpenJDK9 for building" 2018-06-21 21:27:16 +00:00
Colin Cross 8eb0ad15bf Merge "Run ErrorProne in OpenJDK9" 2018-06-21 20:47:41 +00:00
Colin Cross 997262f506 Always use OpenJDK9 for building
Remove support for compiling with javac from OpenJDK8.
We still target 1.8 by default, and OpenJDK8 prebuilts are still
required for the bootclasspath and running robolectric.

Bug: 38418220
Test: m java
Change-Id: I5686deb0ae4f9927192a039d08adc0117b2605dd
2018-06-21 12:25:50 -07:00
Dan Willemsen 1737a4f8a7 Merge "Dump more BUILD_BROKEN_* values out to log" 2018-06-21 19:19:51 +00:00
Dan Willemsen b58f120496 Dump more BUILD_BROKEN_* values out to log
This is useful when determining which devices are setting which values
from the logs, cross-referencing where warnings still occur.

Test: look at out/soong.log
Change-Id: I3e3f0e4c8cbd9ce621b03f5163eff2cccfa8c424
2018-06-21 10:12:53 -07:00
Colin Cross 6654810f37 Run ErrorProne in OpenJDK9
Use the OpenJDK9 javac to run ErrorProne by adding it to
-processorpath and using -Xplugin:ErrorProne.

Bug: 69485063
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I0496006b71b70766ef16d57753cbcf037897799c
2018-06-20 21:03:16 -07:00
Colin Cross 6a77c9871c Use -processorpath for annotation processors
ErrorProne needs to be added to -processorpath, but once anything is
passed via -processorpath javac stops looking in the classpath for
annotation processors.  Move annotation processors to -processorpath
in preparation.

This reapplies Ife06b3c7432ab971f5605dcc18a558bcbd99a675 with fixes
to processorpath in errorprone rules.

Test: m java
Change-Id: I188136771386a2183fb31f4b70b50c95ac419ff8
2018-06-20 21:03:07 -07:00
Colin Cross ab97ae08cd Merge "Revert "Use -processorpath for annotation processors"" 2018-06-21 03:57:17 +00:00
Colin Cross 2f10997e6b Revert "Use -processorpath for annotation processors"
This reverts commit 6dd0bb3b77.

Reason for revert: broke RUN_ERROR_PRONE=true build

Change-Id: I23d066281e392c6e7df29c5cd4558c7cf731c1a5
2018-06-21 03:56:45 +00:00
Colin Cross 1418fe2e4c Merge "Use -processorpath for annotation processors" 2018-06-21 03:34:10 +00:00
Treehugger Robot e5da49dab5 Merge "Turn implicit rules into warnings" 2018-06-21 03:31:11 +00:00
Dan Willemsen fa42f3c10d Turn implicit rules into warnings
Test: build_test in downstream branches
Change-Id: I853e3fa11793cc76ad568b74f7dc31c3d1c5582b
2018-06-20 16:50:45 -07:00
Colin Cross 6dd0bb3b77 Use -processorpath for annotation processors
ErrorProne needs to be added to -processorpath, but once anything is
passed via -processorpath javac stops looking in the classpath for
annotation processors.  Move annotation processors to -processorpath
in preparation.

Test: m java
Change-Id: Ife06b3c7432ab971f5605dcc18a558bcbd99a675
2018-06-20 16:16:49 -07:00
Colin Cross a1ce2a0071 Update soong for blueprint change to allow multiple deps
Blueprint allows multiple dependencies on the same module after
https://github.com/google/blueprint/pull/210.

Fix defaults, WalkDeps can now find the same defaults module multiple
times.

Fix droiddoc, if the srcs_lib points to a lib module that is
specified multiple times, for example through explicit properties
and implicit default libraries, the srcs would be listed on the
command line multiple times.  Move srcs_lib to use its own dependency
tag.

Test: m checkbuild
Change-Id: Ia30ce83be1382820d76bca5046ad18cbffe8af1a
2018-06-20 22:56:36 +00:00
Jiyong Park 1be9691910 Export SDK library names
java_library, java_import, and android_library export SDK library names
that they are using directly or indirectly via its dependencies. When
building an apk, the manifest fixer uses the SDK lib names to
automatically add <uses-library> tags.

The SDK lib names are exported to the make world via
LOCAL_EXPORT_SDK_LIBRARIES flag.

Bug: 77575606
Test: m -j
Change-Id: I4fe606eb7ed23843c58eebe6a324405fe1da34e5
2018-06-20 12:13:33 +09:00
Jiyong Park c08f46fdfc add --uses-library option to manifest_fixer.py
`--uses-library foo` adds <uses-library android:name="foo"
android:required="true"/> element to the manifest.

When there is already a uses-library element with the same
name, then the hand-written element is respected.

Test: m -j
Test: build/soong/scripts/manifest_fixer_test.py

Change-Id: Ia5e989d3c3c3fba7cc9015a6d16dac70464282a8
2018-06-20 12:03:09 +09:00
Treehugger Robot 87e50a0d14 Merge "Recovery partition uses the first architecture only" 2018-06-20 01:11:10 +00:00
Nan Zhang af322cc7c2 Fix the build breakage for droiddoc
Removed the additional "-source $javaVersion" arg in javadoc rule
otherwise javadoc will report error:
javadoc: error - The -source option may be specified no more than once.

Test: m -j ahat-docs
Bug: b/70351683
Change-Id: I7f92236884154075fb4b20cd9a363419b1ecd3f5
2018-06-19 15:23:31 -07:00
Treehugger Robot 1328e9fee9 Merge "Support Java Lang level 9 for droiddoc in Soong." 2018-06-19 21:28:43 +00:00
Nan Zhang 357466b18a Support Java Lang level 9 for droiddoc in Soong.
Test: m -j docs / m -j metalava-api-stubs-docs
Bug: b/70351683
Change-Id: I7220d04f508f6bb5ffd281cf31bc8c0069c219e5
2018-06-19 10:55:29 -07:00
Kostya Kortchinsky d18ae5ce98 Soong support for Scudo
Scudo is a hardened usermode allocator that is part of LLVM's compiler-rt
project (home of the Sanitizers). clang allows for -fsanitize=scudo as a
possible command line option to link the shared Scudo library to a binary.

This patch add Scudo as a potential sanitize option. Scudo is not compatible
with ASan and TSan and will be disabled if either is enabled.

Bug: 72112048
Test: aosp compiled with m -j
Test: local experiment with scudo: true to ensure that a test target
(tombstoned) could be linked with scudo.

Change-Id: I76bb6c60891d4782f6665a112c4c2bf7c31645da
2018-06-19 09:46:09 -07:00
Jiyong Park 413cc744b8 Recovery partition uses the first architecture only
To save space in the recovery partition, modules installed to the
partition are restricted to be built in the first architecure (i.e.,
32bit for 32bit-only device or when TARGET_PREFER_32_BIT is true, and
64bit otherwise).

Most notably, this change removes the 32-bit variant of the linker
(about 1MB). The linker was installed regardless of whether there is a
32-bit executable or not. Now, the unnecessary linker is not installed
and it is guaranteed that all modules in the partition are built with the
same architecture.

Bug: 79146551
Test: m -j
Test: out/target/product/<name>/recovery/root/system/bin/ has only one
variant of the linker.

Change-Id: I4070a43555bad4cfa8eff5253b09dcd004ea8251
2018-06-19 10:49:21 +09:00
Treehugger Robot f89db951e5 Merge "Changed droiddoc.go to compile Metalava based android.jar" 2018-06-18 16:55:28 +00:00
Yi Kong bbabc7b67e Merge "Remove workaround for cortex-a55/a75" 2018-06-17 09:01:20 +00:00
Dan Willemsen d368d6ff78 Turn suffix rules into errors
We've turned off suffix rules with .SUFFIXES, but make them explicit
errors.

Test: build_test on downstream branches
Change-Id: I682ee3eb3a8f1451cd7e16f1e1d59afca5d21a26
2018-06-15 21:53:18 -07:00
Yi Kong 9c63363119 Remove workaround for cortex-a55/a75
Test: m checkbuild
Test: boot on a55/a75 device, pass bionic tests
Bug: 110235326
Change-Id: I5ab2102352a6efe1173b3097875e6e779d4a1a09
2018-06-15 23:15:54 +00:00
Colin Cross f269dbee54 Merge "Add a script to inject values into manifests" 2018-06-15 22:53:52 +00:00
Nan Zhang 16c0a31b18 Changed droiddoc.go to compile Metalava based android.jar
Test: m -j metalava_android_stubs_current
Bug: b/78245848
Change-Id: Ibce139a93a40e412d8def1b26660446b0a7a24ff
2018-06-15 15:42:59 -07:00
Yi Kong 8eb8704cf1 Merge "Update ToolingCFlags overrides to include other new architectures" 2018-06-15 05:08:53 +00:00
Treehugger Robot f71a98df8a Merge "Add errorprone.javacflags to java_sdk_library" 2018-06-15 03:38:51 +00:00
Yi Kong 72f9a0b2f5 Update ToolingCFlags overrides to include other new architectures
Bug: 110235326
Test: m checkbuild
Change-Id: I9d0ada05d95bb260500c1d694332a73363b0f299
2018-06-14 18:45:54 -07:00
Jiyong Park b5b709f72c Add errorprone.javacflags to java_sdk_library
Bug: 110208852
Test: cherry-pick https://android-review.googlesource.com/c/platform/external/apache-http/+/620154
Test: m javac-check RUN_ERROR_PRONE=true

Change-Id: If97871e6e1fd597efed2b796620538ca4c57eed4
2018-06-15 10:40:26 +09:00
Treehugger Robot 4dd99f65de Merge "Support prebuilt libraries in prebuilt_apis.go" 2018-06-15 00:52:04 +00:00
Colin Cross 8bb10e8f8a Add a script to inject values into manifests
Add a script that can inject a <uses-sdk minSdkVersion=""> into
AndroidManifest.xml files.  This will help with merging
LOCAL_STATIC_ANDROID_LIBRARIES, because ManifestMerger treats
a missing minSdkVersion as minSdkVersion=1 and throws errors
if libraries use a larger minSdkVersion.  It will also help
with cases where an app has a manifest that specifies an old
minSdkVersion, but the build system is compiling the app in
a way that is not compatibile with old devices, for example
using a newer dex format.

Bug: 110167203
Test: m java
Test: build/soong/scripts/manifest_fixer_test.py
Change-Id: I528d71a225feb86464c530e11b223babb0ea9edf
2018-06-14 14:54:27 -07:00
Treehugger Robot 33ab6f6134 Merge changes from topic "sharedlib_in_recovery"
* changes:
  Recovery variants are built with -D__ANDROID_RECOVERY__
  Recovery partition has same layout as system
2018-06-13 23:14:29 +00:00
Jayant Chowdhary 4038a6ea9f Merge "Fix VNDK-Ext ABI check regression" 2018-06-13 17:54:03 +00:00
Logan Chien ef1ff3de98 Fix VNDK-Ext ABI check regression
VNDK-Ext are modules with `vndk.enabled: true` but not having
`vendor_available: true`.  In addition, VNDK-Ext should be checked by
source ABI checker.  This change fixes the regression introduced in

Bug: 110142940
Test: Create libminijail_ext, break some ABIs, and see an error.
Change-Id: I8b47ac12d2e132f641129c9549ed22c3971d6c89
2018-06-13 22:32:16 +08:00
Sundong Ahn a01c2a510e Support prebuilt libraries in prebuilt_apis.go
When the sdk_version or LOCAL_SDK_VERSION is not current or
TARGET_BUILD_APPS is not null, module will use the prebuilt
libraries. For this, prebuilt libraries are supported in
prebuilt_api.go

Bug:77577799
Test: make -j
Test: make -j TARGET_BUILD_APPS='camera2_stubs_test'
      and check intermediates files

Change-Id: I9540c1d1a7a030bcc599b77df8d101529b12b3bf
2018-06-13 22:51:45 +09:00
Martijn Coenen 4de27d7e4f Merge "Revert "Revert "Revert "Move -Wno-enum-compare{,-switch} to external cflags"""" 2018-06-13 07:37:56 +00:00
Martijn Coenen 8ad44855e6 Revert "Revert "Revert "Move -Wno-enum-compare{,-switch} to external cflags"""
This reverts commit cc4bbdccd3.

Reason for revert: breaks builds

Change-Id: Ia8908eb372ce46b23aea73283baf37add4477312
2018-06-13 07:36:05 +00:00
Yi Kong 6da4f7d747 Merge "Revert "Revert "Move -Wno-enum-compare{,-switch} to external cflags""" 2018-06-13 02:10:12 +00:00
Yi Kong cc4bbdccd3 Revert "Revert "Move -Wno-enum-compare{,-switch} to external cflags""
This reverts commit 2f71a6adcd.

Change-Id: I09abb194b25813b8b1e4470b22171121cc3f8c11
2018-06-12 22:59:16 +00:00
Treehugger Robot 04f0140479 Merge "Revert "Move -Wno-enum-compare{,-switch} to external cflags"" 2018-06-12 06:44:00 +00:00
Yi Kong 2f71a6adcd Revert "Move -Wno-enum-compare{,-switch} to external cflags"
This reverts commit 96d221f914.

Reason for revert: build breakage for sdk target

Change-Id: I933df62738c08b48d8ae4ea951b2cb4837616c78
2018-06-12 04:51:49 +00:00
Yi Kong 276e82ef2a Merge "Move -Wno-enum-compare{,-switch} to external cflags" 2018-06-12 02:58:15 +00:00
Treehugger Robot d27a18ff2f Merge "Only write CMakeLists.txt for normal variants" 2018-06-12 01:36:13 +00:00
Treehugger Robot 01c66c199e Merge "Add lld --no-rosegment flag to work with unwinder." 2018-06-12 00:13:27 +00:00
Chih-Hung Hsieh b18814e7a4 Add lld --no-rosegment flag to work with unwinder.
Bug: 109657296
Test: make checkbuild and boot
Change-Id: If8eda7ced31f5d4abb357935e9292b81936af6be
2018-06-11 15:07:34 -07:00