Commit graph

9502 commits

Author SHA1 Message Date
Victor Hsieh
a2c16c1aa0 manifest_fixer: rename to --prefer-code-integrity
During code review, the name change was suggested.

Test: local CTS passed
Bug: 112037137
Change-Id: I7eb25210afb45c7477b0d606574048a15c9c721d
2019-01-03 09:51:11 -08:00
Jiyong Park
f7df9b7e55 Fix: 'required' property is ignored
This change fixes a bug that the 'required' property of a module is
ignored when the module is using a shared from an APEX. This is
happening because LOCAL_REQUIRED_MODULES is overwritten (with := instead
of +=) when ApexesProvidingSharedLibs is not empty.

Fixing the bug by appending ApexesProvidingSharedLibs to
AndroidMkData.Reuired so that it is handled in android/androidmk.go

Test: m
Test: build with https://android-review.googlesource.com/c/platform/bionic/+/849044
and make sure that system/bin/vold_prepare_subdirs exist.

Change-Id: Ie57bca480ba4198b4da0df1c73e92fa42b5ebda8
2019-01-04 01:19:44 +09:00
Colin Cross
189ff9868e Set stem for uninstalled apex modules
Apex modules with installable: false are not installed, so the
dist rule copies from LOCAL_BUILT_MODULE instead of
LOCAL_INSTALLED_MODULE.  If LOCAL_BUILT_MODULE_STEM is unset,
LOCAL_BUILT_MODULE will have the module name as the stem,
resulting in an incorrect file copied to the dist directory.
Set LOCAL_MODULE_STEM instead of LOCAL_INSTALLED_MODULE_STEM,
which also covers LOCAL_BUILT_MODUL_STEM.

Fixes: 122277867
Test: tapas test1_com.android.tzdata && m dist
Change-Id: I0af0c5adcac478a1ce68c4625203fd9bd56bf94d
2019-01-02 22:37:21 -08:00
Dan Willemsen
7f30c076d5 Print a status message when starting ninja
This way we don't appear hung at:

  No need to regenerate ninja file

Change-Id: I8dbdaa2c1b1c5a6a73187d0e6061f363b62e10c9
Fixes: 122251150
Test: m nothing
2019-01-02 12:50:49 -08:00
Alex Light
5de4196079 Save invocation info of dex2oat runs.
It is useful to have the exact dex2oat invocation used to generate
artifacts for some tests. This adds the --write-invocation-to= flag to
the build to save this information.

Test: m droid
Bug: 119332327
Change-Id: Id7664cf6d05bbb1c580f94584cdeb96084d5799c
2019-01-02 10:59:08 -08:00
Jooyung Han
e9793a7e82 Fix: soong_ui.bash's wrong check for TOP variable
soong_ui.bash defines `gettop` function and it finds top of the source
tree. It also checks if `TOP` is properly set and if set use it.
However its check was using the wrong operator (`-z`) for it.

Test: m -j
Change-Id: Ie86dc340a9f89f45ff0828ea43f6afa3713bda76
2018-12-28 14:43:52 +09:00
Treehugger Robot
186c771cb4 Merge "In java.go, add implement check for both Dependency and IDE relevant interfaces" 2018-12-28 01:41:25 +00:00
Treehugger Robot
dc208bb2bb Merge "Fix soong_zip printing warnings with --ignore_missing_files" 2018-12-27 23:49:58 +00:00
Dan Willemsen
edc934ccc9 Fix soong_zip printing warnings with --ignore_missing_files
We weren't defaulting args.Stderr to os.Stderr, so we had been calling
fmt.Fprintln with `nil`.

Test: soong_zip --ignore_missing_files -C test/ -f abc -o test.zip
Change-Id: I0421f4bfb07fa36edf86c68ffc847995777c8221
2018-12-27 12:41:25 -08:00
Dan Willemsen
d56097dc27 Remove incorrect file comments
Test: none
Change-Id: Ia2889ee29c2c0bf18adf5d90e506cfce4b14fdcc
2018-12-27 12:26:30 -08:00
albaltai
36ff7dcbf4 In java.go, add implement check for both Dependency and IDE relevant interfaces
1. Add var _ to declare the struct Import implement IDEInfo and
   IDECustomizedModuleName interfaces
2. Modify var _, a typo case for struct Module implement Dependency interface
3. Add nil checking for Dependency interface implementation
4. Add more comment for developer

Bug: 121985695

Test: 1. m aidegen
      2. $ANDROID_HOST_OUT/bin/aidegen framework
      3. check import static android.Manifest.permission.BIND_VOICE_INTERACTION;
	 denpendency should be resolved in frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java

Change-Id: Ia2d2d65b83a52d35ccb3927a36bcf686d5223e20
2018-12-25 14:56:20 +08:00
shinwang
9e4c07a92f In java/java.go, enhance the checking logic for Dependency interface implementation
Add nil checking for Dependency interface implementation

Bug: 121985695

Test: 1. m aidegen
      2. $ANDROID_HOST_OUT/bin/aidegen framework
      3. check import static android.Manifest.permission.BIND_VOICE_INTERACTION;
	 denpendency should be resolved in frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java

Change-Id: Ibac280ce3de2537f453c4ca7e8f79f55667f1fa0
2018-12-25 03:36:37 +00:00
Yi Kong
dfefa44bdb Merge "Update OWNERS list for toolchain team" 2018-12-22 03:50:36 +00:00
Treehugger Robot
fce523979c Merge "Modify jar dependencies collection from dexpreopt to jar with resource" 2018-12-22 03:34:10 +00:00
Yi Kong
dffdd7bc6c Update OWNERS list for toolchain team
Add pirama@ and yikong@ to clang.go, global.go, lto.go, pgo.go owners.

Test: N/A
Change-Id: I9bad4d0854268e7d239d0950525d2360a0e42074
2018-12-21 23:43:54 +00:00
Yi Kong
fae5dac8fd Move -Wno-null-dereference to external only
Test: m checkbuild
Bug: 29823425
Change-Id: Icd675e451b2a2a8e3f489706e533f92d991de9c0
2018-12-21 14:51:41 -08:00
shinwang
7f1b38fa83 Modify jar dependencies collection from dexpreopt to jar with resource
Soong build system modify the jar installed path to dexpreopt, however, the jar only contains dex without java information. This patch modify the jar collection from installed path to ImplementationJars.

Bug: 121231786

Test: 1. m aidegen
      2. $ANDROID_HOST_OUT/bin/aidegen framework
      3. check import static android.Manifest.permission.BIND_VOICE_INTERACTION;
	 denpendency should be resolved in frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java

Change-Id: I8f24f3a3476e125d3fd808e0047db425e15046ac
2018-12-21 10:37:03 +00:00
Jiyong Park
16e91a067d Fix: static dependency across an APEX is lost
This change fixes following problem:

1) a native lib having stubs is defined.
2) the lib is included in an APEX.
3) a static binary is linking the lib from outside of the APEX.
4) then, the dependency from the binary to the lib is vanishing.

This is happening because cc.depsToPaths() mistakely does not
distinguish static lib deps from shared lib deps. For shared lib deps,
it creates two dependencies (one for stubs variant and the other for
non-stubs variant) and choose the stubs variant when the lib and the
current module is not in the same APEX (i.e. dependency to the non-stubs
variant is discarded). However, since we don't have stubs variant for
static library, it ends up having no dependency to the library if the
link is static.

Fixing the issue by skipping the variant selection routine when the link
is static.

Test: m (apex_test added)
Test: build with https://android-review.googlesource.com/c/platform/bionic/+/849044
Change-Id: I21102a31cc5c0b105da2affdd035bd5cc571a6ab
2018-12-21 18:01:39 +09:00
Jiyong Park
da6eb592bf Add use_vendor to APEX module
use_vendor, when set to true, brings vendor variant of the native
libraries and binaries to the APEX.

Bug: 115707625
Test: m (apex_test updated)
Change-Id: Ib4e996f8652f4ce4645a9c22f6914e2ab35edda6
2018-12-20 14:33:02 +09:00
Jiyong Park
5a8320201a Fix a nill pointer dereference when TARGET_FLATTEN_APEX
When TARGET_FLATTEN_APEX is set to true, there is no single output file
for an APEX that other modules can reference via ":module" syntax.
Return nothing in that case.

Bug: 121221006
Test: TARGET_FLATTEN_APEX=true m
Change-Id: I556b55073720b16fd30fd133af58aac229e958c0
2018-12-20 09:54:35 +09:00
Colin Cross
a044a686c5 Merge "Add a flag to allow unbundled builds to build SDKs from source" 2018-12-20 00:35:59 +00:00
Treehugger Robot
894139e655 Merge "Create dexpreopt install dir" 2018-12-20 00:14:36 +00:00
Colin Cross
ed91ae94e2 Create dexpreopt install dir
If dexpreopt is disabled inside dexpreopt_gen there won't be any installed files and the install directory won't be created, causing soong_zip to fail.  Create the directory ahead of time.

Test: treehugger
Change-Id: Icf17d0bcd617eeeafdcd50ab56359fa8d6612822
2018-12-19 18:55:26 +00:00
Jaewoong Jung
80b0f0abb7 Add myself as an owner.
Test: N/A
Change-Id: Ib4303d80793df433d61511710590c0d679908290
2018-12-19 08:19:50 -08:00
Jaewoong Jung
3a0989ce4c Merge "Ignore shared libs for static executables." 2018-12-19 16:16:24 +00:00
Jiyong Park
a88948419a Fix: Flattend APEX is breaking build
When TARGET_FLATTEN_APEX=true, individual files in an APEX are exported
to make. However, because they lack LOCAL_SOONG_CLASSES_JAR,
soong_java_prebuilt.mk get confused and the build breaks.

Fixing the bug by correctly emitting LOCAL_SOONG_CLASSES_JAR and
LOCAL_SOONG_HEADER_JAR.

Test: TARGET_FLATTEN_APEX=true m
out/target/common/obj/JAVA_LIBRARIES/com.android.conscrypt.conscrypt_intermediates/classes.jar

Change-Id: I65ce86ec825f978a43715146bbd5c1d5af513de0
2018-12-19 23:07:23 +09:00
Treehugger Robot
6ebbf3da29 Merge "Add dependency for sysprop" 2018-12-19 11:17:10 +00:00
Nicolas Geoffray
5be3d6b3f5 Merge "Fix build time preopt with shared library uses." 2018-12-19 08:37:01 +00:00
Nicolas Geoffray
f6efad5b6d Merge "Add an owners file for dexpreopt files." 2018-12-19 08:34:14 +00:00
Sundong Ahn
5b73f31c80 Add dependency for sysprop
The dependency is added because the module that uses the sysprop library
needs generated code before it is built.

Test: m -j
Change-Id: I2858fc6fa6f2fe16afa2f4a7ae62746ba0f67e5c
2018-12-19 07:23:08 +00:00
Colin Cross
1f367bfe8b Add a flag to allow unbundled builds to build SDKs from source
Mainline modules are tightly coupled to the platform, and should
build against the current SDK from source and not prebuilts. Add
a flag UNBUNDLED_BUILD_SDKS_FROM_SOURCE to specify that a
TARGET_BUILD_APPS build should build the current SDK instead of
using the prebuilts.

Bug: 121194841
Bug: 121231426
Test: no change to out/build-aosp_sailfish.ninja
Test: forrest unbundled build
Test: forrest master apps build
Test: forrest mainline modules build
Change-Id: I45a40a335483dae2fe192721df9b31bdbab97ee5
2018-12-18 22:46:24 -08:00
Treehugger Robot
8cc51b5620 Merge changes Idb2b552b,I190bca35
* changes:
  When a stub is built for APEX, it is generated with --apex
  APEX-specific symbols can be tagged as # apex
2018-12-19 06:28:23 +00:00
Treehugger Robot
3181721a1e Merge "[hwasan] Reduce history size to save memory." 2018-12-19 06:19:58 +00:00
Evgenii Stepanov
3c5a52a477 [hwasan] Reduce history size to save memory.
Bug: 112437883
Test: adb shell echo $HWASAN_OPTIONS
Change-Id: Ifc4ab10e37efb1a0ce7ea77ad691947d24c2da2b
2018-12-18 17:02:44 -08:00
Jaewoong Jung
232c07c217 Ignore shared libs for static executables.
Ie42edc5184f315f998db953594e425214b810e0e added system_shared_libs to
static libraries so that their exported headers can be referenced.
However, it also added unrequired dependencies, which is an
error-triggering issue for static executables.

This change addresses it by adding a condition to shared libs handling code
in binary.go.

Bug: 121152570
Test: cc_test.go, library_test.go
Change-Id: I1828442c4e496f8d815fccaeca970cd5766bdf5d
2018-12-18 15:56:59 -08:00
Nicolas Geoffray
64d7f87c56 Add an owners file for dexpreopt files.
Test: N/A
Change-Id: I3d14a3cb6f0f5f8f5c0a7266285d4b8917922240
2018-12-18 20:28:06 +00:00
Nicolas Geoffray
05aa7d2d13 Fix build time preopt with shared library uses.
- Handle hidl libraries.
- Handle new shared library encoding.

Test: no mismatch preopt during boot.
bug: 117845483
bug: 111174995
Change-Id: If93dee4a208f365a9ccbbb1f73899d245282bd5b
2018-12-18 17:26:49 +00:00
Colin Cross
539f409d78 Merge "Dexpreopt soong modules inside soong" 2018-12-18 01:54:32 +00:00
Elliott Hughes
97295bd391 Switch to toybox chmod(1).
Test: treehugger
Change-Id: Iccb70941906d9cf8b004303a6935b7df1217babf
2018-12-17 14:55:10 -08:00
Jaewoong Jung
5f3fb4bad1 Make bpf implement SourceFileProducer.
This allows other modules depend on bpf object outputs via the data
property.

Bug: 120246361
Test: bpf_test.go
Change-Id: I2ba9b9fea4d60f896d16f34053eb04513eae30ea
2018-12-17 07:18:39 -08:00
Colin Cross
43f08db29e Dexpreopt soong modules inside soong
Port the dexpreopt logic from Make to the dexpreopt package in Soong,
and use it to dexpreopt Soong modules.  The same package is also
compiled into the dexpreopt_gen binary to generate dexpreopt scripts
for Make modules.

This relands Ib67e2febf9ed921f06e8a86b9ec945c80dff35eb and
I462182638bd57b1367b5bfb0718e975c11ae66f7, along with multiple fixes
to depsfile generation in dexpreopt_gen that caused .odex files for
modules in defined make to be missing dependencies on boot.art, and
a fix to not dexpreopt and strip tests.

Bug: 119412419
Bug: 120273280
Test: no differences to dexpreopt outputs on aosp_sailfish system/,
      only expected changes to dexpreopt outputs on system_other
      (.vdex files for privileged Soong modules no longer incorrectly
      contain .dex contents).
Test: OUT_DIR=$PWD/out m
Test: NINJA_ARGS="-t deps out/target/product/sailfish/obj/APPS/Contacts_intermediates/dexpreopt.zip" m
Change-Id: I6bb2c971cee65d2338839753aa0d84939f335b1b
2018-12-15 19:07:54 -08:00
Treehugger Robot
ace2be498e Merge "Add installable property to apex module type" 2018-12-15 17:59:41 +00:00
Jiyong Park
3fd0baf651 When a stub is built for APEX, it is generated with --apex
Now, symbols that are only to be visible to across APEXes can be tagged
as # vndk. Then when generating the stubs library, the tagged symbol
is included. The symbol is NOT included in other cases; build NDK stubs,
etc.

Bug: 120638081
Test: m (apex_test updated.)
Change-Id: Idb2b552badddfc26af113cc8d4b984788f478813
2018-12-16 02:13:14 +09:00
Jiyong Park
bb4e13536e APEX-specific symbols can be tagged as # apex
If a symbol is tagged as # apex, then it is exported when gen_stub_libs
is invoked with --apex.

Bug: 120638081
Test: python3 cc/test_gen_stub_libs.py

Change-Id: I190bca35d1a4fb422b37d1be41a34de1ad64de6b
2018-12-16 02:12:13 +09:00
Jiyong Park
6437995170 Remove -include <file> when compiling stubs.
Otherwise, the force included headers might cause conflicting types
error with the symbols in the generated stubs source code. e.g.

double acos(double); // in header
void acos() {} // in the generated source code

Bug: 120266448
Test: m (apex_test also updated, and passing)
Change-Id: I717df990959d1b24ec515f0f52a4e28b94e92f32
2018-12-15 23:03:47 +09:00
Jiyong Park
92c0f9ce54 Add installable property to apex module type
When set to false, the apex is built but not installed. Useful for not
polluting the system image with test APEXes when doing mma.

Bug: 120960303
Test: add 'installable: false' to apex.test under system/apex/tests/Android.bp
m; check that out/..../system/apex/apex.test.apex does not exist.

Change-Id: I383d5cdcc8aec705b6a5778dbd07233471d289d0
2018-12-15 22:58:14 +09:00
Treehugger Robot
1ee00b54d9 Merge changes I350fe490,I31e61862,I09b78e38
* changes:
  Stubs libs are available for host
  Don't create unnecessary APEX variations
  Stubs dependency is not installed
2018-12-15 13:47:59 +00:00
Treehugger Robot
df76efe524 Merge "Move -Wno-null-pointer-arithmetic to external only" 2018-12-15 00:29:19 +00:00
Dan Willemsen
82798583d1 Merge "Add support for exclude_srcs in genrule" 2018-12-14 23:42:34 +00:00
Colin Cross
4ff85ebeb7 Revert "Dexpreopt soong modules inside soong"
This reverts commit 29ff88741e.

Test: none
Bug: 119412419
2018-12-14 11:49:58 -08:00