Commit graph

20 commits

Author SHA1 Message Date
Mitch Phillips
3adbcb31ea Make backend for shared library fuzzing.
Additional context (for Googlers): go/android-fuzzing-shared

This patch adds the Make support for automatically installing sanitized
dependent shared libraries. 'make $module' will find all the shared
library dependencies in soong, and create the rules to install them. We
simply need to add the <install sanitized shared library> rule that's
made by Soong as a dependency of the module's phony.

We also now change 'm fuzz' to not just build the fuzz packages, but to
build all fuzz targets into the respective
$ANDROID_PRODUCT_OUT/data/fuzz and $ANDROID_HOST_OUT/fuzz directories.

Bug: N/A
Test: Build fuzz target with shared libs, note the contents of
$ANDROID_PRODUCT_OUT/data/fuzz/lib and out/soong/fuzz-target-*.zip now
has shared libraries.

Change-Id: I74def02fee663ef788ee25ec0d5106faf474c2a6
2019-11-07 15:39:34 -08:00
Yo Chiang
5eac77c735 Build rules use private vars
Create PRIVATE_TOOLS_PREFIX for VNDK build rules. So that the value of
$(my_prefix) is well-preserved.

Bug: 142350531
Bug: 141971626
Test: lunch aosp_cf_x86_go_phone-userdebug ; m nothing
Change-Id: I06f16708c7165cb909f0031182ffb96a462d6000
2019-10-25 22:14:59 +08:00
Jooyung Han
66bd7385d2 Check if installable before installing unstripped
When LOCAL_UNINSTALLABLE_MODULE is true, the module is not installed.
But its unstripped output is installed to the path based on
my_module_path which is not set for it is not installable. Moreover,
my_module_path is not reset after use.

As a result, when LOCAL_UNINSTALLABLE_MODULE is true, the path for
unstripped output is unexpected.

The installation is guarded by LOCAL_UNINSTALLABLE_MODULE now,
which was LOCAL_VNDK_DEPEND_ON_CORE_VARIANT.

Test: m
Change-Id: If18cf76118e058a9e0701a8d66f7ff0f534e5881
2019-10-07 22:33:47 +09:00
Colin Cross
02b50d12be Remove TARGET_TRANSLATE_2ND_ARCH
TARGET_TRANSLATE_2ND_ARCH is never set to true any more,
TARGET_NATIVE_BRIDGE_ARCH := arm is always used instead.

Bug: 141242600
Test: m checkbuild
Change-Id: Id3e0614a1d8a088d37929655b74fecd812606db2
2019-09-18 16:23:04 +00:00
Dan Willemsen
18ffd5891e Remove import_includes/export_includes
Now that ONE_SHOT_MAKEFILE no longer exists, we don't have to rely on
the filesystem to store this informtion.

This removes ~16.7k files from our build graph
(aosp-master/aosp_arm64-eng), though only about 600 of them were being
used in a normal build.

Test: treehugger
Change-Id: I3ac12f5ea7f11d25064109a0599bc5be1976fba5
2019-08-01 14:56:45 -07:00
Oliver Nguyen
e91ab2397f Package coverage files as a zip.
Test: make NATIVE_COVERAGE=true COVERAGE_PATHS="*"
Change-Id: I7ee9253ef47a502a9d29f7e15a4402cbb90e34ae
2019-06-10 15:27:31 -07:00
Jooyung Han
9340a673cd make: Add support to skip current VNDK install
You can get a system.img without current VNDK libs.
This may help when you want a smaller system.img given that the image
will be used with a specific version (not current) of vendor image.

Bug: 132140714
Test: m TARGET_SKIP_CURRENT_VNDK=true && see if current VNDK is not
installed

Change-Id: Ie0815e6dd6ce2f861b6c42e637da4bb146320673
2019-05-25 02:06:08 +09:00
dimitry
a19987d3c2 Filter out .native_bridge static libs from NOTICE files
LOCAL_STATIC_LIBRARIES may contain .native_bridge suffix
when built for translated targets.

This CL makes the NOTICE file exception apply for them too.

Bug: http://b/77159578
Test: make
Change-Id: Ic8a18f06afa0c460751f21587b7f751ac0ae4a3f
2019-05-09 16:35:41 +02:00
Vic Yang
841ab06af1 Skip checking ELF files for uninstallable soong modules
If a module is uninstallable, the shared library dependencies are not
set up and thus the ELF file check may fail incorrectly.  In this case,
there is no need to check ELF files anyway.

Test: Build walleye with no-vendor-variant VNDK enabled and does not
      see erroneous failure anymore.

Change-Id: Icd115fc82daedf11795800de5cbe87c87073586a
2019-04-02 14:06:22 -07:00
Vic Yang
51512c558c Add support for no-vendor-variant VNDK
When TARGET_VNDK_USE_CORE_VARIANT is set to true, the vendor variant of
VNDK libraries are by default not installed.  Instead, the core variant
will be used by vendor binaries at runtime.

To ensure the core variant of VNDK libraries are installed, we also add
a flag LOCAL_VNDK_DEPEND_ON_CORE_VARIANT to indicate that the vendor
variant module depends on the core variant module.  This flag should be
set by Soong for all VNDK libraries without the vendor variant
installed.  When the flag is set, the vendor variant binary is also
compared against the core variant binary to ensure they are
functionally identical.

As we are merging the two variants for some libraries, we need a new
link type to denote a module is usable as both native:vndk and
native:platform.  We add native:platform_vndk for this.

Bug: 119423884
Test: With the corresponding Soong change, build with
      TARGET_VNDK_USE_CORE_VARIANT set to true.
Test: Add a dummy VNDK library and a dummy vendor binary that depends
      on it.  Build with no-vendor-variant VNDK and check the core
      variant is installed.
Test: Add conditional compilation based on __ANDROID_VNDK__ in the
      dummy VNDK library and check build fails.

Change-Id: I40000f2728e8193212113c1ee950e9d697f2d40d
2019-03-20 10:23:04 -07:00
Jiyong Park
a32f00e553 Add LOCAL_SOONG_SYMBOL_PATH
The soong-only variable is used to specify the location where the symbol
file is located. When unspecified, LOCAL_MODULE_PATH is used instead as
before.

This is needed when the path that a file is installed to is different
from the path that the file is accessed from at runtime. For example, if
TARGET_FLATTEN_APEX=true, a file lib/libX.so in an APEX com.android.foo
is installed to /system/apex/com.android.foo/lib/libX.so. However, it's
runtime path is /apex/com.android.foo/lib/libX.so as
/system/apex/com.android.foo is bind-mounted to /apex/com,android.foo.

Bug: 120846816
Test: m and inspect that symbol files exist under
$(PRODUCT_OUT)/symbols/apex/com.android.runtime/

Change-Id: I1b39f6e0cde115d442f14380c365796feff3437b
2019-03-20 06:56:20 +09:00
Jiyong Park
744fd5698f Drop /root when installing symbols
This change fixes a problem that if a module is installed to the root
partition, its symbol file appears at under symbols/root, which is an
non-existing path at runtime. Since the symbol paths should match with
the runtime path, drop /root when installing symbols.

Bug: 123985838
Test: m libc.mountpoint
libc.so is found under symbols/bionic/lib[64]

Change-Id: I38bd226c3ec758d69902f4f288c83f68170c4068
2019-02-11 16:16:18 +09:00
Logan Chien
0e53d887d6 Add prebuilt ELF binaries checker
This commit introduces a prebuilt ELF binaries checker.  The checker
will check:

1. Whether all DT_NEEDED shared libraries are specified in
   `shared_libs` (Android.bp) or `LOCAL_SHARED_LIBRARIES` (Android.mk).

2. Whether all undefined symbols in the prebuilt binary can be resolved
   to defined symbols exported by its dependencies.

This ensures that prebuilt binaries won't silently become ABI
incompatible.

To check the prebuilt binaries, all of the dependencies must be
specified in `shared_libs` (Android.bp) or `LOCAL_SHARED_LIBRARIES`
(Android.mk).

If your prebuilt binaries cannot be checked for some reason, you may add
the following property to Android.bp:

    check_elf_files: false,

Or, add the following setting to Android.mk:

    LOCAL_CHECK_ELF_FILES := false

Bug: 119084334
Test: CHECK_ELF_FILES=true make check-elf-files
Change-Id: I523d3083f22fd4053c096d26f61f8375800281c8
2019-01-21 21:35:01 +08:00
Jaewoong Jung
e8cb1954bb Add -CROSS suffix to cross host OS notice targets.
This fixes a bug where cross host OS notice dependecies were incorrectly
added and caused missing file errors.

Bug: 36073965
Test: Manual build + inspection
Change-Id: I3983ad6158acf939842f836fe3f44cecf9187087
2018-11-08 16:53:02 -08:00
Jaewoong Jung
3d90562b7c Produce NOTICE files for static libraries.
Bug: 36073965
Test: mma + visual check.
Change-Id: I3ff341a0668cc6d6de8a54418a7e0db8af28c85c
2018-11-01 16:40:15 -07:00
Logan Chien
c24a265ae9 Support LOCAL_ADDITIONAL_DEPENDENCIES to soong_cc_prebuilt.mk
This commit adds LOCAL_ADDITIONAL_DEPENDENCIES to soong_cc_prebuilt.mk
so that ABI dump and diff files can be generated and checked.

Test: make -j && find out -name '*.abidiff'
Change-Id: If12ec9a321f42efe4f8dc938568e8911400cc053
2018-10-11 11:19:31 +08:00
Dan Willemsen
8cf6b65445 Remove *_OUT_INTERMEDIATE_LIBRARIES
Always use the exact libraries like Soong does instead.

Test: m
Change-Id: Ifd48020073dd045247f76f84627c497e94562286
2018-09-15 10:52:13 -07:00
Colin Cross
8fb525db71 Add soong_cc_prebuilt.mk
Add soong_cc_prebuilt.mk for Soong modules to use so they can avoid
going through all of prebuilt_internal.mk, dynamic_binary.mk and
binary.mk.  Also moves stripping support into Soong.

Relands I8b37dda2b449b6b5d48d5b983f43de452f494a1e with fixes for
builds with GENERATE_BREAKPAD_SYMBOLS=true

Bug: 113936524
Test: m checkbuild
Change-Id: Id41cd76ccb1b5bb6ac43b41ae3e8f1ce46d7ad7e
2018-09-10 14:46:52 -07:00
Colin Cross
635733b816 Revert "Add soong_cc_prebuilt.mk"
This reverts commit 1bb943b97c.

Reason for revert: broke mac builds
Bug: 113936524

Change-Id: I5b3d8eb1314eb322a5f9c578623ac89e2ad25706
2018-09-10 21:35:55 +00:00
Colin Cross
1bb943b97c Add soong_cc_prebuilt.mk
Add soong_cc_prebuilt.mk for Soong modules to use so they can avoid
going through all of prebuilt_internal.mk, dynamic_binary.mk and
binary.mk.  Also moves stripping support into Soong.

Bug: 113936524
Test: m checkbuild
Change-Id: I8b37dda2b449b6b5d48d5b983f43de452f494a1e
2018-09-10 11:04:05 -07:00