Commit graph

9284 commits

Author SHA1 Message Date
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
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
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
Colin Cross
359e6436be Revert "Fix MaybeRel when OUT is absolute"
This reverts commit fee2bff77c.

Test: none
Bug: 119412419
2018-12-14 11:49:58 -08:00
Yi Kong
c9f6db50d3 Move -Wno-null-pointer-arithmetic to external only
Test: m checkbuild
Bug: 72331524
Change-Id: I9c49a8cef547f6c840001fd203a0abecaeef44d5
Merged-In: I9c49a8cef547f6c840001fd203a0abecaeef44d5
(cherry picked from commit 3e88cb0399)
2018-12-13 18:36:19 -08:00
Colin Cross
fee2bff77c Fix MaybeRel when OUT is absolute
MaybeRel was failing with an error when comparing an absolute out
path to a relative source path.  Make it return false instead, and
add tests.

Bug: 119412419
Test: paths_test.go
Change-Id: I462182638bd57b1367b5bfb0718e975c11ae66f7
2018-12-13 21:05:18 +00:00
Ivan Lozano
e98d11f733 Merge "Add option to avoid recovering with diagnostics." 2018-12-13 20:56:18 +00:00
Colin Cross
29ff88741e 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.

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).
Change-Id: Ib67e2febf9ed921f06e8a86b9ec945c80dff35eb
2018-12-13 15:53:54 +00:00
Jiyong Park
0fefdeac91 Stubs libs are available for host
The runtime APEX is built for host as well as for target. Therefore
stubs libs should be available also for host.

Bug: 120670568
Test: follow the repro step shown in b/120670568#comment4
Change-Id: I350fe490848ae9ceb55aade0521bdfaf48ed083f
2018-12-13 12:01:31 +09:00
Jiyong Park
0ddfcd1188 Don't create unnecessary APEX variations
This change fixes a problem that APEX variations are created for the
modules that actually shouldn't built for any APEX. For example,
consider this case.

apex { name: "myapex", native_shared_libs: ["mylib"],}

cc_library { name: "mylib", shared_libs: ["libfoo#10"],}
cc_library { name: "libfoo",
             shared_libs: ["libbar"],
             stubs: { versions: ["10"], }, }
cc_library { name: "libbar", ...}

Before this change, both the stubs and non-stubs variations of libfoo
were mutated with apexMuator, which is incorrect for the non-stubs
varia; there is no dependency chain from the apex "myapex" to the
non-stubs variation, but to the stubs variation due to the #10 syntax.

This was happening becauses we used the name of the module to determine
whether it should be built for APEX or not. Both stubs and non-stubs
variations have the same module name "libfoo".

Fixing this issue by recording the list of APEX variations required
directly on the module. So, the stubs variation of libfoo has myapex in
its apex variations list, but the non-stubs variation doesn't, and thus
apexMutator does not pick up the non-stubs variation.

Test: m (apex_test updated and passing)
Test: cherry-pick ag/5747464 and m
Change-Id: I31e618626809a828a55fff513ef5f81f79637afa
2018-12-13 10:48:15 +09:00
Jiyong Park
de866cbe50 Stubs dependency is not installed
When the stubs variant of a library is dependend by a platform component
and the library is included in one or more APEX, the library is not
installed to the platform, because it is provided by APEX.

Bug: 120266448
Test: m
Test: add stubs: { versions: ["1"], }, to libnetd_resolv
then build netd. libnetd_resolv.so does not exist under /system.

Change-Id: I09b78e38df285033ef6e9c85f7ea4b0274e85070
2018-12-13 10:48:15 +09:00
Treehugger Robot
9d824cc850 Merge "Remove dependency on framework.jar" 2018-12-13 01:46:54 +00:00
Dongwon Kang
f576fcd413 Merge "Don't install stubs" 2018-12-12 18:15:35 +00:00
Ivan Lozano
7929bba218 Add option to avoid recovering with diagnostics.
Add a no_recover option that allows specifying which sanitizers in
diagnostics modes shouldn't recover. This can help debugging as we test
enabling sanitizers in new libraries since it'll cause tombstones to be
generated along with the diagnostics information.

Bug: 80195448
Bug: 110791537
Test: Compiled test module with this flag, checked compiler command.
Test: Test module crashed, tombstone contained diagnostics information.
Change-Id: Ie938923ef95716c2d49d6cd719ee223ad62755c6
2018-12-12 10:01:16 -08:00
Jerome Gaillard
ff42f04af8 Merge "Upgrade Windows default build version from Vista to 7" 2018-12-12 13:59:56 +00:00
Treehugger Robot
08e047fdc6 Merge "Output of an apex module type can be included in tests" 2018-12-12 12:22:40 +00:00
Jiyong Park
74e240be03 Output of an apex module type can be included in tests
By implementing SourceFileProducer interface, output of an apex module
can be included in tests (via ':modulename' syntax in 'data' property)

Bug: 120055902
Test: replace apexd_testdata/* with :apex.test in
system/apex/apexd/Android.bp. m apex_file_test.
out/host/linux-x86/nativetest/apex_file_test/ has apex.test.apex in it.

Change-Id: I8b721a68e0edc65a3e674febeed485e06b96bc24
2018-12-12 18:33:30 +09:00
Yi Kong
e2025abe96 Merge "Remove unneeded -Wno-expansion-to-defined flag" 2018-12-12 02:27:48 +00:00
Jiyong Park
127d56580d Don't install stubs
Stubs libs are build-time only artifact. Can't be installed.

Test: OUT_DIR=out build/soong/scripts/build-ndk-prebuilts.sh
with https://android-review.googlesource.com/c/platform/frameworks/av/+/846770/7
and two more CLs in the same chain
Examine out/soong/build.ninja
Build rule for out/soong/target/product/generic_arm64/system/lib64/arm64/libmediandk.so
exist only once.

Change-Id: I58ff09ef3fbbdbd2d968aa21b87a493192d4216d
2018-12-12 10:41:55 +09:00
Treehugger Robot
055295d18a Merge "Move cut(1) to toybox." 2018-12-11 22:33:32 +00:00
Chih-hung Hsieh
d340852732 Merge "Disable cert-dcl16-c clang-tidy check for mingw32." 2018-12-11 17:41:38 +00:00